Class LocalOMRSRepositoryConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector
org.odpi.openmetadata.repositoryservices.localrepository.repositoryconnector.LocalOMRSRepositoryConnector
- All Implemented Interfaces:
AuditLoggingComponent
,SecureConnectorExtension
,VirtualConnectorExtension
,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.
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.
-
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.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector
auditLog, maxPageSize, metadataCollection, metadataCollectionId, metadataCollectionName, organizationName, repositoryHelper, repositoryName, repositoryValidator, serverName, serverType, serverUserId
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap
-
Constructor Summary
ModifierConstructorDescriptionprotected
LocalOMRSRepositoryConnector
(OMRSRepositoryConnector realLocalConnector, LocalRepositoryMode localRepositoryMode, OMRSRepositoryEventMapperConnector realEventMapper, OMRSRepositoryEventManager outboundRepositoryEventManager, OMRSRepositoryContentManager repositoryContentManager, OMRSRepositoryEventExchangeRule saveExchangeRule) Constructor used by the LocalOMRSConnectorProvider. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Free up any resources held since the connector is no longer needed.Return the instance event processor that should be passed all incoming instance events received from the cohorts that this server is a member of.Return the instance event processor that should be passed all incoming instance events received from the cohorts that this server is a member of.Return the TypeDef event processor that should be passed all incoming TypeDef events received from the cohorts that this server is a member of.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.Return the local server name used for outbound events.Return the local server type used for outbound events.Returns the metadata collection object that provides an OMRS abstraction of the metadata within a metadata repository.Returns the unique identifier (guid) of the local repository's metadata collection.Return the name of the organization that owns this local repository.Return the event manager that the local repository uses to distribute events from the local repository.boolean
isActiveCohortMember
(String metadataCollectionId) Is the metadata collection id for an active member of the cohort.void
setAuditLog
(OMRSAuditLog auditLog) Receive an audit log object that can be used to record audit log messages.void
setMaxPageSize
(int maxPageSize) Set up the maximum PageSizevoid
setMetadataCollectionId
(String metadataCollectionId) Set up the unique id for this metadata collection.void
setMetadataCollectionName
(String metadataCollectionName) Explicitly set up the metadata collection name.void
setOrganizationName
(String organizationName) Set up the name of the organization that runs/owns the server.void
setRemoteCohortMetadataCollectionIds
(String cohortName, List<String> remoteCohortMetadataCollectionIds) Set up the list of metadata collection identifiers from the remote members of a connected cohort.void
setRepositoryHelper
(OMRSRepositoryContentHelper repositoryHelper) Set up a repository helper object for the repository connector to use.void
setRepositoryValidator
(OMRSRepositoryContentValidator repositoryValidator) Set up a repository validator for the repository connector to use.void
setSecurityVerifier
(OpenMetadataServerSecurityVerifier securityVerifier) Set up a new security verifier (the cohort manager runs with a default verifier until this method is called).void
setServerName
(String serverName) Set up the name of the server where the metadata collection resides.void
setServerType
(String serverType) Set up the descriptive string describing the type of the server.void
setServerUserId
(String localServerUserId) Set up the userId that the local server should use when processing events and there is no external user driving the operation.void
start()
Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector
getConnectorComponentDescription, getMaxPageSize, getMetadataCollectionName, getRepositoryHelper, getRepositoryName, getRepositoryValidator, getServerName, getServerType, getServerUserId, setAuditLog, setRepositoryHelper, setRepositoryName, setRepositoryValidator, validateRepositoryIsActive
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
disconnectConnectors, equals, getArrayConfigurationProperty, getAssetTypeName, getBooleanConfigurationProperty, getConnectedAssetProperties, getConnection, getConnectorInstanceId, 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.repositoryservices.localrepository.OMRSLocalRepository
getMetadataCollectionName
Methods inherited from interface org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSMetadataCollectionManager
getMaxPageSize, getRepositoryName, getServerName, getServerType, getServerUserId, setRepositoryHelper, setRepositoryName, setRepositoryValidator
-
Constructor Details
-
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 repositorylocalRepositoryMode
- what is the mode of the local repository - affects how event mappers are treatedrealEventMapper
- optional event mapper for local repositoryoutboundRepositoryEventManager
- 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 Details
-
setSecurityVerifier
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
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
start
in classConnectorBase
- Throws:
ConnectorCheckedException
- there is a problem within the connector.
-
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.
-
setRepositoryHelper
Set up a repository helper object for the repository connector to use.- Parameters:
repositoryHelper
- helper object for building TypeDefs and metadata instances.
-
setRepositoryValidator
Set up a repository validator for the repository connector to use.- Parameters:
repositoryValidator
- validator object to check the validity of TypeDefs and metadata instances.
-
setMaxPageSize
public void setMaxPageSize(int maxPageSize) Set up the maximum PageSize- Specified by:
setMaxPageSize
in interfaceOMRSMetadataCollectionManager
- Overrides:
setMaxPageSize
in classOMRSRepositoryConnector
- Parameters:
maxPageSize
- maximum number of elements that can be retrieved on a request.
-
setServerName
Set up the name of the server where the metadata collection resides.- Specified by:
setServerName
in interfaceOMRSMetadataCollectionManager
- Overrides:
setServerName
in classOMRSRepositoryConnector
- Parameters:
serverName
- String name
-
setServerType
Set up the descriptive string describing the type of the server. This might be the name of the product, or similar identifier.- Specified by:
setServerType
in interfaceOMRSMetadataCollectionManager
- Overrides:
setServerType
in classOMRSRepositoryConnector
- Parameters:
serverType
- String server type
-
setOrganizationName
Set up the name of the organization that runs/owns the server.- Specified by:
setOrganizationName
in interfaceOMRSMetadataCollectionManager
- Overrides:
setOrganizationName
in classOMRSRepositoryConnector
- Parameters:
organizationName
- String organization name
-
setRemoteCohortMetadataCollectionIds
public void setRemoteCohortMetadataCollectionIds(String cohortName, List<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 interfaceOMRSLocalRepository
- Parameters:
cohortName
- name of cohortremoteCohortMetadataCollectionIds
- list of metadata collection ids
-
isActiveCohortMember
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 interfaceOMRSLocalRepository
- Parameters:
metadataCollectionId
- id to test- Returns:
- boolean flag meaning that the metadata collection is recognized
-
setServerUserId
Set up the userId that the local server should use when processing events and there is no external user driving the operation.- Specified by:
setServerUserId
in interfaceOMRSMetadataCollectionManager
- Overrides:
setServerUserId
in classOMRSRepositoryConnector
- Parameters:
localServerUserId
- string user id
-
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.- Parameters:
auditLog
- audit log object
-
setMetadataCollectionId
Set up the unique id for this metadata collection.- Specified by:
setMetadataCollectionId
in interfaceOMRSMetadataCollectionManager
- Overrides:
setMetadataCollectionId
in classOMRSRepositoryConnector
- Parameters:
metadataCollectionId
- String unique Id
-
setMetadataCollectionName
Explicitly set up the metadata collection name.- Overrides:
setMetadataCollectionName
in classOMRSRepositoryConnector
- Parameters:
metadataCollectionName
- display name of the metadata collection.
-
getMetadataCollection
Returns the metadata collection object that provides an OMRS abstraction of the metadata within a metadata repository.- Specified by:
getMetadataCollection
in interfaceOMRSMetadataCollectionManager
- Overrides:
getMetadataCollection
in classOMRSRepositoryConnector
- Returns:
- OMRSMetadataInstanceStore metadata information retrieved from the metadata repository.
- Throws:
RepositoryErrorException
- no metadata collection
-
getMetadataCollectionId
Returns the unique identifier (guid) of the local repository's metadata collection.- Specified by:
getMetadataCollectionId
in interfaceOMRSLocalRepository
- Specified by:
getMetadataCollectionId
in interfaceOMRSMetadataCollectionManager
- Overrides:
getMetadataCollectionId
in classOMRSRepositoryConnector
- Returns:
- String guid
-
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 interfaceOMRSLocalRepository
- Returns:
- Connection object
-
getOutboundRepositoryEventManager
Return the event manager that the local repository uses to distribute events from the local repository.- Specified by:
getOutboundRepositoryEventManager
in interfaceOMRSLocalRepository
- Returns:
- outbound repository event manager
-
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 interfaceOMRSLocalRepository
- Returns:
- OMRSTypeDefEventProcessor for the local repository.
-
getIncomingInstanceEventProcessor
Return the instance event processor that should be passed all incoming instance events received from the cohorts that this server is a member of.- Specified by:
getIncomingInstanceEventProcessor
in interfaceOMRSLocalRepository
- Returns:
- OMRSInstanceEventProcessor for the local repository.
-
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
Return the local server name used for outbound events.- Specified by:
getLocalServerName
in interfaceOMRSLocalRepository
- Returns:
- String name
-
getLocalServerType
Return the local server type used for outbound events.- Specified by:
getLocalServerType
in interfaceOMRSLocalRepository
- Returns:
- String name
-
getOrganizationName
Return the name of the organization that owns this local repository.- Specified by:
getOrganizationName
in interfaceOMRSLocalRepository
- Specified by:
getOrganizationName
in interfaceOMRSMetadataCollectionManager
- Overrides:
getOrganizationName
in classOMRSRepositoryConnector
- Returns:
- String name
-