WebNMS TL1 API Release 4 Specification

com.adventnet.tl1.message
Class TL1Message

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

public abstract class TL1Message
extends java.lang.Object
implements java.io.Serializable

This abstract class is the base class for TL1InputMessage, TL1ResponseMessage, TL1AckMessage and TL1AutonomousMessage. This class represent the messages that are exchanged between the TL1 Manager and the TL1 Agent.

See Also:
TL1InputMessage, TL1ResponseMessage, TL1AckMessage, TL1AutonomousMessage, Serialized Form

Field Summary
static byte ACK_MESSAGE
          Constant for TL1AckMessage type
static byte AUTONOMOUS_MESSAGE
          Constant for TL1AutoMessage type
static byte INPUT_MESSAGE
          Constant for TL1InputMessage type
static byte INVALID_TL1_MESSAGE
          Constant for Invalid TL1 Message type
static byte RESPONSE_MESSAGE
          Constant for TL1ResponseMessage type
 
Method Summary
abstract  java.lang.Object clone()
          Creates and returns a copy of this message object.
 byte[] encode()
          Returns the byte array of this message object.
 boolean equals(TL1Message mesg)
          Compare the specified message object with this message object for equality.
 java.lang.Object getMessageClassifier()
          Gets the details set on this TL1Message using the setMessageClassifier method.
 java.lang.String getMessageString()
          Gets the String representation of the message that came from the agent.
abstract  java.lang.String getMessageTag()
          Gets the MessageTag of this object.
 int getSize()
          Gets the size of this message object.
 byte getType()
          Returns the message type as a byte constant.
 void setMessageClassifier(java.lang.Object obj)
          Stores application specific details.
 void setMessageString(java.lang.String messageString)
          Sets the specified string coming from the agent on this Message.
 void setType(byte type)
          Sets the TL1 message type.
abstract  java.lang.String toString()
          Returns the string representation of this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INPUT_MESSAGE

public static final byte INPUT_MESSAGE
Constant for TL1InputMessage type

ACK_MESSAGE

public static final byte ACK_MESSAGE
Constant for TL1AckMessage type

RESPONSE_MESSAGE

public static final byte RESPONSE_MESSAGE
Constant for TL1ResponseMessage type

AUTONOMOUS_MESSAGE

public static final byte AUTONOMOUS_MESSAGE
Constant for TL1AutoMessage type

INVALID_TL1_MESSAGE

public static final byte INVALID_TL1_MESSAGE
Constant for Invalid TL1 Message type
Method Detail

getType

public byte getType()
Returns the message type as a byte constant.

The byte constant represents any of the four TL1 message types namely, TL1InputMessage, TL1AckMessage, TL1ResponseMessage and TL1AutonomousMessage.

Returns:
message type as a byte constant.

It can be one of these,

  • TL1Message.INPUT_MESSAGE
  • TL1Message.ACK_MESSAGE
  • TL1Message.RESPONSE_MESSAGE
  • TL1Message.AUTONOMOUS_MESSAGE

setType

public void setType(byte type)
Sets the TL1 message type.

It can be any one of the four byte types,

Parameters:
type - message type as byte constant.

equals

public boolean equals(TL1Message mesg)
Compare the specified message object with this message object for equality.

Parameters:
mesg - TL1Message object to compare.

Returns:
true if this message object is the same as the mesg argument; false otherwise.

Since:
TL1 API 3

encode

public byte[] encode()
Returns the byte array of this message object.

Note : This method must not be invoked by the user. This is used internally by the TL1 API.

Returns:
byte array of the object.

toString

public abstract java.lang.String toString()
Returns the string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
this object as a String.

getMessageTag

public abstract java.lang.String getMessageTag()
Gets the MessageTag of this object.

It can be a Correlation tag in the case of Input Message and Autonomous tag in the case of Autonomous Message.

Returns:
message tag as a String.

Since:
TL1 API 3

setMessageString

public void setMessageString(java.lang.String messageString)
Sets the specified string coming from the agent on this Message.

Parameters:
messageString - String representing message.

getMessageString

public java.lang.String getMessageString()
Gets the String representation of the message that came from the agent.

Returns:
message as a String.

Since:
TL1 API 3

setMessageClassifier

public void setMessageClassifier(java.lang.Object obj)
Stores application specific details. This value is not used by the Message API.

Parameters:
obj - Object instance.

getMessageClassifier

public java.lang.Object getMessageClassifier()
Gets the details set on this TL1Message using the setMessageClassifier method.

Returns:
Returns an Object instance.

getSize

public int getSize()
Gets the size of this message object.

Returns:
Size as an integer.

Since:
TL1 API 3

clone

public abstract java.lang.Object clone()
Creates and returns a copy of this message object.

Returns:
a clone of this instance.

Since:
TL1 API 3

WebNMS TL1 API Release 4 Specification