Class IntegrationConnectorBase

java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.frameworks.integration.connectors.IntegrationConnectorBase
All Implemented Interfaces:
AuditLoggingComponent, SecureConnectorExtension, VirtualConnectorExtension, IntegrationConnector
Direct Known Subclasses:
AnalyticsIntegratorConnector, APIIntegratorConnector, CatalogIntegratorConnector, DatabaseIntegratorConnector, DisplayIntegratorConnector, FilesIntegratorConnector, InfrastructureIntegratorConnector, IntegrationConnectorBase, LineageIntegratorConnector, OrganizationIntegratorConnector, SecurityIntegratorConnector, TopicIntegratorConnector

public abstract class IntegrationConnectorBase extends ConnectorBase implements IntegrationConnector, AuditLoggingComponent, VirtualConnectorExtension
IntegrationConnectorBase is the base class for an integration connector. It manages the storing of the audit log for the connector and provides a default implementation for the abstract engage() method. This method only needs to be overridden by connectors that need to make blocking calls to wait for new metadata.
  • Field Details

  • Constructor Details

    • IntegrationConnectorBase

      public IntegrationConnectorBase()
  • Method Details

    • setAuditLog

      public void setAuditLog(AuditLog auditLog)
      Receive an audit log object that can be used to record audit log messages. The caller has initialized it with the correct component description and log destinations.
      Specified by:
      setAuditLog in interface AuditLoggingComponent
      Parameters:
      auditLog - audit log object
    • getConnectorComponentDescription

      public ComponentDescription getConnectorComponentDescription()
      Return the component description that is used by this connector in the audit log.
      Specified by:
      getConnectorComponentDescription in interface AuditLoggingComponent
      Returns:
      id, name, description, wiki page URL.
    • setConnectorName

      public void setConnectorName(String connectorName)
      Set up the connector name for logging.
      Specified by:
      setConnectorName in interface IntegrationConnector
      Parameters:
      connectorName - connector name from the configuration
    • setContext

      public void setContext(IntegrationContext integrationContext)
      Set up the standard integration context for the connector.
      Specified by:
      setContext in interface IntegrationConnector
      Parameters:
      integrationContext - integration context.
    • start

      public void start() throws ConnectorCheckedException
      Indicates that the connector is completely configured and can begin processing. This call can be used to register with non-blocking services.
      Specified by:
      start in interface IntegrationConnector
      Overrides:
      start in class ConnectorBase
      Throws:
      ConnectorCheckedException - there is a problem within the connector.
    • getNetworkAddress

      protected String getNetworkAddress(Connector assetConnector)
      Retrieve the endpoint from the asset connection.
      Parameters:
      assetConnector - asset connector
      Returns:
      endpoint or null
    • registerCatalogTargetChangeListener

      protected void registerCatalogTargetChangeListener(CatalogTargetChangeListener listener)
      Add a new listener for changes to this connector's catalog targets.
      Parameters:
      listener - listener to register
    • refreshCatalogTargets

      protected void refreshCatalogTargets(CatalogTargetIntegrator catalogTargetIntegrator) throws ConnectorCheckedException
      Return a list of requested catalog targets for the connector. These are extracted from the metadata store.
      Parameters:
      catalogTargetIntegrator - the integration component that will process each catalog target
      Throws:
      ConnectorCheckedException - there is a problem with the connector. It is not able to refresh the metadata.
    • engage

      public void engage() throws ConnectorCheckedException
      This method is for blocking calls to wait for new metadata. It is called from its own thread iff the connector is configured to have its own thread. It is recommended that the implementation returns when each blocking call completes. The integration daemon will pause a second and then call engage() again. This pattern enables the calling thread to detect the shutdown of the integration daemon. This method should be overridden if the connector needs to issue calls that wait for new metadata. If this specific implementation is called a message is logged in the audit log because there is probably a mismatch between the configuration and the connector implementation.
      Specified by:
      engage in interface IntegrationConnector
      Throws:
      ConnectorCheckedException - there is a problem within the connector.
    • disconnect

      public void disconnect() throws ConnectorCheckedException
      Free up any resources held since the connector is no longer needed.
      Specified by:
      disconnect in interface IntegrationConnector
      Overrides:
      disconnect in class ConnectorBase
      Throws:
      ConnectorCheckedException - there is a problem within the connector.