public abstract class ResponseDocument
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CLASSNAME |
(package private) static java.lang.String |
COPYRIGHT |
private static org.apache.log4j.Logger |
logger |
protected org.dom4j.Document |
requestDocument |
protected org.dom4j.Document |
responseDocument |
protected org.dom4j.Element |
responseElement |
private Status |
status |
private org.dom4j.Element |
statusElement |
Modifier | Constructor and Description |
---|---|
protected |
ResponseDocument(org.dom4j.Document theRequestDoc)
Create a response document, based on the request type.
|
Modifier and Type | Method and Description |
---|---|
protected abstract org.dom4j.Element |
addResponseSpecificElement()
Hook for subclasses to add elements specific to the response type when
the response shell is built.
|
protected org.dom4j.Element |
addStatusElement()
Creates the status element including attributes.
|
protected org.dom4j.Element |
createCxmlShell()
Creates the cXML element and attribtues.
|
protected org.dom4j.Document |
createShell()
Creates the response document shell containing the cXML node and the response node,
resulting in a XML document as follows:
|
org.dom4j.Document |
getResponseDocument() |
protected org.dom4j.Element |
getResponseElement() |
java.lang.String |
getStatusReturnCode()
Gets the return code in the response.
|
java.lang.String |
getStatusText()
Gets the status text in the response.
|
protected boolean |
isStatusSuccess()
Returns if this result indicates success.
|
static void |
main(java.lang.String[] args)
Used for testing only.
|
void |
setStatus(Status status)
Sets the status in the response.
|
void |
setStatusReturnCode(int rc)
Sets the return code in the response.
|
void |
setStatusText(java.lang.String msg)
Sets the status text in the response.
|
static final java.lang.String COPYRIGHT
private static final java.lang.String CLASSNAME
private static org.apache.log4j.Logger logger
protected org.dom4j.Document requestDocument
protected org.dom4j.Document responseDocument
protected org.dom4j.Element responseElement
private org.dom4j.Element statusElement
private Status status
protected ResponseDocument(org.dom4j.Document theRequestDoc)
protected org.dom4j.Document createShell() throws java.lang.Exception
java.lang.Exception
protected org.dom4j.Element createCxmlShell() throws java.lang.Exception
java.lang.Exception
protected abstract org.dom4j.Element addResponseSpecificElement() throws java.lang.Exception
java.lang.Exception
protected org.dom4j.Element addStatusElement()
public org.dom4j.Document getResponseDocument()
public void setStatus(Status status)
status
- The status to set.public void setStatusReturnCode(int rc)
rc
- return codepublic java.lang.String getStatusReturnCode()
public void setStatusText(java.lang.String msg)
msg
- status textpublic java.lang.String getStatusText()
protected boolean isStatusSuccess()
protected org.dom4j.Element getResponseElement()
public static void main(java.lang.String[] args) throws java.io.IOException, B2bException
java.io.IOException
B2bException