A resource is extended component that represent the access to an external/internal resource, besides the error handling and identity, it has a start, stop and close methods to manage the resource lifecycle. It also has a checks property to define the checks that will be performed over the resource to achieve the resulted status. The most typical example of a resource are the Provider that allow to access to external databases, message brokers, etc.

Hierarchy

  • EventEmitter
    • HealthWrapper

Implements

Constructors

Properties

Accessors

Methods

Constructors

  • Regular OpenC2 consumer implementation. This class allows the management of incoming command and the underlayer Adapter. The main task of this class is to filter incoming commands that are not related with the instance or are not supported

    Parameters

    • name: string

      Component name used as node identifier for OpenC2

    • components: Resource[]

      Health components to be monitored

    Returns HealthWrapper

Properties

componentId: string = ...

Component identification

name: string

Component name used as node identifier for OpenC2

Accessors

  • get status(): "pass" | "fail" | "warn"
  • Overall component status

    Returns "pass" | "fail" | "warn"

Methods

  • Add a new component to health wrapper

    Parameters

    • component: Resource

      component to be added to the health wrapper

    Returns void

  • Fake close method used to implement the Resource interface

    Returns Promise<void>

  • Fake start method used to implement the Resource interface

    Returns Promise<void>

  • Fake stop method used to implement the Resource interface

    Returns Promise<void>