com.ibm.etill.framework.cassette
Class CassetteResponse

java.lang.Object
  |
  +--com.ibm.etill.framework.cassette.CassetteResponse
Direct Known Subclasses:
APIResponse, ProtocolResponse

public class CassetteResponse
extends Object

CassetteResponse is the base class for all classes that define cassette responses to Framework service requests. Objects derived from CassetteResponse hold all of the response information associated with the associated request. Common to all response classes is a reference to an ETillConnection over which any response messages to the outside world should be sent.

See Also:
Cassette, CassetteRequest

Constructor Summary
CassetteResponse(ETillConnection connection)
          Constructs a response containing the specified ETillConnection object.
 
Method Summary
 ETillConnection getConnection()
          Returns the ETillConnection object associated with this response object.
 void setConnection(ETillConnection connection)
          Associates an ETillConnection object with this response object when a request/response object pair is created.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CassetteResponse

public CassetteResponse(ETillConnection connection)
Constructs a response containing the specified ETillConnection object. This constructor is typically invoked by the Framework as the last link in a chain of constructors.
Parameters:
connection - an ETillConnection object through which any response message to the outside world should be sent.
See Also:
ETillConnection.write(java.lang.Object)
Method Detail

setConnection

public final void setConnection(ETillConnection connection)
Associates an ETillConnection object with this response object when a request/response object pair is created. This connection is the one that should be used to send any required response messages to the outside world.

This method is typically called by the Framework. The only time a cassette should ever call this method is when it is creating its own requset/response pair to simulate an externally-generated API command or protocol message. An example of such a case is the creation of an ApproveRequest and APIRespone pair to handle the automatic approval option of the ACCEPTPAYMENT or RECEIVEPAYMENT command.


getConnection

public final ETillConnection getConnection()
Returns the ETillConnection object associated with this response object. This connection object should be used to send any required response messages to the outside world.