Class LocalOMRSRepositoryConnector

  • All Implemented Interfaces:
    AuditLoggingComponent, OMRSMetadataCollectionManager, OMRSLocalRepository

    public class LocalOMRSRepositoryConnector
    extends OMRSRepositoryConnector
    implements OMRSLocalRepository
    LocalOMRSRepositoryConnector provides access the local metadata repository plus manages outbound repository events. It passes each request to both the real OMRS connector for the local metadata repository and an OMRSEventPublisher. The OMRSEventPublisher will use its configuration to decide if it needs to pass on the request to the rest of the metadata repository cohort.
    • Constructor Detail

      • LocalOMRSRepositoryConnector

        protected LocalOMRSRepositoryConnector​(OMRSRepositoryConnector realLocalConnector,
                                               LocalRepositoryMode localRepositoryMode,
                                               OMRSRepositoryEventMapperConnector realEventMapper,
                                               OMRSRepositoryEventManager outboundRepositoryEventManager,
                                               OMRSRepositoryContentManager repositoryContentManager,
                                               OMRSRepositoryEventExchangeRule saveExchangeRule)
        Constructor used by the LocalOMRSConnectorProvider. It provides the information necessary to run the local repository.
        Parameters:
        realLocalConnector - connector to the local repository
        localRepositoryMode - what is the mode of the local repository - affects how event mappers are treated
        realEventMapper - optional event mapper for local repository
        outboundRepositoryEventManager - event manager to call for outbound events.
        repositoryContentManager - repositoryContentManager for supporting OMRS in managing TypeDefs.
        saveExchangeRule - rule to determine what events to save to the local repository.
    • Method Detail

      • setSecurityVerifier

        public void setSecurityVerifier​(OpenMetadataServerSecurityVerifier securityVerifier)
        Set up a new security verifier (the cohort manager runs with a default verifier until this method is called). The security verifier provides authorization checks for access and maintenance changes to open metadata. Authorization checks are enabled through the OpenMetadataServerSecurityConnector.
        Parameters:
        securityVerifier - new security verifier
      • setRepositoryHelper

        public void setRepositoryHelper​(OMRSRepositoryContentHelper repositoryHelper)
        Set up a repository helper object for the repository connector to use.
        Parameters:
        repositoryHelper - helper object for building TypeDefs and metadata instances.
      • setRepositoryValidator

        public void setRepositoryValidator​(OMRSRepositoryContentValidator repositoryValidator)
        Set up a repository validator for the repository connector to use.
        Parameters:
        repositoryValidator - validator object to check the validity of TypeDefs and metadata instances.
      • setRemoteCohortMetadataCollectionIds

        public void setRemoteCohortMetadataCollectionIds​(java.lang.String cohortName,
                                                         java.util.List<java.lang.String> remoteCohortMetadataCollectionIds)
        Set up the list of metadata collection identifiers from the remote members of a connected cohort. This is called from the cohort registry as it is handling the remote registrations.
        Specified by:
        setRemoteCohortMetadataCollectionIds in interface OMRSLocalRepository
        Parameters:
        cohortName - name of cohort
        remoteCohortMetadataCollectionIds - list of metadata collection ids
      • isActiveCohortMember

        public boolean isActiveCohortMember​(java.lang.String metadataCollectionId)
        Is the metadata collection id for an active member of the cohort. This is used to set up the provenance type correctly (between LOCAL_COHORT and DEREGISTERED_REPOSITORY).
        Specified by:
        isActiveCohortMember in interface OMRSLocalRepository
        Parameters:
        metadataCollectionId - id to test
        Returns:
        boolean flag meaning that the metadata collection is recognized
      • setAuditLog

        public void setAuditLog​(OMRSAuditLog 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.
        Parameters:
        auditLog - audit log object
      • setMetadataCollectionName

        public void setMetadataCollectionName​(java.lang.String metadataCollectionName)
        Explicitly set up the metadata collection name.
        Overrides:
        setMetadataCollectionName in class OMRSRepositoryConnector
        Parameters:
        metadataCollectionName - display name of the metadata collection.
      • getLocalRepositoryRemoteConnection

        public Connection getLocalRepositoryRemoteConnection()
        Returns the Connection to the local repository that can be used by remote servers to create an OMRS repository connector to call this server in order to access the local repository.
        Specified by:
        getLocalRepositoryRemoteConnection in interface OMRSLocalRepository
        Returns:
        Connection object
      • getIncomingTypeDefEventProcessor

        public OMRSTypeDefEventProcessor getIncomingTypeDefEventProcessor()
        Return the TypeDef event processor that should be passed all incoming TypeDef events received from the cohorts that this server is a member of.
        Specified by:
        getIncomingTypeDefEventProcessor in interface OMRSLocalRepository
        Returns:
        OMRSTypeDefEventProcessor for the local repository.
      • getIncomingInstanceRetrievalEventProcessor

        public OMRSInstanceRetrievalEventProcessor getIncomingInstanceRetrievalEventProcessor()
        Return the instance event processor that should be passed all incoming instance events received from the cohorts that this server is a member of.
        Returns:
        OMRSInstanceEventProcessor for the local repository.
      • getLocalServerName

        public java.lang.String getLocalServerName()
        Return the local server name used for outbound events.
        Specified by:
        getLocalServerName in interface OMRSLocalRepository
        Returns:
        String name
      • getLocalServerType

        public java.lang.String getLocalServerType()
        Return the local server type used for outbound events.
        Specified by:
        getLocalServerType in interface OMRSLocalRepository
        Returns:
        String name