public class EntityAttributeFilteringStage extends BaseStage<Element>
EntityAttributeFilteringStage.EntityAttributeContext is built
from the components of the attribute and the entity's registrationAuthority,
if any.
Note that the registrationAuthority to be used is assumed to have been
extracted out into a RegistrationAuthority object in the entity's item metadata.
The stage can be operated in a whitelisting mode (the default) or in a blacklisting mode
by setting the whitelisting property to false.| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
EntityAttributeFilteringStage.ContextImpl
A simple immutable implementation of
EntityAttributeFilteringStage.EntityAttributeContext. |
static interface |
EntityAttributeFilteringStage.EntityAttributeContext
An entity attribute context against which matches can take place.
|
| Modifier and Type | Field and Description |
|---|---|
private Logger |
log
Class logger.
|
private List<com.google.common.base.Predicate<EntityAttributeFilteringStage.EntityAttributeContext>> |
rules
List of matching rules to apply to each attribute value.
|
private boolean |
whitelisting
Mode of operation: whitelisting or blacklisting.
|
| Constructor and Description |
|---|
EntityAttributeFilteringStage() |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
applyRules(EntityAttributeFilteringStage.EntityAttributeContext ctx)
Apply the rules to a context.
|
protected void |
doDestroy() |
protected void |
doExecute(Collection<Item<Element>> itemCollection)
Performs the stage processing on the given Item collection.
|
private String |
extractRegistrationAuthority(Item<Element> item)
Extract the registration authority for an entity from its entity metadata.
|
private void |
filterAttribute(Element attribute,
String registrationAuthority)
Filter an
Attribute element. |
private void |
filterEntityAttributes(Element entityAttributes,
String registrationAuthority)
Filter an
EntityAttributes extension element. |
List<com.google.common.base.Predicate<EntityAttributeFilteringStage.EntityAttributeContext>> |
getRules()
Returns the
List of rules being used to match entity attributes. |
boolean |
isWhitelisting()
Indicates whether the stage is set to whitelisting or blacklisting mode.
|
void |
setRules(List<com.google.common.base.Predicate<EntityAttributeFilteringStage.EntityAttributeContext>> newRules)
Sets the
List of rules to be used to match attribute values. |
void |
setWhitelisting(boolean newValue)
Sets the mode of operation.
|
execute, getCollectionPredicate, setCollectionPredicatesetIddoInitialize, getIddestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, isDestroyedprivate final Logger log
private List<com.google.common.base.Predicate<EntityAttributeFilteringStage.EntityAttributeContext>> rules
true terminating the evaluation.
This amounts to an implicit ORing of the individual rules, with early
termination.private boolean whitelisting
public void setRules(@Nonnull List<com.google.common.base.Predicate<EntityAttributeFilteringStage.EntityAttributeContext>> newRules)
List of rules to be used to match attribute values.newRules - new List of rules@Nonnull public List<com.google.common.base.Predicate<EntityAttributeFilteringStage.EntityAttributeContext>> getRules()
List of rules being used to match entity attributes.List of rulespublic void setWhitelisting(boolean newValue)
newValue - true to whitelist (default),
false to blacklistpublic boolean isWhitelisting()
true if whitelisting (default),
false if blacklistingprivate boolean applyRules(EntityAttributeFilteringStage.EntityAttributeContext ctx)
ctx - the context to apply the rules totrue if one of the rules returns true;
otherwise falseprivate String extractRegistrationAuthority(@Nonnull Item<Element> item)
item - the Item representing the entitynull if not presentprivate void filterAttribute(@Nonnull Element attribute, @Nullable String registrationAuthority)
Attribute element.attribute - an Attribute element to filterregistrationAuthority - the registration authority associated with the entityprivate void filterEntityAttributes(@Nonnull Element entityAttributes, @Nullable String registrationAuthority)
EntityAttributes extension element.entityAttributes - the EntityAttributes extension elementregistrationAuthority - the registration authority associated with the entityprotected void doExecute(Collection<Item<Element>> itemCollection) throws StageProcessingException
BaseStageThe stage is guaranteed to be have been initialized and not destroyed when this is invoked.
doExecute in class BaseStage<Element>itemCollection - collection to be processedStageProcessingException - thrown if there is an unrecoverable problem when processing the stageprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentCopyright © 1999–2016. All rights reserved.