C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
ServiceContext Class Reference

This class provides the context for a Service invocation. More...

#include <opcuatypes.h>

Public Member Functions

 ServiceContext ()
 Construction.
 
virtual ~ServiceContext ()
 Destruction.
 
 ServiceContext (const ServiceContext &)
 Copy constructor.
 
ServiceContextoperator= (const ServiceContext &)
 Assignment operator.
 
SessionpSession () const
 Returns the Session object. More...
 
const SessionUserContextpSessionUserContext () const
 Returns the SessionUserContext object. More...
 
OpcUa_UInt32 timeoutHint () const
 Returns the timeout hint in milliseconds set by the client for this service invocation. More...
 
UaDateTime receiveTime () const
 Returns the timestamp the server received this service invocation. More...
 
UaDateTime clientTime () const
 Returns the timestamp set by the client for this service invocation. More...
 
OpcUa_UInt32 returnDiagnostics () const
 Returns the client requested diagnostic level for this service invocation. More...
 
OpcUa_UInt32 requestHandle () const
 Returns the request handle set by the client for this service invocation.
 
UaString clientAuditEntryId () const
 Returns the AuditEntryId set by the client for this service invocation.
 
void setContext (Session *pSession, const OpcUa_RequestHeader &header)
 Sets the Service context with information provided by the client in the request header and with the session object related to the request. More...
 
void setSession (Session *pSession)
 Sets the Session object. More...
 
void setReturnDiagnostics (OpcUa_UInt32 returnDiagnostics)
 Set the client requested diagnostic level for this service invocation. More...
 
void setTimeoutHint (OpcUa_UInt32 timeoutHint)
 Set the client requested timeout hint for the service call. More...
 
void setNodeManagementMutex (UaMutex *pMutex)
 Sets the mutex for the node list in a NodeManagerUaNode for locking in UaNodes when accessing the reference lists or other nodes to avoid configuration changes during this time. More...
 
UaMutexgetNodeManagementMutex () const
 Gets the mutex for the node list in a NodeManagerUaNode for locking in UaNodes when accessing the reference lists or other nodes. More...
 

Detailed Description

This class provides the context for a Service invocation.

This context contains the Session object used for the Service call and the general client side settings like the timeout hint and the level of requested diagnostic information.

Member Function Documentation

UaDateTime ServiceContext::clientTime ( ) const
inline

Returns the timestamp set by the client for this service invocation.

UaMutex * ServiceContext::getNodeManagementMutex ( ) const

Gets the mutex for the node list in a NodeManagerUaNode for locking in UaNodes when accessing the reference lists or other nodes.

This mutex is used to avoid configuration changes during this time.

Returns
Mutex for the NodeManagers node list or NULL if the mutex was not set with setNodeManagementMutex.
Session* ServiceContext::pSession ( ) const
inline

Returns the Session object.

The Session object is reference counted. The Session is valid until the client has closed the Session or it timed out. If the Session pointer is stored in user objects, these objects must add their own reference.

const SessionUserContext * ServiceContext::pSessionUserContext ( ) const

Returns the SessionUserContext object.

The SessionUserContext is only valid as long as the session is valid. Used internally by the SDK.

UaDateTime ServiceContext::receiveTime ( ) const
inline

Returns the timestamp the server received this service invocation.

OpcUa_UInt32 ServiceContext::returnDiagnostics ( ) const
inline

Returns the client requested diagnostic level for this service invocation.

Bit mask that defines the diagnostic information to be returned from the server.
Bit Value — Diagnostics to return -----------— Define
0x0000 0001 - ServiceLevel / SymbolicId -------— OpcUa_DiagnosticsMasks_ServiceSymbolicId
0x0000 0002 - ServiceLevel / LocalizedText ----— OpcUa_DiagnosticsMasks_ServiceLocalizedText
0x0000 0004 - ServiceLevel / AdditionalInfo ---— OpcUa_DiagnosticsMasks_ServiceAdditionalInfo
0x0000 0008 - ServiceLevel / Inner StatusCode -— OpcUa_DiagnosticsMasks_ServiceInnerStatusCode
0x0000 0010 - ServiceLevel / Inner Diagnostics — OpcUa_DiagnosticsMasks_ServiceInnerDiagnostics
0x0000 0020 - OperationLevel / SymbolicId -----— OpcUa_DiagnosticsMasks_OperationSymbolicId
0x0000 0040 - OperationLevel / LocalizedText --— OpcUa_DiagnosticsMasks_OperationLocalizedText
0x0000 0080 - OperationLevel / AdditionalInfo -— OpcUa_DiagnosticsMasks_OperationAdditionalInfo
0x0000 0100 - OperationLevel / Inner StatusCode – OpcUa_DiagnosticsMasks_OperationInnerStatusCode
0x0000 0200 - OperationLevel / Inner Diagnostics - OpcUa_DiagnosticsMasks_OperationInnerDiagnostics

void ServiceContext::setContext ( Session pSession,
const OpcUa_RequestHeader header 
)

Sets the Service context with information provided by the client in the request header and with the session object related to the request.

Used internally by the SDK

Parameters
[in]pSessionInterface pointer of the Session object The session was created by the ServerConfig object in the Method createSession. A vendor specific implementation can create a derived Session class with vendor specific information.
[in]headerThe requested header provided by the client for the service call
void ServiceContext::setNodeManagementMutex ( UaMutex pMutex)

Sets the mutex for the node list in a NodeManagerUaNode for locking in UaNodes when accessing the reference lists or other nodes to avoid configuration changes during this time.

Parameters
[in]pMutexMutex for the NodeManagers node list
void ServiceContext::setReturnDiagnostics ( OpcUa_UInt32  returnDiagnostics)

Set the client requested diagnostic level for this service invocation.

Used internally by the SDK

Parameters
[in]returnDiagnosticsRequested diagnostic level
void ServiceContext::setSession ( Session pSession)

Sets the Session object.

Used internally by the SDK

Parameters
[in]pSessionInterface pointer of the Session object The session was created by the ServerConfig object in the Method createSession. A vendor specific implementation can create a derived Session class with vendor specific information.
void ServiceContext::setTimeoutHint ( OpcUa_UInt32  timeoutHint)

Set the client requested timeout hint for the service call.

Parameters
[in]timeoutHintTimout hint in milliseconds
OpcUa_UInt32 ServiceContext::timeoutHint ( ) const
inline

Returns the timeout hint in milliseconds set by the client for this service invocation.

A client side stack returns an timeout error to the caller after the timeout expired.


The documentation for this class was generated from the following files: