Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Subscription

The Subscription class used in the OPCUA server side.

Hierarchy

  • EventEmitter
    • Subscription

Index

Constructors

constructor

Properties

Optional $session

$session: ServerSession

id

id: number

lifeTimeCount

lifeTimeCount: number

The life time count defines how many times the publish interval expires without having a connection to the client to deliver data. If the life time count reaches maxKeepAliveCount, the subscription will automatically terminate. OPCUA Spec: The life-time count shall be a minimum of three times the keep keep-alive count.

Note: this has to be interpreted as without having a PublishRequest available

default

1

maxKeepAliveCount

maxKeepAliveCount: number

The keep alive count defines how many times the publish interval need to expires without having notifications available before the server send an empty message. OPCUA Spec says: a value of 0 is invalid.

default

10

maxNotificationsPerPublish

maxNotificationsPerPublish: number

The maximum number of notifications that the Client wishes to receive in a single Publish response. A value of zero indicates that there is no limit. The number of notifications per Publish is the sum of monitoredItems in the DataChangeNotification and events in the EventNotificationList.

property

maxNotificationsPerPublish

default

0

messageSent

messageSent: boolean

priority

priority: number

publishEngine

publishEngine: IServerPublishEngine

publishingEnabled

publishingEnabled: boolean

publishingInterval

publishingInterval: number

the Subscription publishing interval

default

1000

sessionId

sessionId: NodeId

state

state: any

subscriptionDiagnostics

subscriptionDiagnostics: SubscriptionDiagnosticsDataTypePriv

Static defaultMaxListeners

defaultMaxListeners: number

Static defaultPublishingInterval

defaultPublishingInterval: number = 1000

Static maximumPublishingInterval

maximumPublishingInterval: number = 1000 * 60 * 60 * 24 * 15

Static minimumPublishingInterval

minimumPublishingInterval: number = 50

Static registry

registry: ObjectRegistry = new ObjectRegistry()

Accessors

aborted

  • get aborted(): boolean

disabledMonitoredItemCount

  • get disabledMonitoredItemCount(): number

hasMonitoredItemNotifications

  • get hasMonitoredItemNotifications(): boolean

hasPendingNotifications

  • get hasPendingNotifications(): boolean

Private keepAliveCounterHasExpired

  • get keepAliveCounterHasExpired(): boolean

lifeTimeHasExpired

  • get lifeTimeHasExpired(): boolean

monitoredItemCount

  • get monitoredItemCount(): number

pendingNotificationsCount

  • get pendingNotificationsCount(): number

sentNotificationsCount

  • get sentNotificationsCount(): number

subscriptionId

  • get subscriptionId(): number

timeToExpiration

  • get timeToExpiration(): number

timeToKeepAlive

  • get timeToKeepAlive(): number

unacknowledgedMessageCount

  • get unacknowledgedMessageCount(): number

Methods

_get_future_sequence_number

  • _get_future_sequence_number(): number

Private _publish_pending_notifications

  • _publish_pending_notifications(): void

acknowledgeNotification

  • acknowledgeNotification(sequenceNumber: number): StatusCode

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

Private adjustSamplingInterval

  • adjustSamplingInterval(samplingInterval: number, node: BaseNode): number
  • adjust monitored item sampling interval

    • an samplingInterval ===0 means that we use a event-base model ( no sampling)
    • otherwise the sampling is adjusted

    Parameters

    • samplingInterval: number
    • node: BaseNode

    Returns number

createMonitoredItem

  • createMonitoredItem(addressSpace: AddressSpace, timestampsToReturn: TimestampsToReturn, monitoredItemCreateRequest: MonitoredItemCreateRequest): MonitoredItemCreateResult
  • create a monitored item

    Parameters

    • addressSpace: AddressSpace

      address space

    • timestampsToReturn: TimestampsToReturn

      the timestamp to return

    • monitoredItemCreateRequest: MonitoredItemCreateRequest

      the parameters describing the monitored Item to create

    Returns MonitoredItemCreateResult

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>

getAvailableSequenceNumbers

  • getAvailableSequenceNumbers(): number[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getMessageForSequenceNumber

  • getMessageForSequenceNumber(sequenceNumber: number): any

getMonitoredItem

  • getMonitoredItem(monitoredItemId: number | string): MonitoredItem

getMonitoredItems

  • getMonitoredItems is used to get information about monitored items of a subscription.Its intended use is defined in Part 4. This method is the implementation of the Standard OPCUA GetMonitoredItems Method. from spec: This method can be used to get the list of monitored items in a subscription if CreateMonitoredItems failed due to a network interruption and the client does not know if the creation succeeded in the server.

    Returns GetMonitoredItemsResult

getSessionId

  • getSessionId(): NodeId

Private increaseLifeTimeCounter

  • increaseLifeTimeCounter(): 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[]

modify

notificationHasExpired

  • notificationHasExpired(notification: any): boolean

Private notifyTransfer

  • notifyTransfer(): void

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

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

process_subscription

  • process_subscription(): void

rawListeners

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

    • event: string | symbol

    Returns Function[]

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

removeMonitoredItem

  • removeMonitoredItem(monitoredItemId: number | string): StatusCode

Private resendInitialValues

  • resendInitialValues(): void

Private resetLifeTimeAndKeepAliveCounters

  • resetLifeTimeAndKeepAliveCounters(): void
  • the server invokes the resetLifeTimeAndKeepAliveCounters method of the subscription when the server has send a Publish Response, so that the subscription can reset its life time counter.

    Returns void

Private resetLifeTimeCounter

  • resetLifeTimeCounter(): void

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setPublishingMode

  • setPublishingMode(publishingEnabled: boolean): StatusCode

terminate

  • terminate(): void

toString

  • toString(): string

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