Class OMRSRegistryEvent


  • public class OMRSRegistryEvent
    extends OMRSEvent
    OMRSRegistryEvent provides the conversion between the properties of a registry event and the serialized event body. It supports conversion in either direction through its inner class called OMRSRegistryEventPayload:
    • Converting from registry event properties to an OMRSEvent body for sending outbound events.
    • Converting from an event body to registry event properties for inbound events.
    OMRSRegistryEvent also provides a specialized interface to allow the cohort registry to work effectively with registry events.
    • Constructor Detail

      • OMRSRegistryEvent

        public OMRSRegistryEvent​(org.odpi.openmetadata.repositoryservices.events.beans.v1.OMRSEventV1 inboundEvent)
        Inbound event constructor that takes the object created by the Jackson JSON mapper and unpacks the properties into the registry event.
        Parameters:
        inboundEvent - incoming Event.
      • OMRSRegistryEvent

        public OMRSRegistryEvent​(OMRSRegistryEventType registryEventType,
                                 java.util.Date registrationTimestamp,
                                 java.lang.String metadataCollectionName,
                                 Connection remoteConnection)
        Constructor for a normal outbound event. It sets the event type and the other parameters used in a registry event payload.
        Parameters:
        registryEventType - type of event (REGISTRATION_EVENT, REFRESH_REGISTRATION_REQUEST, RE_REGISTRATION_EVENT)
        registrationTimestamp - time that the local repository registered.
        metadataCollectionName - name of the metadata collection being registered.
        remoteConnection - remote connection to this local repository.
      • OMRSRegistryEvent

        public OMRSRegistryEvent​(OMRSRegistryEventType registryEventType)
        Constructor for an UnRegistration Event.
        Parameters:
        registryEventType - the type of event
      • OMRSRegistryEvent

        public OMRSRegistryEvent​(OMRSRegistryEventErrorCode errorCode,
                                 java.lang.String errorMessage,
                                 java.lang.String targetMetadataCollectionId,
                                 Connection remoteConnection)
        Constructor for the REGISTRATION_ERROR_EVENT outbound event.
        Parameters:
        errorCode - detailed error code
        errorMessage - Optional error message
        targetMetadataCollectionId - the identifier of the server that sent bad information.
        remoteConnection - remote connection to the target repository. (Optional only supplied if relevant to the reported error; otherwise null.)
    • Method Detail

      • getRegistryEventType

        public OMRSRegistryEventType getRegistryEventType()
        Return the specific registry event type.
        Returns:
        registry event type enum
      • getRegistrationTimestamp

        public java.util.Date getRegistrationTimestamp()
        Return the date/time that the repository registered with the open metadata repository cohort. If this is a normal registry event then this timestamp is the registration time for the local repository. If this an error event, then this is the registration time for the target repository.
        Returns:
        Date object for timestamp
      • getMetadataCollectionName

        public java.lang.String getMetadataCollectionName()
        Return the display name for the repository's metadata collection.
        Returns:
        string name
      • getRemoteConnection

        public Connection getRemoteConnection()
        Return the remote connection used to create a connector used to call the repository across the network. If this is a normal registry event then this connection is for the local repository. If this an error event, then this is the connection for the target repository.
        Returns:
        Connection object
      • getErrorCode

        public OMRSRegistryEventErrorCode getErrorCode()
        Return the error code for the event. This property is only used for error events.
        Returns:
        OMRSRegistryEventErrorCode enum
      • getOMRSEventV1

        public org.odpi.openmetadata.repositoryservices.events.beans.v1.OMRSEventV1 getOMRSEventV1()
        Returns an OMRSEvent populated with details from this RegistryEvent
        Overrides:
        getOMRSEventV1 in class OMRSEvent
        Returns:
        OMRSEvent (Version 1) object
      • toString

        public java.lang.String toString()
        Standard toString method.
        Overrides:
        toString in class OMRSEvent
        Returns:
        JSON style description of variables.