All Implemented Interfaces:
AuditLoggingComponent, SecureConnectorExtension, VirtualConnectorExtension, OMRSCohortRegistryStore

public class FileBasedRegistryStoreConnector extends OMRSCohortRegistryStoreConnectorBase
FileBasedRegistryStoreConnector uses JSON to store details of the membership of the open metadata repository cohort on behalf of the OMRSCohortRegistry.
  • Constructor Details

    • FileBasedRegistryStoreConnector

      public FileBasedRegistryStoreConnector()
  • Method Details

    • initialize

      public void initialize(String connectorInstanceId, ConnectionProperties connectionProperties)
      Initialize the connector.
      Overrides:
      initialize in class ConnectorBase
      Parameters:
      connectorInstanceId - - unique id for the connector instance - useful for messages etc
      connectionProperties - - POJO for the configuration used to create the connector.
    • saveLocalRegistration

      public void saveLocalRegistration(MemberRegistration localRegistration)
      Save the local registration to the cohort registry store. This provides details of the local repository's registration with the metadata repository cohort. Any previous local registration information is overwritten.
      Parameters:
      localRegistration - - details of the local repository's registration with the metadata cohort.
    • retrieveLocalRegistration

      public MemberRegistration retrieveLocalRegistration()
      Retrieve details of the local registration from the cohort registry store. A null may be returned if the local registration information has not been saved (typically because this is a new server instance).
      Returns:
      MemberRegistration object containing details for the local repository's registration with the metadata cohort (may be null if no registration has taken place).
    • removeLocalRegistration

      public void removeLocalRegistration()
      Remove details of the local registration from the cohort registry store. This is used when the local repository unregisters from the open metadata repository cohort. There is a side-effect that all the remote registrations are removed to since the local repository is no longer a member of this cohort.
    • saveRemoteRegistration

      public void saveRemoteRegistration(MemberRegistration remoteRegistration)
      Save details of a remote registration. This contains details of one of the other repositories in the metadata repository cohort.
      Parameters:
      remoteRegistration - - details of a remote repository in the metadata repository cohort.
    • retrieveRemoteRegistrations

      public List<MemberRegistration> retrieveRemoteRegistrations()
      Return a list of all the remote metadata repositories registered in the metadata repository cohort.
      Returns:
      Remote registrations list
    • retrieveRemoteRegistration

      public MemberRegistration retrieveRemoteRegistration(String metadataCollectionId)
      Return the registration information for a specific metadata repository, identified by its metadataCollectionId. If the metadataCollectionId is not recognized then null is returned.
      Parameters:
      metadataCollectionId - - unique identifier for the repository
      Returns:
      MemberRegistration object containing details of the remote metadata repository. (null if not found)
    • removeRemoteRegistration

      public void removeRemoteRegistration(String metadataCollectionId)
      Remove details of the requested remote repository's registration from the store.
      Parameters:
      metadataCollectionId - - unique identifier for the repository
    • clearAllRegistrations

      public void clearAllRegistrations()
      Remove the local and remote registrations from the cohort registry store since the local server has unregistered from the cohort.
    • disconnect

      public void disconnect()
      Close the config file
      Overrides:
      disconnect in class ConnectorBase
    • close

      public void close()
      Flush all changes and close the registry store.