Class RequestedCatalogTargetsManager

java.lang.Object
org.odpi.openmetadata.frameworks.integration.connectors.RequestedCatalogTargetsManager
All Implemented Interfaces:
CatalogTargetChangeListener

public class RequestedCatalogTargetsManager extends Object implements CatalogTargetChangeListener
Manages the map of catalog targets that this integration connector is working with. It is also responsible for keeping the list current. This is the OIF implementation of CatalogTargetChangeListener that is driven from the connector base. It is also possible for an integration connector to register itself as a listener with this class.
  • Constructor Details

    • RequestedCatalogTargetsManager

      public RequestedCatalogTargetsManager(Map<String,Object> connectorConfigProperties, String connectorName, AuditLog auditLog)
      Constructor - passed the values from the integration connector that are needed by each catalog target,
      Parameters:
      connectorConfigProperties - base configuration properties - these are overlaid with the config properties from the catalog target relationship
      connectorName - can of this connector for error messages
      auditLog - audit log for this connector
  • Method Details

    • setLocalMetadataCollectionId

      public void setLocalMetadataCollectionId(String localMetadataCollectionId)
      Tell this manager which metadata collection is the local one, so that catalog targets registered through another metadata access store in the same cohort can be left to the daemons that registered them.
      The value has to be one the caller knows rather than one it has worked out: the identifier of the metadata collection that homes an instance this connector itself created. Nothing about a metadata collection's name can be relied on for this - a name is optional and can be set to anything - and no API hands a connector the identifier of the store it writes through.
      Parameters:
      localMetadataCollectionId - identifier of the local metadata collection
    • retrieveKnownCatalogTargets

      public List<RequestedCatalogTarget> retrieveKnownCatalogTargets(IntegrationContext integrationContext, CatalogTargetFactory catalogTargetFactory) throws ConnectorCheckedException
      Return a list of requested catalog targets for the connector. These are extracted from the metadata store.
      Parameters:
      integrationContext - the integration context for the parent connector
      catalogTargetFactory - subclass of connector implementation that is able to create a catalog target processor
      Throws:
      ConnectorCheckedException - a problem with the connector. It is not able to refresh the metadata.
    • refreshCatalogTargets

      public void refreshCatalogTargets(IntegrationContext integrationContext, CatalogTargetFactory catalogTargetFactory) throws ConnectorCheckedException, UserNotAuthorizedException
      Retrieve the latest list of catalog targets and call refresh on each one.
      Parameters:
      integrationContext - the integration context for the parent connector
      catalogTargetFactory - subclass of connector implementation that is able to create a catalog target processor
      Throws:
      ConnectorCheckedException - a problem with the connector. It is not able to refresh the metadata.
      UserNotAuthorizedException - connector has been shut down
    • passEventToCatalogTargets

      public void passEventToCatalogTargets(IntegrationContext integrationContext, OpenMetadataOutTopicEvent event) throws UserNotAuthorizedException
      Retrieve the latest list of catalog targets and call refresh on each one.
      Parameters:
      integrationContext - the integration context for the parent connector
      event - event to pass on to each catalog target that is capable
      Throws:
      UserNotAuthorizedException - connector has been shut down
    • getRequestedCatalogTargets

      public List<RequestedCatalogTarget> getRequestedCatalogTargets()
      Return list of the current catalog targets - used in event processing for speed.
      Returns:
      list of the current catalog targets
    • registerCatalogTargetChangeListener

      public void registerCatalogTargetChangeListener(CatalogTargetChangeListener listener)
      Add a listener.
      Parameters:
      listener - listener to register
    • newCatalogTarget

      public void newCatalogTarget(RequestedCatalogTarget catalogTarget) throws UserNotAuthorizedException, ConnectorCheckedException
      This catalog target has been created since the last refresh.
      Specified by:
      newCatalogTarget in interface CatalogTargetChangeListener
      Parameters:
      catalogTarget - new catalog target
      Throws:
      UserNotAuthorizedException - parent connector has been disconnected
      ConnectorCheckedException - problem starting up
    • updatedCatalogTarget

      public void updatedCatalogTarget(RequestedCatalogTarget oldCatalogTarget, RequestedCatalogTarget newCatalogTarget)
      This catalog target has new properties.
      Specified by:
      updatedCatalogTarget in interface CatalogTargetChangeListener
      Parameters:
      oldCatalogTarget - old values
      newCatalogTarget - new values
    • removedCatalogTarget

      public void removedCatalogTarget(RequestedCatalogTarget catalogTarget) throws ConnectorCheckedException
      This catalog target has been removed from the connector.
      Specified by:
      removedCatalogTarget in interface CatalogTargetChangeListener
      Parameters:
      catalogTarget - removed relationship
      Throws:
      ConnectorCheckedException - problem disconnecting
    • disconnect

      public void disconnect() throws ConnectorCheckedException
      Shutdown metadata synchronization
      Throws:
      ConnectorCheckedException - something failed in the super class