TET
Class SyncMessage

java.lang.Object
  extended by TET.SyncMessage

public class SyncMessage
extends java.lang.Object

The SyncMessage class provides the details of one message used during a TET sychronization event.


Field Summary
static int TET_SMDUP
          Bit value for flags, indicating that more than one system attempted to send message data.
static int TET_SMMSGMAX
          Maximum size of a sync message.
static int TET_SMRCVMSG
          Bit value for flags, indicating that the system is receiving message data.
static int TET_SMSNDMSG
          Bit value for flags, indicating that the system is sending message data.
static int TET_SMTRUNC
          Bit value for flags, indicating that the message data was truncated.
 
Constructor Summary
SyncMessage()
          Construct an empty SyncMessage.
SyncMessage(byte[] msg)
          Construct a SyncMessage which will be used for the transmission of a message.
SyncMessage(int msglen)
          Construct a SyncMessage which will be used for the reception of a message.
 
Method Summary
 boolean duplicated()
          Were there two senders during synchronization?
 int getSysID()
          Get the value of the system ID of the sending system.
 int length()
          Retrieve the message length.
 byte[] message()
          Retrieve the message data.
 boolean sender()
          Was this message sent or does it contains message received from another system?
 void set_message(byte[] msg)
          Set up a SyncMessage for transmission of a message.
 void set_receive_length(int msglen)
          Set up a SyncMessage for reception of a message.
 boolean truncated()
          Was this synchronization message truncated?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TET_SMSNDMSG

public static final int TET_SMSNDMSG
Bit value for flags, indicating that the system is sending message data.

Provided as public for backwards compatibility only; serves no useful purpose outside package.

See Also:
Constant Field Values

TET_SMRCVMSG

public static final int TET_SMRCVMSG
Bit value for flags, indicating that the system is receiving message data.

Provided as public for backwards compatibility only; serves no useful purpose outside package.

See Also:
Constant Field Values

TET_SMDUP

public static final int TET_SMDUP
Bit value for flags, indicating that more than one system attempted to send message data.

Provided as public for backwards compatibility only; serves no useful purpose outside package.

See Also:
Constant Field Values

TET_SMTRUNC

public static final int TET_SMTRUNC
Bit value for flags, indicating that the message data was truncated.

Provided as public for backwards compatibility only; serves no useful purpose outside package.

See Also:
Constant Field Values

TET_SMMSGMAX

public static final int TET_SMMSGMAX
Maximum size of a sync message. Size must be expressable in 12 bits.

See Also:
Constant Field Values
Constructor Detail

SyncMessage

public SyncMessage()
Construct an empty SyncMessage.


SyncMessage

public SyncMessage(byte[] msg)
Construct a SyncMessage which will be used for the transmission of a message.

Parameters:
msg - the message to send.

SyncMessage

public SyncMessage(int msglen)
Construct a SyncMessage which will be used for the reception of a message.

Parameters:
msglen - the size of the receive buffer to set up.
Method Detail

set_message

public void set_message(byte[] msg)
Set up a SyncMessage for transmission of a message.

Parameters:
msg - the message to send.

length

public int length()
Retrieve the message length.

Returns:
the message length.

set_receive_length

public void set_receive_length(int msglen)
Set up a SyncMessage for reception of a message.

Parameters:
msglen - the size of the receive buffer to set up.

message

public byte[] message()
Retrieve the message data.

Returns:
the message data (as a byte array), null if there is no message data.

truncated

public boolean truncated()
Was this synchronization message truncated?

Returns:
true if the message was truncated because the message was longer than the receive buffer or because the message was longer than the permitted message length.

duplicated

public boolean duplicated()
Were there two senders during synchronization?

Returns:
true if there were two senders during synchronization.

sender

public boolean sender()
Was this message sent or does it contains message received from another system?

Returns:
true if this message was sent during synchronization.

getSysID

public int getSysID()
Get the value of the system ID of the sending system.

Returns:
the value of the system ID, or -1 if this message data was not used to receive data.