|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
fedora.client.batch.BatchModifyParser
public class BatchModifyParser
Title: BatchModifyParser.java
Description: A class for parsing the xml modify directives in the Batch Modify input file. The parsing is configured to parse directives in the file sequentially. Logs are written for each successful and failed directive that is processed. Recoverable(non-fatal) errors are written to the log file and processing continues. Catastrophic errors will cause parsing to halt and set the count of failed directives to -1 indicating that parsing was halted prior to the end of the file. In this case the logs will contain all directives processed up to the point of failure.
| Constructor Summary | |
|---|---|
BatchModifyParser(Uploader UPLOADER,
FedoraAPIM APIM,
FedoraAPIA APIA,
java.io.InputStream in,
java.io.PrintStream out)
Constructor allows this class to initiate the parsing. |
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
endDocument()
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
|
static java.util.Map |
getBDefLabelMap()
|
static java.util.Map |
getBMechLabelMap(java.lang.String bDefPID)
Get a map of pid-to-label of behavior mechanisms that implement the behavior defined by the indicated bdef. |
int |
getFailedCount()
Get the count of failed directives. |
int |
getSucceededCount()
Get the count of successful directives. |
static void |
main(java.lang.String[] args)
Main method for testing only. |
void |
skippedEntity(java.lang.String name)
|
void |
startDocument()
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BatchModifyParser(Uploader UPLOADER,
FedoraAPIM APIM,
FedoraAPIA APIA,
java.io.InputStream in,
java.io.PrintStream out)
Constructor allows this class to initiate the parsing.
UPLOADER - - An instance of Uploader.APIM - - An instance of FedoraAPIM.APIA - - An instance of Fedora APIA.in - - An input stream containing the xml to be parsed.out - - A print stream used for writing log info.| Method Detail |
|---|
public int getFailedCount()
Get the count of failed directives. Note that a failed count value of -1 indicates that a fatal parsing error occurred before all directives could be parsed and the number of unprocessed directives is indeterminate. The log file will contain details on how many directives were successfully processed before the fatal error was encountered.
public int getSucceededCount()
Get the count of successful directives.
public void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerendDocument in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException
startPrefixMapping in interface org.xml.sax.ContentHandlerstartPrefixMapping in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void skippedEntity(java.lang.String name)
throws org.xml.sax.SAXException
skippedEntity in interface org.xml.sax.ContentHandlerskippedEntity in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public static java.util.Map getBDefLabelMap()
throws java.io.IOException
java.io.IOException
public static java.util.Map getBMechLabelMap(java.lang.String bDefPID)
throws java.io.IOException
bDefPID - PID of the associated behavior defintion object.
java.io.IOException - If an error occurs in retrieving the list of labels.public static void main(java.lang.String[] args)
Main method for testing only.
args - Array of input parms consisting of hostname, port, username, password, protocol, directives, log.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||