com.adventnet.tl1
Class TASClient

java.lang.Object
  |
  +--com.adventnet.tl1.TASClient

public class TASClient
extends java.lang.Object

TASClient is an intermediate service provider between TL1Session and TAServer. It is used to send the messages from TL1Session to TASession. This class is useful in situations were the application uses Java applets to communicate with the TL1-Agent.The Java security mechanism limits the applet from communicating with any other host,except the one from which it is downloaded.This class provides the mechanism to overcome this limitation.Note that stand-alone Java applications do not need this API feature.This class is useful only in scenarios where applets are used on the Manager side.


Field Summary
(package private) static int CONN_ERROR
          Constant used to indicate communication error with agent.
(package private) static int CONN_OK
          Constant used to indicate communication with the agent is proper.
(package private) static int INVALID_STATUS
          Constant used for invalid status.
(package private) static int RESPONSE_OK
          Constant used to indicate if the response received is proper or not.
(package private)  int responseStatus
           
 
Constructor Summary
TASClient()
          Void Constructor.
TASClient(java.io.DataInputStream dis, java.io.DataOutputStream dos)
          Constructor which takes instances of both DataInputStream and DataOutputStream which together represent the two directions of communication.
TASClient(java.net.Socket sckt)
          Constructor with the specified Socket instance.
 
Method Summary
 java.lang.String getList()
          To get the list of files under the particular directory named "data" from TASession.
 byte[] receive()
          To receive the data from TASession.
 void send(byte[] msg)
          This method is used to send the message to the TASession.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_STATUS

static final int INVALID_STATUS
Constant used for invalid status.

RESPONSE_OK

static final int RESPONSE_OK
Constant used to indicate if the response received is proper or not.

CONN_OK

static final int CONN_OK
Constant used to indicate communication with the agent is proper.

CONN_ERROR

static final int CONN_ERROR
Constant used to indicate communication error with agent.

responseStatus

int responseStatus
Constructor Detail

TASClient

public TASClient()
Void Constructor.

TASClient

public TASClient(java.io.DataInputStream dis,
                 java.io.DataOutputStream dos)
Constructor which takes instances of both DataInputStream and DataOutputStream which together represent the two directions of communication.
Parameters:
dis - DataInputStream
dos - DataOutputStream

TASClient

public TASClient(java.net.Socket sckt)
Constructor with the specified Socket instance.
Parameters:
sckt - Socket instance
Method Detail

send

public void send(byte[] msg)
This method is used to send the message to the TASession. Message is specified as a byte array.
Parameters:
msg - - message as a byte array.

getList

public java.lang.String getList()
To get the list of files under the particular directory named "data" from TASession.
Returns:
the list of file names as a string delimited by ','

receive

public byte[] receive()
To receive the data from TASession. Data may be a response message or a list of file names.
Returns:
data as a byte array.