com.prosysopc.ua.server
Interface SessionManagerListener

All Known Implementing Classes:
SessionManagerAdapter

public interface SessionManagerListener


Method Summary
 boolean onActivateSession(Session session, ServerUserIdentity userIdentity)
          Notification of session activation.
 void onActivateSessionError(Session session, org.opcfoundation.ua.core.UserIdentityToken userToken, Exception e)
          Notification of an activation error.
 void onAfterActivateSession(Session session)
          Notification of a successful session activation.
 void onCancelSession(Session session)
          Notification of session cancel.
 void onCloseSession(Session session, boolean deleteSubscriptions)
          Notification of session close.
 void onCreateSession(Session session)
          Notification of session creation.
 

Method Detail

onActivateSession

boolean onActivateSession(Session session,
                          ServerUserIdentity userIdentity)
                          throws StatusException
Notification of session activation. Used to validate the userIdentity. The event is called whenever a client application activates the session, which occurs, at initial connection, and also if the user identity is changed.

Note that raising an exception will also lead to a call to onActivateSessionError(com.prosysopc.ua.server.Session, org.opcfoundation.ua.core.UserIdentityToken, java.lang.Exception)

The UaServer listens to the event as well, and delegates the certificate check to its userValidator.

Parameters:
session - The session which the user is logging in. The old user identity is still assigned to the session (it will be null in the first time).
userIdentity - the new user identity that is being used to activate the session.
Returns:
true, if the user is allowed access.
Throws:
StatusException - if there is a problem with the activation. For example, if the session is active, and you do not want to enable the user identity to be changed, throw the exception with StatusCodes.Bad_IdentityChangeNotSupported.

onActivateSessionError

void onActivateSessionError(Session session,
                            org.opcfoundation.ua.core.UserIdentityToken userToken,
                            Exception e)
Notification of an activation error. Read the exception to get more details on the error. userToken is the invalid token that was used for activation.

Parameters:
session - The session which the user was logging in.
userToken - The user token that was used
e - The error that was raised.

onAfterActivateSession

void onAfterActivateSession(Session session)
Notification of a successful session activation. The event will only be called after a successful activation.

Parameters:
session - The session which the user logged in. You can read the new UserIdentity from the session.

onCancelSession

void onCancelSession(Session session)
Notification of session cancel. The event is used to notify the server that all currently pending operations for the session should be cancelled.

Parameters:
session - the session being canceled.

onCloseSession

void onCloseSession(Session session,
                    boolean deleteSubscriptions)
Notification of session close.

Parameters:
session - the session being closed.
deleteSubscriptions - whether the client is requesting that all subscriptions related to the session are to be deleted as well.

onCreateSession

void onCreateSession(Session session)
                     throws StatusException
Notification of session creation. The session is initialized with the data received from the client request, including the clientIdentity. The application certificate is typically checked in this event.

The UaServer listens to the event as well, and delegates the certificate check to its certificateValidator.

Parameters:
session - the session to be created.
Throws:
StatusException


Copyright © 2018. All rights reserved.