|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.autodesk.workflows.Response
public class Response
Encapsulates Command responses. This class encapsulates the responses from workflow commands. Commands can respond with several possible types of values, job IDs, job status, error messages, etc. This class allows a command to set a descriptive response.
A response can include several parts, binary and non-binary. Separate methods allow these two parts to be sent to OutputStreams.
Additionally this class is used by clients to retrieve the data from a server response.
| Constructor Summary | |
|---|---|
Response()
Creates an initialized Response object. |
|
Response(java.io.InputStream is,
java.io.OutputStream os)
Construct a client-side response. |
|
Response(java.lang.String str)
Construct a client-side response. |
|
| Method Summary | |
|---|---|
byte[] |
getBinary()
Get the binary portion of the response. |
java.lang.String |
getDebug()
Get the unknown debug text portion of the response. |
java.io.File |
getFile()
Get the file portion of the response. |
int |
getJobExitValue()
Get the exit value from the process. |
long |
getJobID()
Get the jobID. |
java.lang.String |
getJobMessage()
Get the non-localized message for the job status. |
java.lang.String |
getJobStderr()
Get the contents of the job's stdout stream. |
java.lang.String |
getJobStdout()
Get the contents of the job's stdout stream. |
java.lang.String |
getLocalizedJobMessage()
Get the localized message for the job status. |
int |
getPercentComplete()
Get the percentage complete portion of the response. |
java.lang.String |
getStatus()
Get the command status. |
java.lang.String |
getText()
Get the text portion of the response. |
java.util.List |
getXML()
Get the XML response. |
void |
output(java.io.OutputStream outputStream)
Outputs the response to the stream. |
void |
setBinary(byte[] buffer)
Set the binary response. |
void |
setDebug(java.lang.String text)
Set some unknown debug text. |
void |
setFile(java.io.File file)
Set the file to return. |
void |
setJobExitValue(int value)
Set the exit value from the process. |
void |
setJobID(long jobID)
Set the jobID. |
void |
setJobMessage(java.lang.String msg)
Set a non-localized message for the job status. |
void |
setJobStderr(java.lang.String str)
Set the contents of the job's stderr stream. |
void |
setJobStdout(java.lang.String str)
Set the contents of the job's stdout stream. |
void |
setLocalizedJobMessage(java.lang.String msg)
Set a localized message for the job status. |
void |
setPercentComplete(int percent)
Set the percentage complete. |
void |
setStatus(java.lang.String status)
Set the status of the command. |
void |
setText(java.lang.String text)
Set some unknown text. |
void |
setXML(org.jdom.Element xml)
Set the XML response. |
void |
setXML(java.util.List xml)
Set the XML response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Response()
set*() methods to set the response.
public Response(java.io.InputStream is,
java.io.OutputStream os)
is - an input stream from the server. May not be null.os - an output stream to write binary data to. May be null. (This
is kind of klunky. There should be a better way to do this.)public Response(java.lang.String str)
str - A string containing the XML response. Since this is
a String, this method only works with simple responses. i.e.
If a response contains a file, this method will not do anything
with it.| Method Detail |
|---|
public void setJobID(long jobID)
jobID - the value to set.public long getJobID()
public void setStatus(java.lang.String status)
status - a string representing the status of the command.public java.lang.String getStatus()
public void setJobMessage(java.lang.String msg)
msg - a text description of the job status.public void setLocalizedJobMessage(java.lang.String msg)
msg - a text description of the job status.public java.lang.String getJobMessage()
public java.lang.String getLocalizedJobMessage()
public void setJobStdout(java.lang.String str)
str - textual contents of the stdout stream.public java.lang.String getJobStdout()
public void setJobStderr(java.lang.String str)
str - textual contents of the stderr stream.public java.lang.String getJobStderr()
public void setXML(org.jdom.Element xml)
xml - an Element.public void setXML(java.util.List xml)
xml - a List of XML elements.public java.util.List getXML()
public void setBinary(byte[] buffer)
setBinary() or
setFile() can be set for any one response. This method
inherits the passed in buffer, it does not copy it. Callers must not
modify the buffer after this method is called.
buffer - the binary data to return.public byte[] getBinary()
public void setFile(java.io.File file)
setBinary() or
setFile() can be set for any one response.
file - the file to return.public java.io.File getFile()
public void setPercentComplete(int percent)
percent - the percentage complete - a value from 0 to 100. No
validity check is done.public int getPercentComplete()
public void setText(java.lang.String text)
text - the typless text to return.public java.lang.String getText()
public void setDebug(java.lang.String text)
text - the typless text to return.public java.lang.String getDebug()
public void setJobExitValue(int value)
public int getJobExitValue()
public void output(java.io.OutputStream outputStream)
outputStream - the stream to write the XML to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||