net.shibboleth.metadata.dom.saml
Class EntityRegistrationAuthorityFilterStage

java.lang.Object
  extended by net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
      extended by net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent
          extended by net.shibboleth.metadata.pipeline.BaseStage<ItemType>
              extended by net.shibboleth.metadata.pipeline.BaseIteratingStage<DomElementItem>
                  extended by net.shibboleth.metadata.dom.saml.EntityRegistrationAuthorityFilterStage
All Implemented Interfaces:
Stage<DomElementItem>, net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.IdentifiableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent

@ThreadSafe
public class EntityRegistrationAuthorityFilterStage
extends BaseIteratingStage<DomElementItem>

A pipeline stage that will filter EntityDescriptor or EntityDescriptors based on their registration authority.


Field Summary
private  Collection<String> designatedAuthorities
          Registrars which are white/black listed depending on the value of whitelistingAuthorities.
private  Logger log
          Class logger.
private  boolean removingEntitylessEntitiesDescriptor
          Whether EntitiesDescriptor that do not contain EntityDescriptors should be removed.
private  boolean requiringRegistrationInformation
          Whether a descriptor is required to have registration information.
private  boolean whitelistingAuthorities
          Whether designatedAuthorities should be considered a whitelist or a blacklist.
 
Constructor Summary
EntityRegistrationAuthorityFilterStage()
           
 
Method Summary
protected  void doDestroy()
          
protected  boolean doExecute(DomElementItem item)
          Processes a given Item.
protected  boolean filterOutDescriptor(Element descriptor)
          Determines if a given should be filtered out.
 Collection<String> getDesignatedRegistrationAuthorities()
          Gets the list of designated registration authority.
 boolean isRemovingEntitylessEntitiesDescriptor()
          Gets whether EntitiesDescriptor that do not contain EntityDescriptors should be removed.
 boolean isRequiringRegistrationInformation()
          Gets whether a descriptor is required to have registration information.
 boolean isWhitelistingRegistrationAuthorities()
          Whether the list of designated registration authority should be considered a whitelist.
protected  boolean processEntitiesDescriptor(Element entitiesDescriptor)
          Iterates over all child EntitiesDescriptors and EntityDescriptor to see if they should be removed.
 void setDesignatedRegistrationAuthorities(Collection<String> authorities)
          Sets the list of designated registration authority.
 void setRemovingEntitylessEntitiesDescriptor(boolean remove)
          Sets whether EntitiesDescriptor that do not contain EntityDescriptors should be removed.
 void setRequiringRegistrationInformation(boolean isRequired)
          Sets whether a descriptor is required to have registration information.
 void setWhitelistingRegistrationAuthorities(boolean whitelisting)
          Sets whether the list of designated registration authority 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, setId
 
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent
doInitialize, getId
 
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
destroy, 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.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
 
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiableComponent
getId
 
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
 

Field Detail

log

private final Logger log
Class logger.


requiringRegistrationInformation

private boolean requiringRegistrationInformation
Whether a descriptor is required to have registration information. Default value: false


designatedAuthorities

private Collection<String> designatedAuthorities
Registrars which are white/black listed depending on the value of whitelistingAuthorities.


whitelistingAuthorities

private boolean whitelistingAuthorities
Whether designatedAuthorities 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

EntityRegistrationAuthorityFilterStage

public EntityRegistrationAuthorityFilterStage()
Method Detail

isRequiringRegistrationInformation

public boolean isRequiringRegistrationInformation()
Gets whether a descriptor is required to have registration information.

Returns:
whether a descriptor is required to have registration information

setRequiringRegistrationInformation

public void setRequiringRegistrationInformation(boolean isRequired)
Sets whether a descriptor is required to have registration information.

Parameters:
isRequired - whether a descriptor is required to have registration information

getDesignatedRegistrationAuthorities

@Nonnull
@NonnullElements
@Unmodifiable
public Collection<String> getDesignatedRegistrationAuthorities()
Gets the list of designated registration authority.

Returns:
list of designated registration authority, never null

setDesignatedRegistrationAuthorities

public void setDesignatedRegistrationAuthorities(@Nullable@NullableElements
                                                 Collection<String> authorities)
Sets the list of designated registration authority.

Parameters:
authorities - list of designated registration authority

isWhitelistingRegistrationAuthorities

public boolean isWhitelistingRegistrationAuthorities()
Whether the list of designated registration authority should be considered a whitelist.

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

setWhitelistingRegistrationAuthorities

public void setWhitelistingRegistrationAuthorities(boolean whitelisting)
Sets whether the list of designated registration authority should be considered a whitelist.

Parameters:
whitelisting - true if the designated registration authority 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

doDestroy

protected void doDestroy()

Overrides:
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent

doExecute

protected boolean doExecute(@Nonnull
                            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(@Nonnull
                                            Element entitiesDescriptor)
Iterates over all child EntitiesDescriptors and EntityDescriptor to see if they should be removed. Also removed EntitiesDescriptor that no longer contain EntityDescriptor descendants after filtering if isRemovingEntitylessEntitiesDescriptor().

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

filterOutDescriptor

protected boolean filterOutDescriptor(@Nonnull
                                      Element descriptor)
Determines if a given should be filtered out. A descriptor is filtered out if registration information is required by the descriptor does not have it, registration information is present but does not contain the required authority attribute, registrars are being whitelisted and the descriptor's registration authority is not in the whitelist, or registrars are being blacklisted and the descriptor's registration authority is in the blacklist.

Parameters:
descriptor - the descriptor
Returns:
true if the descriptor should be filtered out


Copyright © 1999-2012. All Rights Reserved.