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
,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.
-
-
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, securedProperties
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LocalOMRSRepositoryConnector(OMRSRepositoryConnector realLocalConnector, LocalRepositoryMode localRepositoryMode, OMRSRepositoryEventMapperConnector realEventMapper, OMRSRepositoryEventManager outboundRepositoryEventManager, OMRSRepositoryContentManager repositoryContentManager, OMRSRepositoryEventExchangeRule saveExchangeRule)
Constructor used by the LocalOMRSConnectorProvider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disconnect()
Free up any resources held since the connector is no longer needed.LocalOMRSInstanceEventProcessor
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.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.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.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.java.lang.String
getLocalServerName()
Return the local server name used for outbound events.java.lang.String
getLocalServerType()
Return the local server type used for outbound events.OMRSMetadataCollection
getMetadataCollection()
Returns the metadata collection object that provides an OMRS abstraction of the metadata within a metadata repository.java.lang.String
getMetadataCollectionId()
Returns the unique identifier (guid) of the local repository's metadata collection.java.lang.String
getOrganizationName()
Return the name of the organization that owns this local repository.OMRSRepositoryEventManager
getOutboundRepositoryEventManager()
Return the event manager that the local repository uses to distribute events from the local repository.boolean
isActiveCohortMember(java.lang.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(java.lang.String metadataCollectionId)
Set up the unique id for this metadata collection.void
setMetadataCollectionName(java.lang.String metadataCollectionName)
Explicitly set up the metadata collection name.void
setOrganizationName(java.lang.String organizationName)
Set up the name of the organization that runs/owns the server.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.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(java.lang.String serverName)
Set up the name of the server where the metadata collection resides.void
setServerType(java.lang.String serverType)
Set up the descriptive string describing the type of the server.void
setServerUserId(java.lang.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
equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initialize, initializeConnectedAssetProperties, isActive, 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 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 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 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
-
start
public void start() throws ConnectorCheckedException
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
public void disconnect() throws ConnectorCheckedException
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
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.
-
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
public void setServerName(java.lang.String serverName)
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
public void setServerType(java.lang.String serverType)
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
public void setOrganizationName(java.lang.String organizationName)
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(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 interfaceOMRSLocalRepository
- Parameters:
cohortName
- name of cohortremoteCohortMetadataCollectionIds
- 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 interfaceOMRSLocalRepository
- Parameters:
metadataCollectionId
- id to test- Returns:
- boolean flag meaning that the metadata collection is recognized
-
setServerUserId
public void setServerUserId(java.lang.String localServerUserId)
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
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
-
setMetadataCollectionId
public void setMetadataCollectionId(java.lang.String metadataCollectionId)
Set up the unique id for this metadata collection.- Specified by:
setMetadataCollectionId
in interfaceOMRSMetadataCollectionManager
- Overrides:
setMetadataCollectionId
in classOMRSRepositoryConnector
- Parameters:
metadataCollectionId
- String unique Id
-
setMetadataCollectionName
public void setMetadataCollectionName(java.lang.String metadataCollectionName)
Explicitly set up the metadata collection name.- Overrides:
setMetadataCollectionName
in classOMRSRepositoryConnector
- Parameters:
metadataCollectionName
- display name of the metadata collection.
-
getMetadataCollection
public OMRSMetadataCollection getMetadataCollection() throws RepositoryErrorException
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
public java.lang.String 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
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 interfaceOMRSLocalRepository
- Returns:
- Connection object
-
getOutboundRepositoryEventManager
public OMRSRepositoryEventManager 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
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 interfaceOMRSLocalRepository
- Returns:
- OMRSTypeDefEventProcessor for the local repository.
-
getIncomingInstanceEventProcessor
public LocalOMRSInstanceEventProcessor 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
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 interfaceOMRSLocalRepository
- Returns:
- String name
-
getLocalServerType
public java.lang.String getLocalServerType()
Return the local server type used for outbound events.- Specified by:
getLocalServerType
in interfaceOMRSLocalRepository
- Returns:
- String name
-
getOrganizationName
public java.lang.String 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
-
-