Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ServerSession

A Server session object.

from OPCUA Spec 1.02:

  • Sessions are created to be independent of the underlying communications connection. Therefore, if a communication connection fails, the Session is not immediately affected. The exact mechanism to recover from an underlying communication connection error depends on the SecureChannel mapping as described in Part 6.

  • Sessions are terminated by the Server automatically if the Client fails to issue a Service request on the Session within the timeout period negotiated by the Server in the CreateSession Service response. This protects the Server against Client failures and against situations where a failed underlying connection cannot be re-established.

  • Clients shall be prepared to submit requests in a timely manner to prevent the Session from closing automatically.

  • Clients may explicitly terminate Sessions using the CloseSession Service.

  • When a Session is terminated, all outstanding requests on the Session are aborted and BadSessionClosed StatusCodes are returned to the Client. In addition, the Server deletes the entry for the Client from its SessionDiagnosticsArray Variable and notifies any other Clients who were subscribed to this entry.

Hierarchy

  • EventEmitter
    • ServerSession

Implements

  • ISubscriber
  • ISessionBase

Index

Constructors

constructor

  • new ServerSession(parent: any, sessionTimeout: number): ServerSession

Properties

__status

__status: string = ""

Optional _watchDog

_watchDog: WatchDog

Optional _watchDogData

_watchDogData: IWatchdogData2

authenticationToken

authenticationToken: NodeId

Optional channel

channel: ServerSecureChannelLayer

Optional channelId

channelId: number | null

Optional clientDescription

clientDescription: ApplicationDescription

continuationPointManager

continuationPointManager: ContinuationPointManager

creationDate

creationDate: Date

nodeId

nodeId: NodeId

Optional nonce

nonce: Buffer

parent

parent: any

publishEngine

Optional sessionDiagnostics

sessionDiagnostics: UASessionDiagnostics

sessionName

sessionName: string = ""

sessionObject

sessionObject: any

sessionTimeout

sessionTimeout: number

Optional subscriptionDiagnosticsArray

subscriptionDiagnosticsArray: UADynamicVariableArray<SubscriptionDiagnosticsDataType>

Optional userIdentityToken

userIdentityToken: UserIdentityToken

Static defaultMaxListeners

defaultMaxListeners: number

Static maxPublishRequestInQueue

maxPublishRequestInQueue: number = 100

Static registry

registry: ObjectRegistry = new ObjectRegistry()

Accessors

aborted

  • get aborted(): boolean

addressSpace

  • get addressSpace(): AddressSpace

clientConnectionTime

  • get clientConnectionTime(): Date

clientLastContactTime

  • get clientLastContactTime(): number

cumulatedSubscriptionCount

  • get cumulatedSubscriptionCount(): number

currentMonitoredItemCount

  • get currentMonitoredItemCount(): number

currentPublishRequestInQueue

  • get currentPublishRequestInQueue(): number

currentSubscriptionCount

  • get currentSubscriptionCount(): number

status

  • get status(): string
  • set status(value: string): void

Methods

_attach_channel

  • _attach_channel(channel: ServerSecureChannelLayer): void

_detach_channel

  • _detach_channel(): void

_exposeSubscriptionDiagnostics

  • _exposeSubscriptionDiagnostics(subscription: Subscription): void

_unexposeSubscriptionDiagnostics

  • _unexposeSubscriptionDiagnostics(subscription: Subscription): void

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

close

  • close(deleteSubscriptions: boolean, reason: string): void
  • close a ServerSession, this will also delete the subscriptions if the flag is set.

    Spec extract:

    If a Client invokes the CloseSession Service then all Subscriptions associated with the Session are also deleted if the deleteSubscriptions flag is set to TRUE. If a Server terminates a Session for any other reason, Subscriptions associated with the Session, are not deleted. Each Subscription has its own lifetime to protect against data loss in the case of a Session termination. In these cases, the Subscription can be reassigned to another Client before its lifetime expires.

    method

    close

    Parameters

    • deleteSubscriptions: boolean

      : should we delete subscription ?

    • reason: string

    Returns void

createSubscription

deleteSubscription

  • deleteSubscription(subscriptionId: number): StatusCode

dispose

  • dispose(): void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getSessionDiagnosticsArray

  • getSessionDiagnosticsArray(): UADynamicVariableArray<SessionDiagnosticsDataType>

getSubscription

  • getSubscription(subscriptionId: number): Subscription | null

incrementRequestErrorCounter

  • incrementRequestErrorCounter(counterName: string): void

incrementRequestTotalCounter

  • incrementRequestTotalCounter(counterName: string): void

incrementTotalRequestCount

  • incrementTotalRequestCount(): void

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

Private onClientSeen

  • onClientSeen(currentTime: Date): void

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

registerNode

  • registerNode(nodeId: NodeId): any

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

resolveRegisteredNode

  • resolveRegisteredNode(aliasNodeId: NodeId): NodeId

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

unRegisterNode

  • unRegisterNode(aliasNodeId: NodeId): void

updateClientLastContactTime

  • updateClientLastContactTime(currentTime: Date): void

Private watchdogReset

  • watchdogReset(): void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc