Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OPCUAClientBase

Hierarchy

  • OPCUASecureObject
  • EventEmitter

Implements

  • ICertificateKeyPairProvider

Implemented by

Index

Constructors

constructor

  • Parameters

    • options: IOPCUASecureObjectOptions

    Returns OPCUAClientBase

Properties

applicationName

applicationName: string

bytesRead

bytesRead: number

bytesWritten

bytesWritten: number

certificateFile

certificateFile: string

clientName

clientName: string

connectionStrategy

connectionStrategy: ConnectionStrategy

defaultSecureTokenLifetime

defaultSecureTokenLifetime: number

Optional endpoint

endpoint: EndpointDescription

endpointUrl

endpointUrl: string

isReconnecting

isReconnecting: boolean

keepPendingSessionsOnDisconnect

keepPendingSessionsOnDisconnect: boolean

keepSessionAlive

keepSessionAlive: boolean

knowsServerEndpoint

knowsServerEndpoint: boolean

privateKeyFile

privateKeyFile: string

protocolVersion

protocolVersion: 0

reconnectOnFailure

reconnectOnFailure: boolean

securityMode

securityMode: MessageSecurityMode

securityPolicy

securityPolicy: SecurityPolicy

Optional serverCertificate

serverCertificate: Certificate

tokenRenewalInterval

tokenRenewalInterval: number

transactionsPerformed

transactionsPerformed: number

Static defaultMaxListeners

defaultMaxListeners: number

Static registry

registry: ObjectRegistry = new ObjectRegistry()

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

connect

  • connect(endpointUrl: string): Promise<void>
  • connect(endpointUrl: string, callback: ErrorCallback): void

disconnect

  • disconnect(): Promise<void>
  • disconnect(callback: ErrorCallback): 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>

findEndpointForSecurity

  • findEndpointForSecurity(securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy): EndpointDescription | undefined

findServers

findServersOnNetwork

getCertificate

  • Returns Certificate

getCertificateChain

  • Returns Certificate

getEndpoints

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getPrivateKey

  • getPrivateKey(): PrivateKeyPEM
  • Returns PrivateKeyPEM

listenerCount

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

    • type: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

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
  • on(event: "connected", eventHandler: function): this
  • on(event: "connection_failed", eventHandler: function): this
  • on(event: "backoff", eventHandler: function): this
  • on(event: "start_reconnection", eventHandler: function): this
  • on(event: "reconnection_attempt_has_failed", eventHandler: function): this
  • on(event: "after_reconnection", eventHandler: function): this
  • on(event: "abort", eventHandler: function): this
  • on(event: "close", eventHandler: function): this
  • on(event: "send_chunk", eventHandler: function): this
  • on(event: "receive_chunk", eventHandler: function): this
  • on(event: "send_request", eventHandler: function): this
  • on(event: "receive_response", eventHandler: function): this
  • on(event: "lifetime_75", eventHandler: function): this
  • on(event: "security_token_renewed", eventHandler: function): this
  • on(event: "connection_lost", eventHandler: function): this
  • on(event: "connection_reestablished", eventHandler: function): this
  • on(event: "timed_out_request", eventHandler: function): this
  • on(event: string | symbol, listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • this Event is raised when the initial connection has succeeded

    Parameters

    • event: "connected"
    • eventHandler: function
        • (): void
        • Returns void

    Returns this

  • this Event is raised when the initial connection has failed

    Parameters

    • event: "connection_failed"
    • eventHandler: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • this Event is raised when a failing connection is about to be tried again

    Parameters

    • event: "backoff"
    • eventHandler: function
        • (count: number, delay: number): void
        • Parameters

          • count: number
          • delay: number

          Returns void

    Returns this

  • this event is raised when the client has encountered a connection failure and and is going to reconnection mode. You can intercept start_reconnection event to pause your interaction with the remote OPCUA server.

    Parameters

    • event: "start_reconnection"
    • eventHandler: function
        • (): void
        • Returns void

    Returns this

  • this event is raised when the client has failed one attempt to reconnect to the server This event will be raised if the socket has successfully being created to the server but if something went wrong during the reconnection process.

    Parameters

    • event: "reconnection_attempt_has_failed"
    • eventHandler: function
        • (err: Error, message: string): void
        • Parameters

          • err: Error
          • message: string

          Returns void

    Returns this

  • this event is raised after the client has successfully manage to re-establish the connection with the remote OPCUA Server. You can intercept start_reconnection event to resume your interaction with the remote OPCUA server.

    Parameters

    • event: "after_reconnection"
    • eventHandler: function
        • (err?: Error): void
        • Parameters

          • Optional err: Error

          Returns void

    Returns this

  • the event is raised when the connection has been aborted by the remote OPCUA Server

    Parameters

    • event: "abort"
    • eventHandler: function
        • (): void
        • Returns void

    Returns this

  • this event is raised when the connection is closed

    Parameters

    • event: "close"
    • eventHandler: function
        • (): void
        • Returns void

    Returns this

  • this event is raised when the client is sending a message chunk to the server (advanced use only)

    Parameters

    • event: "send_chunk"
    • eventHandler: function
        • (chunk: Buffer): void
        • Parameters

          • chunk: Buffer

          Returns void

    Returns this

  • this event is raised when the client has recevied a new message chunk from the servers (advanced use only)

    Parameters

    • event: "receive_chunk"
    • eventHandler: function
        • (chunk: Buffer): void
        • Parameters

          • chunk: Buffer

          Returns void

    Returns this

  • Parameters

    • event: "send_request"
    • eventHandler: function

    Returns this

  • Parameters

    • event: "receive_response"
    • eventHandler: function

    Returns this

  • this event is raised when the current security token has reached 75% of its livetime and is therefore about to expired.

    Parameters

    • event: "lifetime_75"
    • eventHandler: function
        • (token: SecurityToken): void
        • Parameters

          • token: SecurityToken

          Returns void

    Returns this

  • this event is raised after the (about ) security token as been renewed and renegociated with the server.to expire

    Parameters

    • event: "security_token_renewed"
    • eventHandler: function
        • (): void
        • Returns void

    Returns this

  • this event is raised when a broken connection with the remote Server has been reestablished

    Parameters

    • event: "connection_lost"
    • eventHandler: function
        • (): void
        • Returns void

    Returns this

  • this event is raised when a broken connection with the remote Server has been reestablished

    Parameters

    • event: "connection_reestablished"
    • eventHandler: function
        • (): void
        • Returns void

    Returns this

  • This event is raised when a request sent to the remote OPCUA server has reach it's timeout value without a Response from the server.

    Parameters

    • event: "timed_out_request"
    • eventHandler: function

    Returns 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

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

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