@ThreadSafe public class DOMResourceSourceStage extends BaseStage<Element>
Resource
, parses the document, and places the resultant
document (root) element in to the provided DOMElementItem
collection.
This stage requires the following properties be set prior to initialization:
parserPool
domResource
Modifier and Type | Field and Description |
---|---|
private Resource |
domResource
Resource used to fetch remote XML document.
|
private boolean |
errorCausesSourceFailure
Whether an error parsing one source file causes this entire
Stage to
fail, or just excludes the material from the offending source file. |
private Logger |
log
Class logger.
|
private net.shibboleth.utilities.java.support.xml.ParserPool |
parserPool
Pool of parsers used to parse incoming DOM.
|
Constructor and Description |
---|
DOMResourceSourceStage() |
Modifier and Type | Method and Description |
---|---|
protected void |
doDestroy() |
protected void |
doExecute(Collection<Item<Element>> itemCollection)
Performs the stage processing on the given Item collection.
|
protected void |
doInitialize() |
Resource |
getDOMResource()
Gets the resource from which the XML Document will be fetched.
|
boolean |
getErrorCausesSourceFailure()
Gets whether an error reading and parsing the XML file causes this stage to fail.
|
net.shibboleth.utilities.java.support.xml.ParserPool |
getParserPool()
Gets the pool of DOM parsers used to parse the XML file in to a DOM.
|
protected void |
populateItemCollection(Collection<Item<Element>> itemCollection,
InputStream data)
Builds an
DOMElementItem collection from a new XML document. |
void |
setDOMResource(Resource resource)
Sets the resource from which the XML document will be fetched.
|
void |
setErrorCausesSourceFailure(boolean causesFailure)
Sets whether an error reading and parsing the XML file causes this stage to fail.
|
void |
setParserPool(net.shibboleth.utilities.java.support.xml.ParserPool pool)
Sets the pool of DOM parsers used to parse the XML file in to a DOM.
|
execute, getCollectionPredicate, setCollectionPredicate
setId
getId
destroy, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, isDestroyed
private final Logger log
private Resource domResource
private net.shibboleth.utilities.java.support.xml.ParserPool parserPool
private boolean errorCausesSourceFailure
Stage
to
fail, or just excludes the material from the offending source file. Default value: true
@Nullable public Resource getDOMResource()
public void setDOMResource(@Nonnull Resource resource)
resource
- resource from which the XML document will be fetched@Nullable public net.shibboleth.utilities.java.support.xml.ParserPool getParserPool()
public void setParserPool(@Nonnull net.shibboleth.utilities.java.support.xml.ParserPool pool)
pool
- pool of DOM parsers used to parse the XML file in to a DOMpublic boolean getErrorCausesSourceFailure()
public void setErrorCausesSourceFailure(boolean causesFailure)
causesFailure
- whether an error reading and parsing the XML file causes this stage to failprotected void doExecute(@Nonnull@NonnullElements Collection<Item<Element>> itemCollection) throws StageProcessingException
The stage is guaranteed to be have been initialized and not destroyed when this is invoked.
doExecute
in class BaseStage<Element>
itemCollection
- collection to be processedStageProcessingException
- thrown if there is an unrecoverable problem when processing the stageprotected void populateItemCollection(@Nonnull@NonnullElements Collection<Item<Element>> itemCollection, InputStream data) throws StageProcessingException
DOMElementItem
collection from a new XML document. Also caches DOM Element in its parsed form
for later use.itemCollection
- collection to which the read in and parsed document element is addeddata
- XML input fileStageProcessingException
- thrown if there is a problem reading and parsing the responseprotected void doDestroy()
doDestroy
in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
protected void doInitialize() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize
in class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
net.shibboleth.utilities.java.support.component.ComponentInitializationException
Copyright © 1999–2016. All rights reserved.