Class XtdbOMRSRepositoryConnector

  • All Implemented Interfaces:
    org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent, 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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase

        org.odpi.openmetadata.frameworks.connectors.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 
      Constructor Description
      XtdbOMRSRepositoryConnector()
      Default constructor used by the OCF Connector Provider.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void disconnect()
      boolean equals​(Object o)
      Default equality comparison.
      boolean expectsLuceneRegexes()
      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.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 getXtdbAPI()
      Retrieve the XTDB API directly.
      int hashCode()
      Default hash calculation.
      boolean isDataStoreEmpty()
      Checks whether the data store is currently empty.
      boolean isLuceneConfigured()
      Indicates whether Lucene is configured in the connector (true) or not (false).
      void logProblem​(String className, String methodName, XtdbOMRSAuditCode 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)
      void start()
      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, isActive, toString
      • Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector

        clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp
    • Constructor Detail

      • XtdbOMRSRepositoryConnector

        public XtdbOMRSRepositoryConnector()
        Default constructor used by the OCF Connector Provider.
    • Method Detail

      • 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,
                               XtdbOMRSAuditCode 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 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
      • 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