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:
org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent, org.odpi.openmetadata.frameworks.connectors.SecureConnectorExtension, org.odpi.openmetadata.frameworks.connectors.VirtualConnectorExtension, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSMetadataCollectionManager

public class XTDBOMRSRepositoryConnector extends org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector
Provides all connectivity and API-based interaction with a XTDB back-end.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor used by the OCF Connector Provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    boolean
    Default equality comparison.
    boolean
    Indicates whether the connector expects all regular expressions to be Lucene-compatible (true) or not (false).
    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail
    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.
    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntitySummary
    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.
    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship
    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
    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, Exception 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)
    void
    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

    getConnectedAssetProperties, getConnection, getConnectorInstanceId, initialize, initializeConnectedAssetProperties, initializeEmbeddedConnectors, initializeSecretsStoreConnector, 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

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • XTDBOMRSRepositoryConnector

      public XTDBOMRSRepositoryConnector()
      Default constructor used by the OCF Connector Provider.
  • Method Details

    • setMetadataCollectionId

      public void setMetadataCollectionId(String metadataCollectionId)
      Specified by:
      setMetadataCollectionId in interface org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSMetadataCollectionManager
      Overrides:
      setMetadataCollectionId in class org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector
    • start

      public void start() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Overrides:
      start in class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
    • disconnect

      public void disconnect() throws org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
      Overrides:
      disconnect in class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException
    • 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, Exception 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 occurred
      methodName - where the problem occurred
      code - describing the problem
      cause - 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

      public void validateCommit(xtdb.api.TransactionInstant instant, String methodName) throws Exception
      Validate that the commit was persisted, or throw an exception if it failed.
      Parameters:
      instant - giving the commit point
      methodName - that made the commit
      Throws:
      Exception - on any error
    • getResultingEntity

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.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 transaction
      methodName - that made the commit
      Returns:
      EntityDetail result of the committed transaction (synchronous) or null (asynchronous)
      Throws:
      Exception - on any error
    • getResultingEntitySummary

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.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 transaction
      methodName - that made the commit
      Returns:
      EntitySummary result of the committed transaction (synchronous) or null (asynchronous)
      Throws:
      Exception - on any error
    • getResultingRelationship

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.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 transaction
      methodName - 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

      public boolean equals(Object o)
      Default equality comparison.
      Overrides:
      equals in class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
      Parameters:
      o - object to compare against
      Returns:
      boolean
    • hashCode

      public int hashCode()
      Default hash calculation.
      Overrides:
      hashCode in class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
      Returns:
      int