com.adventnet.tl1
Interface ConnectionHandler

All Known Implementing Classes:
ConnectionHandlerImpl

public interface ConnectionHandler

This is an interface that the application must implement if the user wishes to take some actions before or after connecting to the TL1Agent. Eventhough it is optional to implement this interface,in some cases this interface is indispensable.

For example,there are devices which send banners before accepting the connection,and also some devices which expect a particular sequence of characters,like "\n\r;" etc before sending the log-in message.In such circumstances,this interface provides a useful means to succesfully establish connection with the device. Registering this handler should have to be done before opening the session. The implementation of this interface should be registered with TL1Session as follows.

 session.setConnectionHandler(ConnectionHandlerImpl)
 

where session is the instance of TL1Session and ConnectionHandlerImpl is the implementation of this interface.
Click here to view the source file ConnectionHandlerImpl.java

See Also:
TL1Session.setConnectionHandler(com.adventnet.tl1.ConnectionHandler), TL1Session.removeConnectionHandler(), TL1Session

Method Summary
 void postConnect(TL1Session session)
          This callback method is invoked after establishing connection with the TL1 Agent.
 void preConnect(TL1Session session)
          This callback method is invoked before establishing connection with the TL1 Agent.
 

Method Detail

preConnect

public void preConnect(TL1Session session)
This callback method is invoked before establishing connection with the TL1 Agent. This enables the user to take some action (if required),before initiating the connection with the TL1 Device.
Parameters:
session - TL1Session instance.

postConnect

public void postConnect(TL1Session session)
This callback method is invoked after establishing connection with the TL1 Agent. Some real world TL1 devices send some text-banner in the form of strings. This could cause the API to throw some parse exceptions,the reason being that the TL1Session,by default does not expect any banner as only rare TL1 Devices send the initial banner.This method provides the user with the required functionality to overcome this scenario.
Parameters:
session - TL1Session instance.