net.shibboleth.metadata.dom.saml
Class ContactPersonFilterStage

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.ContactPersonFilterStage
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 ContactPersonFilterStage
extends BaseIteratingStage<DomElementItem>

Filtering stage that removes ContactPerson elements from EntityDescriptors.

Note, only the values TECHNICAL, SUPPORT, ADMINISTRATIVE, BILLING, and OTHER are valid contact person types. Attempting to designate a type other than these will result in that type being ignored. ContactPerson elements which do not contain the required contactType attribute are always removed.

To remove all contact persons enable type whitelisting and provide an empty designated type set.


Field Summary
static String ADMINISTRATIVE
          'administrative' person type constant.
private  Set<String> allowedTypes
          Allowed contact person types.
static String BILLING
          'billing' person type constant.
private  Set<String> designatedTypes
          Person types which are white/black listed depending on the value of whitelistingTypes.
private  Logger log
          Class logger.
static String OTHER
          'other' person type constant.
static String SUPPORT
          'support' person type constant.
static String TECHNICAL
          'technical' person type constant.
private  boolean whitelistingTypes
          Whether designatedTypes should be considered a whitelist.
 
Constructor Summary
ContactPersonFilterStage()
           
 
Method Summary
protected  void doDestroy()
          
protected  boolean doExecute(DomElementItem item)
          Processes a given Item.
 Collection<String> getDesignateTypes()
          Gets the list of designated person types.
protected  boolean isRetainedContactPersonType(Element contactPerson)
          Check whether the given contact person is designated as a type that is to be retained or not.
 boolean isWhitelistingTypes()
          Gets whether the list of designated roles should be considered a whitelist.
protected  void processEntitiesDescriptor(Element entitiesDescriptor)
          Iterates over all child EntitiesDescriptor, passing each to processEntitiesDescriptor(Element), and EntityDescriptor, passing each to processEntityDescriptor(Element).
protected  void processEntityDescriptor(Element entityDescriptor)
          Processes an EntityDescriptor by removing any ContactPerson that is within it.
 void setDesignatedTypes(Collection<String> types)
          Sets the list of designated entity roles.
 void setWhitelistingTypes(boolean whitelisting)
          Sets whether the list of designated roles 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

TECHNICAL

public static final String TECHNICAL
'technical' person type constant.

See Also:
Constant Field Values

SUPPORT

public static final String SUPPORT
'support' person type constant.

See Also:
Constant Field Values

ADMINISTRATIVE

public static final String ADMINISTRATIVE
'administrative' person type constant.

See Also:
Constant Field Values

BILLING

public static final String BILLING
'billing' person type constant.

See Also:
Constant Field Values

OTHER

public static final String OTHER
'other' person type constant.

See Also:
Constant Field Values

log

private final Logger log
Class logger.


allowedTypes

private Set<String> allowedTypes
Allowed contact person types.


designatedTypes

private Set<String> designatedTypes
Person types which are white/black listed depending on the value of whitelistingTypes.


whitelistingTypes

private boolean whitelistingTypes
Whether designatedTypes should be considered a whitelist. Default value: true

Constructor Detail

ContactPersonFilterStage

public ContactPersonFilterStage()
Method Detail

getDesignateTypes

@Nonnull
@NonnullElements
@Unmodifiable
public Collection<String> getDesignateTypes()
Gets the list of designated person types.

Returns:
list of designated person types

setDesignatedTypes

public void setDesignatedTypes(@Nullable@NullableElements
                               Collection<String> types)
Sets the list of designated entity roles. The list may contain either role element names or schema types.

Parameters:
types - list of designated entity roles

isWhitelistingTypes

public boolean isWhitelistingTypes()
Gets whether the list of designated roles should be considered a whitelist.

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

setWhitelistingTypes

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

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

doExecute

protected boolean doExecute(@Nonnull
                            DomElementItem item)
                     throws StageProcessingException
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
Throws:
StageProcessingException - thrown if there is a problem with the stage processing

processEntitiesDescriptor

protected void processEntitiesDescriptor(@Nonnull
                                         Element entitiesDescriptor)
Iterates over all child EntitiesDescriptor, passing each to processEntitiesDescriptor(Element), and EntityDescriptor, passing each to processEntityDescriptor(Element).

Parameters:
entitiesDescriptor - EntitiesDescriptor being processed

processEntityDescriptor

protected void processEntityDescriptor(@Nonnull
                                       Element entityDescriptor)
Processes an EntityDescriptor by removing any ContactPerson that is within it.

Parameters:
entityDescriptor - entity descriptor being processed

isRetainedContactPersonType

protected boolean isRetainedContactPersonType(@Nonnull
                                              Element contactPerson)
Check whether the given contact person is designated as a type that is to be retained or not.

Parameters:
contactPerson - the contact person
Returns:
true if the contact person should be retained, false otherwise

doDestroy

protected void doDestroy()

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


Copyright © 1999-2012. All Rights Reserved.