Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ClientSubscription

Hierarchy

  • EventEmitter
    • ClientSubscription

Implemented by

Index

Events

on

  • on(event: string | symbol, listener: function): this
  • on(event: string | symbol, listener: function): this
  • on(event: "started", eventHandler: function): this
  • on(event: "terminated", eventHandler: function): this
  • on(event: "item_added", eventHandler: function): this
  • on(event: "keepalive", eventHandler: function): this
  • on(event: "internal_error", eventHandler: function): this
  • on(event: "raw_notification", eventHandler: function): this
  • on(event: "received_notifications", eventHandler: function): this
  • on(event: "status_changed", eventHandler: function): this
  • on(event: "error", eventHandler: function): this

Properties

isActive

isActive: boolean

true is the subscription is fully active

lifetimeCount

lifetimeCount: number

maxKeepAliveCount

maxKeepAliveCount: number

maxNotificationsPerPublish

maxNotificationsPerPublish: number

monitoredItems

priority

priority: number

publishingEnabled

publishingEnabled: boolean

publishingInterval

publishingInterval: number

session

session: ClientSession

subscriptionId

subscriptionId: SubscriptionId

timeoutHint

timeoutHint: number

Static defaultMaxListeners

defaultMaxListeners: number

Methods

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

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

listenerCount

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

    • type: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

monitor

  • monitor(itemToMonitor: ReadValueIdOptions, requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn): Promise<ClientMonitoredItemBase>
  • monitor(itemToMonitor: ReadValueIdOptions, requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn, done: function): void
  • monitor(...args: any[]): any
  • add a monitor item to the subscription

    method

    monitor

    async
    example:

    clientSubscription.monitor( // itemToMonitor: { nodeId: "ns=0;i=2258", attributeId: AttributeIds.Value, indexRange: null, dataEncoding: { namespaceIndex: 0, name: null } }, // requestedParameters: { samplingInterval: 3000, filter: null, queueSize: 1, discardOldest: true }, TimestampsToReturn.Neither );

    Monitoring a Value Change With a DataChange Filter

    options.trigger {DataChangeTrigger} {Status|StatusValue|StatusValueTimestamp} options.deadbandType {DeadbandType} {None|Absolute|Percent} options.deadbandValue {Double}

    example:

    clientSubscription.monitor( // itemToMonitor: { nodeId: "ns=0;i=2258", attributeId: AttributeIds.Value, }, // requestedParameters: { samplingInterval: 3000, filter: new DataChangeFilter({ trigger: DataChangeTrigger.StatusValue, deadbandType: DeadbandType.Absolute, deadbandValue: 0.1 }), queueSize: 1, discardOldest: true }, TimestampsToReturn.Neither );

    Monitoring an Event

    If the monitor attributeId is EventNotifier then the filter must be specified

    example:

    var filter = new EventFilter({ selectClauses: [ { browsePath: [ {name: 'ActiveState' }, {name: 'id'} ]}, { browsePath: [ {name: 'ConditionName'} ]} ], whereClause: [] });

    clientSubscription.monitor( // itemToMonitor: { nodeId: "ns=0;i=2258", attributeId: AttributeIds.EventNotifier, indexRange: null, dataEncoding: { namespaceIndex: 0, name: null } }, // requestedParameters: { samplingInterval: 3000,

       filter: filter,
    
       queueSize: 1,
       discardOldest: true
    },
    TimestampsToReturn.Neither

    );

    Parameters

    • itemToMonitor: ReadValueIdOptions
    • requestedParameters: MonitoringParametersOptions
    • timestampsToReturn: TimestampsToReturn

      //{TimestampsToReturnId}

    Returns Promise<ClientMonitoredItemBase>

    Monitoring a simple Value Change

  • Parameters

    • itemToMonitor: ReadValueIdOptions
    • requestedParameters: MonitoringParametersOptions
    • timestampsToReturn: TimestampsToReturn
    • done: function

    Returns void

  • Parameters

    • Rest ...args: any[]

    Returns any

monitorItems

  • monitorItems(itemsToMonitor: ReadValueIdOptions[], requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn): Promise<ClientMonitoredItemGroup>
  • monitorItems(itemsToMonitor: ReadValueIdOptions[], requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn, done: function): void
  • monitorItems(...args: any[]): any

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

once

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

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

          • Rest ...args: any[]

          Returns void

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

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

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

terminate

  • terminate(): Promise<void>
  • terminate(callback: ErrorCallback): void
  • terminate(...args: any[]): any

Static create

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