|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.fcrepo.client.batch.BatchModifyParser
public class BatchModifyParser
Parses a stream of batch modify directives and makes appropriate calls to the a Fedora server. 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.fcrepo.common.Constants |
|---|
Constants.FedoraHome |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
BatchModifyParser(Uploader UPLOADER,
FedoraAPIMMTOM APIM,
FedoraAPIAMTOM APIA,
InputStream in,
PrintStream out)
Constructor allows this class to initiate the parsing. |
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
endElement(String namespaceURI,
String localName,
String qName)
|
static Map |
getDeploymentLabelMap(String sDefPID)
Get a map of pid-to-label of service deployments that implement the service defined by the indicated definition. |
int |
getFailedCount()
Get the count of failed directives. |
static Map |
getServiceLabelMap()
|
int |
getSucceededCount()
Get the count of successful directives. |
static void |
main(String[] args)
Main method for testing only. |
void |
skippedEntity(String name)
|
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes attrs)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, startPrefixMapping, 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,
FedoraAPIMMTOM APIM,
FedoraAPIAMTOM APIA,
InputStream in,
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 skippedEntity(String name)
throws SAXException
skippedEntity in interface ContentHandlerskippedEntity in class DefaultHandlerSAXException
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerSAXException
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes attrs)
throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXException
public void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXException
public static Map getServiceLabelMap()
throws IOException
IOException
public static Map getDeploymentLabelMap(String sDefPID)
throws IOException
sDefPID - PID of the associated service defintion object.
IOException - If an error occurs in retrieving the list of labels.public static void main(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 | |||||||||