Package net.shibboleth.idp.attribute.filter.policyrule.saml.impl

# Class AbstractEntityGroupPolicyRule

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractPolicyRule
net.shibboleth.idp.attribute.filter.policyrule.saml.impl.AbstractEntityGroupPolicyRule

All Implemented Interfaces:
  `PolicyRequirementRule`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`

Direct Known Subclasses:
  `IssuerInEntityGroupPolicyRule`, `ProxiedRequesterInEntityGroupPolicyRule`, `RequesterInEntityGroupPolicyRule`

public abstract class AbstractEntityGroupPolicyRule extends AbstractPolicyRule
A matcher that evaluates to true if an entity's metadata matches the provided entity group name, or a valid metadata-sourced affiliation of entities.

Since:
  4.0.0

## Nested Class Summary

## Nested classes/interfaces inherited from interface net.shibboleth.idp.attribute.filter.PolicyRequirementRule

`PolicyRequirementRule.Tristate`

## Field Summary

Fields
Modifier and Type
Field
Description
`private boolean`
`checkAffiliations`
Whether to search metadata for AffiliationDescriptor membership.
`private String`
`entityGroup`
The entity group to match against.

### Fields inherited from interface net.shibboleth.idp.attribute.filter.PolicyRequirementRule

`MATCHES_ALL, MATCHES_NONE, REQUIREMENT_RULE_FAILS`

## Constructor Summary

Constructors
Constructor
Description
`AbstractEntityGroupPolicyRule()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`String`
`getEntityGroup()`
Gets the entity group to match against.
`protected abstract EntityDescriptor`
`getEntityMetadata(AttributeFilterContext filterContext)`
Gets the entity descriptor for the entity to check.
`boolean`
`isCheckAffiliations()`
Returns whether we check a supplied `MetadataResolver` for membership in an AffiliationDescriptor as a form of group policy.
`PolicyRequirementRule.Tristate`
`matches(AttributeFilterContext input)`
Evaluate what this rule means.
`void`
`setCheckAffiliations(boolean flag)`
Set whether to check a supplied `MetadataResolver` for membership in an AffiliationDescriptor as a form of group policy.
`void`
`setEntityGroup(String group)`
Sets the entity group to match against.

### Methods inherited from class net.shibboleth.idp.attribute.filter.policyrule.impl.AbstractPolicyRule

`getLogPrefix`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

## Field Details

### entityGroup

@NonnullAfterInit @NotEmpty private String entityGroup
The entity group to match against.

### checkAffiliations

private boolean checkAffiliations
Whether to search metadata for AffiliationDescriptor membership.

## Constructor Details

### AbstractEntityGroupPolicyRule

public AbstractEntityGroupPolicyRule()

## Method Details

### getEntityGroup

@NonnullAfterInit @NotEmpty public String getEntityGroup()
Gets the entity group to match against.

Returns:
  entity group to match against

### setEntityGroup

public void setEntityGroup(@Nullable String group)
Sets the entity group to match against.

Parameters:
  `group` - entity group to match against

### setCheckAffiliations

public void setCheckAffiliations(boolean flag)
Set whether to check a supplied `MetadataResolver` for membership in an AffiliationDescriptor as a form of group policy.

Defaults to false.

Parameters:
  `flag` - flag to set

### isCheckAffiliations

public boolean isCheckAffiliations()
Returns whether we check a supplied `MetadataResolver` for membership in an AffiliationDescriptor as a form of group policy.

Returns:
  whether to check for AffiliationDescriptor membership
Since:
  4.0.0

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractPolicyRule`
Throws:
  `ComponentInitializationException`

### getEntityMetadata

@Nullable protected abstract EntityDescriptor getEntityMetadata(@Nonnull AttributeFilterContext filterContext)
Gets the entity descriptor for the entity to check.

Parameters:
  `filterContext` - current filter request context
Returns:
  entity descriptor for the entity to check

### matches

@Nonnull public PolicyRequirementRule.Tristate matches(@Nonnull AttributeFilterContext input)
Evaluate what this rule means.

Parameters:
  `input` - the context.
Returns:
  whether the rule holds