Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OpcuaRemoteOperationController

This controller maps incoming Call events to OPC UA method calls.

It connects to OPC UA server, observes incoming Call events, invokes associated OPC UA method calls, and responds with Return events containing the output arguments of the OPC UA method calls.

Mappings from Call events to OPC UA method calls are configured on a controller option named opcuaRemoteOperationOptions which must implement the OpcuaRemoteOperationOptions interface. You can also implement application specific Call event parameter validation and coercion functions as well as a function to coerce OPC UA method output arguments to a Return event result value.

An incoming Call event is responded with a Return error event in the following cases:

  • Call event parameters cannot be mapped onto OPC UA method input arguments, because they are either not present on the Call event, or parameter validation or coercion fails.
  • The OPC UA method call fails, i.e. the returned status code is not "Good".
  • The OPC UA method output arguments cannot be coerced to a Return event result value.
remarks

This controller only runs in a Node.js runtime, not in a browser.

Hierarchy

  • Controller
    • OpcuaRemoteOperationController

Implements

  • IController

Index

Constructors

constructor

  • internal

    For internal use in framework only.

    Never instantiate Controller objects in your application; they are created automatically by dependency injection.

    Parameters

    • _container: Container
    • _options: ControllerOptions
    • _controllerName: string

    Returns OpcuaRemoteOperationController

Accessors

communicationManager

  • get communicationManager(): CommunicationManager

container

  • get container(): Container
  • Gets the container object of this controller.

    Returns Container

options

  • get options(): Readonly<ControllerOptions>
  • Gets the controller's options as specified in the configuration options.

    Returns Readonly<ControllerOptions>

registeredName

  • get registeredName(): string
  • Gets the registered name of this controller.

    The registered name is either defined by the corresponding key in the Components.controllers object in the container configuration, or by invoking Container.registerController method with this name.

    Returns string

runtime

  • get runtime(): Runtime
  • Gets the container's Runtime object.

    Returns Runtime

Methods

Protected extendLogObject

  • extendLogObject(log: Log): void
  • Whenever one of the controller's log methods (e.g. logDebug, logInfo, logWarning, logError, logFatal) is called by application code, the controller creates a Log object with appropriate property values and passes it to this method before advertising it.

    You can override this method to additionally set certain properties (such as LogHost.hostname or Log.logLabels). Ensure that super.extendLogObject is called in your override. The base method does nothing.

    Parameters

    • log: Log

      log object to be extended before being advertised

    Returns void

Protected getOperationContextFor

  • Overwrite this method to provide a remote operation context for observing Call events for a given remote operation.

    By default, if specified, the operation context of the given callReturnMapping is returned. Otherwise, undefined is returned.

    Do not call this method in your application code, it is called by this controller internally.

    Parameters

    Returns CoatyObject

logDebug

  • logDebug(message: string, ...tags: string[]): void
  • Advertise a Log object for debugging purposes.

    Parameters

    • message: string

      a debug message

    • Rest ...tags: string[]

      any number of log tags

    Returns void

logError

  • logError(error: any, message: string, ...tags: string[]): void
  • Advertise a Log object for an error.

    Parameters

    • error: any

      an error (object)

    • message: string

      additional error message

    • Rest ...tags: string[]

      any number of log tags

    Returns void

logErrorWithStacktrace

  • logErrorWithStacktrace(error: any, message: string, ...tags: string[]): void
  • Advertise a Log object for an error with stacktrace information.

    Parameters

    • error: any

      an error (object)

    • message: string

      additional error message

    • Rest ...tags: string[]

      any number of log tags

    Returns void

logFatal

  • logFatal(error: any, message: string, ...tags: string[]): void
  • Advertise a Log object for a fatal error.

    Parameters

    • error: any

      an error (object)

    • message: string

      additional error message

    • Rest ...tags: string[]

      any number of log tags

    Returns void

logInfo

  • logInfo(message: string, ...tags: string[]): void
  • Advertise an informational Log object.

    Parameters

    • message: string

      an informational message

    • Rest ...tags: string[]

      any number of log tags

    Returns void

logWarning

  • logWarning(message: string, ...tags: string[]): void
  • Advertise a Log object for a warning.

    Parameters

    • message: string

      a warning message

    • Rest ...tags: string[]

      any number of log tags

    Returns void

onCommunicationManagerStarting

  • onCommunicationManagerStarting(): void

onCommunicationManagerStopping

  • onCommunicationManagerStopping(): void

onDispose

  • onDispose(): void

onInit

  • onInit(): void

Protected traceOpcuaError

  • traceOpcuaError(error: any): void
  • Overwrite this method to define how internal OPC UA errors within this controller should be traced.

    By default, OPC UA errors are logged on the console.

    Do not call this method in your application code, it is called by this controller internally.

    Parameters

    • error: any

      an OPC UA error

    Returns void

Generated using TypeDoc