SessionManager Class Reference

Class definition of the SessionManager. Manages the Sessions and creates Secure Channels. It is not possible to create plane copies of this Class. More...

#include <sessionmanager.h>

Collaboration diagram for SessionManager:

List of all members.


Public Member Functions

 SessionManager ()
 ~SessionManager ()
UaStatus startUp (ServerConfig *pServerConfig, NodeManagerRoot *pNodeManagerRoot)
UaStatus shutDown ()
UaStatus closeAllUaSessions ()
UaStatus createSession (const UaString &sessionName, const UaByteString clientCertificate, OpcUa_Double requestedSessionTimeout, OpcUa_Double &revisedSessionTimeout, Session **session)
UaStatus activateSession (const OpcUa_NodeId *authenticationToken, OpcUa_UInt32 uSecureChannelId, const UaStringArray &localeIDs, UaUserIdentityToken *pUserIdentityToken)
SessiongetSession (const OpcUa_NodeId *authenticationToken, OpcUa_Boolean updateSession)
UaStatus closeSession (const OpcUa_NodeId *authenticationToken, OpcUa_Boolean deleteSubscriptions)
void secureChannelCreated (OpcUa_UInt32 uSecureChannelId, const UaString &sSecurityPolicy, OpcUa_UInt16 uSecurityMode)
void secureChannelDeleted (OpcUa_UInt32 uSecureChannelId)
OpcUa_UInt32 startServerShutDown ()
UaStatus purge ()

Detailed Description

Class definition of the SessionManager. Manages the Sessions and creates Secure Channels. It is not possible to create plane copies of this Class.

SessionManager


Constructor & Destructor Documentation

SessionManager::SessionManager (  ) 

construction

SessionManager::~SessionManager (  ) 

destruction


Member Function Documentation

UaStatus SessionManager::startUp ( ServerConfig pServerConfig,
NodeManagerRoot pNodeManagerRoot 
)

Initialize method for session manager.

Parameters:
pServerConfig Server configuration object.
pNodeManagerRoot a pointer to the root NodeManager.
Returns:
Error code

UaStatus SessionManager::shutDown (  ) 

Shut down session manager. Shut down method for session manager.

Returns:
Error code

UaStatus SessionManager::closeAllUaSessions (  ) 

Close all sessions created via the UA communication channel

Returns:
Error code

UaStatus SessionManager::createSession ( const UaString sessionName,
const UaByteString  clientCertificate,
OpcUa_Double  requestedSessionTimeout,
OpcUa_Double &  revisedSessionTimeout,
Session **  session 
)

Create a session.

Parameters:
sessionName the name of the Session to be build.
clientCertificate the certificate the Client sends to the Server.
requestedSessionTimeout Requested number of milliseconds that the session should remain open without activity.
revisedSessionTimeout Returned number of milliseconds that the session remains open without activity.
session Interface to the Session context for the method call
Returns:
Error code

UaStatus SessionManager::activateSession ( const OpcUa_NodeId *  authenticationToken,
OpcUa_UInt32  uSecureChannelId,
const UaStringArray &  localeIDs,
UaUserIdentityToken pUserIdentityToken 
)

Acivate a session.

Parameters:
localeIDs List of locale ids in priority order for localized strings.
authenticationToken Secret session Id created by the server application.
uSecureChannelId the SecureChannelId to be deleted.
pUserIdentityToken User identity token contained in an ExtensionObject used to handle different types of user identity tokens like user/password or an X509 certificate. It provides the credentials of the user associated with the Client application. The implementation of this method must use these credentials to determine whether the Client should be allowed to activate a Session and what resources the Client has access to during this Session. If the method is not able to validate the user or if the user has no right to access the server, the method must return the status code OpcUa_BadUserAccessDenied.
Returns:
Error code

Session * SessionManager::getSession ( const OpcUa_NodeId *  authenticationToken,
OpcUa_Boolean  updateSession 
)

Get a session by authenticationToken

Parameters:
authenticationToken Server unique node id that identifies the session.
updateSession Indicates if the timeout of the returned session should be updated.
Returns:
Corresponding session for passed session ID

UaStatus SessionManager::closeSession ( const OpcUa_NodeId *  authenticationToken,
OpcUa_Boolean  deleteSubscriptions 
)

Close a session identified by session ID

Parameters:
authenticationToken Secret session Id created by the server application.
deleteSubscriptions Indicates if the subscriptions should be deleted by the server
Returns:
Error code.

void SessionManager::secureChannelCreated ( OpcUa_UInt32  uSecureChannelId,
const UaString sSecurityPolicy,
OpcUa_UInt16  uSecurityMode 
)

Event to inform session manager about creation of a secure channel

Parameters:
uSecureChannelId the SecureChannelId to be deleted.
sSecurityPolicy the policies needed for the secure channel.
uSecurityMode the security mode, if the event type refers to a secure channel.

void SessionManager::secureChannelDeleted ( OpcUa_UInt32  uSecureChannelId  ) 

Event to inform session manager about deletion of a secure channel

Parameters:
uSecureChannelId the SecureChannelId to be deleted.

OpcUa_UInt32 SessionManager::startServerShutDown (  ) 

Inform the session manager about the shutdown of the server.

Returns:
Number of active client connections.

UaStatus SessionManager::purge (  ) 

Purge all sessions which are marked to delete

Returns:
Error code


The documentation for this class was generated from the following files:
  • src/uaserver/uaservercpp/coremodule/sessionmanager.h
  • src/uaserver/uaservercpp/coremodule/sessionmanager.cpp