net.shibboleth.metadata.dom
Class XPathFilteringStage

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

@ThreadSafe
public class XPathFilteringStage
extends BaseStage<DomElementItem>

Pipeline stage which allows filtering of @{link DomElementItem}s according to an XPath expression. Each DomElementItem is removed if the XPath expression evaluates as true.

This stage requires the following properties be set prior to initialization:


Field Summary
private  Logger log
          Class logger.
private  NamespaceContext namespaceContext
          The NamespaceContext to use in interpreting the XPath expression.
private  String xpathExpression
          The XPath expression to execute on each DomElementItem.
 
Constructor Summary
XPathFilteringStage()
           
 
Method Summary
 void doExecute(Collection<DomElementItem> metadataCollection)
          Performs the stage processing on the given Item collection.
protected  void doInitialize()
          Do the initialization of the component.
 NamespaceContext getNamespaceContext()
          Gets the NamespaceContext to use in interpreting the XPath expression.
 String getXpathExpression()
          Gets the XPath expression to execute on each DomElementItem.
 void setNamespaceContext(NamespaceContext context)
          Sets the NamespaceContext to use in interpreting the XPath expression.
 void setXpathExpression(String expression)
          Sets the XPath expression to execute on each DomElementItem.
 
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

log

private final Logger log
Class logger.


xpathExpression

private String xpathExpression
The XPath expression to execute on each DomElementItem.


namespaceContext

private NamespaceContext namespaceContext
The NamespaceContext to use in interpreting the XPath expression.

Constructor Detail

XPathFilteringStage

public XPathFilteringStage()
Method Detail

getXpathExpression

public String getXpathExpression()
Gets the XPath expression to execute on each DomElementItem.

Returns:
XPath expression to execute on each DomElementItem

setXpathExpression

public void setXpathExpression(String expression)
Sets the XPath expression to execute on each DomElementItem.

Parameters:
expression - XPath expression to execute on each DomElementItem

getNamespaceContext

public NamespaceContext getNamespaceContext()
Gets the NamespaceContext to use in interpreting the XPath expression.

Returns:
NamespaceContext to use in interpreting the XPath expression

setNamespaceContext

public void setNamespaceContext(NamespaceContext context)
Sets the NamespaceContext to use in interpreting the XPath expression.

Parameters:
context - NamespaceContext to use in interpreting the XPath expression

doExecute

public void doExecute(Collection<DomElementItem> metadataCollection)
Performs the stage processing on the given Item collection.

Specified by:
doExecute in class BaseStage<DomElementItem>
Parameters:
metadataCollection - collection to be processed

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.