Class InputProcessorChainImpl
java.lang.Object
org.apache.xml.security.stax.impl.InputProcessorChainImpl
- All Implemented Interfaces:
InputProcessorChain
,ProcessorChain
Implementation of a InputProcessorChain
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionInputProcessorChainImpl
(InboundSecurityContext inboundSecurityContext) InputProcessorChainImpl
(InboundSecurityContext inboundSecurityContext, int startPos) InputProcessorChainImpl
(InboundSecurityContext inboundSecurityContext, DocumentContextImpl documentContext) protected
InputProcessorChainImpl
(InboundSecurityContext inboundSecurityContext, DocumentContextImpl documentContextImpl, int startPos, List<InputProcessor> inputProcessors) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProcessor
(InputProcessor newInputProcessor) Adds an InputProcessor to the chain.createSubChain
(InputProcessor inputProcessor) Create a new SubChain.createSubChain
(InputProcessor inputProcessor, boolean clone) 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.The actual processed document's document contextReturns a list with the active processors.The actual processed document's security contextRequests the next XMLEvent from the next processor in the chain.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.
-
Field Details
-
LOG
protected static final transient org.slf4j.Logger LOG
-
-
Constructor Details
-
InputProcessorChainImpl
-
InputProcessorChainImpl
-
InputProcessorChainImpl
public InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext, DocumentContextImpl documentContext) -
InputProcessorChainImpl
protected InputProcessorChainImpl(InboundSecurityContext inboundSecurityContext, DocumentContextImpl documentContextImpl, int startPos, List<InputProcessor> inputProcessors)
-
-
Method Details
-
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 interfaceProcessorChain
-
getSecurityContext
Description copied from interface:InputProcessorChain
The actual processed document's security context- Specified by:
getSecurityContext
in interfaceInputProcessorChain
- Returns:
- The InboundSecurityContext
-
getDocumentContext
Description copied from interface:InputProcessorChain
The actual processed document's document context- Specified by:
getDocumentContext
in interfaceInputProcessorChain
- Returns:
- The DocumentContext
-
addProcessor
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 interfaceInputProcessorChain
- Parameters:
newInputProcessor
- The InputProcessor which should be placed in the chain
-
removeProcessor
Description copied from interface:InputProcessorChain
Removes the specified InputProcessor from this chain.- Specified by:
removeProcessor
in interfaceInputProcessorChain
- Parameters:
inputProcessor
- to remove
-
getProcessors
Description copied from interface:InputProcessorChain
Returns a list with the active processors.- Specified by:
getProcessors
in interfaceInputProcessorChain
- Returns:
- a list with the active processors
-
processHeaderEvent
Description copied from interface:InputProcessorChain
Requests the next security header XMLEvent from the next processor in the chain.- Specified by:
processHeaderEvent
in interfaceInputProcessorChain
- Returns:
- The next XMLEvent from the previous processor
- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-
processEvent
Description copied from interface:InputProcessorChain
Requests the next XMLEvent from the next processor in the chain.- Specified by:
processEvent
in interfaceInputProcessorChain
- Returns:
- The next XMLEvent from the previous processor
- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-
doFinal
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 interfaceProcessorChain
- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- 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. The associated DocumentContext will be cloned.- Specified by:
createSubChain
in interfaceInputProcessorChain
- Parameters:
inputProcessor
- The InputProcessor position the XMLEvents should be processed over this SubChain.- Returns:
- A new InputProcessorChain
- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-
createSubChain
public InputProcessorChain createSubChain(InputProcessor inputProcessor, boolean clone) 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. The parameter clone controls if the associated DocumentContext should be cloned or reference the existing one.- Specified by:
createSubChain
in interfaceInputProcessorChain
- Parameters:
inputProcessor
- The InputProcessor position the XMLEvents should be processed over this SubChain.clone
- if true the associated DocumentContext will be cloned otherwise the DocumentContext will be referenced.- Returns:
- A new InputProcessorChain
- Throws:
XMLStreamException
- thrown when a streaming error occursXMLSecurityException
- thrown when a Security failure occurs
-