com.tivoli.twg.libs
Class TWGTransmitObject

java.lang.Object
  extended bycom.tivoli.twg.libs.TWGTransmitObject

public class TWGTransmitObject
extends java.lang.Object

Director Transmit Object: used for tracking transmits by the TWGDataLinkMultiplexer


Constructor Summary
TWGTransmitObject(byte[] buf)
          Constructor for transmit object.
TWGTransmitObject(byte[] buf, int start, int len)
          Constructor for transmit object.
TWGTransmitObject(byte[] buf1, int start1, int len1, byte[] buf2, int start2, int len2)
          Constructor for transmit object, with two part message buffer
 
Method Summary
 int ReadBytesToTransfer(byte[] buf, int off, int len)
          Get next set of bytes to be sent (up to requested number of bytes) into provided buffer.
 int TotalMsgLen()
          Return total message length
 int TotalMsgRemaining()
          Return total bytes remaining in message
protected  void TransferDone(boolean success)
          Callback for notifying of completion of transmit.
 short TransferID()
          Return transmit ID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TWGTransmitObject

public TWGTransmitObject(byte[] buf,
                         int start,
                         int len)
Constructor for transmit object.

Parameters:
buf - - byte array containing message to be sent
start - - index in byte array of start of message
len - - length of message in byte array

TWGTransmitObject

public TWGTransmitObject(byte[] buf1,
                         int start1,
                         int len1,
                         byte[] buf2,
                         int start2,
                         int len2)
Constructor for transmit object, with two part message buffer

Parameters:
buf1 - - byte array containing 1st part of message to be sent
start1 - - index in byte array of start of message
len1 - - length of message in byte array
buf2 - - byte array containing 2nd part of message to be sent
start2 - - index in byte array of start of message
len2 - - length of message in byte array

TWGTransmitObject

public TWGTransmitObject(byte[] buf)
Constructor for transmit object.

Parameters:
buf - - byte array containing message to be sent
Method Detail

TransferID

public final short TransferID()
Return transmit ID

Returns:
transmit ID

TotalMsgLen

public final int TotalMsgLen()
Return total message length

Returns:
total message length

TotalMsgRemaining

public final int TotalMsgRemaining()
Return total bytes remaining in message

Returns:
total number of bytes remaining to be sent

ReadBytesToTransfer

public int ReadBytesToTransfer(byte[] buf,
                               int off,
                               int len)
Get next set of bytes to be sent (up to requested number of bytes) into provided buffer.

Parameters:
buf - - buffer to read data into
off - - offset from start of buffer to read into
len - - maximum number of bytes to be read
Returns:
number of bytes actually read

TransferDone

protected void TransferDone(boolean success)
Callback for notifying of completion of transmit.

Parameters:
success - - boolean set to true if completed successfully, or false if failed or cancelled