context.arch.comm
Class RequestObject

java.lang.Object
  extended bycontext.arch.comm.RequestObject

public class RequestObject
extends java.lang.Object

This is the generic object that encapsulates the data and information for sending a request to another CTK object : the data object and the url of the request, the destination server hostname and port. At the creation, the data type is always DataObject, but it may be change into String when the data has been encoded.

Author:
Agathe
See Also:
DataObject, context.arch.comm.HTTPRequestObject

Constructor Summary
RequestObject(DataObject dataObject, java.lang.String messageUrl)
          Creates new RequestObject with the dataobject to send and the message url.
RequestObject(DataObject dataObject, java.lang.String messageUrl, java.lang.String serverHostname)
          Creates new RequestObject with the dataobject to send, the message url and the destination server hostname
RequestObject(DataObject dataObject, java.lang.String messageUrl, java.lang.String serverHostname, int serverPort)
          Creates new RequestObject with the dataobject to send, the message url, the destination server hostname and the destination server port.
RequestObject(DataObject dataObject, java.lang.String messageUrl, java.lang.String serverHostname, int serverPort, java.lang.String serverId)
          Creates new RequestObject with the dataobject to send, the message url, the destination server hostname and the destination server port.
RequestObject(DataObject dataObject, java.lang.String messageUrl, java.lang.String serverHostname, int serverPort, java.lang.String serverId, java.lang.String type)
          Creates new RequestObject with the dataobject to send, the message url, the destination server hostname and the destination server port.
 
Method Summary
 boolean equals(RequestObject anotherRequestObject)
          Tests if 2 request objects are equal or not
 java.lang.Object getData()
          Returns the message data object
 java.lang.Object getEncodedData()
          Returns the enocded message object
 DataObject getNonEncodedData()
          Returns the message data object
 int getPort()
          Returns the destination server port
 java.lang.String getReceiverId()
          Get the receiver id
 java.lang.String getServerHostname()
          Returns the destination server hostname
 java.lang.String getType()
          Returns the type of the message : this method should be overridden
 java.lang.String getUrl()
          Returns the message url
 boolean portDefined()
          Tests if the destination server port is defined or not
 void setData(java.lang.Object data)
           
 void setEncodedData(java.lang.String encodedData)
           
 void setReceiverId(java.lang.String receiverId)
          Set the receiver id
 void setType(java.lang.String type)
          Sets the type of the request
 void setUrl(java.lang.String url)
           
 java.lang.String toString()
          Returns a printable version of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequestObject

public RequestObject(DataObject dataObject,
                     java.lang.String messageUrl)
Creates new RequestObject with the dataobject to send and the message url.

Parameters:
messageUrl - The message url

RequestObject

public RequestObject(DataObject dataObject,
                     java.lang.String messageUrl,
                     java.lang.String serverHostname)
Creates new RequestObject with the dataobject to send, the message url and the destination server hostname

Parameters:
dataObject - The data to send
messageUrl - The message url
serverHostname - The destination server hostname

RequestObject

public RequestObject(DataObject dataObject,
                     java.lang.String messageUrl,
                     java.lang.String serverHostname,
                     int serverPort)
Creates new RequestObject with the dataobject to send, the message url, the destination server hostname and the destination server port.

Parameters:
dataObject - The data to send
messageUrl - The message url
serverHostname - The destination server hostname
serverPort - The destination server port

RequestObject

public RequestObject(DataObject dataObject,
                     java.lang.String messageUrl,
                     java.lang.String serverHostname,
                     int serverPort,
                     java.lang.String serverId)
Creates new RequestObject with the dataobject to send, the message url, the destination server hostname and the destination server port.

Parameters:
dataObject - The data to send
messageUrl - The message url
serverHostname - The destination server hostname
serverPort - The destination server port

RequestObject

public RequestObject(DataObject dataObject,
                     java.lang.String messageUrl,
                     java.lang.String serverHostname,
                     int serverPort,
                     java.lang.String serverId,
                     java.lang.String type)
Creates new RequestObject with the dataobject to send, the message url, the destination server hostname and the destination server port.

Parameters:
dataObject - The data to send
messageUrl - The message url
serverHostname - The destination server hostname
serverPort - The destination server port
Method Detail

getData

public java.lang.Object getData()
Returns the message data object

Returns:
Object

setData

public void setData(java.lang.Object data)

getNonEncodedData

public DataObject getNonEncodedData()
Returns the message data object

Returns:
DataObject

getEncodedData

public java.lang.Object getEncodedData()
Returns the enocded message object

Returns:
String

setEncodedData

public void setEncodedData(java.lang.String encodedData)

getServerHostname

public java.lang.String getServerHostname()
Returns the destination server hostname

Returns:
String

getUrl

public java.lang.String getUrl()
Returns the message url

Returns:
String

setUrl

public void setUrl(java.lang.String url)

getType

public java.lang.String getType()
Returns the type of the message : this method should be overridden

Returns:
String

setType

public void setType(java.lang.String type)
Sets the type of the request

Parameters:
type -

portDefined

public boolean portDefined()
Tests if the destination server port is defined or not

Returns:
boolean True if the server port is defined, false otherwise

getPort

public int getPort()
Returns the destination server port

Returns:
int

setReceiverId

public void setReceiverId(java.lang.String receiverId)
Set the receiver id


getReceiverId

public java.lang.String getReceiverId()
Get the receiver id


equals

public boolean equals(RequestObject anotherRequestObject)
Tests if 2 request objects are equal or not

Parameters:
anotherRequestObject -
Returns:
boolean True if both request objects are equal

toString

public java.lang.String toString()
Returns a printable version of this object