A service is a special kind of resource that besides Resource properties, it could offer:

  • Its own REST API endpoints, using an express router, to expose details about service, this endpoints will be exposed under the observability paths.
  • A links property to define the endpoints that the service expose, this information will be exposed in the observability paths.
  • A metrics property to expose the metrics of the service, this registry will be merged with the global metrics registry.

Hierarchy (View Summary)

Constructors

Properties

componentId: string = ...

Component identification

consumerMap: ConsumerMap

Consumer Map

Accessors

  • Return links offered by this service

    Returns Links

  • get name(): string
  • Component name

    Returns string

  • get router(): Router
  • Return an Express router with access to OpenC2 information

    Returns Router

  • get status(): "pass" | "fail" | "warn"
  • Component health status

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

Methods

  • Close the OpenC2 component

    Returns Promise<void>

  • Issue a new command to the requested consumers. If '' is indicated as a consumer, the command will be broadcasted. If an actuator is indicated in the command the command will not be broadcasted even if it include the '' symbol.

    Parameters

    Returns Promise<ResponseMessage[]>

  • Issue a new command to the requested consumers. If '' is indicated as a consumer, the command will be broadcasted. If an actuator is indicated in the command the command will not be broadcasted even if it include the '' symbol.

    Parameters

    • to: string[]

      Consumer objetive of this command

    • content: Command

      Command to be issued

    Returns Promise<ResponseMessage[]>

  • Issue a new command to the requested consumers. If '*' is indicated as a consumer, the command will be broadcasted.

    Parameters

    • to: string[]

      Consumer objetive of this command

    • action: Action

      command action

    • target: Target

      command target

    Returns Promise<ResponseMessage[]>

  • Removes all listeners, or those of the specified event.

    Parameters

    • Optionalevent: "error"

      error event

    Returns this

  • Connect the OpenC2 Adapter to the underlayer transport system and perform the startup of the component

    Returns Promise<void>

  • Disconnect the OpenC2 Adapter to the underlayer transport system and perform the shutdown of the component

    Returns Promise<void>

Events

  • Add a listener for the error event, emitted when the component detects an error.

    Parameters

    • event: "error"

      error event

    • listener: (error: Crash | Error) => void

      Error event listener

    Returns this

  • Add a listener for the status event, emitted when the component changes its status.

    Parameters

    • event: "status"

      status event

    • listener: (status: "pass" | "fail" | "warn") => void

      Status event listener

    Returns this

  • Removes the specified listener from the listener array for the error event.

    Parameters

    • event: "error"

      error event

    • listener: (error: Crash | Error) => void

      Error event listener

    Returns this

  • Removes the specified listener from the listener array for the status event.

    Parameters

    • event: "status"

      status event

    • listener: (status: "pass" | "fail" | "warn") => void

      Status event listener

    Returns this

  • Add a listener for the error event, emitted when the component detects an error.

    Parameters

    • event: "error"

      error event

    • listener: (error: Crash | Error) => void

      Error event listener

    Returns this

  • Add a listener for the status event, emitted when the component changes its status.

    Parameters

    • event: "status"

      status event

    • listener: (status: "pass" | "fail" | "warn") => void

      Status event listener

    Returns this

  • Add a listener for the error event, emitted when the component detects an error. This is a one-time event, the listener will be removed after the first emission.

    Parameters

    • event: "error"

      error event

    • listener: (error: Crash | Error) => void

      Error event listener

    Returns this

  • Add a listener for the status event, emitted when the component changes its status. This is a one-time event, the listener will be removed after the first emission.

    Parameters

    • event: "status"

      status event

    • listener: (status: "pass" | "fail" | "warn") => void

      Status event listener

    Returns this

  • Removes the specified listener from the listener array for the error event.

    Parameters

    • event: "error"

      error event

    • listener: (error: Crash | Error) => void

      Error event listener

    Returns this

  • Removes the specified listener from the listener array for the status event.

    Parameters

    • event: "status"

      status event

    • listener: (status: "pass" | "fail" | "warn") => void

      Status event listener

    Returns this