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) protectedInputProcessorChainImpl(InboundSecurityContext inboundSecurityContext, DocumentContextImpl documentContextImpl, int startPos, List<InputProcessor> inputProcessors) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProcessor(InputProcessor newInputProcessor) Adds an InputProcessor to the chain.createSubChain(InputProcessor inputProcessor) Create a new SubChain.createSubChain(InputProcessor inputProcessor, boolean clone) Create a new SubChain.voiddoFinal()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.voidremoveProcessor(InputProcessor inputProcessor) Removes the specified InputProcessor from this chain.voidreset()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:ProcessorChainresets the chain so that the next event will go again to the first processor in the chain.- Specified by:
resetin interfaceProcessorChain
-
getSecurityContext
Description copied from interface:InputProcessorChainThe actual processed document's security context- Specified by:
getSecurityContextin interfaceInputProcessorChain- Returns:
- The InboundSecurityContext
-
getDocumentContext
Description copied from interface:InputProcessorChainThe actual processed document's document context- Specified by:
getDocumentContextin interfaceInputProcessorChain- Returns:
- The DocumentContext
-
addProcessor
Description copied from interface:InputProcessorChainAdds 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:
addProcessorin interfaceInputProcessorChain- Parameters:
newInputProcessor- The InputProcessor which should be placed in the chain
-
removeProcessor
Description copied from interface:InputProcessorChainRemoves the specified InputProcessor from this chain.- Specified by:
removeProcessorin interfaceInputProcessorChain- Parameters:
inputProcessor- to remove
-
getProcessors
Description copied from interface:InputProcessorChainReturns a list with the active processors.- Specified by:
getProcessorsin interfaceInputProcessorChain- Returns:
- a list with the active processors
-
processHeaderEvent
Description copied from interface:InputProcessorChainRequests the next security header XMLEvent from the next processor in the chain.- Specified by:
processHeaderEventin 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:InputProcessorChainRequests the next XMLEvent from the next processor in the chain.- Specified by:
processEventin 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:ProcessorChainWill 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:
doFinalin 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:InputProcessorChainCreate 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:
createSubChainin 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:InputProcessorChainCreate 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:
createSubChainin 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
-