javax.microedition.ipdr.callback
Interface ConnectionController


public interface ConnectionController

The interface enables to control the ability of establishing a connection and session start state in a connection. The application sets connection controller. The ConnectionController is used by the ETA implementation in two cases: a) First case, whenever the ETA has to decide whether to open connection in the IPDR/SP level (initiate "connect" message or just before response to "connect" message). The ETA MUST invoke canConnect and initiate (or response to) "connect" message just if true is returned (otherwise it will wait and retry later according to the configuration). b) Second case, just before opening active session (sending "start session" message to the collection system). In such case the ETA implementation MUST first invoke canStartSession and send "session start" just if true is returned (otherwise it will wait and retry later according to the configuration). This interface is returned by the ConnectionControllerFactory

Version:
1.0
Author:
Shai Gotlib
See Also:
ConnectionControllerFactory.getConnectionController(), ConnectionControllerFactory

Method Summary
 boolean canConnect(java.lang.String collectorIdentifier, ConnectionConfig connectionConfig)
          Enables controlling the initialization of a connection.
 boolean canStartSession(java.lang.String collectorIdentifier, ConnectionConfig connectionConfig, SessionConfig sessionConfig)
          Informs the caller whether or not it can start an "active session".
 

Method Detail

canConnect

public boolean canConnect(java.lang.String collectorIdentifier,
                          ConnectionConfig connectionConfig)
Enables controlling the initialization of a connection. It used by the ETA implementation before each attempt to establish the IPDR/SP connection to the collector or response to CONNECT request (in IPDR/SP level). The implementtion must not open IPDR/SP connection if canConnect() return false

Parameters:
collectorIdentifier - the collector identifier (IPv4 "dotted decimal notation")
connectionConfig - The connection configuration
Returns:
true for can establish a connection and false otherwise (boolean value).

canStartSession

public boolean canStartSession(java.lang.String collectorIdentifier,
                               ConnectionConfig connectionConfig,
                               SessionConfig sessionConfig)
Informs the caller whether or not it can start an "active session". It is used by the ETA implementation before "session start" event is sent to the collection system.

Parameters:
collectorIdentifier - the collector identifier (IPv4 "dotted decimal notation")
connectionConfig - the current connection configuration
sessionConfig - the relevant session configuration
Returns:
true for can session start and false otherwise (boolean value).