|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.metadata.pipeline.AbstractComponent
net.shibboleth.metadata.pipeline.BaseStage<DomElementItem>
net.shibboleth.metadata.dom.DomFilesystemSourceStage
@ThreadSafe public class DomFilesystemSourceStage
A stage which reads XML information from the filesystem and places it in the given DomElementItem collection.
This stage requires the following properties be set prior to initialization:
parserPoolsource
| Field Summary | |
|---|---|
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 boolean |
noSourceFilesAnError
Whether the lack of source files is treated as an error. |
private org.opensaml.util.xml.ParserPool |
parserPool
Pool of DOM parsers used to parse the XML file in to a DOM. |
private boolean |
recurseDirectories
Whether or not directories are recursed if the given input file is a directory. |
private File |
sourceFile
The file path to the DOM material provided by this source. |
private FileFilter |
sourceFileFilter
Filter used to determine if a file should be included. |
| Constructor Summary | |
|---|---|
DomFilesystemSourceStage()
|
|
| Method Summary | |
|---|---|
protected void |
doExecute(Collection<DomElementItem> itemCollection)
Performs the stage processing on the given Item collection. |
protected void |
doInitialize()
Do the initialization of the component. |
boolean |
getErrorCausesSourceFailure()
Gets whether an error parsing a single file causes the source to fail. |
org.opensaml.util.xml.ParserPool |
getParserPool()
Gets the pool of DOM parsers used to parse the XML file in to a DOM. |
boolean |
getRecurseDirectories()
Gets whether directories will be recursively searched for XML input files. |
File |
getSource()
Gets the path to the DOM material provided by this source. |
FileFilter |
getSourceFileFilter()
Gets the filter used to determine if a file, in a directory, should be treated as a source file. |
protected void |
getSourceFiles(File input,
List<File> collector)
Gets the source files from a given input. |
boolean |
isNoSourceFilesAnError()
Get whether the lack of source files is considered an error. |
protected DomElementItem |
processSourceFile(File source)
Reads in an XML source file, parses it, and creates the appropriate DomElementItem for the data. |
void |
setErrorCausesSourceFailure(boolean causesFailure)
Sets whether an error parsing a single file causes the source to fail. |
void |
setNoSourceFilesAnError(boolean isError)
Sets whether the lack of source files is considered an error. |
void |
setParserPool(org.opensaml.util.xml.ParserPool pool)
Sets the pool of DOM parsers used to parse the XML file in to a DOM. |
void |
setRecurseDirectories(boolean recurse)
Sets whether directories will be recursively searched for XML input files. |
void |
setSource(File source)
Sets the path to the DOM material provided by this source. |
void |
setSourceFileFilter(FileFilter filter)
Sets the filter used to determine if a file, in a directory, should be treated as a source file. |
| Methods inherited from class net.shibboleth.metadata.pipeline.BaseStage |
|---|
execute |
| Methods inherited from class net.shibboleth.metadata.pipeline.AbstractComponent |
|---|
equals, getId, getInitializationInstant, hashCode, initialize, isInitialized, setId |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.shibboleth.metadata.pipeline.Component |
|---|
getId, getInitializationInstant, initialize, isInitialized |
| Field Detail |
|---|
private final Logger log
private org.opensaml.util.xml.ParserPool parserPool
private File sourceFile
private FileFilter sourceFileFilter
sourceFile is a
directory.
private boolean recurseDirectories
false
private boolean noSourceFilesAnError
false
private boolean errorCausesSourceFailure
Stage to
fail, or just excludes the material from the offending source file. Default value: true
| Constructor Detail |
|---|
public DomFilesystemSourceStage()
| Method Detail |
|---|
public org.opensaml.util.xml.ParserPool getParserPool()
public void setParserPool(org.opensaml.util.xml.ParserPool pool)
pool - pool of DOM parsers used to parse the XML file in to a DOMpublic File getSource()
public void setSource(File source)
source - path to the DOM material provided by this sourcepublic FileFilter getSourceFileFilter()
public void setSourceFileFilter(FileFilter filter)
filter - filter used to determine if a file, in a directory, should be treated as a source file, may be nullpublic boolean getRecurseDirectories()
public void setRecurseDirectories(boolean recurse)
recurse - whether directories will be recursively searched for XML input filespublic boolean isNoSourceFilesAnError()
public void setNoSourceFilesAnError(boolean isError)
isError - whether the lack of source files is considered an errorpublic boolean getErrorCausesSourceFailure()
public void setErrorCausesSourceFailure(boolean causesFailure)
causesFailure - whether an error parsing a single file causes the source to fail
protected void doExecute(Collection<DomElementItem> itemCollection)
throws StageProcessingException
doExecute in class BaseStage<DomElementItem>itemCollection - collection to be processed
StageProcessingException - thrown if there is an unrecoverable problem when processing the stage
protected void getSourceFiles(File input,
List<File> collector)
recurseDirectories is true, then this process is repeated for each child direcrory.
input - the source input file, never nullcollector - the collector of XML input files
protected DomElementItem processSourceFile(File source)
throws StageProcessingException
DomElementItem for the data.
source - XML file to read in
errorCausesSourceFailure is false
StageProcessingException - thrown if there is a problem reading in the Element and
errorCausesSourceFailure is true
protected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractComponentComponentInitializationException - throw if there is a problem initializing the component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||