Session Class Reference

Derived from ReferenceCounter. This class manages the Session. It creates new Session or checks wether a Session has expired or not. Here you can manage all Session relevant things. It is not possible to create plane copies of this Class. It is also not possible to use the default constructor and destructor. More...

#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)
UaStatus open (const UaString &sessionName, const UaByteString clientCertificate, OpcUa_UInt32 sessionTimeout)
UaStatus activate (OpcUa_UInt32 uSecureChannelId, const UaStringArray &localeIDs)
UaStatus close (OpcUa_Boolean deleteSubscriptions)
void resetTimeout ()
OpcUa_Boolean hasExpired () const
UaStatus isValid (OpcUa_UInt32 uSecureChannelId)
void setInvalid ()
OpcUa_Boolean mustDelete ()
void getSessionId (OpcUa_NodeId &sessionId) const
OpcUa_Int32 getIntegerSessionId () const
void getAuthenticationToken (OpcUa_NodeId &authenticationToken) const
OpcUa_UInt32 getSecureChannelId () const
const OpcUa_ByteString * getClientCertificate () const
void setServerNonce (const OpcUa_ByteString *pServerNonce)
const OpcUa_ByteString * getServerNonce () const
UaStatus queuePublishRequest (UaPublishContext *pUaPublishContext)
UaPublishContextgetPublishRequest ()
UaStatus queueSubscriptionForPublish (UaSubscription *pSubscription)
UaStatus queueBrowseContext (BrowseContext *pBCP, OpcUa_ByteString *pCP)
BrowseContextgetBrowseContext (OpcUa_ByteString *pCP)
UaStatus queueHistoryReadCP (HistoryReadCPUserDataBase *pHistoryReadCP, OpcUa_ByteString *pCP)
HistoryReadCPUserDataBasegetHistoryReadCP (OpcUa_ByteString *pCP)
UaString getLocalId ()
UaStatus subscriptionCreated (UaSubscription *pSubscription)
UaStatus subscriptionInvalidated (UaSubscription *pSubscription)
RegisteredNodegetRegisteredNode (OpcUa_UInt32 handle) const
OpcUa_UInt32 addRegisteredNode (RegisteredNode *pRegisteredNode)
UaStatusCode removeRegisteredNode (OpcUa_UInt32 handle)
void lockSendResponse ()
void unlockSendResponse ()
void startingServiceProcessing ()
void finishedServiceProcessing ()
OpcUa_UInt32 activeServiceCount () const
OpcUa_Boolean isSecureChannelValid ()
void setSecureChannelInvalid ()

Protected Member Functions

virtual ~Session ()

Detailed Description

Derived from ReferenceCounter. This class manages the Session. It creates new Session or checks wether a Session has expired or not. Here you can manage all Session relevant things. It is not possible to create plane copies of this Class. It is also not possible to use the default constructor and destructor.

Session


Constructor & Destructor Documentation

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

Prohibit use of default destructor

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

construction

Parameters:
sessionId the id of the current Session.
authenticationToken Secret session Id created by the server application.


Member Function Documentation

UaStatus Session::open ( const UaString sessionName,
const UaByteString  clientCertificate,
OpcUa_UInt32  sessionTimeout 
)

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:
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.
See also:
activate
Returns:
Error code

UaStatus Session::activate ( OpcUa_UInt32  uSecureChannelId,
const UaStringArray &  localeIDs 
)

Activate the session.

Parameters:
uSecureChannelId Sets the Session to a valid state.
localeIDs List of locale ids in priority order for localized strings.
Returns:
Error code

UaStatus Session::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

Parameters:
deleteSubscriptions Indicates if the subscriptions should be deleted by the server
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.

OpcUa_Boolean Session::hasExpired (  )  const

Checks if the session timeout expired

Returns:
TRUE if session timeout expired FALSE if not

UaStatus Session::isValid ( OpcUa_UInt32  uSecureChannelId  ) 

Checks if the session is valid

Returns:
Error code.

void Session::setInvalid (  ) 

Set the state of the session to invalid

OpcUa_Boolean Session::mustDelete (  ) 

Checks if the session must be deleted

Returns:
TRUE if session is to delete FALSE if not

void Session::getSessionId ( OpcUa_NodeId &  sessionId  )  const

Returns the ID of the session

Parameters:
sessionId the Id of the current Session.

OpcUa_Int32 Session::getIntegerSessionId (  )  const

