com.pushtotest.tool.protocolhandler
Interface Header

All Known Implementing Classes:
HeaderWrapper, HTTPHeader, SOAPHeader, XMLRPCHeader

public interface Header

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


Method Summary
 java.lang.String get(java.lang.String name)
          Returns the value of a single header variable as a String.
 java.util.Iterator getHeaders()
          Returns an Itterator of all of the header values so that they user can get the list and then get the values.
 java.lang.String id()
          Returns an id for this protocol.
 void set(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.
 void set(java.lang.String name, java.lang.String value, boolean encode)
          Sets a parameter value pair as something that should be set in the header of this protocol.
 java.lang.String toString()
          Returns the content of the header to be used by the 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.

set

void set(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.

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

set

void set(java.lang.String name,
         java.lang.String value,
         boolean encode)
Sets a parameter value pair as something that should be set in the header of this protocol. Optionally will encode the value with a protocol specific encoding. E.g. HTTP headers need to have some values Base64 encoded.

Parameters:
name - The name of the header variable.
value - The value to set for this header variable.
encode - Whether or not to encode the value with the right encoder for this type.

get

java.lang.String get(java.lang.String name)
Returns the value of a single header variable as a String.

Parameters:
name - The name of the header variable to look for.

getHeaders

java.util.Iterator getHeaders()
Returns an Itterator of all of the header values so that they user can get the list and then get the values.

Returns:
An Iterator to iterate over to get all of the values.

toString

java.lang.String toString()
Returns the content of the header to be used by the Protocol.

Overrides:
toString in class java.lang.Object
Returns:
All of the content that should be sent as the Protocol header.