Class OMRSTopicConnector

  • All Implemented Interfaces:
    AuditLoggingComponent, 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.
    • Field Detail

    • Constructor Detail

      • OMRSTopicConnector

        public OMRSTopicConnector()
        Default constructor
    • Method Detail

      • initializeEmbeddedConnectors

        public void initializeEmbeddedConnectors​(java.util.List<Connector> embeddedConnectors)
        Registers itself as a listener of any OpenMetadataTopicConnectors that are passed as embedded connectors.
        Specified by:
        initializeEmbeddedConnectors in interface VirtualConnectorExtension
        Parameters:
        embeddedConnectors - list of connectors
      • setAuditLog

        public void setAuditLog​(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:
        setAuditLog in interface AuditLoggingComponent
        Parameters:
        auditLog - audit log object
      • setEventProtocolLevel

        public void setEventProtocolLevel​(OMRSEventProtocolVersion eventProtocolVersion)
        Set up the version of the protocol to use for events.
        Specified by:
        setEventProtocolLevel in interface OMRSTopic
        Parameters:
        eventProtocolVersion - version enum
      • registerListener

        @Deprecated
        public void registerListener​(OMRSTopicListener topicListener)
        Deprecated.
        Register an OMRSTopicListener object. This object will be supplied with all the OMRS events received on the topic.
        Specified by:
        registerListener in interface OMRSTopic
        Parameters:
        topicListener - object implementing the OMRSTopicListener interface
      • registerListener

        public void registerListener​(OMRSTopicListener topicListener,
                                     java.lang.String serviceName)
        Register a listener object. This object will be supplied with all the events received on the topic.
        Specified by:
        registerListener in interface OMRSTopic
        Parameters:
        topicListener - object implementing the OMRSTopicListener interface
        serviceName - name of the service that the listener is from
      • registerListener

        public void registerListener​(OMRSTopicRepositoryEventListener topicListener,
                                     java.lang.String serviceName)
        Register a listener object. This object will be supplied with all the events received on the topic.
        Specified by:
        registerListener in interface OMRSTopic
        Parameters:
        topicListener - object implementing the OMRSTopicRepositoryEventListener interface
        serviceName - name of the service that the listener is from
      • processEvent

        public void processEvent​(java.lang.String event)
        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 interface OpenMetadataTopicListener
        Parameters:
        event - inbound event