OPC UA Connector#

OPCUAConnector Class

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

  • Registering the device with OpenFactory.

  • Deploying an OPC UA producer to publish device data into the Kafka cluster.

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

See also

The schema of the OPCUAConnector is openfactory.schemas.connectors.opcua.OPCUAConnectorSchema.

class openfactory.connectors.opcua.opcua_connector.OPCUAConnector(deployment_strategy, ksqlClient, bootstrap_servers=None)[source]#

Bases: Connector

Connector for OPC UA devices that manages deployment of OPC UA producers.

Responsibilities include:

  • Registering the device as an OpenFactory asset.

  • Deploying an OPC UA producer to stream device data to Kafka.

  • Managing references between the device and its producer in OpenFactory.

  • Tearing down the producer when the device is removed.

See also

The schema of the OPCUAConnector is openfactory.schemas.connectors.opcua.OPCUAConnectorSchema.

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

Initializes the OPCUAConnector.

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.

deploy_opcua_producer(device)[source]#

Deploy an OPC UA producer.

Return type:

None

Parameters:

device (Device) – The device for which the producer is to be deployed.

Raises:

OFAException – If the producer 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.