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

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

public class InputProcessorChainImpl
extends Object
implements InputProcessorChain

Implementation of a InputProcessorChain

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
  InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext)
           
  InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext, DocumentContextImpl documentContext)
           
protected InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext, DocumentContextImpl documentContextImpl, int startPos, List<InputProcessor> inputProcessors)
           
  InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext, int startPos)
           
 
Method Summary
 void addProcessor(InputProcessor newInputProcessor)
          Adds an InputProcessor to the chain.
 InputProcessorChain createSubChain(InputProcessor inputProcessor)
          Create a new SubChain.
 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<InputProcessor> getProcessors()
          Returns a list with the active processors.
 InboundSecurityContext getSecurityContext()
          The actual processed document's security context
 XMLSecEvent processEvent()
          Requests the next XMLEvent from the next processor in the chain.
 XMLSecEvent processHeaderEvent()
          Requests the next security header XMLEvent from the next processor in the chain.
 void removeProcessor(InputProcessor inputProcessor)
          Removes the specified InputProcessor 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

InputProcessorChainImpl

public InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext)

InputProcessorChainImpl

public InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext,
                               int startPos)

InputProcessorChainImpl

public InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext,
                               DocumentContextImpl documentContext)

InputProcessorChainImpl

protected InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext,
                                  DocumentContextImpl documentContextImpl,
                                  int startPos,
                                  List<InputProcessor> inputProcessors)
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 InboundSecurityContext getSecurityContext()
Description copied from interface: InputProcessorChain
The actual processed document's security context

Specified by:
getSecurityContext in interface InputProcessorChain
Returns:
The InboundSecurityContext

getDocumentContext

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

Specified by:
getDocumentContext in interface InputProcessorChain
Returns:
The DocumentContext

addProcessor

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

Specified by:
addProcessor in interface InputProcessorChain
Parameters:
newInputProcessor - The InputProcessor which should be placed in the chain

removeProcessor

public void removeProcessor(InputProcessor inputProcessor)
Description copied from interface: InputProcessorChain
Removes the specified InputProcessor from this chain.

Specified by:
removeProcessor in interface InputProcessorChain
Parameters:
inputProcessor - to remove

getProcessors

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

Specified by:
getProcessors in interface InputProcessorChain
Returns:
List

processHeaderEvent

public XMLSecEvent processHeaderEvent()
                               throws XMLStreamException,
                                      XMLSecurityException
Description copied from interface: InputProcessorChain
Requests the next security header XMLEvent from the next processor in the chain.

Specified by:
processHeaderEvent in interface InputProcessorChain
Returns:
The next XMLEvent from the previous processor
Throws:
XMLStreamException - thrown when a streaming error occurs
XMLSecurityException - thrown when a Security failure occurs

processEvent

public XMLSecEvent processEvent()
                         throws XMLStreamException,
                                XMLSecurityException
Description copied from interface: InputProcessorChain
Requests the next XMLEvent from the next processor in the chain.

Specified by:
processEvent in interface InputProcessorChain
Returns:
The next XMLEvent from the previous 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 InputProcessorChain createSubChain(InputProcessor inputProcessor)
                                   throws XMLStreamException,
                                          XMLSecurityException
Description copied from interface: InputProcessorChain
Create a new SubChain. The XMLEvents will be only be processed from the given InputProcessor to the end. All earlier InputProcessors don't get these events. In other words the chain will be splitted in two parts.

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


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