com.adventnet.agent.tl1
Class TL1AgentResponseInfo

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

public class TL1AgentResponseInfo
extends java.lang.Object

This class is used to hold the information of the response block for both response messages and autonomous messages. The object of this class will be returned from the doAction() method of the generated code. These details will be taken into account by the agent while sending the response/autonomous messages.


Field Summary
static java.lang.String COMMENT
          This variable describes that the TL1Line is a comment.
static java.lang.String QUOTED
          This variable describes that the TL1Line is a quoted one.
static java.lang.String UNQUOTED
          This variable describes that the TL1Line is an Unquoted one.
 
Constructor Summary
TL1AgentResponseInfo()
          Default Constructor
TL1AgentResponseInfo(java.util.Hashtable[] responseLines, java.lang.String[] responseLineTypes, boolean[] nameEqualsValue, java.lang.String[] responseKeys, java.lang.String completionCode)
          Constructor to initialise the TL1AgentResponseInfo.
TL1AgentResponseInfo(java.util.Hashtable[] responseLines, java.lang.String[] responseLineTypes, boolean[] nameEqualsValue, java.lang.String[] responseKeys, java.util.Vector sessionList, java.lang.String alarmCode)
          Constructor to initialise the TL1AgentResponseInfo.
 
Method Summary
 java.lang.String getAlarmCode()
          Getter for Alarm code of the autonomous message.
 double getATag()
          Getter for the atag of the autonomous message.
(package private)  java.lang.String getCommandCode()
          Thease methods are included for the getting or setting command codes for autoInfo while creating autonomous messages.
 java.lang.String getCompletionCode()
          Getter for the completion code of the response message.
 java.lang.String[] getResponseDelimiters()
          Getter for the response delimiters in a particular response.
 java.lang.String[] getResponseKeys()
          Getter for the response keys.
 java.util.Hashtable[] getResponseLines()
          Getter for responseLines.
 java.util.Vector getResponseLinesVector()
          Returns the Vector having TL1Line objects as it's elements.
 java.lang.String[] getResponseLineTypes()
          Getter for responseLineTypes.
 java.util.Vector getSessionList()
          Getter for session list.
 java.lang.String getSourceIdentifier()
           
 boolean[] isNameEqualsValue()
          To check whether each line in the responseBlock is name-defined or position-defined.
 void setAlarmCode(java.lang.String alarmCode)
          Used to set the alarm code for the autonomous message.
 void setATag(double aTag)
          Used to set the atag of the autonomous message.
 void setCommandCode(java.lang.String command)
          Setting the command code.
 void setCompletionCode(java.lang.String completionCode)
          Used to set the completion code of the response message.
 void setNameEqualsValue(boolean[] nameEqualsValue)
          Used to specify whether a response block is name-defined or position-defined.
 void setResponseDelimiters(java.lang.String[] delimiters)
          Used to set the delimiters of a response/autonomous message.
 void setResponseKeys(java.lang.String[] keys)
          Used to set the response keys.
 void setResponseLines(java.util.Hashtable[] responseLines)
          Used to set the responseLineTypes.
 void setResponseLinesVector(java.util.Vector respVec)
          Set the ResponseLinesVector.
 void setResponseLineTypes(java.lang.String[] responseLineTypes)
          Used to set the responseLineTypes.
 void setSessionList(java.util.Vector sessionList)
          Used to set the TL1SessionList which should receive the autonomous message.
 void setSourceIdentifier(java.lang.String sid)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUOTED

public static final java.lang.String QUOTED
This variable describes that the TL1Line is a quoted one.

UNQUOTED

public static final java.lang.String UNQUOTED
This variable describes that the TL1Line is an Unquoted one.

COMMENT

public static final java.lang.String COMMENT
This variable describes that the TL1Line is a comment.
Constructor Detail

TL1AgentResponseInfo

public TL1AgentResponseInfo()
Default Constructor

TL1AgentResponseInfo

public TL1AgentResponseInfo(java.util.Hashtable[] responseLines,
                            java.lang.String[] responseLineTypes,
                            boolean[] nameEqualsValue,
                            java.lang.String[] responseKeys,
                            java.lang.String completionCode)
Constructor to initialise the TL1AgentResponseInfo. This constructor can be used while sending Response Messages. ResponseKeys is a must.
Parameters:
responseLines - An Hashtable array containing the name - value pairs of each line.
responseLineTypes - A String array mentioning the line types of each line - whether quoted or unquoted or comment.
nameEqualsValue - This specifies whether each line in the response block should be name-defined or position-defined.
responseKeys - The response keys for a particular command code.
completionCode - The completion code of the Autonomous Message. If it is null, it will be taken as COMPLD.

TL1AgentResponseInfo

public TL1AgentResponseInfo(java.util.Hashtable[] responseLines,
                            java.lang.String[] responseLineTypes,
                            boolean[] nameEqualsValue,
                            java.lang.String[] responseKeys,
                            java.util.Vector sessionList,
                            java.lang.String alarmCode)
Constructor to initialise the TL1AgentResponseInfo. This constructor can be used while sending Autonomous Messages. ResponseKeys is a must.
Parameters:
responseLines - An Hashtable array containing the name - value pairs of each line.
responseLineTypes - A String array mentioning the line types of each line - whether quoted or unquoted or comment.
nameEqualsValue - This specifies whether each line in the response block should be name-defined or position-defined.
responseKeys - The response keys for a particular command code.
sessionList - A vector of TL1Sessions.
alarmCode - The alarm code of the Autonomous Message. If it is null, it will be taken as MAJOR_ALARM.
Method Detail

getResponseLineTypes

public java.lang.String[] getResponseLineTypes()
Getter for responseLineTypes.
Returns:
The response line types as a String[].

setResponseLineTypes

public void setResponseLineTypes(java.lang.String[] responseLineTypes)
Used to set the responseLineTypes.
Parameters:
responseLineTypes - A String array mentioning the line types of each line - whether quoted or unquoted or comment. For Example:

     String[] lineTypes = new String[2];
     lineTypes[0] = TL1AgentResponseInfo.UNQUOTED;
     lineTypes[1] = TL1AgentResponseInfo.QUOTED;
     TL1AgentResponseInfo respInfo = new TL1AgentResponseInfo();
     respInfo.setResponseLineTypes(lineTypes);
 

getResponseLines

public java.util.Hashtable[] getResponseLines()
Getter for responseLines.
Returns:
The Hashtable array which contains the lines in the response block. Each element in the array represents a line.

setResponseLines

public void setResponseLines(java.util.Hashtable[] responseLines)
Used to set the responseLineTypes.
Parameters:
responseLines - An Hashtable array which contains the name - value pairs of the response lines. Each element in the array represents a line. For Example:

     Hashtable[] table = new Hashtable[2];
     table[0] = new Hashtable();
     table[1] = new Hashtable();
     for(int i=0; i<responseKeys.length; i++) {
         table[0].put(responseKeys[i], defaultRespVals[i]);
         table[1].put(responseKeys[i], responseVals[i]);
     }
     TL1AgentResponseInfo respInfo = new TL1AgentResponseInfo();
     respInfo.setResponseLines(table);
 

isNameEqualsValue

public boolean[] isNameEqualsValue()
To check whether each line in the responseBlock is name-defined or position-defined.
Returns:
a boolean array.

setNameEqualsValue

public void setNameEqualsValue(boolean[] nameEqualsValue)
Used to specify whether a response block is name-defined or position-defined.
Parameters:
nameEqualsValue - Specifies how each line should be - either name-defined or position-defined.

getResponseKeys

public java.lang.String[] getResponseKeys()
Getter for the response keys.
Returns:
The response keys for a particular command code.

setResponseKeys

public void setResponseKeys(java.lang.String[] keys)
Used to set the response keys.
Parameters:
keys - The Keys as a String array.

getResponseDelimiters

public java.lang.String[] getResponseDelimiters()
Getter for the response delimiters in a particular response.
Returns:
The response delimiters as a String array.

setResponseDelimiters

public void setResponseDelimiters(java.lang.String[] delimiters)
Used to set the delimiters of a response/autonomous message.
Parameters:
delimiters - The delimiters that will be used in a response.

getCompletionCode

public java.lang.String getCompletionCode()
Getter for the completion code of the response message.
Returns:
Completion Code as a String.
See Also:
TL1ResponseMessage

setCompletionCode

public void setCompletionCode(java.lang.String completionCode)
Used to set the completion code of the response message.
Parameters:
completionCode - The completion code. If it is not mentioned, it will be taken as COMPLD.
See Also:
TL1ResponseMessage

getAlarmCode

public java.lang.String getAlarmCode()
Getter for Alarm code of the autonomous message.
Returns:
Alarm Code.
See Also:
TL1AutonomousMessage

setAlarmCode

public void setAlarmCode(java.lang.String alarmCode)
Used to set the alarm code for the autonomous message.
Parameters:
alarmCode - The alarm code.
See Also:
TL1AutonomousMessage

getSessionList

public java.util.Vector getSessionList()
Getter for session list.
Returns:
Session list as a Vector.

setSessionList

public void setSessionList(java.util.Vector sessionList)
Used to set the TL1SessionList which should receive the autonomous message.
Parameters:
sessionList - A vector of session list.

getATag

public double getATag()
Getter for the atag of the autonomous message.
Returns:
A double specifying the A-Tag.

setATag

public void setATag(double aTag)
Used to set the atag of the autonomous message.
Parameters:
aTag - The A-Tag as a double.

getResponseLinesVector

public java.util.Vector getResponseLinesVector()
Returns the Vector having TL1Line objects as it's elements. It is used for multiple response lines support.

setResponseLinesVector

public void setResponseLinesVector(java.util.Vector respVec)
Set the ResponseLinesVector. The Vector has TL1Line objects as it's elements. It is used for multiple response lines support.
Parameters:
respVec - - The Vector containg response lines.

getCommandCode

java.lang.String getCommandCode()
Thease methods are included for the getting or setting command codes for autoInfo while creating autonomous messages. For input messages the command code is there in it's requestInfo.

getSourceIdentifier

public java.lang.String getSourceIdentifier()

setCommandCode

public void setCommandCode(java.lang.String command)
Setting the command code. This will be used in the autonomous message.
Parameters:
command - - command code to be shown in autonomous message.

setSourceIdentifier

public void setSourceIdentifier(java.lang.String sid)