com.adventnet.tl1.message
Class TL1InputMessage

java.lang.Object
  |
  +--com.adventnet.tl1.message.TL1Message
        |
        +--com.adventnet.tl1.message.TL1InputMessage

public class TL1InputMessage
extends TL1Message

This class represents a TL1 Input Message block that is sent from the TL1 Manager to the TL1 Network Element(device) in order to manage it. On the NE, this Message translates to a certain action getting executed on the NE.

TL1 Input Message block

See Also:
TL1CommandCode, TL1AccessIdentifier, TL1MessagePayloadBlock, TL1GeneralBlock

Field Summary
(package private)  java.lang.String message
           
(package private) static char sep
           
 
Constructor Summary
TL1InputMessage()
          Default constructor creates an instance of TL1InputMessage object.
TL1InputMessage(TL1CommandCode cmdCode)
          Constructor that create an instance of TL1InputMessage object intialized with the specified Command Code.
TL1InputMessage(TL1CommandCode cmdCode, TL1AccessIdentifier aID)
          Constructor that create an instance of TL1InputMessage object intialized with the specified Command Code and Access Identifier.
TL1InputMessage(TL1CommandCode cmdCode, TL1AccessIdentifier aID, java.lang.String cTag)
          Constructor that create an instance of TL1InputMessage object intialized with the specified Command Code, Access Identifier and Correlation Tag.
 
Method Summary
 byte[] encode()
          Encodes the TL1InputMessage.Not to be invoked by the user.This is used internally by the API.
 TL1AccessIdentifier getAccessId()
          Get the TL1AccessIdentifier object of the message.
 java.lang.String getAppendEndString()
          Get the string that is to be appended to the end of each Input Message.
 java.lang.String getAppendFrontString()
          Get the string that is to be appended to the front of each Input Message.
 TL1CommandCode getCommandCode()
          Get the TL1CommandCode object set on this Input Message.
 java.lang.String getCorrelationTag()
          Get the Correlation Tag set on this Input Message.
 TL1GeneralBlock getGeneralBlock()
          Get the TL1GeneralBlock object of the message.
 java.util.Vector getMessagePayloadBlock()
          Get the Message Payload Block set on this Input Message as a vector.
 java.lang.String getMPBString()
          Get the String format of the Message Payload Block set on this Input Message.
 int getRetries()
          Get number of retries before timeout.
 int getSize()
          Return the length of this Input Message.
 java.lang.String getTargetId()
          Get the Target Identifier of the message as a String.
 long getTimeExpires()
          Get the time when request should time out.This method should not be invoked by the user.This is used internally by the API.
 int getTimeout()
          To get the timeout value.
 long getTimeSent()
          Get the time, when request was sent.This method should not be invoked by the user.This is used internally by the API.
 boolean isAppendEnd()
          Checks if the append end flag is set or not.
 boolean isAppendFront()
          Checks if the append front flag is set or not.
 void setAccessId(TL1AccessIdentifier aID)
          Set the specified Access Identifier on this Input Message.
 void setAppendEnd(boolean value)
          Set the append end flag.
 void setAppendEndString(java.lang.String s)
          Set the string that is to be appended to the end of each Input Message.
 void setAppendFront(boolean value)
          Set the append front flag.
 void setAppendFrontString(java.lang.String s)
          Set the string that is to be appended to the front of each Input Message.
 void setCommandCode(TL1CommandCode tL1CmdCode)
          Set the command code on this Input Message with the specified value.
 void setCorrelationTag(java.lang.String correlationTag)
          Set the specified Correlation Tag on this Input Message.
 void setGeneralBlock(TL1GeneralBlock genBlk)
          Set the specified TL1GeneralBlock on this Input Message.
 void setMessagePayloadBlock(java.util.Vector mpb)
          set the vector of MessagePayloadBlock objects with the given vector.
 void setRetries(int count)
          Set number of retries before timeout.
 void setTargetId(java.lang.String tID)
          Set the specified Target Identifier on this Input Message.
 void setTimeExpires(long t)
          Set the time when request should timeout.This method should not be invoked by the user.This is used internally by the API.
 void setTimeout(int timeout)
          Set the timeout value.
 void setTimeSent(long t)
          Set the time when request should timeout.This method should not be invoked by the user.This is used internally by the API.
 
