com.ibm.etill.framework.io
Class FrameworkDataStream

java.lang.Object
  |
  +--com.ibm.etill.framework.io.FrameworkDataStream
All Implemented Interfaces:
ETillConnection

public final class FrameworkDataStream
extends Object
implements ETillConnection

This class defines the default data stream interface for the Commerce Payments framework. The format of data communicated throught this stream is that of a length and value pair. The basic syntax of this message is: length = Integer representing size of message (value portion). value = A sequence of bytes representing the message but limited to the size specified by the length field.


Constructor Summary
FrameworkDataStream()
          Default Constructor .
 
Method Summary
 void closeConnection()
          Deletes the logical connection associated with this object.
 String getClassName()
          getClassName() .
 Socket getSocket()
          getSocket()
 Object read()
          read() This method just opens an InputStream and converts the data to a byte array.
 void setClassName(String name)
          setClassName() .
 void setConnection(Object o)
          An ETillConnection object needs to store an instance of the logical connection for it's associated ComPoint.
 String toString()
          toString()
 Object write(Object message)
          Writes an Object to the ComPoint associated with the ETillConnection instance.
 Object writeErrorResponse(Object message)
          Writes an error message to the ComPoint associated with the ETillConnection instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameworkDataStream

public FrameworkDataStream()
Default Constructor .
Method Detail

setClassName

public void setClassName(String name)
setClassName() .

getClassName

public String getClassName()
getClassName() .

toString

public String toString()
toString()
Overrides:
toString in class Object

getSocket

public Socket getSocket()
getSocket()
Returns:
A Socket.object

setConnection

public void setConnection(Object o)
                   throws IOException
An ETillConnection object needs to store an instance of the logical connection for it's associated ComPoint. Once a ComPoint establishes a connection it will register that connection by invoking this method. This will enable the ETillConnection object to always be knowledgeable of its connection type. .
Specified by:
setConnection in interface ETillConnection
Returns:
void

read

public Object read()
            throws IOException
read() This method just opens an InputStream and converts the data to a byte array.
Specified by:
read in interface ETillConnection
Returns:
An Object representing a byte array.

write

public Object write(Object message)
             throws IOException
Writes an Object to the ComPoint associated with the ETillConnection instance.
Since this is an asynchronous protocol, this method returns right away with a null
Specified by:
write in interface ETillConnection
Parameters:
tc - Object to write. Assumed to be a byte array.
Returns:
a null object

writeErrorResponse

public Object writeErrorResponse(Object message)
                          throws IOException
Writes an error message to the ComPoint associated with the ETillConnection instance.
Since this is an asynchronous protocol, this method returns right away with a null
Specified by:
writeErrorResponse in interface ETillConnection
Parameters:
tc - Object to write. Assumed to be a byte array.
Returns:
a null object

closeConnection

public void closeConnection()
                     throws IOException
Deletes the logical connection associated with this object.
Specified by:
closeConnection in interface ETillConnection