com.pushtotest.tool.protocolhandler
Interface Body

All Known Implementing Classes:
ApacheSOAPBody, HTTPBody, HTTPMultipartBody, MailBody, SOAPBody, XMLRPCBody

public interface Body

This is an interface that should be implemented to allow Protocol specific setting of the content of the body of a request.


Method Summary
 void addHeaders(java.net.HttpURLConnection con)
          Allows the Body object to add its own HTTP header parameters
 void addParameter(java.lang.String name, java.lang.String value)
          Sets a parameter value pair as something that should be set in the header of this protocol.
 java.lang.String getBody()
          Returns the content of the body to be used by the Protocol.
 java.lang.String id()
          Returns an id for this protocol.
 

Method Detail

id

java.lang.String id()
Returns an id for this protocol. The id is a string that will be used to uniquily identify the protocol. For example
:// would be appropriate (without the "://")
.

Returns:
The id for this Protocol.

getBody

java.lang.String getBody()
                         throws ToolException
Returns the content of the body to be used by the Protocol.

Returns:
All of the content that should be sent as the Protocol body.
Throws:
ToolException

addParameter

void addParameter(java.lang.String name,
                  java.lang.String value)
                  throws ToolException
Sets a parameter value pair as something that should be set in the header of this protocol.

Parameters:
name - The name of the header variable.
value - The value to set for this header variable.
Throws:
ToolException

addHeaders

void addHeaders(java.net.HttpURLConnection con)
Allows the Body object to add its own HTTP header parameters

Parameters:
con - The HttpURLConnection object that will communicate with the host using HTTP protocols