com.apama.session
Event SessionHandler


A helper interface event for connecting and administrating an MDA Session. The interface must be constructed using the com.apama.session.SessionHandlerFactory.

The Handler supplies:-
- Default connected callback (which does nothing).
- Common universal error callback used for all errors (failed connects, errors, etc) and a default implementation which logs at the ERROR level.
Since:
CMF 5.1.0
See Also:
com.apama.session.SessionHandlerFactory - Factory event to create this interface.
com.apama.session.HandlerErrorConstants - Event containing the possible Error constants.
com.apama.utils.Params - The Parameters event.

Member summary
 action<string, string>connect

Connect this Session Handler to the Session identified by the supplied session and transport name using the currently set connected callback (which may be the default supplied by the handler).
 action<string, string, action<com.apama.session.SessionHandler>>connectCb

Connect this Session Handler to the Session identified by the supplied session and transport name using the supplied callback.
 action<>disconnect

Disconnect this Session Handler from the current session it is connected to. It is an error to attempt a disconnect before a successful connect.
 action<action<com.apama.session.SessionHandler>>disconnectCb

Disconnect this Session Handler from the current session it is connected to and call the user back on the supplied callback when successfully disconnected. It is an error to attempt a disconnect before a successful connect.
 action<action<com.apama.session.SessionHandler>> returns integeraddConnectedCallback

Add this callback to the set called when the Session is connected.
 action<integer>removeConnectedCallback

Remove a Connected Callback identified by the result of "addConnectedCallback".
 action<>clearConnectedCallbacks

Clear any currently set connected callbacks.
 action<action<com.apama.session.SessionHandlercom.apama.utils.Error>> returns integeraddErrorCallback

Add this Error callback to the set called on an error.
 action<integer>removeErrorCallback

Remove an Error Callback identified by the result of "addErrorCallback".
 action<>clearErrorCallbacks

Clear any currently set error callbacks.
 action<com.apama.session.SessionHandlercom.apama.utils.Error>defaultErrorCallback

Call the default Error callback as supplied by the Handler (which logs the error at ERROR level). You may call this from an overridden Error callback (to get the log message) but it is not required.
 action<com.apama.utils.Params>setParams

Set the Parameters in this handler to a copy of the supplied parameters, to be used in subsequent subscriptions.
 action<> returns com.apama.utils.ParamsgetParams

Get a copy of the current parameters of this Handler.
 action<> returns com.apama.session.SessionInfogetSessionInfo

Get the Session Info event associated with the session this Handler is connected to.
 action<> returns booleanisConnected

Returns true if the Handler is connected.
 
Member detail

addConnectedCallback

            action<action<com.apama.session.SessionHandler>> returns integer addConnectedCallback
        
Add this callback to the set called when the Session is connected.

Parameters:
cbConnected - The callback.
The parameters for cbConnected are:
handler - The SessionHandler.
Returns:
Ref Id used to remove the connected callback.
See Also:
com.apama.session.SessionHandler#removeConnectedCallback - This action should be called with the returned refId to remove this callback.

addErrorCallback

            action<action<com.apama.session.SessionHandlercom.apama.utils.Error>> returns integer addErrorCallback
        
Add this Error callback to the set called on an error.

Parameters:
cbError - The Error callback.
The parameters for cbError are:
handler - The SessionHandler.
error - The Error event.
Returns:
Ref Id used to remove the connected callback.
See Also:
com.apama.session.SessionHandler#removeErrorCallback - 
com.apama.session.HandlerErrorConstants - 

clearConnectedCallbacks

            action<> clearConnectedCallbacks
        
Clear any currently set connected callbacks.
See Also:
com.apama.session.SessionHandler#addConnectedCallback - 

clearErrorCallbacks

            action<> clearErrorCallbacks
        
Clear any currently set error callbacks.
See Also:
com.apama.session.SessionHandler#addErrorCallback - 

connect

            action<string, string> connect
        
Connect this Session Handler to the Session identified by the supplied session and transport name using the currently set connected callback (which may be the default supplied by the handler).

Parameters:
sessionName - The name of the session to connect to.
transportName - The name of the transport to connect to.

connectCb

            action<string, string, action<com.apama.session.SessionHandler>> connectCb
        
Connect this Session Handler to the Session identified by the supplied session and transport name using the supplied callback.

Parameters:
sessionName - The name of the session to connect to.
transportName - The name of the transport to connect to.
cbConnected - The callback.

defaultErrorCallback

            action<com.apama.session.SessionHandlercom.apama.utils.ErrordefaultErrorCallback
        
Call the default Error callback as supplied by the Handler (which logs the error at ERROR level). You may call this from an overridden Error callback (to get the log message) but it is not required.

Parameters:
handler - The SessionHandler.
error - The Error event.

disconnect

            action<> disconnect
        
Disconnect this Session Handler from the current session it is connected to. It is an error to attempt a disconnect before a successful connect.

disconnectCb

            action<action<com.apama.session.SessionHandler>> disconnectCb
        
Disconnect this Session Handler from the current session it is connected to and call the user back on the supplied callback when successfully disconnected. It is an error to attempt a disconnect before a successful connect.

Parameters:
cbDisconnected - The callback.

getParams

            action<> returns com.apama.utils.Params getParams
        
Get a copy of the current parameters of this Handler.

Returns:
The parameters.
See Also:
com.apama.utils.Params - 

getSessionInfo

            action<> returns com.apama.session.SessionInfo getSessionInfo
        
Get the Session Info event associated with the session this Handler is connected to.

Returns:
The com.apama.session.SessionInfo event associated with this Handler.
See Also:
com.apama.session.SessionInfo - 

isConnected

            action<> returns boolean isConnected
        
Returns true if the Handler is connected.

Returns:
Boolean value indicating if the Handler is connected.

removeConnectedCallback

            action<integer> removeConnectedCallback
        
Remove a Connected Callback identified by the result of "addConnectedCallback".

Parameters:
refId - The reference Id as returned from the call to "addConnectedCallback".
See Also:
com.apama.session.SessionHandler#addConnectedCallback - 

removeErrorCallback

            action<integer> removeErrorCallback
        
Remove an Error Callback identified by the result of "addErrorCallback".

Parameters:
refId - The reference ID as returned from the call to "addErrorCallback".
See Also:
com.apama.session.SessionHandler#addErrorCallback - 

setParams

            action<com.apama.utils.ParamssetParams
        
Set the Parameters in this handler to a copy of the supplied parameters, to be used in subsequent subscriptions.

Parameters:
parameters - The parameters.
See Also:
com.apama.utils.Params -