Options
All
  • Public
  • Public/Protected
  • All
Menu

  subscribe now with sterfive to access the online-user manual

Hierarchy

  • EventEmitter
    • ClientSubscription

Index

Constructors

constructor

Events

on

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSubscription

  • notify the observers that the subscription has now started

    Parameters

    • event: "started"
    • eventHandler: (subscriptionId: number) => void
        • (subscriptionId: number): void
        • Parameters

          • subscriptionId: number

          Returns void

    Returns ClientSubscription

  • notify the observers tha the client subscription has terminated

    Parameters

    • event: "terminated"
    • eventHandler: () => void
        • (): void
        • Returns void

    Returns ClientSubscription

  • notify the observers that a new monitored item has been added to the subscription.

    Parameters

    Returns ClientSubscription

  • notify the observers that a keep alive Publish Response has been received from the server.

    Parameters

    • event: "keepalive"
    • eventHandler: () => void
        • (): void
        • Returns void

    Returns ClientSubscription

  • notify the observers that an error has occurred

    Parameters

    • event: "internal_error"
    • eventHandler: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns ClientSubscription

  • Parameters

    Returns ClientSubscription

  • notify the observers that some notifications has been received from the server in a PublishResponse each modified monitored Item

    Parameters

    Returns ClientSubscription

  • notify the observers that the server has send a status changed notification (such as BadTimeout )

    Parameters

    Returns ClientSubscription

  • Parameters

    • event: "error"
    • eventHandler: (err: Error) => void
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns ClientSubscription

Properties

hasSession

hasSession: boolean

return true if the subscription is attached to a valid session

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

return the session associated with the subscription. (may throw if the session is not valid)

subscriptionId

subscriptionId: number

timeoutHint

timeoutHint: number

Static ignoreNextWarning

ignoreNextWarning: boolean

Methods

_createMonitoredItem

addListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSubscription

emit

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

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

    Returns boolean

eventNames

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

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getMonitoredItems

  • Returns Promise<MonitoredItemData>

  • Parameters

    Returns void

listenerCount

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

    • event: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

monitor

  • add a monitor item to the subscription

    method

    monitor

    Monitoring a simple Value Change

    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

    Returns Promise<ClientMonitoredItem>

  • Parameters

    Returns void

monitorItems

off

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSubscription

once

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSubscription

prependListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSubscription

prependOnceListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSubscription

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • Parameters

    • Optional event: string | symbol

    Returns ClientSubscription

removeListener

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

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

          • Rest ...args: any[]

          Returns void

    Returns ClientSubscription

setMaxListeners

  • Parameters

    • n: number

    Returns ClientSubscription

terminate

  • terminate(): Promise<void>
  • terminate(callback: ErrorCallback): void
  • Returns Promise<void>

  • Parameters

    Returns void

Static create

Generated using TypeDoc