Methods inherited from class com.adventnet.tl1.message.TL1Message
getType, isSetSplCharParsing, setSplCharParsing, setType, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sep

static final char sep

message

java.lang.String message
Constructor Detail

TL1InputMessage

public TL1InputMessage()
Default constructor creates an instance of TL1InputMessage object.

TL1InputMessage

public TL1InputMessage(TL1CommandCode cmdCode)
Constructor that create an instance of TL1InputMessage object intialized with the specified Command Code.
Parameters:
cmdCode - TL1CommandCode object.
See Also:
TL1CommandCode

TL1InputMessage

public TL1InputMessage(TL1CommandCode cmdCode,
                       TL1AccessIdentifier aID)
Constructor that create an instance of TL1InputMessage object intialized with the specified Command Code and Access Identifier.
Parameters:
cmdCode - TL1CommandCode object.
aID - TL1AccessIdentifier.
See Also:
TL1CommandCode, TL1AccessIdentifier

TL1InputMessage

public TL1InputMessage(TL1CommandCode cmdCode,
                       TL1AccessIdentifier aID,
                       java.lang.String cTag)
Constructor that create an instance of TL1InputMessage object intialized with the specified Command Code, Access Identifier and Correlation Tag.
Parameters:
cmdCode - TL1CommandCode object.
aID - TL1AccessIdentifier object.
cTag - String representing correlation tag.
See Also:
TL1CommandCode, TL1AccessIdentifier
Method Detail

setTimeSent

public void setTimeSent(long t)
Set the time when request should timeout.This method should not be invoked by the user.This is used internally by the API.
Parameters:
t - Time value in long

setTimeExpires

public void setTimeExpires(long t)
Set the time when request should timeout.This method should not be invoked by the user.This is used internally by the API.
Parameters:
t - Time value in long

getTimeSent

public long getTimeSent()
Get the time, when request was sent.This method should not be invoked by the user.This is used internally by the API.
Returns:
time value in long.

getTimeExpires

public long getTimeExpires()
Get the time when request should time out.This method should not be invoked by the user.This is used internally by the API.
Returns:
Time value in long.

getRetries

public int getRetries()
Get number of retries before timeout. The retries in the Input Message overrides the retries value in session. This means, only when the retries in the Input Message is 0, the session value is used.The default value of retries is 0.
Returns:
The retries value.

setRetries

public void setRetries(int count)
Set number of retries before timeout. The retries in the Input Message overrides the retries value in session. This means, only when the retries in the Input Message is 0, the session value is used. The default value of retries is 0.
Parameters:
count - The retries value.

getTimeout

public int getTimeout()
To get the timeout value. The timeout is the time to wait for the first response in milli-seconds, before attempting a retransmission. The timeout in the Input Message overrides the timeout value in session. This means, only when the timeout in the Input Message is 0, the session timeout value is used. The default value of timeout is 0 milliseconds.
Returns:
The timeout value in milliseconds used for monitoring the request

setTimeout

public void setTimeout(int timeout)
Set the timeout value. The timeout in the Input Message overrides the timeout value in session. This means, only when the timeout in the Input Message is 0, the session timeout value is used. The default value of timeout is 0 milliseconds. The timeout value to be set should be in milliseconds.
Parameters:
timeout - The timeout value to be used for monitoring the request

setAppendFront

public void setAppendFront(boolean value)
Set the append front flag.
Parameters:
value - boolean value to set. true - if the input message has to be appended with some string at the beginning of message. false - otherwise.

setAppendEnd

public void setAppendEnd(boolean value)
Set the append end flag.
Parameters:
value - boolean value to set. True - if the input message has to be appended with some string at the end of message. false - otherwise.

