net.shibboleth.metadata.dom.saml
Class EntitiesDescriptorAssemblerStage

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

@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()
          Constructor.
 
Method Summary
protected  void addDescriptorName(Element entitiesDescriptor)
          Adds the Name attribute to the EntitiesDescriptor.
protected  void doExecute(Collection<DomElementItem> itemCollection)
          Performs the stage processing on the given Item collection.
protected  void doInitialize()
          Do the initialization of the component.
 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
 
Methods inherited from class net.shibboleth.metadata.pipeline.AbstractComponent
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

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()
Constructor.

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

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(EntitiesDescriptorAssemblerStage.ItemOrderingStrategy strategy)
Sets the strategy used to order a collection of Items.

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

getDescriptorName

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(String name)
Sets the Name used for the generated descriptor.

Parameters:
name - Name used for the generated descriptor

doExecute

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

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(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

doInitialize

protected void doInitialize()
                     throws ComponentInitializationException
Do the initialization of the component. Default implementation of this method is a no-op. Extending classes should override this method to perform any initialization logic necessary.

Overrides:
doInitialize in class AbstractComponent
Throws:
ComponentInitializationException - throw if there is a problem initializing the component


Copyright © 2009-2011. All Rights Reserved.