Class OMRSTopicConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.repositoryservices.connectors.omrstopic.OMRSTopicConnector
- All Implemented Interfaces:
AuditLoggingComponent
,SecureConnectorExtension
,VirtualConnectorExtension
,OMRSTopic
,OpenMetadataTopicListener
public class OMRSTopicConnector
extends ConnectorBase
implements OMRSTopic, VirtualConnectorExtension, OpenMetadataTopicListener, AuditLoggingComponent
OMRSTopicConnector provides the support for the registration of OMRSTopicListeners and the distribution of
OMRS events - both inbound and outbound.
The OMRSTopicConnector is a virtual connector. It uses one or more event bus connectors to interact with real event buses. These connectors are passed to it during initialization. During its operation, it acts as a go-between the event buses processing JSON payloads and internal open metadata components that expect to receive OMRS Events.
OMRSTopicConnector implements 3 interfaces:
- OMRSTopic provides the methods for OMRSTopicListeners to register with this connector.
- VirtualConnectorExtension declares this connector a virtual connector and provides the method for receiving the event bus connectors (embedded connectors).
- OpenMetadataTopicListener enables this object to register with the real event bus connectors that implement OpenMetadataTopic.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Free up any resources held since the connector is no longer needed.Return the component description that is used by this connector in the audit log.void
processEvent
(String event) Receives events from the real topic, parses them into event objects and passes them on to the OMRSTopicListeners registered with this connector.void
registerListener
(OMRSTopicListener topicListener) Deprecated.void
registerListener
(OMRSTopicListener topicListener, String serviceName) Register a listener object.void
registerListener
(OMRSTopicRepositoryEventListener topicListener, String serviceName) Register a listener object.void
sendInstanceEvent
(OMRSInstanceEvent instanceEvent) Set the instance event to the OMRS Topic connector if the instance event is of the permitted type.sendRegistryEvent
(OMRSRegistryEvent registryEvent) Send the registry event to the OMRS Topic connector and manage errorssendTypeDefEvent
(OMRSTypeDefEvent typeDefEvent) Send the TypeDef event to the OMRS Topic connector (providing TypeDef Events are enabled).void
setAuditLog
(AuditLog auditLog) Receive an audit log object that can be used to record audit log messages.void
setEventProtocolLevel
(OMRSEventProtocolVersion eventProtocolVersion) Set up the version of the protocol to use for events.void
start()
Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, getArrayConfigurationProperty, getAssetTypeName, getBooleanConfigurationProperty, getConnectedAssetProperties, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getNetworkAddresses, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeConnectedAssetProperties, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toString
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension
initializeEmbeddedConnectors
-
Field Details
-
auditLog
-
-
Constructor Details
-
OMRSTopicConnector
public OMRSTopicConnector()Default constructor
-
-
Method Details
-
setAuditLog
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 interfaceAuditLoggingComponent
- Parameters:
auditLog
- audit log object
-
getConnectorComponentDescription
Return the component description that is used by this connector in the audit log.- Specified by:
getConnectorComponentDescription
in interfaceAuditLoggingComponent
- Returns:
- id, name, description, wiki page URL.
-
setEventProtocolLevel
Set up the version of the protocol to use for events.- Specified by:
setEventProtocolLevel
in interfaceOMRSTopic
- Parameters:
eventProtocolVersion
- version enum
-
registerListener
Deprecated.Register an OMRSTopicListener object. This object will be supplied with all the OMRS events received on the topic.- Specified by:
registerListener
in interfaceOMRSTopic
- Parameters:
topicListener
- object implementing the OMRSTopicListener interface
-
registerListener
Register a listener object. This object will be supplied with all the events received on the topic.- Specified by:
registerListener
in interfaceOMRSTopic
- Parameters:
topicListener
- object implementing the OMRSTopicListener interfaceserviceName
- name of the service that the listener is from
-
registerListener
Register a listener object. This object will be supplied with all the events received on the topic.- Specified by:
registerListener
in interfaceOMRSTopic
- Parameters:
topicListener
- object implementing the OMRSTopicRepositoryEventListener interfaceserviceName
- name of the service that the listener is from
-
start
Indicates that the connector is completely configured and can begin processing. OMRSTopicConnector needs to pass on the start() to its embedded connectors.- Overrides:
start
in classConnectorBase
- Throws:
ConnectorCheckedException
- there is a problem within the connector.
-
sendRegistryEvent
public CompletableFuture<Boolean> sendRegistryEvent(OMRSRegistryEvent registryEvent) throws ConnectorCheckedException Send the registry event to the OMRS Topic connector and manage errors- Specified by:
sendRegistryEvent
in interfaceOMRSTopic
- Parameters:
registryEvent
- properties of the event to send- Returns:
- a future that contains the result of send event
- Throws:
ConnectorCheckedException
- the connector is not able to communicate with the event bus
-
sendTypeDefEvent
public CompletableFuture<Boolean> sendTypeDefEvent(OMRSTypeDefEvent typeDefEvent) throws ConnectorCheckedException Send the TypeDef event to the OMRS Topic connector (providing TypeDef Events are enabled).- Specified by:
sendTypeDefEvent
in interfaceOMRSTopic
- Parameters:
typeDefEvent
- properties of the event to send- Returns:
- a future that contains the result of sendEvent
- Throws:
ConnectorCheckedException
- the connector is not able to communicate with the event bus
-
sendInstanceEvent
Set the instance event to the OMRS Topic connector if the instance event is of the permitted type.- Specified by:
sendInstanceEvent
in interfaceOMRSTopic
- Parameters:
instanceEvent
- properties of the event to send- Throws:
ConnectorCheckedException
- the connector is not able to communicate with the event bus
-
processEvent
Receives events from the real topic, parses them into event objects and passes them on to the OMRSTopicListeners registered with this connector.- Specified by:
processEvent
in interfaceOpenMetadataTopicListener
- Parameters:
event
- inbound event
-
disconnect
Free up any resources held since the connector is no longer needed.- Overrides:
disconnect
in classConnectorBase
- Throws:
ConnectorCheckedException
- there is a problem within the connector.
-