UA Server SDK C++ Bundle
1.4.1.271
|
Class used to manage a client session in the server. More...
#include <session.h>
Inherits ReferenceCounter.
Inherited by UaSession.
Public Member Functions | |
Session (OpcUa_Int32 sessionId, const UaNodeId &authenticationToken) | |
construction More... | |
virtual UaStatus | open (const UaString &sessionName, const UaByteString clientCertificate, OpcUa_UInt32 sessionTimeout) |
Open the session. More... | |
virtual UaStatus | activate (OpcUa_UInt32 uSecureChannelId, UaUserIdentityToken *pUserIdentityToken, const UaStringArray &localeIDs) |
Activate the session. More... | |
virtual UaStatus | close (OpcUa_Boolean deleteSubscriptions) |
Close the session This method is called if the Client closes the Session with the service CloseSession or if the internal clean up routine is closing the Session after a Session timeout. More... | |
virtual OpcUa_Boolean | hasExpired () const |
Checks if the session timeout expired. More... | |
virtual UaStatus | isValid (OpcUa_UInt32 uSecureChannelId) |
Checks if the session is valid. More... | |
virtual void | setInvalid () |
Set the state of the session to invalid. | |
OpcUa_Boolean | isActivated () |
Get flag indicating if session was activated. More... | |
UaDateTime | lastTimeoutReset () |
Get time the session timeout was reset. More... | |
virtual OpcUa_Boolean | mustDelete () |
Checks if the session must be deleted. More... | |
virtual OpcUa_Boolean | isSecureChannelValid () |
Check if the secure channel assigned to the session is valid. More... | |
virtual void | setSecureChannelInvalid () |
Invalidate the secure channel assigned to the session. More... | |
virtual UaStatus | queueBrowseContext (BrowseContext *pBCP, OpcUa_ByteString *pCP) |
Queue a browse continuation point. More... | |
virtual BrowseContext * | getBrowseContext (OpcUa_ByteString *pCP) |
Get a browse continuation point. More... | |
virtual OpcUa_UInt16 | getMaxBrowseCPs () |
Get the maximum number of browse continuation points. More... | |
virtual UaStatus | queueQueryContext (QueryContext *pBCP, OpcUa_ByteString *pCP) |
Queue a query continuation point. More... | |
virtual QueryContext * | getQueryContext (OpcUa_ByteString *pCP) |
Get a query continuation point. More... | |
virtual UaStatus | queueHistoryReadCP (HistoryReadCPUserDataBase *pHistoryReadCP, OpcUa_ByteString *pCP) |
Queue a history read continuation point. More... | |
virtual HistoryReadCPUserDataBase * | getHistoryReadCP (OpcUa_ByteString *pCP) |
Get a history read continuation point. More... | |
void | registerSessionCallback (SessionCallback *pCallback) |
Register callback interface of object interested in the session status. | |
void | unregisterSessionCallback (SessionCallback *pCallback) |
Unregister callback interface of object not longer interested in the session status. | |
void | resetTimeout () |
Reset session timeout. More... | |
void | getSessionNodeId (OpcUa_NodeId &sessionId) const |
Returns the NodeId of the session. More... | |
OpcUa_Int32 | getIntegerSessionId () const |
Returns the integer ID of the session. More... | |
void | getAuthenticationToken (OpcUa_NodeId &authenticationToken) const |
Returns the private ID of the session This ID is private to the client and server application and must be kept private inside the management of the session in the client and server code. More... | |
OpcUa_UInt32 | getSessionTimeout () const |
Returns the timeout of the session. More... | |
UaString | getSessionName () const |
Returns the name of the session. More... | |
OpcUa_UInt32 | getSecureChannelId () const |
Returns the ID of the SecureChannel assigned to the session. More... | |
void | setSecureChannelSecurityPolicy (const UaString &sSecurityPolicy) |
Sets the security policy of the secure channel active for this session. | |
UaString | getSecureChannelSecurityPolicy () const |
Returns the security policy of the secure channel active for this session. | |
void | setSecureChannelMessageSecurityMode (OpcUa_MessageSecurityMode messageSecurityMode) |
Sets the message security mode of the secure channel active for this session. | |
OpcUa_MessageSecurityMode | getSecureChannelMessageSecurityMode () const |
Returns the message security mode of the secure channel active for this session. | |
void | setSecureChannelEndpointConfiguration (const UaEndpoint *pEndpoint) |
Sets the server endpoint configuration used by the secure channel active for this session. | |
const UaEndpoint * | getSecureChannelEndpointConfiguration () const |
Returns the server endpoint configuration used by the secure channel active for this session. | |
const OpcUa_ByteString * | getClientCertificate () const |
Returns the client certificate of the client created the session. More... | |
void | setClientApplicationDescription (const UaApplicationDescription &clientApplicationDescription) |
Sets the client application description that contains ApplicationUri, ProductUri, ApplicationName and ApplicationType. | |
UaApplicationDescription | getClientApplicationDescription () const |
Returns the client application description that contains ApplicationUri, ProductUri, ApplicationName and ApplicationType. | |
void | setClientNetworkAddress (const UaString &clientNetworkAddress) |
Sets the client network address used to communicate with the server through this session. | |
UaString | getClientNetworkAddress () const |
Returns the client network address used to communicate with the server through this session. | |
UaString | getLocalId () const |
Get the first local Id used for the session. More... | |
const UaStringArray * | getLocalIds () const |
Get the list of all local Ids used for the session. More... | |
void | setClientUserId (const UaString &sClientUserId) |
Sets the client user id for the session. More... | |
UaString | getClientUserId () const |
Returns the client user id for the session. More... | |
virtual OpcUa_UInt64 | getSecureChannelKey () const |
Returns an unique key to identify the secure channel in the session manager. More... | |
virtual OpcUa_Boolean | isUserAnAdmin () const |
Flag indicating if the session user has administration rights. More... | |
void | setIsUserAnAdmin (OpcUa_Boolean isAdmin) |
Method used to set the isUserAnAdmin flag. More... | |
Public Member Functions inherited from ReferenceCounter | |
ReferenceCounter () | |
construction | |
virtual | ~ReferenceCounter () |
destruction | |
Static Public Member Functions | |
static OpcUa_UInt64 | getSecureChannelKey (UaEndpoint *pEndpoint, OpcUa_UInt32 uSecureChannelId) |
Returns an unique key to identify the secure channel in the session manager. More... | |
Protected Member Functions | |
Session () | |
Prohibit use of default constructor. | |
virtual | ~Session () |
Prohibit use of destructor. More... | |
Class used to manage a client session in the server.
It manages all Session relevant settings including the lifetime of the Session. The object is reference counted and can not be deleted directly.
|
protectedvirtual |
Prohibit use of destructor.
Prohibit use of default destructor.
Session::Session | ( | OpcUa_Int32 | sessionId, |
const UaNodeId & | authenticationToken | ||
) |
construction
sessionId | the id of the current Session. |
authenticationToken | Secret session Id created by the server application. |
|
virtual |
Activate the session.
Sets the Session to a valid state.
uSecureChannelId | The if of the secure channel used for the session. |
pUserIdentityToken | The passed object can be an instance UaUserIdentityTokenAnonymous for the user type Anonymous and UaUserIdentityTokenUserPassword for the user type UserPassword |
localeIDs | List of locale ids in priority order for localized strings. |
|
virtual |
Close the session This method is called if the Client closes the Session with the service CloseSession or if the internal clean up routine is closing the Session after a Session timeout.
deleteSubscriptions | Indicates if the subscriptions should be deleted by the server |
Reimplemented in UaSession.
void Session::getAuthenticationToken | ( | OpcUa_NodeId & | authenticationToken | ) | const |
Returns the private ID of the session This ID is private to the client and server application and must be kept private inside the management of the session in the client and server code.
authenticationToken | Secret session Id created by the server application. |
|
virtual |
Get a browse continuation point.
pCP | the continuation point as ByteString. |
const OpcUa_ByteString * Session::getClientCertificate | ( | ) | const |
Returns the client certificate of the client created the session.
UaString Session::getClientUserId | ( | ) | const |
Returns the client user id for the session.
|
virtual |
Get a history read continuation point.
pCP | the continuation point as ByteString. |
OpcUa_Int32 Session::getIntegerSessionId | ( | ) | const |
Returns the integer ID of the session.
UaString Session::getLocalId | ( | ) | const |
Get the first local Id used for the session.
const UaStringArray * Session::getLocalIds | ( | ) | const |
Get the list of all local Ids used for the session.
|
virtual |
Get the maximum number of browse continuation points.
|
virtual |
Get a query continuation point.
pCP | the continuation point as ByteString. |
OpcUa_UInt32 Session::getSecureChannelId | ( | ) | const |
Returns the ID of the SecureChannel assigned to the session.
|
virtual |
Returns an unique key to identify the secure channel in the session manager.
Reimplemented in UaSession.
|
static |
Returns an unique key to identify the secure channel in the session manager.
pEndpoint | The endpoint used to create the secure channel. |
uSecureChannelId | The id of the sessions secure channel. |
UaString Session::getSessionName | ( | ) | const |
Returns the name of the session.
void Session::getSessionNodeId | ( | OpcUa_NodeId & | sessionId | ) | const |
Returns the NodeId of the session.
sessionId | the NodeId of the current Session. |
OpcUa_UInt32 Session::getSessionTimeout | ( | ) | const |
Returns the timeout of the session.
|
virtual |
Checks if the session timeout expired.
OpcUa_Boolean Session::isActivated | ( | ) |
Get flag indicating if session was activated.
|
virtual |
Check if the secure channel assigned to the session is valid.
|
virtual |
Flag indicating if the session user has administration rights.
This flag is used internally in the SDK to detect if the user has rights to view critical diagnostic information like session or subscription related information. It may also be used to check if a user is allowed to execute configuration actions. The default value is false. It must be set by the custom user validation code.
|
virtual |
Checks if the session is valid.
UaDateTime Session::lastTimeoutReset | ( | ) |
Get time the session timeout was reset.
|
virtual |
Checks if the session must be deleted.
|
virtual |
Open the session.
Sets the Session timeout and the client name. But the Session is still not valid. An additional call to activateSession is necessary to make the Session valid.
sessionName | Displayable string that identifies the OPC client session. |
clientCertificate | Certificate of the OPC client application. |
sessionTimeout | Maximum number of milliseconds that the session should remain open without activity. |
|
virtual |
Queue a browse continuation point.
pBCP | the actual BrowseContext as a pointer. |
pCP | the continuation point as ByteString. |
|
virtual |
Queue a history read continuation point.
pHistoryReadCP | the actual continuation point data as a pointer. |
pCP | the continuation point as ByteString. |
|
virtual |
Queue a query continuation point.
pBCP | the actual QueryContext as a pointer. |
pCP | the continuation point as ByteString. |
void Session::resetTimeout | ( | ) |
Reset session timeout.
This method is called every time a valid service call is executed in the Session context.
void Session::setClientUserId | ( | const UaString & | sClientUserId | ) |
Sets the client user id for the session.
void Session::setIsUserAnAdmin | ( | OpcUa_Boolean | isAdmin | ) |
Method used to set the isUserAnAdmin flag.
It can be used by custom user validation code to set the general flag.
|
virtual |
Invalidate the secure channel assigned to the session.
Reimplemented in UaSession.