isAppendFront

public boolean isAppendFront()
Checks if the append front flag is set or not.
Returns:
boolean value (true or false).

isAppendEnd

public boolean isAppendEnd()
Checks if the append end flag is set or not.
Returns:
boolean value (true or false).

setAppendFrontString

public void setAppendFrontString(java.lang.String s)
Set the string that is to be appended to the front of each Input Message.
Parameters:
s - String to be appended.

setAppendEndString

public void setAppendEndString(java.lang.String s)
Set the string that is to be appended to the end of each Input Message.
Parameters:
s - String to be appended.

getAppendFrontString

public java.lang.String getAppendFrontString()
Get the string that is to be appended to the front of each Input Message.
Returns:
string that is appended to the front.

getAppendEndString

public java.lang.String getAppendEndString()
Get the string that is to be appended to the end of each Input Message.
Returns:
string that is appended to the end.

setCommandCode

public void setCommandCode(TL1CommandCode tL1CmdCode)
Set the command code on this Input Message with the specified value.
Parameters:
tL1CmdCode - TL1CommandCode object.
See Also:
TL1CommandCode

getCommandCode

public TL1CommandCode getCommandCode()
Get the TL1CommandCode object set on this Input Message.
Returns:
TL1CommandCode object.
See Also:
TL1CommandCode

setTargetId

public void setTargetId(java.lang.String tID)
Set the specified Target Identifier on this Input Message.
Parameters:
tID - String representing Target Id.

getTargetId

public java.lang.String getTargetId()
Get the Target Identifier of the message as a String.
Returns:
String representing Target Identifier.

getAccessId

public TL1AccessIdentifier getAccessId()
Get the TL1AccessIdentifier object of the message.
Returns:
TL1AccessIdentifier object.
See Also:
TL1AccessIdentifier

setAccessId

public void setAccessId(TL1AccessIdentifier aID)
Set the specified Access Identifier on this Input Message.
Parameters:
aID - TL1AccessIdentifier object.
See Also:
TL1AccessIdentifier

setCorrelationTag

public void setCorrelationTag(java.lang.String correlationTag)
Set the specified Correlation Tag on this Input Message. This tag correlates the input message with the output message.
Parameters:
correlationTag - String representing ctag.

getCorrelationTag

public java.lang.String getCorrelationTag()
Get the Correlation Tag set on this Input Message. This tag correlates the input message with the output message.
Returns:
String representing the correlation tag.

setGeneralBlock

public void setGeneralBlock(TL1GeneralBlock genBlk)
Set the specified TL1GeneralBlock on this Input Message.
Parameters:
genBlk - instance of TL1GeneralBlock.
See Also:
TL1GeneralBlock

getGeneralBlock

public TL1GeneralBlock getGeneralBlock()
Get the TL1GeneralBlock object of the message.
Returns:
instance of TL1GeneralBlock.
See Also:
TL1GeneralBlock

getMessagePayloadBlock

public java.util.Vector getMessagePayloadBlock()
Get the Message Payload Block set on this Input Message as a vector. Each element of the vector is a TL1MessagePayloadBlock.
Returns:
Vector containing TL1MessagePayloadBlock objects.
See Also:
TL1MessagePayloadBlock

getMPBString

public java.lang.String getMPBString()
Get the String format of the Message Payload Block set on this Input Message.
Returns:
String representation of the Message Payload Block.
See Also:
TL1MessagePayloadBlock

setMessagePayloadBlock

public void setMessagePayloadBlock(java.util.Vector mpb)
set the vector of MessagePayloadBlock objects with the given vector.
Parameters:
mpb - Vector of TL1MessagePayloadBlock objects.
See Also:
TL1MessagePayloadBlock

getSize

public int getSize()
Return the length of this Input Message.
Returns:
size as an integer.

encode

public byte[] encode()
Encodes the TL1InputMessage.Not to be invoked by the user.This is used internally by the API.
Overrides:
encode in class TL1Message
Returns:
returns the encoded value.