#include <session.h>

Inheritance diagram for Session:
Collaboration diagram for Session:

List of all members.

Public Member Functions

 Session (OpcUa_Int32 sessionId, const UaNodeId &authenticationToken)
virtual UaStatus open (const UaString &sessionName, const UaByteString clientCertificate, OpcUa_UInt32 sessionTimeout)
virtual UaStatus activate (OpcUa_UInt32 uSecureChannelId, UaUserIdentityToken *pUserIdentityToken, const UaStringArray &localeIDs)
virtual UaStatus close (OpcUa_Boolean deleteSubscriptions)
virtual OpcUa_Boolean hasExpired () const
virtual UaStatus isValid (OpcUa_UInt32 uSecureChannelId)
virtual void setInvalid ()
virtual OpcUa_Boolean mustDelete ()
virtual OpcUa_Boolean isSecureChannelValid ()
virtual void setSecureChannelInvalid ()
virtual UaStatus queueBrowseContext (BrowseContext *pBCP, OpcUa_ByteString *pCP)
virtual BrowseContextgetBrowseContext (OpcUa_ByteString *pCP)
virtual UaStatus queueHistoryReadCP (HistoryReadCPUserDataBase *pHistoryReadCP, OpcUa_ByteString *pCP)
virtual HistoryReadCPUserDataBasegetHistoryReadCP (OpcUa_ByteString *pCP)
void resetTimeout ()
void getSessionNodeId (OpcUa_NodeId &sessionId) const
OpcUa_Int32 getIntegerSessionId () const
void getAuthenticationToken (OpcUa_NodeId &authenticationToken) const
OpcUa_UInt32 getSessionTimeout () const
UaString getSessionName () const
OpcUa_UInt32 getSecureChannelId () const
const OpcUa_ByteString * getClientCertificate () const
UaString getLocalId () const
const UaStringArray * getLocalIds () const
UaString getClientUserId () const

Protected Member Functions

 Session ()
virtual ~Session ()

Detailed Description

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.


Constructor & Destructor Documentation

Session::Session (  ) [protected]

Prohibit use of default constructor

Session::~Session (  ) [protected, virtual]

Prohibit use of destructor

Prohibit use of default destructor

Session::Session ( OpcUa_Int32  sessionId,
const UaNodeId authenticationToken 
)

construction

Parameters:
sessionIdthe id of the current Session.
authenticationTokenSecret session Id created by the server application.

Member Function Documentation

UaStatus Session::activate ( OpcUa_UInt32  uSecureChannelId,
UaUserIdentityToken pUserIdentityToken,
const UaStringArray &  localeIDs 
) [virtual]

Activate the session. Sets the Session to a valid state.

Parameters:
uSecureChannelIdThe if of the secure channel used for the session.
pUserIdentityTokenThe passed object can be an instance UaUserIdentityTokenAnonymous for the user type Anonymous and UaUserIdentityTokenUserPassword for the user type UserPassword
localeIDsList of locale ids in priority order for localized strings.
Returns:
Error code
UaStatus Session::close ( OpcUa_Boolean  deleteSubscriptions ) [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

Parameters:
deleteSubscriptionsIndicates if the subscriptions should be deleted by the server
Returns:
Error code

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.

Parameters:
authenticationTokenSecret session Id created by the server application.
BrowseContext * Session::getBrowseContext ( OpcUa_ByteString *  pCP ) [virtual]

Get a browse continuation point

Parameters:
pCPthe continuationpoint as ByteString.
Returns:
a browse continuation point.
const OpcUa_ByteString * Session::getClientCertificate (  ) const

Returns the client certificate of the client created the session

Returns:
Client certificate
UaString Session::getClientUserId (  ) const

Returns the client user id for the session.

HistoryReadCPUserDataBase * Session::getHistoryReadCP ( OpcUa_ByteString *  pCP ) [virtual]

Get a history read continuation point

Parameters:
pCPthe continuationpoint as ByteString.
Returns:
The history read continuation point data pointer.
OpcUa_Int32 Session::getIntegerSessionId (  ) const

Returns the integer ID of the session

Returns:
Integer session ID of the session object
UaString Session::getLocalId (  ) const

Get the first local Id used for the session

Returns:
The first localId used for the session as UaString.
const UaStringArray * Session::getLocalIds (  ) const

Get the list of all local Ids used for the session

Returns:
The list of all localIds used for the session as const UaStringArray*.
OpcUa_UInt32 Session::getSecureChannelId (  ) const

Returns the ID of the SecureChannel assigned to the session

Returns:
SecureChannel ID used for the session object
UaString Session::getSessionName (  ) const

Returns the name of the session

Returns:
Name of the session object
void Session::getSessionNodeId ( OpcUa_NodeId &  sessionId ) const

Returns the NodeId of the session

Parameters:
sessionIdthe NodeId of the current Session.
OpcUa_UInt32 Session::getSessionTimeout (  ) const

Returns the timeout of the session

Returns:
Timeout of the session object
OpcUa_Boolean Session::hasExpired (  ) const [virtual]

Checks if the session timeout expired

Returns:
TRUE if session timeout expired FALSE if not
OpcUa_Boolean Session::isSecureChannelValid (  ) [virtual]

Check if the secure channel assigned to the session is valid.

Returns:
TRUE if valid FALSE if not.
UaStatus Session::isValid ( OpcUa_UInt32  uSecureChannelId ) [virtual]

Checks if the session is valid

Returns:
Error code.
OpcUa_Boolean Session::mustDelete (  ) [virtual]

Checks if the session must be deleted

Returns:
TRUE if session is to delete FALSE if not
UaStatus Session::open ( const UaString sessionName,
const UaByteString  clientCertificate,
OpcUa_UInt32  sessionTimeout 
) [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.

Parameters:
sessionNameDisplayable string that identifies the OPC client session.
clientCertificateCertificate of the OPC client application.
sessionTimeoutMaximum number of milliseconds that the session should remain open without activity.
See also:
activate
Returns:
Error code
UaStatus Session::queueBrowseContext ( BrowseContext pBCP,
OpcUa_ByteString *  pCP 
) [virtual]

Queue a browse continuation point

Parameters:
pBCPthe actual Browsecontext as a pointer.
pCPthe continuationpoint as ByteString.
Returns:
Error code
UaStatus Session::queueHistoryReadCP ( HistoryReadCPUserDataBase pHistoryReadCP,
OpcUa_ByteString *  pCP 
) [virtual]

Queue a history read continuation point

Parameters:
pHistoryReadCPthe actual continuation point data as a pointer.
pCPthe continuationpoint as ByteString.
Returns:
Error code
void Session::resetTimeout (  )

Reset session timeout. This method is called every time a valid service call is executed in the Session context.

void Session::setInvalid (  ) [virtual]

Set the state of the session to invalid

void Session::setSecureChannelInvalid (  ) [virtual]

Invalidate the secure channel assigned to the session.

Reimplemented in UaSession.


The documentation for this class was generated from the following files:
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/session.h
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/session.cpp