net.shibboleth.metadata.dom.saml
Class EntitiesDescriptorAssemblerStage

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<DomElementItem>
              extended by net.shibboleth.metadata.dom.saml.EntitiesDescriptorAssemblerStage
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 EntitiesDescriptorAssemblerStage
extends BaseStage<DomElementItem>

A Stage capable of assembling a collection of EntityDescriptor elements in to a single EntitiesDescriptor element.


Nested Class Summary
static interface EntitiesDescriptorAssemblerStage.ItemOrderingStrategy
          A strategy that defines how to order a Item collection.
private  class EntitiesDescriptorAssemblerStage.NoOpItemOrderingStrategy
          An ordering strategy that simply returns the collection in whatever order it was already in.
 
Field Summary
private  String descriptorName
          Name to use for the EntitiesDescriptor.
private  Logger log
          Class logger.
static QName NAME_ATTRIB_NAME
          Name of the EntitiesDescriptor's Name attribute.
private  boolean noChildrenAProcessingError
          Whether attempting to turn an empty item collection, which would result in a schema-invalid childless EntitiesDescriptor, should be treated as processing error.
private  EntitiesDescriptorAssemblerStage.ItemOrderingStrategy orderingStrategy
          Strategy used to order a collection of Items.
 
Constructor Summary
EntitiesDescriptorAssemblerStage()
           
 
Method Summary
protected  void addDescriptorName(Element entitiesDescriptor)
          Adds the Name attribute to the EntitiesDescriptor.
protected  void doDestroy()
          
protected  void doExecute(Collection<DomElementItem> itemCollection)
          Performs the stage processing on the given Item collection.
protected  void doInitialize()
          
 String getDescriptorName()
          Gets the Name used for the generated descriptor.
 EntitiesDescriptorAssemblerStage.ItemOrderingStrategy getItemOrderingStrategy()
          Gets the strategy used to order a collection of Items.
 boolean isNoChildrenAProcessingError()
          Gets whether attempting to turn an empty item collection, which would result in a schema-invalid childless EntitiesDescriptor, should be treated as processing error.
 void setDescriptorName(String name)
          Sets the Name used for the generated descriptor.
 void setItemOrderingStrategy(EntitiesDescriptorAssemblerStage.ItemOrderingStrategy strategy)
          Sets the strategy used to order a collection of Items.
 void setNoChildrenAProcessingError(boolean isError)
          Sets whether attempting to turn an empty item collection, which would result in a schema-invalid childless EntitiesDescriptor, should be treated as processing error.
 
Methods inherited from class net.shibboleth.metadata.pipeline.BaseStage
execute, setId
 
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent
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

NAME_ATTRIB_NAME

public static final QName NAME_ATTRIB_NAME
Name of the EntitiesDescriptor's Name attribute.


log

private final Logger log
Class logger.


noChildrenAProcessingError

private boolean noChildrenAProcessingError
Whether attempting to turn an empty item collection, which would result in a schema-invalid childless EntitiesDescriptor, should be treated as processing error. Default value: false


orderingStrategy

private EntitiesDescriptorAssemblerStage.ItemOrderingStrategy orderingStrategy
Strategy used to order a collection of Items. The default strategy performs no ordering.


descriptorName

private String descriptorName
Name to use for the EntitiesDescriptor.

Constructor Detail

EntitiesDescriptorAssemblerStage

public EntitiesDescriptorAssemblerStage()
Method Detail

isNoChildrenAProcessingError

public boolean isNoChildrenAProcessingError()
Gets whether attempting to turn an empty item collection, which would result in a schema-invalid childless EntitiesDescriptor, should be treated as processing error.

Returns:
whether attempting to turn an empty item collection should be treated as processing error

setNoChildrenAProcessingError

public void setNoChildrenAProcessingError(boolean isError)
Sets whether attempting to turn an empty item collection, which would result in a schema-invalid childless EntitiesDescriptor, should be treated as processing error.

Parameters:
isError - whether attempting to turn an empty item collection should be treated as processing error

getItemOrderingStrategy

@Nonnull
public EntitiesDescriptorAssemblerStage.ItemOrderingStrategy getItemOrderingStrategy()
Gets the strategy used to order a collection of Items.

Returns:
strategy used to order a collection of Items

setItemOrderingStrategy

public void setItemOrderingStrategy(@Nonnull
                                    EntitiesDescriptorAssemblerStage.ItemOrderingStrategy strategy)
Sets the strategy used to order a collection of Items.

Parameters:
strategy - strategy used to order a collection of Items

getDescriptorName

@Nullable
public String getDescriptorName()
Gets the Name used for the generated descriptor.

Returns:
Name used for the generated descriptor, may be null

setDescriptorName

public void setDescriptorName(@Nullable
                              String name)
Sets the Name used for the generated descriptor.

Parameters:
name - Name used for the generated descriptor

doExecute

protected void doExecute(@Nonnull@NonnullElements
                         Collection<DomElementItem> itemCollection)
                  throws StageProcessingException
Performs the stage processing on the given Item collection.

The stage is guaranteed to be have been initialized and not destroyed when this is invoked.

Specified by:
doExecute in class BaseStage<DomElementItem>
Parameters:
itemCollection - collection to be processed
Throws:
StageProcessingException - thrown if there is an unrecoverable problem when processing the stage

addDescriptorName

protected void addDescriptorName(@Nonnull
                                 Element entitiesDescriptor)
Adds the Name attribute to the EntitiesDescriptor. This attribute is added if descriptorName is not null.

Parameters:
entitiesDescriptor - the entity descriptor to which the

doDestroy

protected void doDestroy()

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

doInitialize

protected void doInitialize()
                     throws net.shibboleth.utilities.java.support.component.ComponentInitializationException

Overrides:
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent
Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException


Copyright © 1999-2012. All Rights Reserved.