Capability Connect

class ds_capability.components.abstract_common_component.AbstractCommonComponent(property_manager: Any, intent_model: Any, default_save: bool | None = None, reset_templates: bool | None = None, template_path: str | None = None, template_module: str | None = None, template_source_handler: str | None = None, template_persist_handler: str | None = None, align_connectors: bool | None = None)

An abstract common component class that contains the methods shared across all capabilities. This allows all capability instances to share common behavior in initialization, connectivity management, reporting and running the component.

add_connector_persist(connector_name: str, uri_file: str, save: bool | None = None, **kwargs)

Adds a connector using settings from the self.pm.TEMPLATE_PERSIST template connector. self.pm.TEMPLATE_PERSIST are added at initialisation

Parameters:
  • connector_name – the name or label to identify and reference the connector

  • uri_file – the name of the file to append to the end of the default path

  • save – override of the default save action set at initialisation.

  • kwargs – any kwargs to add to the default connector

Returns:

add_connector_source(connector_name: str, uri_file: str, save: bool | None = None, **kwargs)

Adds a connector using settings from the self.pm.TEMPLATE_SOURCE template connector.

Parameters:
  • connector_name – the name or label to identify and reference the connector

  • uri_file – the name of the file to append to the end of the default path

  • save – override of the default save action set at initialisation.

  • kwargs – any kwargs to add to the default connector

Returns:

add_connector_uri(connector_name: str, uri: str, save: bool | None = None, template_aligned: bool | None = None, **kwargs)

Sets the contract giving the full uri path. This is a shortcut of set_source_contract(…), not requiring a ConnectorContract to be set up and using the default module and handler values.

Parameters:
  • connector_name – the name or label to identify and reference the connector

  • uri – a fully qualified uri of the source data

  • template_aligned – the connector aligns with the template so changes to the template

  • save – (optional) if True, save to file. Default is True

set_persist(uri_file: str | None = None, save: bool | None = None, **kwargs)

sets the persist contract CONNECTOR_PERSIST using the TEMPLATE_PERSIST connector contract

Parameters:
  • uri_file – (optional) the uri_file is appended to the template path

  • save – (optional) if True, save to file. Default is True

set_persist_uri(uri: str, save: bool | None = None, template_aligned: bool | None = None, **kwargs)

Sets the persist contract giving the full uri path. This is a shortcut of set_persist_contract(…), not requiring a ConnectorContract to be set up and using the default module and handler values.

Parameters:
  • uri – a fully qualified uri of the persist data

  • template_aligned – the connector aligns with the template so changes to the template

  • save – (optional) if True, save to file. Default is True

set_source(uri_file: str, save: bool | None = None, **kwargs)

sets the source contract CONNECTOR_SOURCE using the TEMPLATE_SOURCE connector contract,

Parameters:
  • uri_file – the uri_file is appended to the template path

  • save – (optional) if True, save to file. Default is True

set_source_uri(uri: str, save: bool | None = None, template_aligned: bool | None = None, **kwargs)

Sets the source contract giving the full uri path. This is a shortcut of set_source_contract(…), not requiring a ConnectorContract to be set up and using the default module and handler values.

Parameters:
  • uri – a fully qualified uri of the source data

  • template_aligned – the connector aligns with the template so changes to the template

  • save – (optional) if True, save to file. Default is True