com.adventnet.cli.transport
Interface CLIProtocolOptions

All Known Implementing Classes:
SerialCommOptionsImpl, TelnetProtocolOptionsImpl

public interface CLIProtocolOptions

This interface defines some protocol specific options which have to be implemented by the user depending upon the protocol being used to communicate with the CLI device. A reference implementation for Telnet has been provided and it is used as the default protocol. The implementation of this interface can be passed as an argument to the CLISession constructor as follows:

 CLISession session = new CLISession(cliProtocolOptionsImpl,enablePooling);
 
OR it can be set on the session before calling the open() method in the CLISession, like:
 session.setCLIProtocolOptions(cliProtocolOptionsImpl);
 
where session is an instance of CLISession and cliProtcolOptionsImpl is an instance of the class which implements this interface. The enablePooling is a boolean to indicate whether the session is dedicated or not.
Click here to view the Telnet implementation for this interface.

See Also:
CLISession.CLISession(CLIProtocolOptions,boolean), TelnetProtocolOptionsImpl

Method Summary
 java.lang.Object clone()
          Performs a clone of this object.
 java.lang.Object getID()
          This is used to generate a unique id based on a particular connection.
 java.lang.String getInitialMessage()
          Gets the initial message sent by the device after a connection is established.
 java.util.Properties getProperties()
          Gets the list of properties on this CLIProperty instance.
 void setInitialMessage(java.lang.String message)
          Sets the initial message sent by the device after a connection is established.
 void setProperties(java.util.Properties properties)
          Sets a list of properties on this CLIProperty instance.
 

Method Detail

getID

public java.lang.Object getID()
This is used to generate a unique id based on a particular connection. The id generated will be used to identify the connection in the CLI Transport Pool. Implementors have to generate unique Id for identifying the different connections which may have been established.
Returns:
the ID as an Object.
See Also:
TelnetProtocolOptionsImpl

clone

public java.lang.Object clone()
Performs a clone of this object. Implementors have to copy the appropriate fields in their protocol options implementation.
Overrides:
clone in class java.lang.Object
Returns:
the cloned instance of this object.
See Also:
TelnetProtocolOptionsImpl

getInitialMessage

public java.lang.String getInitialMessage()
Gets the initial message sent by the device after a connection is established. This is the message that is sent by the device after a successful login/connection establishment with the device.
Returns:
the initial message from the device.

setInitialMessage

public void setInitialMessage(java.lang.String message)
Sets the initial message sent by the device after a connection is established. Implementors of this interface should set the initial message sent by the device after a successful connection establishment.
Parameters:
message - the initial message from the device.

setProperties

public void setProperties(java.util.Properties properties)
Sets a list of properties on this CLIProperty instance.
Parameters:
props - the property object which contains the list of properties.

getProperties

public java.util.Properties getProperties()
Gets the list of properties on this CLIProperty instance.


Copyright (c)AdventNet Inc., 1996-2003