com.adventnet.management.transport
Interface SessionTransportProvider

All Known Implementing Classes:
TcpSessionTransportImpl

public interface SessionTransportProvider

A basic interface which will be implemented for actual communication between client and the server. This interface provides the basic IO operations (open, close, read, write) required by the session communication.


Field Summary
static int ERROR
          Static constant for indicating if the operation is a failure.
static int OK
          Static constant for indicating if the operation is a success.
 
Method Summary
 int close()
          Closes the transport interface after communication is over.
 int open(java.lang.String[] params)
          Opens the transport interface over which the data is sent/received.
 byte[] read()
          Receive data from the peer over the transport interface.
 int write(byte[] buf, int len)
          Send data to the peer over the transport interface.
 

Field Detail

OK

public static final int OK
Static constant for indicating if the operation is a success.

ERROR

public static final int ERROR
Static constant for indicating if the operation is a failure.
Method Detail

open

public int open(java.lang.String[] params)
         throws TransportException
Opens the transport interface over which the data is sent/received.
Parameters:
params - parameters required for opening the session interface.
Returns:
OK on successful open or ERROR in case of error.
Throws:
TransportException - in case of an error during opening the transport interface.

write

public int write(byte[] buf,
                 int len)
          throws TransportException
Send data to the peer over the transport interface.
Parameters:
buf - Buffer that contains the bytes to be sent.
len - Number of bytes to write.
Throws:
TransportException - in case of an error during send.

read

public byte[] read()
            throws TransportException
Receive data from the peer over the transport interface.
Returns:
byte array in which the bytes are read into.
Throws:
TransportException - in case of an error during receive.

close

public int close()
          throws TransportException
Closes the transport interface after communication is over.
Returns:
OK on successful close or ERROR in case of error.
Throws:
TransportException - in case of an error during closing.


Copyright (c)AdventNet Inc., 1996-2004