|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pushtotest.tool.response.ResponseWrapper
public abstract class ResponseWrapper
This is an abstract class that implements the Response interface that should make it easy to deal with some of the details of the Response by providing reasonable default implementations of each of the methods.
| Field Summary | |
|---|---|
protected java.lang.Object |
content
|
protected long |
datatime
|
protected java.util.Map |
parameters
|
protected Protocol |
parent
|
protected int |
responsecode
|
protected java.lang.String |
responseMessage
|
protected long |
setuptime
|
protected long |
totaltime
|
| Constructor Summary | |
|---|---|
ResponseWrapper()
|
|
| Method Summary | |
|---|---|
void |
appendParameter(java.lang.String name,
java.lang.Object value)
This method appends an Object to a parameter that is already stored or creates a new parameter if name is not used already. |
void |
appendParameters(java.lang.String name,
java.util.List values)
This method appends a List of Objects to a parameter that is already stored or creates a new parameter if name is not used already. |
java.lang.Object |
getContent()
This method returns the entire contents that comprised the response that was sent back from the server. |
int |
getContentSize()
Returns the size of the content. |
long |
getDataTime()
Returns the time it took from recieving back the first byte of data until the last byte of data was recieved. |
java.util.Iterator |
getParameterKeys()
Returns an Itterator of all of the parameters values so that they user can get the list and then get the values. |
java.lang.Object |
getParameterValue(java.lang.String name)
Returns a single value that is associated with the name given. |
java.util.List |
getParameterValues(java.lang.String name)
Returns the values associated with this parameter as a List. |
Protocol |
getParentProtocol()
Returns the Protocol that was called that generated this Response object. |
int |
getResponseCode()
Returns the response code value received from the host |
java.lang.String |
getResponseMessage()
Returns the response code message. |
long |
getSetupTime()
Returns the amount of time between when the connection is started and the first byte of data is recieved back from the server. |
long |
getTotalTime()
Returns the total time it took to connect to the host, make the request and get all of the data back. |
abstract java.lang.String |
id()
Gets the id of this response object. |
void |
setContent(java.lang.Object content)
This method sets the entire contents that comprised the response that was sent back from the server. |
void |
setDataTime(long millis)
Sets the time it took from recieving back the first byte of data until the last byte of data was recieved. |
void |
setParameter(java.lang.String name,
java.lang.Object value)
This method stores something in this response to be used later by a process. |
void |
setParameters(java.lang.String name,
java.util.List values)
Sets a List of parameters to be stored with the associated name. |
void |
setParentProtocol(Protocol parent)
Sets the parent protocol of this Response object. |
void |
setResponseCode(int thecode)
Sets the response code value, used internally |
void |
setResponseMessage(java.lang.String rmsg)
Sets the response code message. |
void |
setSetupTime(long millis)
Returns the amount of time between when the connection is started and the first byte of data is recieved back from the server. |
void |
setTotalTime(long millis)
Sets the total time it took to connect to the host, make the request and get all of the data back. |
java.lang.String |
toString()
Returns a string representation of all of the content that was returned from the server that made up this Response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map parameters
protected Protocol parent
protected java.lang.Object content
protected int responsecode
protected java.lang.String responseMessage
protected long totaltime
protected long datatime
protected long setuptime
| Constructor Detail |
|---|
public ResponseWrapper()
| Method Detail |
|---|
public abstract java.lang.String id()
id in interface Responsepublic void setResponseCode(int thecode)
setResponseCode in interface Responseint - responsecodepublic int getResponseCode()
getResponseCode in interface Responsepublic java.lang.String getResponseMessage()
getResponseMessage in interface Responsepublic void setResponseMessage(java.lang.String rmsg)
setResponseMessage in interface Responsepublic Protocol getParentProtocol()
getParentProtocol in interface Response
public void setParentProtocol(Protocol parent)
throws UnsupportedTypeException
setParentProtocol in interface Responseparent - The Protocol that caused this Response to be returned.
UnsupportedTypeException - If for some reason the Parent type and the
the Response type are incompatible.public java.lang.Object getContent()
getContent in interface Responsepublic void setContent(java.lang.Object content)
setContent in interface ResponseThe - content as a String.public java.lang.String toString()
toString in interface ResponsetoString in class java.lang.Objectpublic int getContentSize()
public void setTotalTime(long millis)
setTotalTime in interface Responsemillis - The time it took to do the whole connection.public long getTotalTime()
getTotalTime in interface Responsepublic void setDataTime(long millis)
setDataTime in interface Responsemillis - The time to get the data back from the host.public long getDataTime()
getDataTime in interface Responsepublic void setSetupTime(long millis)
setSetupTime in interface Responsemillis - The amount of time it takes to connect and send the request.public long getSetupTime()
getSetupTime in interface Response
public void setParameter(java.lang.String name,
java.lang.Object value)
name if one already exists.
setParameter in interface Responsename - The name to store this as.value - The object to associate with this name.
public void setParameters(java.lang.String name,
java.util.List values)
setParameters in interface Responsename - The name of the parameter.values - The objects to associate with this param.
public void appendParameter(java.lang.String name,
java.lang.Object value)
name is not used already.
appendParameter in interface Responsename - The name of the parameter.value - The object to associate with this param.
public void appendParameters(java.lang.String name,
java.util.List values)
name is not used already.
appendParameters in interface Responsename - The name of the parameter.values - The objects to associate with this param.public java.lang.Object getParameterValue(java.lang.String name)
getParameterValues call instead.
getParameterValue in interface Responsename - The name of the parameter to get the value for.getParameterValues(java.lang.String)public java.util.Iterator getParameterKeys()
getParameterKeys in interface Responsepublic java.util.List getParameterValues(java.lang.String name)
getParameterValues in interface Responsename - The name of the parameter to get the value for.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||