com.adventnet.tl1.message
Class TL1Message

java.lang.Object
  |
  +--com.adventnet.tl1.message.TL1Message
Direct Known Subclasses:
TL1AckMessage, TL1AutonomousMessage, TL1InputMessage, TL1ResponseMessage

public abstract class TL1Message
extends java.lang.Object

This abstract class is the base class for TL1InputMessage , TL1ResponseMessage , TL1AckMessage and TL1AutonomousMessage. This object represents the message that is exchanged between the TL1 Manager and the TL1 Agent.

See Also:
TL1InputMessage, TL1ResponseMessage, TL1AckMessage, TL1AutonomousMessage

Constructor Summary
(package private) TL1Message()
          Default constructor.
 
Method Summary
abstract  byte[] encode()
          This abstract method returns the byte[] value of the object.
 byte getType()
          To get the type of the message.
static boolean isSetSplCharParsing()
          Method to verify whether the parser is in the mode to accept messages containing non-standard special characters in the TextBlock of the output messages from the TL1 Agent.
static void setSplCharParsing(boolean flag)
          To set a boolean value to allow or disallow parsing of special characters in TL1TextBlock.
 void setType(byte type)
          To set the message type.
 java.lang.String toString()
          Returns the String representation of this object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TL1Message

TL1Message()
Default constructor.
Method Detail

setSplCharParsing

public static void setSplCharParsing(boolean flag)
To set a boolean value to allow or disallow parsing of special characters in TL1TextBlock.

If this flag is set to true,the following characters will be permitted in the Textblock portion of the response message or autonomous message.

'@' , '?' , '[' , ']' , '~' , '`' , '!' , '$' , '^' , '|' , '{' , '}' , '(' , ')' , '.' , '-' and '_'.

In addition to the above characters ':' will also be permitted , if the Textblock of the response / autonomous message is UnQuoted.
If the Textblock is quoted , then ':' will retain its existing meaning as per the standard syntax ( ie block delimiter ) .

Parameters:
flag - The status of this flag determines whether or not the above mentioned special characters will be allowed or not.
In order to avoid exceptions due to the presence of special characters in the TextBlock of messages sent by the agent,set this flag to true.
By default,the value of this flag is true.

isSetSplCharParsing

public static boolean isSetSplCharParsing()
Method to verify whether the parser is in the mode to accept messages containing non-standard special characters in the TextBlock of the output messages from the TL1 Agent.
Returns:
boolean value indicating whether or not non-standard special characters will be accepted by the parser.
true if special characters are allowed.
false if special characters are not allowed.

getType

public byte getType()
To get the type of the message.

The four types of TL1 messages , namely TL1InputMessage , TL1AckMessage , TL1ResponseMessage and TL1AutonomousMessage are each indicated by a corresponding byte.

TL1InputMessage is represented by 0x01
TL1AckMessage is represented by 0x02
TL1ResponseMessage is represented by 0x03
TL1AutonomousMessage is represented by 0x04

Returns:
message type as byte.

This byte constant can be any one of the four bytes mentioned above , which may also be symbolically represented as constants in class TL1API , viz

TL1API.INPUT_MESSAGE ,
TL1API.ACK_MESSAGE ,
TL1API.RESPONSE_MESSAGE and
TL1API.AUTONOMOUS_MESSAGE .

See Also:
TL1API

setType

public void setType(byte type)
To set the message type.

This could be any one of the four bytes , viz those represented by

TL1API.INPUT_MESSAGE ,
TL1API.ACK_MESSAGE ,
TL1API.RESPONSE_MESSAGE or
TL1API.AUTONOMOUS_MESSAGE .

Parameters:
type - message type as byte.
See Also:
TL1API

encode

public abstract byte[] encode()
This abstract method returns the byte[] value of the object.

This is not to be invoked by the user.This is used internally by our API.

Returns:
byte[] byte value of the object

toString

public java.lang.String toString()
Returns the String representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
this object as a String.