net.shibboleth.metadata.dom.saml
Class EntityFilterStage

java.lang.Object
  extended by net.shibboleth.metadata.pipeline.AbstractComponent
      extended by net.shibboleth.metadata.pipeline.BaseStage<ItemType>
          extended by net.shibboleth.metadata.pipeline.BaseIteratingStage<DomElementItem>
              extended by net.shibboleth.metadata.dom.saml.EntityFilterStage
All Implemented Interfaces:
Component, Stage<DomElementItem>

@ThreadSafe
public class EntityFilterStage
extends BaseIteratingStage<DomElementItem>

A pipeline stage that will remove SAML EntityDescriptior elements which do meet specified filtering criteria.


Field Summary
private  Collection<String> designatedEntities
          Entities which are white/black listed depending on the value of whitelistingEntities.
private  Logger log
          Class logger.
private  boolean removingEntitylessEntitiesDescriptor
          Whether EntitiesDescriptor that do not contain EntityDescriptors should be removed.
private  boolean whitelistingEntities
          Whether designatedEntities should be considered a whitelist or a blacklist.
 
Constructor Summary
EntityFilterStage()
           
 
Method Summary
protected  boolean doExecute(DomElementItem item)
          Processes a given Item.
 Collection<String> getDesignatedEntities()
          Gets the list of designated entity IDs.
 boolean isRemovingEntitylessEntitiesDescriptor()
          Gets whether EntitiesDescriptor that do not contain EntityDescriptors should be removed.
 boolean isWhitelistingEntities()
          Whether the list of designated entities should be considered a whitelist.
protected  boolean processEntitiesDescriptor(Element entitiesDescriptor)
          Iterates over all child EntitiesDescriptor, passing each to processEntitiesDescriptor(Element), and EntityDescriptor, passing each to processEntityDescriptor(Element).
protected  boolean processEntityDescriptor(Element entityDescriptor)
          Filters the given entity descriptor.
 void setDesignatedEntities(Collection<String> ids)
          Sets the list of designated entity IDs.
 void setRemovingEntitylessEntitiesDescriptor(boolean remove)
          Sets whether EntitiesDescriptor that do not contain EntityDescriptors should be removed.
 void setWhitelistingEntities(boolean whitelisting)
          Sets whether the list of designated entities should be considered a whitelist.
 
Methods inherited from class net.shibboleth.metadata.pipeline.BaseIteratingStage
doExecute
 
Methods inherited from class net.shibboleth.metadata.pipeline.BaseStage
execute
 
Methods inherited from class net.shibboleth.metadata.pipeline.AbstractComponent
doInitialize, equals, getId, getInitializationInstant, hashCode, initialize, isInitialized, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.shibboleth.metadata.pipeline.Component
getId, getInitializationInstant, initialize, isInitialized
 

Field Detail

log

private final Logger log
Class logger.


designatedEntities

private Collection<String> designatedEntities
Entities which are white/black listed depending on the value of whitelistingEntities.


whitelistingEntities

private boolean whitelistingEntities
Whether designatedEntities should be considered a whitelist or a blacklist. Default value: false


removingEntitylessEntitiesDescriptor

private boolean removingEntitylessEntitiesDescriptor
Whether EntitiesDescriptor that do not contain EntityDescriptors should be removed. Default value: true

Constructor Detail

EntityFilterStage

public EntityFilterStage()
Method Detail

getDesignatedEntities

public Collection<String> getDesignatedEntities()
Gets the list of designated entity IDs.

Returns:
list of designated entity IDs, never null

setDesignatedEntities

public void setDesignatedEntities(Collection<String> ids)
Sets the list of designated entity IDs.

Parameters:
ids - list of designated entity IDs

isWhitelistingEntities

public boolean isWhitelistingEntities()
Whether the list of designated entities should be considered a whitelist.

Returns:
true if the designated entities should be considered a whitelist, false otherwise

setWhitelistingEntities

public void setWhitelistingEntities(boolean whitelisting)
Sets whether the list of designated entities should be considered a whitelist.

Parameters:
whitelisting - true if the designated entities should be considered a whitelist, false otherwise

isRemovingEntitylessEntitiesDescriptor

public boolean isRemovingEntitylessEntitiesDescriptor()
Gets whether EntitiesDescriptor that do not contain EntityDescriptors should be removed.

Returns:
whether EntitiesDescriptor that do not contain EntityDescriptors should be removed

setRemovingEntitylessEntitiesDescriptor

public void setRemovingEntitylessEntitiesDescriptor(boolean remove)
Sets whether EntitiesDescriptor that do not contain EntityDescriptors should be removed.

Parameters:
remove - whether EntitiesDescriptor that do not contain EntityDescriptors should be removed

doExecute

protected boolean doExecute(DomElementItem item)
Processes a given Item.

Specified by:
doExecute in class BaseIteratingStage<DomElementItem>
Parameters:
item - Item on which to operate
Returns:
true if the Item should be retained in the collection, false if not

processEntitiesDescriptor

protected boolean processEntitiesDescriptor(Element entitiesDescriptor)
Iterates over all child EntitiesDescriptor, passing each to processEntitiesDescriptor(Element), and EntityDescriptor, passing each to processEntityDescriptor(Element). If isRemovingEntitylessEntitiesDescriptor() is true and the EntitiesDescriptor contains no child EntitiesDescriptors or EntityDescriptors it is removed.

Parameters:
entitiesDescriptor - EntitiesDescriptor being processed
Returns:
true if the descriptor should be removed, false otherwise

processEntityDescriptor

protected boolean processEntityDescriptor(Element entityDescriptor)
Filters the given entity descriptor.

Parameters:
entityDescriptor - entity descriptor to be filtered
Returns:
true if the given entity descriptor itself should be filtered out, false otherwise


Copyright © 2009-2011. All Rights Reserved.