SHDR Connector#

SHDRConnector Class

Provides orchestration for deploying SHDR-based devices into the OpenFactory environment. This includes:

  • Registering the device with OpenFactory.

  • Registering an SHDR device with the SHDR coordinator to publish device data into the Kafka cluster.

  • Tearing down all associated components when the device is removed.

See also

The schema of the SHDRConnector is openfactory.schemas.connectors.shdr.SHDRConnectorSchema.

class openfactory.connectors.shdr.shdr_connector.SHDRConnector(deployment_strategy, ksqlClient, bootstrap_servers=None)[source]#

Bases: Connector

Connector for SHDR devices that manages deployment and registration of SHDR devices.

Responsibilities include:

  • Registering the device as an OpenFactory asset.

  • Registering the SHDR device with the SHDR coordinator to stream device data to Kafka.

See also

The schema of the SHDRConnector is openfactory.schemas.connectors.shdr.SHDRConnectorSchema.

CONNECTOR_NAME = 'SHDR'#
__init__(deployment_strategy, ksqlClient, bootstrap_servers=None)[source]#

Initializes the SHDRConnector.

Parameters:
  • deployment_strategy (OpenFactoryServiceDeploymentStrategy) – The deployment strategy to use.

  • ksqlClient (KSQLDBClient) – The client for interacting with ksqlDB.

  • bootstrap_servers (str) – The Kafka bootstrap server address. Defaults to config.KAFKA_BROKER.

deploy(device, yaml_config_file)[source]#

Deploy a device based on its configuration.

Return type:

None

Parameters:
  • device (Device) – Device to deploy.

  • yaml_config_file (str) – Path to the YAML configuration file.

Raises:

OFAException – If the device cannot be deployed.

tear_down(device_uuid)[source]#

Tear down a deployed device given its UUID.

Return type:

None

Parameters:

device_uuid (str) – Unique identifier of the device to be torn down.

Raises:

OFAException – If the device cannot be torn down.