Class CatalogTargetProcessorBase
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipProperties
org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipBeanProperties
org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.connectors.CatalogTargetProperties
org.odpi.openmetadata.frameworks.opengovernance.properties.CatalogTarget
org.odpi.openmetadata.frameworks.integration.properties.RequestedCatalogTarget
org.odpi.openmetadata.frameworks.integration.connectors.CatalogTargetProcessorBase
- Direct Known Subclasses:
AuditLogDestinationCatalogTargetProcessor,HarvestOpenMetadataCatalogTargetProcessor,HarvestSurveysCatalogTargetProcessor,JDBCIntegrationCatalogTargetProcessor,KafkaTopicCatalogTargetProcessor,KafkaTopicSourceCatalogTargetProcessor,OpenLineageEventReceiverCatalogTargetProcessor,OpenMetadataProductsHarvesterCatalogTargetProcessor,OSSUnityCatalogInsideCatalogSyncCatalogTargetProcessor,OSSUnityCatalogServerSyncCatalogTargetProcessor,PostgresServerCatalogTargetProcessor
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final AuditLogprotected final Stringprotected Stringprotected Stringprotected final PropertyHelperFields inherited from class org.odpi.openmetadata.frameworks.integration.properties.RequestedCatalogTarget
connectorToTarget, integrationContext -
Constructor Summary
ConstructorsConstructorDescriptionCatalogTargetProcessorBase(CatalogTarget template, CatalogTargetContext catalogTargetContext, Connector connectorToTarget, String connectorName, AuditLog auditLog) Copy/clone constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidFree up any resources held since the catalog target processor is no longer needed.getArrayConfigurationProperty(String propertyName, Map<String, Object> configurationProperties) Retrieve a configuration property that is a comma-separated list of strings.getArrayConfigurationProperty(String propertyName, Map<String, Object> configurationProperties, String defaultValue) Retrieve a configuration property that is a comma-separated list of strings.getArrayConfigurationProperty(String propertyName, Map<String, Object> configurationProperties, List<String> defaultValue) Retrieve a configuration property that is a comma-separated list of strings.protected booleangetBooleanConfigurationProperty(String propertyName, Map<String, Object> configurationProperties) Retrieve a configuration property that is a boolean.protected DategetDateConfigurationProperty(String propertyName, Map<String, Object> configurationProperties) Retrieve a configuration property that is a string formatted date or null if not set.protected StringgetHostIdentifier(String networkAddress) Extract the host identifier (eg coco.com) from the network address.protected intgetIntConfigurationProperty(String propertyName, Map<String, Object> configurationProperties) Retrieve a configuration property that is an integer.protected longgetLongConfigurationProperty(String propertyName, Map<String, Object> configurationProperties) Retrieve a configuration property that is an integer.protected StringgetPortNumber(String networkAddress) Retrieves the port number from a network address string.protected StringgetStringConfigurationProperty(String propertyName, Map<String, Object> configurationProperties) Retrieve a configuration property that is a string or null if not set.getSuppliedPlaceholderProperties(Map<String, Object> configurationProperties) Pass the configuration properties as placeholder properties.voidrefresh()Requests that the connector does a comparison of the metadata in the third party technology and open metadata repositories.protected voidEnsure that the metadata collection identifiers are properly set up.protected StringsetUpSoftwareCapability(String softwareCapabilityTypeName) Ensure that the named software capability type is properly set up.voidstart()Indicates that the catalog target processor is completely configured and can begin processing.protected voidthrowBadBeanClass(OpenMetadataType expectedType, String methodName, OpenMetadataRootElement element) Indicate that an element does not have properties of the expected bean class.protected voidthrowMissingConnectionInfo(String missingParameterName, String methodName) Log that the connector can not process the catalog target because of an incomplete connection.protected voidthrowMissingPropertyValue(String missingPropertyName, String methodName, OpenMetadataRootElement element) Throw an exception because a necessary property is missing.protected voidthrowWrongTypeOfCatalogTarget(String expectedTypeName, String methodName) Log that the connector can not process the type of catalog target it has been passed.protected voidthrowWrongTypeOfResourceConnector(String expectedClassName, String methodName) Log that the connector can not process the type of catalog target it has been passed.Methods inherited from class org.odpi.openmetadata.frameworks.integration.properties.RequestedCatalogTarget
equals, getConnectorToTarget, getIntegrationContext, getNetworkAddress, hashCode, toStringMethods inherited from class org.odpi.openmetadata.frameworks.opengovernance.properties.CatalogTarget
getCatalogTargetElement, getRelationshipGUID, getRelationshipVersions, setCatalogTargetElement, setRelationshipGUID, setRelationshipVersionsMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.connectors.CatalogTargetProperties
getCatalogTargetName, getConfigurationProperties, getConnectionName, getDeleteMethod, getMetadataSourceQualifiedName, getPermittedSynchronization, getTemplates, setCatalogTargetName, setConfigurationProperties, setConnectionName, setDeleteMethod, setMetadataSourceQualifiedName, setPermittedSynchronization, setTemplatesMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipBeanProperties
getExtendedProperties, getTypeName, setExtendedProperties, setTypeNameMethods inherited from class org.odpi.openmetadata.frameworks.openmetadata.properties.RelationshipProperties
getEffectiveFrom, getEffectiveTo, setEffectiveFrom, setEffectiveTo
-
Field Details
-
connectorName
-
auditLog
-
propertyHelper
-
metadataCollectionGUID
-
metadataCollectionName
-
-
Constructor Details
-
CatalogTargetProcessorBase
public CatalogTargetProcessorBase(CatalogTarget template, CatalogTargetContext catalogTargetContext, Connector connectorToTarget, String connectorName, AuditLog auditLog) Copy/clone constructor- Parameters:
template- object to copycatalogTargetContext- specialized context for this catalog targetconnectorToTarget- connector to access the target resourceconnectorName- name of this integration connectorauditLog- 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:
startin classRequestedCatalogTarget- 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
Free up any resources held since the catalog target processor is no longer needed.- Throws:
ConnectorCheckedException- there is a problem within the connector.
-
setUpMetadataSource
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 targetmethodName- 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 connectormethodName- 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 targetmethodName- 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 namemethodName- calling methodelement- 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 informationmethodName- calling methodelement- element in error- Throws:
ConnectorCheckedException- resulting exception
-
getHostIdentifier
Extract the host identifier (eg coco.com) from the network address.- Parameters:
networkAddress- network address from the endpoint- Returns:
- host identifier
-
getPortNumber
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 propertyconfigurationProperties- configuration properties- Returns:
- string value of property or null if not supplied
-
getDateConfigurationProperty
protected Date getDateConfigurationProperty(String propertyName, Map<String, Object> configurationProperties) throws InvalidParameterExceptionRetrieve a configuration property that is a string formatted date or null if not set.- Parameters:
propertyName- name of propertyconfigurationProperties- 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 propertyconfigurationProperties- configuration propertiesdefaultValue- 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 propertyconfigurationProperties- configuration propertiesdefaultValue- 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 propertyconfigurationProperties- 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 propertyconfigurationProperties- 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 propertyconfigurationProperties- 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 propertyconfigurationProperties- configuration properties- Returns:
- integer value or zero if not supplied
-