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

  • Parameters

    Returns Subscription

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

Static defaultPublishingInterval

defaultPublishingInterval: number

Static maxMonitoredItemCount

maxMonitoredItemCount: number

Static maxNotificationPerPublishHighLimit

maxNotificationPerPublishHighLimit: number

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

hasPendingNotifications

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

    Returns boolean

hasUncollectedMonitoredItemNotifications

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

    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

sentNotificationMessageCount

  • get sentNotificationMessageCount(): 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

applyOnMonitoredItem

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

    Returns Promise<void>

createMonitoredItem

dispose

  • dispose(): void
  • Returns void

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[]

getMessageForSequenceNumber

  • Parameters

    • sequenceNumber: number

    Returns NotificationMessage

getMonitoredItem

  • get a monitoredItem by Id.

    Parameters

    • monitoredItemId: 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

modify

  • modify subscription parameters

    Parameters

    Returns void

notificationHasExpired

  • notificationHasExpired(notification: { start_tick: number }): boolean
  • returns true if the notification has expired

    Parameters

    • notification: { start_tick: number }
      • start_tick: number

    Returns boolean

postCreateMonitoredItem

preCreateMonitoredItem

process_subscription

  • process_subscription(): void
  • Returns void

removeMonitoredItem

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

    Parameters

    • monitoredItemId: number

      : the id of the monitored item to get.

    Returns StatusCode

setPublishingMode

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

    Parameters

    • publishingEnabled: boolean

    Returns StatusCode

setTriggering

  • setTriggering(triggeringItemId: number, linksToAdd: number[], linksToRemove: number[]): { addResults: StatusCode[]; removeResults: StatusCode[]; statusCode: StatusCode }
  • Parameters

    • triggeringItemId: number
    • linksToAdd: number[]
    • linksToRemove: number[]

    Returns { addResults: StatusCode[]; removeResults: StatusCode[]; statusCode: StatusCode }

terminate

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

    Returns void

toString

  • toString(): string
  • Returns string

Generated using TypeDoc