net.shibboleth.metadata.dom
Class XPathFilteringStage

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.XPathFilteringStage
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 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
protected  void doDestroy()
          
 void doExecute(Collection<DomElementItem> metadataCollection)
          Performs the stage processing on the given Item collection.
protected  void doInitialize()
          
 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, 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

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

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

Returns:
XPath expression to execute on each DomElementItem

setXpathExpression

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

Parameters:
expression - XPath expression to execute on each DomElementItem

getNamespaceContext

@Nonnull
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(@Nullable
                                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(@Nonnull@NonnullElements
                      Collection<DomElementItem> metadataCollection)
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:
metadataCollection - collection to be processed

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.