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>
List of all members.
Public Member Functions |
| SessionManager () |
virtual | ~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) |
Session * | getSession (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 () |
Static Public Member Functions |
static UaDateTime | getLastSystemTimeChange () |
Protected Member Functions |
virtual void | sessionOpened (Session *) |
virtual void | sessionActivated (Session *) |
virtual void | sessionClosed (Session *, OpcUa_Boolean) |
virtual OpcUa_Int32 | getNewSessionId () |
Protected Attributes |
UaMutex | m_mutex |
std::map< OpcUa_Int32, Session * > | m_mapSessions |
std::map< OpcUa_UInt32,
std::list< Session * > > | m_mapSecureChannels |
OpcUa_Int32 | m_lastSessionID |
OpcUa_Boolean | m_isStarted |
ServerConfig * | m_pServerConfig |
NodeManagerRoot * | m_pNodeManagerRoot |
OpcUa_UInt16 | m_SessionIdNamespaceIndex |
OpcUa_Boolean | m_isShutdownStarted |
Static Protected Attributes |
static OpcUa_DateTime | s_lastPurge |
static OpcUa_DateTime | s_timeOfLastSystemTimeChangeDetected |
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 |
( |
) |
|
SessionManager::~SessionManager |
( |
) |
[virtual] |
Member Function Documentation
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
UaStatus SessionManager::closeAllUaSessions |
( |
) |
|
Close all sessions created via the UA communication channel
- Returns:
- Error code
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.
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
UaDateTime SessionManager::getLastSystemTimeChange |
( |
) |
[static] |
Returns the time when a system time change was detected
OpcUa_Int32 SessionManager::getNewSessionId |
( |
) |
[protected, virtual] |
Returns a new unique session id The method can be overwritten by a derived class
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
Purge all sessions which are marked to delete
- 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. |
virtual void SessionManager::sessionActivated |
( |
Session * |
) |
[inline, protected, virtual] |
Event for derived classes indicating that a session was activated.
- Parameters:
-
session | Interface pointer of the activated Session. |
virtual void SessionManager::sessionClosed |
( |
Session * |
, |
|
|
OpcUa_Boolean |
|
|
) |
| [inline, protected, virtual] |
Event for derived classes indicating that a session was closed.
- Parameters:
-
session | Interface pointer of the closed Session. |
deleteSubscriptions | Flag indicating if subscriptions are also deleted. |
virtual void SessionManager::sessionOpened |
( |
Session * |
) |
[inline, protected, virtual] |
Event for derived classes indicating that a new session was opened.
- Parameters:
-
session | Interface pointer of the new Session. |
Shut down session manager. Shut down method for session manager.
- Returns:
- Error code
OpcUa_UInt32 SessionManager::startServerShutDown |
( |
) |
|
Inform the session manager about the shutdown of the server.
- Returns:
- Number of active client connections.
Initialize method for session manager.
- Parameters:
-
pServerConfig | Server configuration object. |
pNodeManagerRoot | a pointer to the root NodeManager. |
- Returns:
- Error code
Member Data Documentation
Flag that indicates that the shutdown of the server was started
Flag that indicates the status of the manager
Last used session ID. Session ID must be unique in the server instance
Map of session objects based on secure channel Id
Map of session objects based on session Id
Server configuration object
Namespace index used for the session node ids
Time of the last purge call
The time when a system time change was detected
The documentation for this class was generated from the following files:
- /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/sessionmanager.h
- /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/sessionmanager.cpp