Options
All
  • Public
  • Public/Protected
  • All
Menu

  subscribe now with sterfive to access the online-user manual

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

monitoredItemIdCounter

monitoredItemIdCounter: number

number of monitored Item

priority

priority: number

Optional publishEngine

publishEngine: IServerSidePublishEngine

publishIntervalCount

publishIntervalCount: number

publishingEnabled

publishingEnabled: boolean

publishingInterval

publishingInterval: number

the Subscription publishing interval

default

1000

sessionId

sessionId: NodeId

state

subscriptionDiagnostics

subscriptionDiagnostics: SubscriptionDiagnosticsDataTypePriv

Readonly Static captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static defaultPublishingInterval

defaultPublishingInterval: number

Readonly Static errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Static maximumPublishingInterval

maximumPublishingInterval: number

Static minimumPublishingInterval

minimumPublishingInterval: number

Static registry

registry: ObjectRegistry

Accessors

aborted

  • get aborted(): boolean
  • Returns boolean

disabledMonitoredItemCount

  • get disabledMonitoredItemCount(): number
  • number of disabled monitored items.

    Returns number

hasMonitoredItemNotifications

  • get hasMonitoredItemNotifications(): boolean
  • rue if monitored Item have uncollected Notifications

    Returns boolean

hasPendingNotifications

  • get hasPendingNotifications(): boolean
  • is 'true' if there are pending notifications for this subscription. (i.e moreNotifications)

    Returns boolean

lifeTimeHasExpired

  • get lifeTimeHasExpired(): boolean
  • True if the subscription life time has expired.

    Returns boolean

monitoredItemCount

  • get monitoredItemCount(): number
  • number of monitored items handled by this subscription

    Returns number

pendingNotificationsCount

  • get pendingNotificationsCount(): number
  • number of pending notifications

    Returns number

sentNotificationsCount

  • get sentNotificationsCount(): number
  • number of sent notifications

    Returns number

subscriptionId

  • get subscriptionId(): number
  • Returns number

timeToExpiration

  • get timeToExpiration(): number
  • number of milliseconds before this subscription times out (lifeTimeHasExpired === true);

    Returns number

timeToKeepAlive

  • get timeToKeepAlive(): number
  • Returns number

unacknowledgedMessageCount

  • get unacknowledgedMessageCount(): number
  • The number of unacknowledged messages saved in the republish queue.

    Returns number

Methods

_get_future_sequence_number

  • _get_future_sequence_number(): number
  • Returns number

acknowledgeNotification

  • acknowledgeNotification(sequenceNumber: number): StatusCode
  • acknowledges a notification identified by its sequence number

    Parameters

    • sequenceNumber: number

    Returns StatusCode

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): Subscription
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Subscription

applyOnMonitoredItem

  • applyOnMonitoredItem(functor: (monitoredItem: MonitoredItem) => Promise<void>): Promise<void>
  • Parameters

    Returns Promise<void>

createMonitoredItem

dispose

  • dispose(): void
  • Returns void

emit

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

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

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getAvailableSequenceNumbers

  • getAvailableSequenceNumbers(): number[]
  • returns in an array the sequence numbers of the notifications that have been sent and that haven't been acknowledged yet.

    Returns number[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getMessageForSequenceNumber

  • Parameters

    • sequenceNumber: number

    Returns NotificationMessage

getMonitoredItem

  • getMonitoredItem(monitoredItemId: string | number): MonitoredItem
  • get a monitoredItem by Id.

    Parameters

    • monitoredItemId: string | number

      : the id of the monitored item to get.

    Returns MonitoredItem

    the monitored item matching monitoredItemId

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

  • Returns NodeId

listenerCount

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

    • event: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

modify

  • modify subscription parameters

    Parameters

    Returns void

notificationHasExpired

  • notificationHasExpired(notification: any): boolean
  • returns true if the notification has expired

    Parameters

    • notification: any

    Returns boolean

off

  • off(event: string | symbol, listener: (...args: any[]) => void): Subscription
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Subscription

on

  • on(event: string | symbol, listener: (...args: any[]) => void): Subscription
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Subscription

once

  • once(event: string | symbol, listener: (...args: any[]) => void): Subscription
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Subscription

postCreateMonitoredItem

preCreateMonitoredItem

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): Subscription
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Subscription

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): Subscription
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Subscription

process_subscription

  • process_subscription(): void
  • Returns void

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • Parameters

    • Optional event: string | symbol

    Returns Subscription

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): Subscription
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Subscription

removeMonitoredItem

  • removeMonitoredItem(monitoredItemId: string | number): StatusCode
  • remove a monitored Item from the subscription.

    Parameters

    • monitoredItemId: string | number

      : the id of the monitored item to get.

    Returns StatusCode

setMaxListeners

  • Parameters

    • n: number

    Returns Subscription

setPublishingMode

  • setPublishingMode(publishingEnabled: boolean): StatusCode
  • set publishing mode

    Parameters

    • publishingEnabled: boolean

    Returns StatusCode

terminate

  • terminate(): void
  • Terminates the subscription. Calling this method will also remove any monitored items.

    Returns void

toString

  • toString(): string
  • Returns string

Static listenerCount

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

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>

Generated using TypeDoc