public class Response
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Response.Result
enumeration for the different result types of a response
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
clientTxnID
the client transaction ID
|
private static java.lang.String[] |
messageKeys
the message keys
|
private Response.Result |
result
the overall result
|
private java.util.List<ResultMessage> |
resultMessages
additional result messages
|
private java.lang.String |
serverTxnID
the server transaction ID
|
Constructor and Description |
---|
Response() |
Modifier and Type | Method and Description |
---|---|
void |
accept(ResponseVisitor visitor)
call the suitable method of the given visitor
|
protected void |
dataFromList(KVMultiList list)
subclasses that need to read additional data from the key-value pair
response should override this method.
|
protected void |
dataFromXml(org.w3c.dom.Element data)
subclasses that need to read additional data from the XML response should
override this method.
|
void |
fromList(KVMultiList list)
initialize the instance from the given key-value multi-list
|
void |
fromXml(org.w3c.dom.Document doc)
initialize the instance from the given XML DOM document.
|
java.lang.String |
getClientTxnID()
return the client transaction ID
|
Response.Result |
getResult()
return the result
|
java.util.List<ResultMessage> |
getResultMessages()
return a list of list of the supplied result messages
|
java.lang.String |
getServerTxnID()
return the server transaction ID
|
boolean |
isSuccess()
return whether the result is
Success |
java.lang.String |
toString()
return a string representation for debugging purposes
|
private java.lang.String clientTxnID
private java.lang.String serverTxnID
private Response.Result result
private java.util.List<ResultMessage> resultMessages
private static final java.lang.String[] messageKeys
public void fromXml(org.w3c.dom.Document doc) throws org.w3c.dom.DOMException, ResponseParseException
doc
- the documentorg.w3c.dom.DOMException
- on DOM exceptionsResponseParseException
- if the document does not contain the
expected contentprotected void dataFromXml(org.w3c.dom.Element data) throws org.w3c.dom.DOMException, ResponseParseException
data
- the data element or null
if the data contains no additional dataorg.w3c.dom.DOMException
- on DOM exceptionsResponseParseException
- if the document does not contain the
expected contentpublic void fromList(KVMultiList list) throws ResponseParseException
list
- the multilistResponseParseException
- if the list does not contain the
expected contentprotected void dataFromList(KVMultiList list) throws ResponseParseException
list
- the listResponseParseException
- if the document does not contain the
expected contentpublic void accept(ResponseVisitor visitor)
visitor
- the visitorpublic java.lang.String toString()
toString
in class java.lang.Object
public Response.Result getResult()
public boolean isSuccess()
Success
true
if sopublic java.lang.String getServerTxnID()
null
if none was suppliedpublic java.lang.String getClientTxnID()
null
if none was suppliedpublic java.util.List<ResultMessage> getResultMessages()
Copyright © 2005-2013 Knipp Medien und Kommunikation GmbH