org.apache.xml.security.stax.impl
Class OutputProcessorChainImpl

java.lang.Object
  extended by org.apache.xml.security.stax.impl.OutputProcessorChainImpl
All Implemented Interfaces:
OutputProcessorChain, ProcessorChain

public class OutputProcessorChainImpl
extends Object
implements OutputProcessorChain

Implementation of a OutputProcessorChain

Version:
$Revision: 1463132 $ $Date: 2013-04-01 14:27:45 +0100 (Mon, 01 Apr 2013) $
Author:
$Author: giger $

Field Summary
protected static boolean isDebugEnabled
           
protected static org.slf4j.Logger log
           
 
Constructor Summary
  OutputProcessorChainImpl(OutboundSecurityContext outboundSecurityContext)
           
  OutputProcessorChainImpl(OutboundSecurityContext outboundSecurityContext, DocumentContextImpl documentContext)
           
protected OutputProcessorChainImpl(OutboundSecurityContext outboundSecurityContext, DocumentContextImpl documentContextImpl, int startPos, List<OutputProcessor> outputProcessors)
           
  OutputProcessorChainImpl(OutboundSecurityContext outboundSecurityContext, int startPos)
           
 
Method Summary
 void addProcessor(OutputProcessor newOutputProcessor)
          Adds an OutputProcessor to the chain.
 OutputProcessorChain createSubChain(OutputProcessor outputProcessor)
          Create a new SubChain.
 OutputProcessorChain createSubChain(OutputProcessor outputProcessor, XMLSecStartElement parentXMLSecStartElement)
           
 void doFinal()
          Will finally be called when the whole document is processed Important note: Every processor in the chain has to call doFinal() in its own doFinal() method.
 DocumentContext getDocumentContext()
          The actual processed document's document context
 List<OutputProcessor> getProcessors()
          Returns a list with the active processors.
 OutboundSecurityContext getSecurityContext()
          The actual processed document's security context
 void processEvent(XMLSecEvent xmlSecEvent)
          Forwards the XMLEvent to the next processor in the chain.
 void removeProcessor(OutputProcessor outputProcessor)
          Removes the specified OutputProcessor from this chain.
 void reset()
          resets the chain so that the next event will go again to the first processor in the chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final transient org.slf4j.Logger log

isDebugEnabled

protected static final transient boolean isDebugEnabled
Constructor Detail

OutputProcessorChainImpl

public OutputProcessorChainImpl(OutboundSecurityContext outboundSecurityContext)

OutputProcessorChainImpl

public OutputProcessorChainImpl(OutboundSecurityContext outboundSecurityContext,
                                int startPos)

OutputProcessorChainImpl

public OutputProcessorChainImpl(OutboundSecurityContext outboundSecurityContext,
                                DocumentContextImpl documentContext)

OutputProcessorChainImpl

protected OutputProcessorChainImpl(OutboundSecurityContext outboundSecurityContext,
                                   DocumentContextImpl documentContextImpl,
                                   int startPos,
                                   List<OutputProcessor> outputProcessors)
Method Detail

reset

public void reset()
Description copied from interface: ProcessorChain
resets the chain so that the next event will go again to the first processor in the chain.

Specified by:
reset in interface ProcessorChain

getSecurityContext

public OutboundSecurityContext getSecurityContext()
Description copied from interface: OutputProcessorChain
The actual processed document's security context

Specified by:
getSecurityContext in interface OutputProcessorChain
Returns:
The InboundSecurityContext

getDocumentContext

public DocumentContext getDocumentContext()
Description copied from interface: OutputProcessorChain
The actual processed document's document context

Specified by:
getDocumentContext in interface OutputProcessorChain
Returns:
The DocumentContext

addProcessor

public void addProcessor(OutputProcessor newOutputProcessor)
Description copied from interface: OutputProcessorChain
Adds an OutputProcessor to the chain. The place where it will be applied can be controlled through the Phase, getBeforeProcessors and getAfterProcessors. @see Interface OutputProcessor

Specified by:
addProcessor in interface OutputProcessorChain
Parameters:
newOutputProcessor - The OutputProcessor which should be placed in the chain

removeProcessor

public void removeProcessor(OutputProcessor outputProcessor)
Description copied from interface: OutputProcessorChain
Removes the specified OutputProcessor from this chain.

Specified by:
removeProcessor in interface OutputProcessorChain
Parameters:
outputProcessor - to remove

getProcessors

public List<OutputProcessor> getProcessors()
Description copied from interface: OutputProcessorChain
Returns a list with the active processors.

Specified by:
getProcessors in interface OutputProcessorChain
Returns:
List

processEvent

public void processEvent(XMLSecEvent xmlSecEvent)
                  throws XMLStreamException,
                         XMLSecurityException
Description copied from interface: OutputProcessorChain
Forwards the XMLEvent to the next processor in the chain.

Specified by:
processEvent in interface OutputProcessorChain
Parameters:
xmlSecEvent - The XMLEvent which should be forwarded to the next processor
Throws:
XMLStreamException - thrown when a streaming error occurs
XMLSecurityException - thrown when a Security failure occurs

doFinal

public void doFinal()
             throws XMLStreamException,
                    XMLSecurityException
Description copied from interface: ProcessorChain
Will finally be called when the whole document is processed Important note: Every processor in the chain has to call doFinal() in its own doFinal() method. InputProcessors should call it before doing other stuff to keep the processing order. Remember the input-chain is in principle processed in the reverse order since we "leech" the events through the chain. So that means that we should do the same for the doFinal method, otherwise we may run into troubles.

Specified by:
doFinal in interface ProcessorChain
Throws:
XMLStreamException - thrown when a streaming error occurs
XMLSecurityException - thrown when a Security failure occurs

createSubChain

public OutputProcessorChain createSubChain(OutputProcessor outputProcessor)
                                    throws XMLStreamException,
                                           XMLSecurityException
Description copied from interface: OutputProcessorChain
Create a new SubChain. The XMLEvents will be only be processed from the given OutputProcessor to the end. All earlier OutputProcessors don't get these events. In other words the chain will be splitted in two parts.

Specified by:
createSubChain in interface OutputProcessorChain
Parameters:
outputProcessor - The OutputProcessor position the XMLEvents should be processed over this SubChain.
Returns:
A new OutputProcessorChain
Throws:
XMLStreamException - thrown when a streaming error occurs
XMLSecurityException - thrown when a Security failure occurs

createSubChain

public OutputProcessorChain createSubChain(OutputProcessor outputProcessor,
                                           XMLSecStartElement parentXMLSecStartElement)
                                    throws XMLStreamException,
                                           XMLSecurityException
Specified by:
createSubChain in interface OutputProcessorChain
Throws:
XMLStreamException
XMLSecurityException


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.