C# Class Opc.Ua.Server.SessionManager

A generic session manager object for a server.
Inheritance: ISessionManager, IDisposable
ファイルを表示 Open project: OPCFoundation/UA-.NET Class Usage Examples

Public Methods

Method Description
ActivateSession ( OperationContext context, NodeId authenticationToken, SignatureData clientSignature, List clientSoftwareCertificates, ExtensionObject userIdentityToken, SignatureData userTokenSignature, StringCollection localeIds, byte &serverNonce ) : bool

Activates an existing session

CloseSession ( NodeId sessionId ) : void

Closes the specifed session.

This method should not throw an exception if the session no longer exists.

CreateSession ( OperationContext context, X509Certificate2 serverCertificate, string sessionName, byte clientNonce, ApplicationDescription clientDescription, string endpointUrl, X509Certificate2 clientCertificate, double requestedSessionTimeout, uint maxResponseMessageSize, NodeId &sessionId, NodeId &authenticationToken, byte &serverNonce, double &revisedSessionTimeout ) : Session

Creates a new session.

Dispose ( ) : void

Frees any unmanaged resources.

GetSessions ( ) : IList

Returns all of the sessions known to the session manager.

SessionManager ( IServerInternal server, ApplicationConfiguration configuration ) : System

Initializes the manager with its configuration.

Shutdown ( ) : void

Stops the session manager and closes all sessions.

Startup ( ) : void

Starts the session manager.

ValidateRequest ( RequestHeader requestHeader, RequestType requestType ) : OperationContext

Validates request header and returns a request context.

This method verifies that the session id valid and that it uses secure channel id associated with with current thread. It also verifies that the timestamp is not too and that the sequence number is not out of order (update requests only).

Protected Methods

Method Description
CreateSession ( OperationContext context, IServerInternal server, X509Certificate2 serverCertificate, NodeId sessionCookie, byte serverNonce, string sessionName, ApplicationDescription clientDescription, string endpointUrl, X509Certificate2 clientCertificate, double sessionTimeout, uint maxResponseMessageSize, int maxRequestAge, int maxContinuationPoints ) : Session

Creates a new instance of a session.

Dispose ( bool disposing ) : void

An overrideable version of the Dispose.

RaiseSessionEvent ( Session session, SessionEventReason reason ) : void

Raises an event related to a session.

Private Methods

Method Description
MonitorSessions ( object data ) : void

Periodically checks if the sessions have timed out.

Method Details

ActivateSession() public method

Activates an existing session
public ActivateSession ( OperationContext context, NodeId authenticationToken, SignatureData clientSignature, List clientSoftwareCertificates, ExtensionObject userIdentityToken, SignatureData userTokenSignature, StringCollection localeIds, byte &serverNonce ) : bool
context OperationContext
authenticationToken NodeId
clientSignature SignatureData
clientSoftwareCertificates List
userIdentityToken ExtensionObject
userTokenSignature SignatureData
localeIds StringCollection
serverNonce byte
return bool

CloseSession() public method

Closes the specifed session.
This method should not throw an exception if the session no longer exists.
public CloseSession ( NodeId sessionId ) : void
sessionId NodeId
return void

CreateSession() protected method

Creates a new instance of a session.
protected CreateSession ( OperationContext context, IServerInternal server, X509Certificate2 serverCertificate, NodeId sessionCookie, byte serverNonce, string sessionName, ApplicationDescription clientDescription, string endpointUrl, X509Certificate2 clientCertificate, double sessionTimeout, uint maxResponseMessageSize, int maxRequestAge, int maxContinuationPoints ) : Session
context OperationContext
server IServerInternal
serverCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
sessionCookie NodeId
serverNonce byte
sessionName string
clientDescription ApplicationDescription
endpointUrl string
clientCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
sessionTimeout double
maxResponseMessageSize uint
maxRequestAge int
maxContinuationPoints int
return Session

CreateSession() public method

Creates a new session.
public CreateSession ( OperationContext context, X509Certificate2 serverCertificate, string sessionName, byte clientNonce, ApplicationDescription clientDescription, string endpointUrl, X509Certificate2 clientCertificate, double requestedSessionTimeout, uint maxResponseMessageSize, NodeId &sessionId, NodeId &authenticationToken, byte &serverNonce, double &revisedSessionTimeout ) : Session
context OperationContext
serverCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
sessionName string
clientNonce byte
clientDescription ApplicationDescription
endpointUrl string
clientCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
requestedSessionTimeout double
maxResponseMessageSize uint
sessionId NodeId
authenticationToken NodeId
serverNonce byte
revisedSessionTimeout double
return Session

Dispose() public method

Frees any unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

An overrideable version of the Dispose.
protected Dispose ( bool disposing ) : void
disposing bool
return void

GetSessions() public method

Returns all of the sessions known to the session manager.
public GetSessions ( ) : IList
return IList

RaiseSessionEvent() protected method

Raises an event related to a session.
protected RaiseSessionEvent ( Session session, SessionEventReason reason ) : void
session Session
reason SessionEventReason
return void

SessionManager() public method

Initializes the manager with its configuration.
public SessionManager ( IServerInternal server, ApplicationConfiguration configuration ) : System
server IServerInternal
configuration ApplicationConfiguration
return System

Shutdown() public method

Stops the session manager and closes all sessions.
public Shutdown ( ) : void
return void

Startup() public method

Starts the session manager.
public Startup ( ) : void
return void

ValidateRequest() public method

Validates request header and returns a request context.
This method verifies that the session id valid and that it uses secure channel id associated with with current thread. It also verifies that the timestamp is not too and that the sequence number is not out of order (update requests only).
public ValidateRequest ( RequestHeader requestHeader, RequestType requestType ) : OperationContext
requestHeader RequestHeader
requestType RequestType
return OperationContext