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:
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent,org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension,IntegrationConnector
public abstract class IntegrationConnectorBase
extends org.odpi.openmetadata.frameworks.connectors.ConnectorBase
implements IntegrationConnector, org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent, org.odpi.openmetadata.frameworks.connectors.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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.frameworks.connectors.ConnectorBase.ProtectedConnection -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.odpi.openmetadata.frameworks.auditlog.AuditLogprotected Stringprotected List<org.odpi.openmetadata.frameworks.connectors.Connector>protected IntegrationContextFields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, securedProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidFree up any resources held since the connector is no longer needed.voidengage()This method is for blocking calls to wait for new metadata.org.odpi.openmetadata.frameworks.auditlog.ComponentDescriptionReturn the component description that is used by this connector in the audit log.voidinitializeEmbeddedConnectors(List<org.odpi.openmetadata.frameworks.connectors.Connector> embeddedConnectors) Set up the list of connectors that this virtual connector will use to support its interface.voidsetAuditLog(org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.voidsetConnectorName(String connectorName) Set up the connector name for logging.voidsetContext(IntegrationContext integrationContext) Set up the standard integration context for the connector.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initialize, initializeConnectedAssetProperties, isActive, start, toStringMethods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestampMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.odpi.openmetadata.frameworks.integration.connectors.IntegrationConnector
refresh, start
-
Field Details
-
auditLog
protected org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog -
connectorName
-
integrationContext
-
embeddedConnectors
-
-
Constructor Details
-
IntegrationConnectorBase
public IntegrationConnectorBase()
-
-
Method Details
-
setAuditLog
public void setAuditLog(org.odpi.openmetadata.frameworks.auditlog.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:
setAuditLogin interfaceorg.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent- Parameters:
auditLog- audit log object
-
getConnectorComponentDescription
public org.odpi.openmetadata.frameworks.auditlog.ComponentDescription getConnectorComponentDescription()Return the component description that is used by this connector in the audit log.- Specified by:
getConnectorComponentDescriptionin interfaceorg.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent- Returns:
- id, name, description, wiki page URL.
-
initializeEmbeddedConnectors
public void initializeEmbeddedConnectors(List<org.odpi.openmetadata.frameworks.connectors.Connector> embeddedConnectors) Set up the list of connectors that this virtual connector will use to support its interface. The connectors are initialized waiting to start. When start() is called on the virtual connector, it needs to pass start() to each of the embedded connectors. Similarly for disconnect().- Specified by:
initializeEmbeddedConnectorsin interfaceorg.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension- Parameters:
embeddedConnectors- list of connectors
-
setConnectorName
Set up the connector name for logging.- Specified by:
setConnectorNamein interfaceIntegrationConnector- Parameters:
connectorName- connector name from the configuration
-
setContext
Set up the standard integration context for the connector.- Specified by:
setContextin interfaceIntegrationConnector- Parameters:
integrationContext- integration context.
-
engage
public void engage() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedExceptionThis 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:
engagein interfaceIntegrationConnector- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException- there is a problem within the connector.
-
disconnect
public void disconnect() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedExceptionFree up any resources held since the connector is no longer needed.- Specified by:
disconnectin interfaceIntegrationConnector- Overrides:
disconnectin classorg.odpi.openmetadata.frameworks.connectors.ConnectorBase- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException- there is a problem within the connector.
-