Class XTDBOMRSRepositoryConnector
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.adapters.repositoryservices.xtdb.repositoryconnector.XTDBOMRSRepositoryConnector
- All Implemented Interfaces:
AuditLoggingComponent
,SecureConnectorExtension
,VirtualConnectorExtension
,OMRSMetadataCollectionManager
Provides all connectivity and API-based interaction with a XTDB back-end.
-
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
ConstructorDescriptionDefault constructor used by the OCF Connector Provider. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Free up any resources held since the connector is no longer needed.boolean
Default equality comparison.boolean
Indicates whether the connector expects all regular expressions to be Lucene-compatible (true) or not (false).getResultingEntity
(String docId, xtdb.api.TransactionInstant instant, String methodName) Validates that the commit was persisted (if synchronous), throwing an exception if it failed, and also retrieves and returns the detailed entity that resulted from the transaction.getResultingEntitySummary
(String docId, xtdb.api.TransactionInstant instant, String methodName) Validates that the commit was persisted (if synchronous), throwing an exception if it failed, and also retrieves and returns the summary entity that resulted from the transaction.getResultingRelationship
(String docId, xtdb.api.TransactionInstant instant, String methodName) Validates that the commit was persisted (if synchornous), throwing an exception if it failed, and also retrieves and returns the detailed relationship that resulted from the transaction.xtdb.api.IXtdb
Retrieve the XTDB API directly.int
hashCode()
Default hash calculation.boolean
Checks whether the data store is currently empty.boolean
Indicates whether Lucene is configured in the connector (true) or not (false).void
logProblem
(String className, String methodName, XTDBAuditCode code, Throwable cause, String... params) Log a problem with the connector, preferring the audit log so long as it is available and only falling back to debug-level logging if it is not.xtdb.api.TransactionInstant
runTx
(xtdb.api.tx.Transaction statements) Run multiple statements through XTDB as a single transaction.void
setMetadataCollectionId
(String metadataCollectionId) Set up the unique id for this metadata collection.void
start()
Indicates that the connector is completely configured and can begin processing.void
validateCommit
(xtdb.api.TransactionInstant instant, String methodName) Validate that the commit was persisted, or throw an exception if it failed.Methods inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector
getConnectorComponentDescription, getMaxPageSize, getMetadataCollection, getMetadataCollectionId, getMetadataCollectionName, getOrganizationName, getRepositoryHelper, getRepositoryName, getRepositoryValidator, getServerName, getServerType, getServerUserId, setAuditLog, setMaxPageSize, setMetadataCollectionName, setOrganizationName, setRepositoryHelper, setRepositoryName, setRepositoryValidator, setServerName, setServerType, setServerUserId, validateRepositoryIsActive
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, getArrayConfigurationProperty, getAssetTypeName, getBooleanConfigurationProperty, getConnectedAssetProperties, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getNetworkAddresses, getStringConfigurationProperty, getSuppliedPlaceholderProperties, 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
-
Constructor Details
-
XTDBOMRSRepositoryConnector
public XTDBOMRSRepositoryConnector()Default constructor used by the OCF Connector Provider.
-
-
Method Details
-
setMetadataCollectionId
Set up the unique id for this metadata collection.- Specified by:
setMetadataCollectionId
in interfaceOMRSMetadataCollectionManager
- Overrides:
setMetadataCollectionId
in classOMRSRepositoryConnector
- Parameters:
metadataCollectionId
- String unique Id
-
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.
-
isLuceneConfigured
public boolean isLuceneConfigured()Indicates whether Lucene is configured in the connector (true) or not (false).- Returns:
- boolean
-
expectsLuceneRegexes
public boolean expectsLuceneRegexes()Indicates whether the connector expects all regular expressions to be Lucene-compatible (true) or not (false).- Returns:
- boolean
-
logProblem
public void logProblem(String className, String methodName, XTDBAuditCode code, Throwable cause, String... params) Log a problem with the connector, preferring the audit log so long as it is available and only falling back to debug-level logging if it is not.- Parameters:
className
- where the problem occurredmethodName
- where the problem occurredcode
- describing the problemcause
- the exception that triggered the problem (if any)params
- providing additional details about the problem
-
isDataStoreEmpty
public boolean isDataStoreEmpty()Checks whether the data store is currently empty.- Returns:
- true of the data store is empty (has no metadata stored), otherwise false
-
validateCommit
Validate that the commit was persisted, or throw an exception if it failed.- Parameters:
instant
- giving the commit pointmethodName
- that made the commit- Throws:
Exception
- on any error
-
getResultingEntity
public EntityDetail getResultingEntity(String docId, xtdb.api.TransactionInstant instant, String methodName) throws Exception Validates that the commit was persisted (if synchronous), throwing an exception if it failed, and also retrieves and returns the detailed entity that resulted from the transaction. Note that if the operation is configured to be asynchronous, this will ALWAYS return null for the entity details.- Parameters:
docId
- of the entity within XTDB itself (i.e. prefixed)instant
- giving the commit point of the transactionmethodName
- that made the commit- Returns:
- EntityDetail result of the committed transaction (synchronous) or null (asynchronous)
- Throws:
Exception
- on any error
-
getResultingEntitySummary
public EntitySummary getResultingEntitySummary(String docId, xtdb.api.TransactionInstant instant, String methodName) throws Exception Validates that the commit was persisted (if synchronous), throwing an exception if it failed, and also retrieves and returns the summary entity that resulted from the transaction. Note that if the operation is configured to be asynchronous, this will ALWAYS return null for the entity details.- Parameters:
docId
- of the entity within XTDB itself (i.e. prefixed)instant
- giving the commit point of the transactionmethodName
- that made the commit- Returns:
- EntitySummary result of the committed transaction (synchronous) or null (asynchronous)
- Throws:
Exception
- on any error
-
getResultingRelationship
public Relationship getResultingRelationship(String docId, xtdb.api.TransactionInstant instant, String methodName) throws Exception Validates that the commit was persisted (if synchornous), throwing an exception if it failed, and also retrieves and returns the detailed relationship that resulted from the transaction. Note that if the operation is configured to be asynchronous, this will ALWAYS return null for the relationship detials.- Parameters:
docId
- of the relationship within XTDB itself (i.e. prefixed)instant
- giving the commit point of the transactionmethodName
- that made the commit- Returns:
- Relationship result of the committed transaction (synchronous) or null (asynchronous)
- Throws:
Exception
- on any error
-
runTx
public xtdb.api.TransactionInstant runTx(xtdb.api.tx.Transaction statements) Run multiple statements through XTDB as a single transaction.- Parameters:
statements
- the transaction to submit- Returns:
- TransactionInstant transaction details
-
getXtdbAPI
public xtdb.api.IXtdb getXtdbAPI()Retrieve the XTDB API directly. NOTE: This should only be used in very exceptional circumstances where direct access to the API is needed (e.g. for testing purposes). Use any other method where possible.- Returns:
- IXtdb
-
equals
Default equality comparison.- Overrides:
equals
in classConnectorBase
- Parameters:
o
- object to compare against- Returns:
- boolean
-
hashCode
public int hashCode()Default hash calculation.- Overrides:
hashCode
in classConnectorBase
- Returns:
- int
-