com.adventnet.agent.tl1
Class TL1MessageFormatter

java.lang.Object
  |
  +--com.adventnet.agent.tl1.TL1MessageFormatter

public class TL1MessageFormatter
extends java.lang.Object

This class is used to create a TLIAgentRequestInfo, TL1Message and Autonomous message.


Field Summary
(package private)  java.lang.String commandCode
           
(package private)  SecurityView secView
           
(package private)  TL1Session session
           
(package private)  java.lang.String target
           
 
Constructor Summary
TL1MessageFormatter(TL1Agent tl1Agent)
          This constructor will create an instance of TL1MessageFormatter.
 
Method Summary
 TL1Message autonomousMessageCreator(TL1AgentResponseInfo autoInfo, double number, TL1Session session)
          This method is used to create an autonomous message.By calling makeHeader(), makeTextBlock() the required things appended with the response message are added.
static TL1Line createTL1Line(java.lang.String[] respKeys, java.lang.Object[] respValues, java.lang.String[] delimiters, java.lang.String lineType, boolean[] nameEqualsValue)
          Returns the TL1Line which is created with the required informations passed here.
 java.lang.String getTarget()
          This method is used to give the target as local machine.
 TL1Header makeHeader()
          This method is used to create a header.
 TL1AgentRequestInfo makeRequestInfo(TL1InputMessage message, TL1Session session)
          This method is used to form a TL1AgentRequestInfo.
 TL1Message responseMessageCreator(TL1AgentResponseInfo respInfo, TL1AgentRequestInfo reqInfo)
          This method is used to create a response message.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandCode

java.lang.String commandCode

session

TL1Session session

target

java.lang.String target

secView

SecurityView secView
Constructor Detail

TL1MessageFormatter

public TL1MessageFormatter(TL1Agent tl1Agent)
This constructor will create an instance of TL1MessageFormatter.
Parameters:
tl1Agent - - TL1Agent reference.
Method Detail

makeRequestInfo

public TL1AgentRequestInfo makeRequestInfo(TL1InputMessage message,
                                           TL1Session session)
                                    throws java.lang.Exception
This method is used to form a TL1AgentRequestInfo.
Parameters:
message - TL1InputMessage
session - TL1Session
Returns:
This will return a TL1AgentResponseInfo using TL1InputMessage and TL1Session

responseMessageCreator

public TL1Message responseMessageCreator(TL1AgentResponseInfo respInfo,
                                         TL1AgentRequestInfo reqInfo)
This method is used to create a response message.
Parameters:
respInfo - - TL1AgentResponseInfo
reqInfo - - TL1AgentRequestInfo
Returns:
TL1Message

autonomousMessageCreator

public TL1Message autonomousMessageCreator(TL1AgentResponseInfo autoInfo,
                                           double number,
                                           TL1Session session)
This method is used to create an autonomous message.By calling makeHeader(), makeTextBlock() the required things appended with the response message are added.
Parameters:
autoInfo - - TL1AgentResponseInfo
number - - the alarm sequence number to be added as alarm tag.
commandCode - - the command code
session - - TL1Session

makeHeader

public TL1Header makeHeader()
This method is used to create a header. Header is the one, contains the current time frame and Target Id.
Returns:
the header

getTarget

public java.lang.String getTarget()
This method is used to give the target as local machine. If TargetId is set using (setTargetId(String)) TL1Agent reference then it will be taken.

createTL1Line

public static TL1Line createTL1Line(java.lang.String[] respKeys,
                                    java.lang.Object[] respValues,
                                    java.lang.String[] delimiters,
                                    java.lang.String lineType,
                                    boolean[] nameEqualsValue)
Returns the TL1Line which is created with the required informations passed here.
Parameters:
respKeys - - The String[] of response keys.
respValues - - The Object[] of response values.
delimiters - - The String[] of delimiters.
lnType - - The String soecifying the line type (QUOTE,UNQUOTE,COMMENT).
nameEqualsValue - - The boolean[] specifies how the key and the value of the line is to be showm.