context.arch.service.helper
Class ServiceInput

java.lang.Object
  extended bycontext.arch.service.helper.ServiceInput

public class ServiceInput
extends java.lang.Object

This class implements a service input object used for executing a service.


Field Summary
static java.lang.String FUNCTION_NAME
          Tag for a function name
static java.lang.String REQUEST_TAG
          Tag for a service request tag
static java.lang.String SERVICE_ID
          Tag for a service id
static java.lang.String SERVICE_INPUT
          Tag for a service input
static java.lang.String SERVICE_NAME
          Tag for a service name
 
Constructor Summary
ServiceInput(DataObject data)
          Basic constructor that creates a serviceInput object from a DataObject.
ServiceInput(java.lang.String service, java.lang.String function, Attributes input)
          Basic constructor that creates a serviceInput object for a synchronous services.
ServiceInput(java.lang.String serviceId, java.lang.String service, java.lang.String function, Attributes input, java.lang.String host, int port, java.lang.String id, java.lang.String requestTag)
          Basic constructor that creates a serviceInput object for an asynchronous services.
ServiceInput(java.lang.String serviceId, java.lang.String service, java.lang.String function, Attributes input, java.lang.String host, java.lang.String port, java.lang.String id, java.lang.String requestTag)
          Basic constructor that creates a serviceInput object for an asynchronous services.
 
Method Summary
 java.lang.String getFunctionName()
          Returns the requested service function name.
 java.lang.String getHostname()
          Returns the requester's hostname.
 java.lang.String getId()
          Returns the requester's id.
 Attributes getInput()
          Returns the input to the service.
 java.lang.String getPort()
          Returns the requester's port.
 java.lang.String getRequestTag()
          Returns the requester's requesting tag
 java.lang.String getServiceId()
          Returns the id of the component offering the service.
 java.lang.String getServiceName()
          Returns the requested service name.
 java.lang.String getUniqueId()
          Returns the requester's unique id.
 void setFunctionName(java.lang.String function)
          Sets the requested service function name.
 void setHostname(java.lang.String host)
          Sets the requester's hostname.
 void setId(java.lang.String id)
          Sets the requester's id.
 void setInput(Attributes input)
          Sets the input to the service.
 void setPort(java.lang.String port)
          Sets the requester's port.
 void setRequestTag(java.lang.String requestTag)
          Sets the requester's request tag.
 void setServiceId(java.lang.String serviceId)
          Sets the id of the component offering the service.
 void setServiceName(java.lang.String service)
          Sets the requested service name.
 DataObject toDataObject()
          This method converts the service input info to a DataObject
 java.lang.String toString()
          This method returns a printable version of this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SERVICE_INPUT

public static final java.lang.String SERVICE_INPUT
Tag for a service input

See Also:
Constant Field Values

SERVICE_ID

public static final java.lang.String SERVICE_ID
Tag for a service id

See Also:
Constant Field Values

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
Tag for a service name

See Also:
Constant Field Values

FUNCTION_NAME

public static final java.lang.String FUNCTION_NAME
Tag for a function name

See Also:
Constant Field Values

REQUEST_TAG

public static final java.lang.String REQUEST_TAG
Tag for a service request tag

See Also:
Constant Field Values
Constructor Detail

ServiceInput

public ServiceInput(java.lang.String service,
                    java.lang.String function,
                    Attributes input)
Basic constructor that creates a serviceInput object for a synchronous services. It contains the name of the service and function to execute and the input to the service.

Parameters:
service - Name of the service to execute
function - Name of the service function to execute

ServiceInput

public ServiceInput(java.lang.String serviceId,
                    java.lang.String service,
                    java.lang.String function,
                    Attributes input,
                    java.lang.String host,
                    int port,
                    java.lang.String id,
                    java.lang.String requestTag)
Basic constructor that creates a serviceInput object for an asynchronous services. It contains the name of the service and function to execute and the input to the service, just like the one for the synchronous service. But, it also includes the requester's port, hostname, id, a unique tag to identify the request and the id of the component offering the service.

Parameters:
serviceId - Id of the component offering the service
service - Name of the service to execute
function - Name of the service function to execute
host - Hostname of the component requesting the service
port - Port of the component requesting the service

ServiceInput

public ServiceInput(java.lang.String serviceId,
                    java.lang.String service,
                    java.lang.String function,
                    Attributes input,
                    java.lang.String host,
                    java.lang.String port,
                    java.lang.String id,
                    java.lang.String requestTag)
Basic constructor that creates a serviceInput object for an asynchronous services. It contains the name of the service and function to execute and the input to the service, just like the one for the synchronous service. But, it also includes the requester's port, hostname, id, a unique tag to identify the request and the id of the component offering the service.

Parameters:
serviceId - Id of the component offering the service
service - Name of the service to execute
function - Name of the service function to execute
host - Hostname of the component requesting the service
port - Port of the component requesting the service

ServiceInput

public ServiceInput(DataObject data)
Basic constructor that creates a serviceInput object from a DataObject. The DataObject must contain the tag.

Method Detail

toDataObject

public DataObject toDataObject()
This method converts the service input info to a DataObject

Returns:
ServiceInput object converted to a DataObject

setServiceId

public void setServiceId(java.lang.String serviceId)
Sets the id of the component offering the service.

Parameters:
serviceId - Id of the component offering the service

getServiceId

public java.lang.String getServiceId()
Returns the id of the component offering the service.

Returns:
id of the component offering the service

setServiceName

public void setServiceName(java.lang.String service)
Sets the requested service name.


getServiceName

public java.lang.String getServiceName()
Returns the requested service name.

Returns:
name of the requested service

setFunctionName

public void setFunctionName(java.lang.String function)
Sets the requested service function name.


getFunctionName

public java.lang.String getFunctionName()
Returns the requested service function name.

Returns:
name of the requested service function

setInput

public void setInput(Attributes input)
Sets the input to the service.

Parameters:
input - Attributes for the service to operate with

getInput

public Attributes getInput()
Returns the input to the service.

Returns:
input to the service

setHostname

public void setHostname(java.lang.String host)
Sets the requester's hostname.

Parameters:
host - Hostname of the requester

getHostname

public java.lang.String getHostname()
Returns the requester's hostname.

Returns:
hostname of the requester

setPort

public void setPort(java.lang.String port)
Sets the requester's port.

Parameters:
port - Port of the requester

getPort

public java.lang.String getPort()
Returns the requester's port.

Returns:
Port of the requester

setId

public void setId(java.lang.String id)
Sets the requester's id.

Parameters:
id - Id of the requester

getId

public java.lang.String getId()
Returns the requester's id.

Returns:
id of the requester

setRequestTag

public void setRequestTag(java.lang.String requestTag)
Sets the requester's request tag.

Parameters:
requestTag - Tag for the requester's request

getRequestTag

public java.lang.String getRequestTag()
Returns the requester's requesting tag

Returns:
the requester's requesting tag

getUniqueId

public java.lang.String getUniqueId()
Returns the requester's unique id.

Returns:
the requester's unique id

toString

public java.lang.String toString()
This method returns a printable version of this class

Returns:
printable version of this class