Class CatalogTargetProcessorBase

Direct Known Subclasses:
AuditLogDestinationCatalogTargetProcessor, HarvestOpenMetadataCatalogTargetProcessor, HarvestSurveysCatalogTargetProcessor, JDBCIntegrationCatalogTargetProcessor, KafkaTopicCatalogTargetProcessor, KafkaTopicSourceCatalogTargetProcessor, OpenLineageEventReceiverCatalogTargetProcessor, OpenMetadataProductsHarvesterCatalogTargetProcessor, OSSUnityCatalogInsideCatalogSyncCatalogTargetProcessor, OSSUnityCatalogServerSyncCatalogTargetProcessor, PostgresServerCatalogTargetProcessor

public abstract class CatalogTargetProcessorBase extends RequestedCatalogTarget
Provides the base class for connector code that processes a single catalog target. When converting an integration connector implementation that does not support catalog targets to one that does, move the core working code into a subclass of this class and implement CatalogTargetIntegrator (and optionally CatalogTargetChangeListener if you need notifications. Ensure you override the getNewRequestedCatalogTargetSkeleton method in CatalogTargetIntegrator to return a new instance of your CatalogTargetProcessorBase class.
  • Field Details

    • connectorName

      protected final String connectorName
    • auditLog

      protected final AuditLog auditLog
    • propertyHelper

      protected final PropertyHelper propertyHelper
    • metadataCollectionGUID

      protected String metadataCollectionGUID
    • metadataCollectionName

      protected String metadataCollectionName
  • Constructor Details

    • CatalogTargetProcessorBase

      public CatalogTargetProcessorBase(CatalogTarget template, CatalogTargetContext catalogTargetContext, Connector connectorToTarget, String connectorName, AuditLog auditLog)
      Copy/clone constructor
      Parameters:
      template - object to copy
      catalogTargetContext - specialized context for this catalog target
      connectorToTarget - connector to access the target resource
      connectorName - name of this integration connector
      auditLog - logging destination
  • Method Details

    • start

      Indicates that the catalog target processor is completely configured and can begin processing. This call can be used to register with non-blocking services, or extract useful metadata values from the catalog target element, connector etc.
      Overrides:
      start in class RequestedCatalogTarget
      Throws:
      ConnectorCheckedException - there is a problem within the connector.
      UserNotAuthorizedException - the connector was disconnected before/during start
    • refresh

      Requests that the connector does a comparison of the metadata in the third party technology and open metadata repositories. Refresh is called when the integration connector first starts and then at intervals defined in the connector's configuration as well as any external REST API calls to explicitly refresh the connector.
      Throws:
      ConnectorCheckedException - there is a problem with the connector. It is not able to refresh the metadata.
      UserNotAuthorizedException - the connector was disconnected so stop refresh processing
    • disconnect

      public void disconnect() throws ConnectorCheckedException
      Free up any resources held since the catalog target processor is no longer needed.
      Throws:
      ConnectorCheckedException - there is a problem within the connector.
    • setUpMetadataSource

      protected void setUpMetadataSource() throws ConnectorCheckedException
      Ensure that the metadata collection identifiers are properly set up.
      Throws:
      ConnectorCheckedException - there is a problem retrieving the server definitions.
    • setUpSoftwareCapability

      protected String setUpSoftwareCapability(String softwareCapabilityTypeName) throws ConnectorCheckedException
      Ensure that the named software capability type is properly set up.
      Throws:
      ConnectorCheckedException - there is a problem retrieving the server definitions.
    • throwWrongTypeOfCatalogTarget

      protected void throwWrongTypeOfCatalogTarget(String expectedTypeName, String methodName) throws ConnectorCheckedException
      Log that the connector can not process the type of catalog target it has been passed.
      Parameters:
      expectedTypeName - desired type of the catalog target
      methodName - calling method
      Throws:
      ConnectorCheckedException - resulting exception
    • throwWrongTypeOfResourceConnector

      protected void throwWrongTypeOfResourceConnector(String expectedClassName, String methodName) throws ConnectorCheckedException
      Log that the connector can not process the type of catalog target it has been passed.
      Parameters:
      expectedClassName - desired class of the catalog target's resource connector
      methodName - calling method
      Throws:
      ConnectorCheckedException - resulting exception
    • throwMissingConnectionInfo

      protected void throwMissingConnectionInfo(String missingParameterName, String methodName) throws ConnectorCheckedException
      Log that the connector can not process the catalog target because of an incomplete connection.
      Parameters:
      missingParameterName - desired type of the catalog target
      methodName - calling method
      Throws:
      ConnectorCheckedException - resulting exception
    • throwMissingPropertyValue

      protected void throwMissingPropertyValue(String missingPropertyName, String methodName, OpenMetadataRootElement element) throws ConnectorCheckedException
      Throw an exception because a necessary property is missing. The description portrays this a s logic error.
      Parameters:
      missingPropertyName - missing property name
      methodName - calling method
      element - element in error
      Throws:
      ConnectorCheckedException - resulting exception
    • throwBadBeanClass

      protected void throwBadBeanClass(OpenMetadataType expectedType, String methodName, OpenMetadataRootElement element) throws ConnectorCheckedException
      Indicate that an element does not have properties of the expected bean class. This is documented as a logic error.
      Parameters:
      expectedType - open metadata type information
      methodName - calling method
      element - element in error
      Throws:
      ConnectorCheckedException - resulting exception
    • getHostIdentifier

      protected String getHostIdentifier(String networkAddress)
      Extract the host identifier (eg coco.com) from the network address.
      Parameters:
      networkAddress - network address from the endpoint
      Returns:
      host identifier
    • getPortNumber

      protected String getPortNumber(String networkAddress)
      Retrieves the port number from a network address string.
      Parameters:
      networkAddress - the network address from the endpoint
      Returns:
      the port number extracted from the network address, or null if not found
    • getStringConfigurationProperty

      protected String getStringConfigurationProperty(String propertyName, Map<String,Object> configurationProperties)
      Retrieve a configuration property that is a string or null if not set.
      Parameters:
      propertyName - name of property
      configurationProperties - configuration properties
      Returns:
      string value of property or null if not supplied
    • getDateConfigurationProperty

      protected Date getDateConfigurationProperty(String propertyName, Map<String,Object> configurationProperties) throws InvalidParameterException
      Retrieve a configuration property that is a string formatted date or null if not set.
      Parameters:
      propertyName - name of property
      configurationProperties - configuration properties
      Returns:
      string value of property or null if not supplied
      Throws:
      InvalidParameterException
    • getSuppliedPlaceholderProperties

      protected Map<String,String> getSuppliedPlaceholderProperties(Map<String,Object> configurationProperties)
      Pass the configuration properties as placeholder properties. This allows the caller to supply additional properties to a template beyond those envisaged in the connector implementation. The templating process is not affected if properties not use in the template are supplied
      Parameters:
      configurationProperties - supplied configuration properties
      Returns:
      placeholder properties map
    • getArrayConfigurationProperty

      protected List<String> getArrayConfigurationProperty(String propertyName, Map<String,Object> configurationProperties, List<String> defaultValue)
      Retrieve a configuration property that is a comma-separated list of strings.
      Parameters:
      propertyName - name of property
      configurationProperties - configuration properties
      defaultValue - value to use if the property is not specified.
      Returns:
      list of strings or null if not set
    • getArrayConfigurationProperty

      protected List<String> getArrayConfigurationProperty(String propertyName, Map<String,Object> configurationProperties, String defaultValue)
      Retrieve a configuration property that is a comma-separated list of strings.
      Parameters:
      propertyName - name of property
      configurationProperties - configuration properties
      defaultValue - value to use if the property is not specified.
      Returns:
      list of strings or null if not set
    • getArrayConfigurationProperty

      protected List<String> getArrayConfigurationProperty(String propertyName, Map<String,Object> configurationProperties)
      Retrieve a configuration property that is a comma-separated list of strings.
      Parameters:
      propertyName - name of property
      configurationProperties - configuration properties
      Returns:
      list of strings or null if not set
    • getBooleanConfigurationProperty

      protected boolean getBooleanConfigurationProperty(String propertyName, Map<String,Object> configurationProperties)
      Retrieve a configuration property that is a boolean. If any non-null value is set it returns true unless the value is set to FALSE, False or false.
      Parameters:
      propertyName - name of property
      configurationProperties - configuration properties
      Returns:
      boolean flag or false if not set
    • getIntConfigurationProperty

      protected int getIntConfigurationProperty(String propertyName, Map<String,Object> configurationProperties)
      Retrieve a configuration property that is an integer.
      Parameters:
      propertyName - name of property
      configurationProperties - configuration properties
      Returns:
      integer value or zero if not supplied
    • getLongConfigurationProperty

      protected long getLongConfigurationProperty(String propertyName, Map<String,Object> configurationProperties)
      Retrieve a configuration property that is an integer.
      Parameters:
      propertyName - name of property
      configurationProperties - configuration properties
      Returns:
      integer value or zero if not supplied