Returns the integer ID of the session

Returns:
Integer session ID of the session object

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:
authenticationToken Secret session Id created by the server application.

OpcUa_UInt32 Session::getSecureChannelId (  )  const

Returns the ID of the SecureChannel assigned to the session

Returns:
SecureChannel ID used for the session object

const OpcUa_ByteString * Session::getClientCertificate (  )  const

Returns the client certificate of the client created the session

Returns:
Client certificate

void Session::setServerNonce ( const OpcUa_ByteString *  pServerNonce  ) 

Set the last created server nonce The server nonce gets created during CreateSession or ActiveSession

Parameters:
pServerNonce a pointer to the ServerNonce information.

const OpcUa_ByteString * Session::getServerNonce (  )  const

Returns the last created server nonce The server nonce gets created during CreateSession or ActiveSession

Returns:
a pointer to the ServerNonce information.

UaStatus Session::queuePublishRequest ( UaPublishContext pUaPublishContext  ) 

Queue a Publish context for the session

Parameters:
pUaPublishContext a pointer to the information of the PublishContext.
Returns:
Error code

UaPublishContext * Session::getPublishRequest (  ) 

Returns a Publish context if one is available for the session

Returns:
a Publish context for the session.

UaStatus Session::queueSubscriptionForPublish ( UaSubscription pSubscription  ) 

Queue a subscriptions that is waiting for a publish

Parameters:
pSubscription a pointer to the information of the Subscription.
Returns:
Error code

UaStatus Session::queueBrowseContext ( BrowseContext pBCP,
OpcUa_ByteString *  pCP 
)

Queue a browse continuation point

Parameters:
pBCP the actual Browsecontext as a pointer.
pCP the continuationpoint as ByteString.
Returns:
Error code

BrowseContext * Session::getBrowseContext ( OpcUa_ByteString *  pCP  ) 

Get a browse continuation point

Parameters:
pCP the continuationpoint as ByteString.
Returns:
a browse continuation point.

UaStatus Session::queueHistoryReadCP ( HistoryReadCPUserDataBase pHistoryReadCP,
OpcUa_ByteString *  pCP 
)

Queue a history read continuation point

Parameters:
pHistoryReadCP the actual continuation point data as a pointer.
pCP the continuationpoint as ByteString.
Returns:
Error code

HistoryReadCPUserDataBase * Session::getHistoryReadCP ( OpcUa_ByteString *  pCP  ) 

Get a history read continuation point

Parameters:
pCP the continuationpoint as ByteString.
Returns:
The history read continuation point data pointer.

UaString Session::getLocalId (  ) 

Get the local Id used for the session

Returns:
the localId used for the session as UaString.

UaStatus Session::subscriptionCreated ( UaSubscription pSubscription  ) 

A new subscription in the session context was created

Parameters:
pSubscription a pointer to the information of the Subscription.
Returns:
Error code.

UaStatus Session::subscriptionInvalidated ( UaSubscription pSubscription  ) 

A subscription in the session context was invalidated

Parameters:
pSubscription a pointer to the information of the Subscription.
Returns:
Error code

RegisteredNode * Session::getRegisteredNode ( OpcUa_UInt32  handle  )  const

Returns the registered node for a handle

Parameters:
handle Handle for the node.
Returns:
Registered Node Information

OpcUa_UInt32 Session::addRegisteredNode ( RegisteredNode pRegisteredNode  ) 

Adds a registered node and returns a handle

Parameters:
pRegisteredNode the actual registered Node to add.
Returns:
Handle for the node

UaStatusCode Session::removeRegisteredNode ( OpcUa_UInt32  handle  ) 

Removes a registered node

Parameters:
handle Handle for the node.

void Session::lockSendResponse (  ) 

Lock access to UA Stack EndSendResponse method.

void Session::unlockSendResponse (  ) 

Unlock access to UA Stack EndSendResponse method.

void Session::startingServiceProcessing (  ) 

Called to increment the active service counter

void Session::finishedServiceProcessing (  ) 

Called to decrement the active service counter

OpcUa_UInt32 Session::activeServiceCount (  )  const

Get count of Service currently processed by the server

Returns:
the number of actual available Services.

OpcUa_Boolean Session::isSecureChannelValid (  ) 

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

Returns:
TRUE if valid FALSE if not.

void Session::setSecureChannelInvalid (  ) 

Invalidate the secure channel assigned to the session.


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