|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.cri.xcat.api.examples.NonBlockingHandler
public class NonBlockingHandler
Constructor Summary | |
---|---|
NonBlockingHandler(java.util.Observer observer)
|
Method Summary | |
---|---|
void |
characters(char[] buf,
int offset,
int len)
|
void |
endDocument()
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name)
|
void |
handleError(java.lang.Exception e)
This method is called when an error has occurred while attempting to submit a request (send a command) to the xCAT daemon. |
void |
handleXmlResponse(java.io.InputStream inputStream)
This method takes the InputStream from the SSL socket connection and parses it. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NonBlockingHandler(java.util.Observer observer)
Method Detail |
---|
public void handleXmlResponse(java.io.InputStream inputStream)
IResponseHandler
The response is in a XML format with the root XML tag of
1. <xcatresponse> <data>...</data> <data>...</data> ... <data>...</data> </xcatresponse>
In this format, there can be multiple
2. <xcatresponse> <data> <desc>desc1</desc> <contents>contents1</contents> </data> <data> <desc>desc2</desc> <contents>contents2</contents> </data> </xcatresponse>
NOTE: In this format, only the data array can have more than one element. All other arrays are assumed to be a single element.
3. <xcatresponse> <node> <name>node1</name> <data> <desc>node 1 desc</desc> <contents>node 1 contents</contents> </data> </node> <node> <name>node2</name> <data> <desc>node 2 desc</desc> <contents>node 2 contents</contents> </data> </node> </xcatresponse>
NOTE: Only the node array can have more than one element. All other arrays are assumed to be a single element.
The response from xcatd may also contain an error. The error will be
specified in the XML response and in which case the client should
recognize this error and respond accordingly. NOTE: The
handleError
method is not automatically called when xcatd
responds with valid XML containing an error message. This is up to the
client.
handleXmlResponse
in interface IResponseHandler
inputStream
- the input stream from the xCAT daemon to this client.public void characters(char[] buf, int offset, int len) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void handleError(java.lang.Exception e)
IResponseHandler
handleError
in interface IResponseHandler
e
- The error that occurred.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |