com.adventnet.tl1
Class TL1ParserOptions

java.lang.Object
  |
  +--com.adventnet.tl1.TL1ParserOptions

public class TL1ParserOptions
extends java.lang.Object

This class provides the mechanism to set the various parser options for a particular TL1Session. The TL1ParserOptions object can be obtained using the method getTL1ParserOptions(), defined in TL1Session.

The options provided include the ones to determine whether the TL1Messages are to be parsed or not,whether or not to drop Ack messages and Autonomous messages in callback,whether or not to drop the echo of Input messages (sent by some agents)as well as whether or not to parse the Text block portion of the TL1Message.

There are a few situations where we have to turn off the parsing of the TL1 message. One particular situation is where the device sends a banner before getting into the TL1 mode. In this particular situation, we should implement the ConnectionHandler interface and in the postConnect(..) method,the parsing of TL1 message should be disabled for a while,until the entire banner is received in the callback method.

This option is useful only in situations like the afore mentioned one. But there is no need to disable TL1 message parsing to get the response in string form.That can automatically be done in the TL1Client implementation irrespective of whether TL1 message parsing is enabled or disabled.

While sending messages asynchronously,if Autonomous messages or Ack messages are sent by the device,they will be received in the callback if the application has registered the TL1Client implementation with the TL1Session. And send(..) will return with the TL1Response message. This class provides the option to drop or receive such messages in callback according to the preference of the user.

Similar option is available to drop the Input messages that are echoed back by some typical agents. Some TL1 devices will echo back the TL1InputMessage sent by the client. By default the TL1Session drops these echoed TL1InputMessages. But if the application wishes to see the echoed TL1InputMessages from the device,then the corresponding option should be turned on.

The next option is the one to enable/disable parsing of TL1TextBlock. Some TL1 devices send messages that are non-compliant with the standard TL1 syntax.Very often the non-compliance is in the TextBlock portion of the message sent by the device.In such circumstances the option to disable TextBlock parsing should be set,in order to avoid exceptions.

See Also:
TL1Session.getTL1ParserOptions(), ConnectionHandler

Constructor Summary
(package private) TL1ParserOptions()
          Default Constructor
 
Method Summary
 void dropTL1AckMsgInCallback(boolean flag)
          Method to set the flag which determines whether or not to drop the TL1AckMessages in the callback(..)
 void dropTL1AutoMsgInCallback(boolean flag)
          Method to set the flag which determines whether or not to drop TL1AutonomousMessages in the callback(..)
 void dropTL1InputMsgInCallback(boolean flag)
          Method to set the flag which determines whether or not to drop the echo of TL1InputMessages in the callback(..)
 boolean isDroppedTL1AckMsgInCallback()
          Method to get the status of the flag which indicates whether or not the TL1AckMessages are dropped in callback(..)
 boolean isDroppedTL1AutoMsgInCallback()
          Method to get the status of the flag which indicates whether or not the TL1AutonomousMessages are dropped in the callback(..)
 boolean isDroppedTL1InputMsgInCallback()
          Method to get the status of the flag which indicates whether or not the echo of TL1InputMessage is dropped in the callback(..)
 boolean isEnabledTL1MessageParsing()
          Method to get the status of the flag which determines whether the TL1 Message Parser is enabled or disabled.
 boolean isReceiveRawData()
          Method to verify receiveRawData is turned on/off.
 boolean isSetTL1TextBlockParsing()
          Method to verify whether the TL1TextBlock parsing is enabled or disabled
 void receiveRawData(boolean flag)
          This flag should be set, only if TL1 Message Parsing is disabled.
 void setTL1MessageParsing(boolean flag)
          Method to set the flag which determines whether or not to enable the TL1 Message Parser.
 void setTL1TextBlockParsing(boolean flag)
          To set a boolean value to enable or disable parsing of TL1TextBlock.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TL1ParserOptions

TL1ParserOptions()
Default Constructor
Method Detail

dropTL1InputMsgInCallback

public void dropTL1InputMsgInCallback(boolean flag)
Method to set the flag which determines whether or not to drop the echo of TL1InputMessages in the callback(..)
Parameters:
flag - If flag is set to true, TL1InputMessages will be dropped in the callback(..).

isDroppedTL1InputMsgInCallback

public boolean isDroppedTL1InputMsgInCallback()
Method to get the status of the flag which indicates whether or not the echo of TL1InputMessage is dropped in the callback(..)
Returns:
boolean value which indicates whether the TL1InputMessages are dropped in callback(..) or not.
true indicates that echo of TL1InputMessage is dropped.
false indicates that echo of TL1InputMessage is not dropped.

dropTL1AckMsgInCallback

public void dropTL1AckMsgInCallback(boolean flag)
Method to set the flag which determines whether or not to drop the TL1AckMessages in the callback(..)
Parameters:
flag - If flag is set to true, TL1AckMessages will be dropped in callback(..)

isDroppedTL1AckMsgInCallback

public boolean isDroppedTL1AckMsgInCallback()
Method to get the status of the flag which indicates whether or not the TL1AckMessages are dropped in callback(..)
Returns:
boolean value which indicates whether the TL1AckMessages are dropped in callback(..) or not.
true indicates that TL1AckMessage will be dropped in the callback(..)
false indicates that TL1AckMessages will not be dropped in the callback(..)

dropTL1AutoMsgInCallback

public void dropTL1AutoMsgInCallback(boolean flag)
Method to set the flag which determines whether or not to drop TL1AutonomousMessages in the callback(..)
Parameters:
flag - If flag is set to true, TL1AutonomousMessages will be dropped in callback(..)

isDroppedTL1AutoMsgInCallback

public boolean isDroppedTL1AutoMsgInCallback()
Method to get the status of the flag which indicates whether or not the TL1AutonomousMessages are dropped in the callback(..)
Returns:
boolean value which indicates whether the TL1AutonomousMessages are dropped in callback(..) or not.
true indicates that TL1AutonomousMessages are dropped in the callback(..)
false indicates that TL1AutonomousMessages are not dropped in the callback(..)

setTL1MessageParsing

public void setTL1MessageParsing(boolean flag)
Method to set the flag which determines whether or not to enable the TL1 Message Parser. Based on the value of the flag, the received TL1 Message will be parsed .
Parameters:
flag - true indicates that parser should be enabled.
false indicates that parser should be disabled.

isEnabledTL1MessageParsing

public boolean isEnabledTL1MessageParsing()
Method to get the status of the flag which determines whether the TL1 Message Parser is enabled or disabled.
Returns:
boolean value which indicates whether the TL1 Message Parser is enabled or disabled.
true indicates that the TL1 Message parser is enabled.
false indicates that the TL1 Message parser is disabled.

setTL1TextBlockParsing

public void setTL1TextBlockParsing(boolean flag)
To set a boolean value to enable or disable parsing of TL1TextBlock.
Parameters:
flag - true if parsing is to be done else false.

isSetTL1TextBlockParsing

public boolean isSetTL1TextBlockParsing()
Method to verify whether the TL1TextBlock parsing is enabled or disabled
Returns:
boolean value which indicates whether TL1TextBlock parsing is enabled or disabled.
true indicates that TL1TextBlock parsing is enabled
false indicates that TL1TextBlock parsing is disabled

receiveRawData

public void receiveRawData(boolean flag)
This flag should be set, only if TL1 Message Parsing is disabled. Some devices may send banner initially before getting into TL1 mode. This flag allows the user to get the raw data as it is received, in case of invalid TL1 message(banner), in the callback with invalid message type and null ctag value.
If the flag is set to true, callback with string response will be invoked with the TL1 Message type and the ctag value of the message received.
Default value of this flag is false. User should use this option only in case of invalid TL1 message to be received in callback.
Parameters:
flag - true means callback will be invoked with the invalid message received from the agent.
false means callback with string response will be invoked with the TL1 Message type and the ctag value of the message received.

isReceiveRawData

public boolean isReceiveRawData()
Method to verify receiveRawData is turned on/off.
Returns:
Returns true,if callback is to be invoked with the invalid message (sometimes to receive banner) received from the agent.
Returns false,if callback is to be invoked with string response, TL1 Message type and the ctag value of the message received.