|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent
net.shibboleth.metadata.pipeline.BaseStage<DomElementItem>
net.shibboleth.metadata.dom.DomResourceSourceStage
@ThreadSafe public class DomResourceSourceStage
A pipeline stage which reads an XML document from an 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:
parserPooldomResource
| Field Summary | |
|---|---|
private net.shibboleth.utilities.java.support.resource.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 Summary | |
|---|---|
DomResourceSourceStage()
|
|
| Method Summary | |
|---|---|
protected void |
doDestroy()
|
protected void |
doExecute(Collection<DomElementItem> itemCollection)
Performs the stage processing on the given Item collection. |
protected void |
doInitialize()
|
net.shibboleth.utilities.java.support.resource.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<DomElementItem> itemCollection,
InputStream data)
Builds an DomElementItem collection from a new XML document. |
void |
setDomResource(net.shibboleth.utilities.java.support.resource.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. |
| Methods inherited from class net.shibboleth.metadata.pipeline.BaseStage |
|---|
execute, setId |
| Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent |
|---|
getId |
| Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent |
|---|
destroy, initialize, isDestroyed, isInitialized |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent |
|---|
destroy, isDestroyed |
| Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiableComponent |
|---|
getId |
| Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent |
|---|
initialize, isInitialized |
| Field Detail |
|---|
private final Logger log
private net.shibboleth.utilities.java.support.resource.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
| Constructor Detail |
|---|
public DomResourceSourceStage()
| Method Detail |
|---|
@Nullable public net.shibboleth.utilities.java.support.resource.Resource getDomResource()
public void setDomResource(@Nonnull
net.shibboleth.utilities.java.support.resource.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 fail
protected void doExecute(@Nonnull@NonnullElements
Collection<DomElementItem> itemCollection)
throws StageProcessingException
The stage is guaranteed to be have been initialized and not destroyed when this is invoked.
doExecute in class BaseStage<DomElementItem>itemCollection - collection to be processed
StageProcessingException - thrown if there is an unrecoverable problem when processing the stage
protected void populateItemCollection(@Nonnull@NonnullElements
Collection<DomElementItem> 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 file
StageProcessingException - thrown if there is a problem reading and parsing the responseprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractDestructableInitializableComponent
protected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||