Class CruxOMRSRepositoryConnector

  • All Implemented Interfaces:
    org.odpi.openmetadata.frameworks.auditlog.AuditLoggingComponent, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSMetadataCollectionManager

    public class CruxOMRSRepositoryConnector
    extends org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector
    Provides all connectivity and API-based interaction with a Crux 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
      CruxOMRSRepositoryConnector()
      Default constructor used by the OCF Connector Provider.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCreateEntityProxyStatements​(crux.api.tx.Transaction.Builder tx, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy entity)
      Retrieve the statements that need to be executed against Crux to create (persist) the entity proxy provided.
      void addCreateEntityStatements​(crux.api.tx.Transaction.Builder tx, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
      Retrieve the statements that need to be executed against Crux to create (persist) the entity provided.
      void addCreateRelationshipStatements​(crux.api.tx.Transaction.Builder tx, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
      Retrieve the statements that need to be executed against Crux to create (persist) the relationship provided.
      void addPurgeEntityStatements​(crux.api.tx.Transaction.Builder tx, String guid)
      Retrieve the statements that need to be executed against Crux to permanently delete the entity (and all of its history) from the Crux repository.
      void addPurgeRelationshipStatements​(crux.api.tx.Transaction.Builder tx, String guid)
      Retrieve the statements that need to be executed against Crux to permanently delete the relationship (and all of its history) from the Crux repository.
      void addSaveReferenceCopyStatements​(crux.api.tx.Transaction.Builder tx, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
      Retrieve the statements that need to be executed against Crux to save the provided relationship as a reference copy.
      void addUpdateEntityStatements​(crux.api.tx.Transaction.Builder tx, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
      Retrieve the statements that need to be executed against Crux to update (persist) the entity provided.
      void addUpdateRelationshipStatements​(crux.api.tx.Transaction.Builder tx, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
      Retrieve the statements that need to be executed against Crux to update the provided relationship instance in the Crux repository.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail createEntity​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
      Create the provided entity instance in the Crux repository.
      void createEntityProxy​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy entity)
      Create the provided entity instance in the Crux repository.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship createRelationship​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
      Create the provided relationship instance in the Crux repository.
      void disconnect()
      boolean equals​(Object o)
      Default equality comparison.
      static void evict​(crux.api.tx.Transaction.Builder tx, String docRef)
      Add eviction of the specified docRef to the transaction (applicable for permanently removing anything by its "primary key").
      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findActiveRelationshipsForEntity​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity, String userId)
      Find all active (non-deleted) relationships in this repository for the provided entity.
      Collection<List<?>> findDirectNeighbors​(crux.api.ICruxDatasource db, String entityGUID, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification)
      Find the immediate neighbors (1-degree separated entities and the relationships between) using the provided criteria.
      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> findEntities​(String entityTypeGUID, List<String> entitySubtypeGUIDs, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties, int fromEntityElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, Date asOfTime, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId)
      Search based on the provided parameters.
      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> findEntitiesByText​(String entityTypeGUID, String searchCriteria, int fromEntityElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, Date asOfTime, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId)
      Search based on the provided parameters.
      Collection<List<?>> findEntityRelationships​(crux.api.ICruxDatasource db, String entityGUID, String userId, boolean includeDeleted)
      Find the relationships that match the provided parameters.
      Collection<List<?>> findEntityRelationships​(crux.api.ICruxDatasource db, String entityGUID, String relationshipTypeGUID, int fromRelationshipElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId)
      Find the relationships that match the provided parameters.
      Collection<List<?>> findHomedEntityRelationships​(crux.api.ICruxDatasource db, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity, String userId)
      Find the relationships that match the provided parameters.
      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findHomedRelationshipsForEntity​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity, String userId)
      Find all relationships homed in this repository for the provided entity.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceGraph findNeighborhood​(String entityGUID, List<String> entityTypeGUIDs, List<String> relationshipTypeGUIDs, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification, Date asOfTime, int level, boolean includeRelationships)
      Find the entities and relationships that radiate out from the supplied entity GUID.
      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findRelationships​(String relationshipTypeGUID, List<String> relationshipSubtypeGUIDs, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties, int fromRelationshipElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId)
      Search based on the provided parameters.
      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findRelationshipsByText​(String relationshipTypeGUID, String searchCriteria, int fromRelationshipElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId)
      Search based on the provided parameters.
      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findRelationshipsForEntity​(String entityGUID, String relationshipTypeGUID, int fromRelationshipElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId)
      Find the relationships, limited by the specified criteria, for the provided entity.
      crux.api.ICruxAPI getCruxAPI()
      Retrieve the Crux API directly.
      crux.api.CruxDocument getCruxObjectByReference​(crux.api.ICruxDatasource db, String reference)
      Retrieve the requested reference's details from an already-open Crux repository.
      crux.api.CruxDocument getCruxObjectByReference​(String reference)
      Retrieve the current version of the requested reference's details from the Crux repository.
      crux.api.CruxDocument getCruxObjectByReference​(String reference, Date asOfTime)
      Retrieve the requested reference's details from the Crux repository.
      crux.api.CruxDocument getCruxObjectByReference​(String reference, Map<clojure.lang.Keyword,​?> txnDetails)
      Retrieve the requested reference's details from the Crux repository at the precise version indicated by the provided transaction details (as returned by an entity history call, must include the valid-time and tx-time).
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail getEntity​(String guid, Date asOfTime, boolean acceptProxies)
      Retrieve the requested entity from the Crux repository.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail getEntityByGuid​(crux.api.ICruxDatasource db, String guid)
      Retrieve the requested entity from the Crux repository.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy getEntityProxy​(String guid)
      Retrieve the requested entity, as a proxy, from the Crux repository.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntitySummary getEntitySummary​(String guid)
      Retrieve the requested entity from the Crux repository.
      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> getPreviousVersionsOfEntity​(String guid, Date from, Date to, int offset, int pageSize, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.HistorySequencingOrder order)
      Retrieve previous versions of the entity between the provided dates, ordered as requested.
      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> getPreviousVersionsOfRelationship​(String guid, Date from, Date to, int offset, int pageSize, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.HistorySequencingOrder order)
      Retrieve previous versions of the relationship between the provided dates, ordered as requested.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship getRelationship​(String guid, Date asOfTime)
      Retrieve the requested relationship from the Crux repository.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceGraph getTraversalsBetweenEntities​(String startEntityGUID, String endEntityGUID, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, Date asOfTime)
      Find all of the traversals that exist between the provided entities, based on the other provided criteria.
      int hashCode()
      Default hash calculation.
      boolean isDataStoreEmpty()
      Checks whether the data store is currently empty.
      void logProblem​(String className, String methodName, CruxOMRSAuditCode 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.
      void purgeEntity​(String guid)
      Permanently delete the entity (and all of its history) from the Crux repository.
      void purgeRelationship​(String guid)
      Permanently delete the relationship (and all of its history) from the Crux repository.
      static void put​(crux.api.tx.Transaction.Builder tx, crux.api.CruxDocument cruxDoc)
      Add a write operation to the transaction (applicable for any write operation, since it is append-only).
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail restorePreviousVersionOfEntity​(String userId, String guid)
      Restore the previous version of the provided entity, and return the restored version (or null if there was no previous version and hence no restoration).
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship restorePreviousVersionOfRelationship​(String userId, String guid)
      Restore the previous version of the provided relationship, and return the restored version (or null if there was no previous version and hence no restoration).
      crux.api.TransactionInstant runTx​(crux.api.tx.Transaction statements)
      Run multiple statements through Crux as a single transaction.
      void saveReferenceCopy​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
      Save the provided entity as a reference copy.
      Collection<List<?>> searchCrux​(crux.api.ICruxDatasource db, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, List<String> subtypeGuids, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String namespace, String userId)
      Search Crux based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).
      Collection<List<?>> searchCrux​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, List<String> subtypeGuids, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, Date asOfTime, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String namespace, String userId)
      Search Crux based on the provided parameters (should work across both Entities and Relationships).
      Collection<List<?>> searchCruxText​(crux.api.ICruxDatasource db, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, String searchCriteria, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String namespace, String userId)
      Search all text properties in Crux based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).
      Collection<List<?>> searchCruxText​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category, String typeGuid, String searchCriteria, int fromElement, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications, Date asOfTime, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String namespace, String userId)
      Search all text properties in Crux based on the provided parameters (should work across both Entities and Relationships).
      void setMetadataCollectionId​(String metadataCollectionId)
      void start()
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail updateEntity​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
      Update the provided entity instance in the Crux repository.
      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship updateRelationship​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
      Update the provided relationship instance in the Crux repository.
      • Methods inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryConnector

        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
    • Constructor Detail

      • CruxOMRSRepositoryConnector

        public CruxOMRSRepositoryConnector()
        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
      • logProblem

        public void logProblem​(String className,
                               String methodName,
                               CruxOMRSAuditCode 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
      • createEntityProxy

        public void createEntityProxy​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy entity)
        Create the provided entity instance in the Crux repository.
        Parameters:
        entity - to create
      • addCreateEntityProxyStatements

        public void addCreateEntityProxyStatements​(crux.api.tx.Transaction.Builder tx,
                                                   org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy entity)
        Retrieve the statements that need to be executed against Crux to create (persist) the entity proxy provided.
        Parameters:
        tx - the transaction through which to create the entity proxy
        entity - to create
      • createEntity

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail createEntity​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
        Create the provided entity instance in the Crux repository.
        Parameters:
        entity - to create
        Returns:
        EntityDetail that was created
      • addCreateEntityStatements

        public void addCreateEntityStatements​(crux.api.tx.Transaction.Builder tx,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
        Retrieve the statements that need to be executed against Crux to create (persist) the entity provided.
        Parameters:
        tx - the transaction through which to create the entity
        entity - to be created
      • addUpdateEntityStatements

        public void addUpdateEntityStatements​(crux.api.tx.Transaction.Builder tx,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
        Retrieve the statements that need to be executed against Crux to update (persist) the entity provided.
        Parameters:
        tx - the transaction through which to update the entity
        entity - to be updated
      • purgeEntity

        public void purgeEntity​(String guid)
        Permanently delete the entity (and all of its history) from the Crux repository. Note that this operation is NOT reversible!
        Parameters:
        guid - of the entity to permanently delete
      • addPurgeEntityStatements

        public void addPurgeEntityStatements​(crux.api.tx.Transaction.Builder tx,
                                             String guid)
        Retrieve the statements that need to be executed against Crux to permanently delete the entity (and all of its history) from the Crux repository.
        Parameters:
        tx - the transaction through which to purge the entity
        guid - of the entity to permanently delete
      • updateEntity

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail updateEntity​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
        Update the provided entity instance in the Crux repository.
        Parameters:
        entity - to update
        Returns:
        EntityDetail that was updated
      • getEntityProxy

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityProxy getEntityProxy​(String guid)
        Retrieve the requested entity, as a proxy, from the Crux repository.
        Parameters:
        guid - of the entity to retrieve
        Returns:
        EntityProxy of the current version of the entity
      • getEntitySummary

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntitySummary getEntitySummary​(String guid)
        Retrieve the requested entity from the Crux repository.
        Parameters:
        guid - of the entity to retrieve
        Returns:
        EntitySummary of the current version of the entity
      • getEntity

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail getEntity​(String guid,
                                                                                                                                              Date asOfTime,
                                                                                                                                              boolean acceptProxies)
                                                                                                                                       throws org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityProxyOnlyException
        Retrieve the requested entity from the Crux repository.
        Parameters:
        guid - of the entity to retrieve
        asOfTime - view of the entity at this particular point in time
        acceptProxies - if true, allow proxies to be returned as EntityDetails
        Returns:
        EntityDetail as it existed at the specified point in time
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityProxyOnlyException - if the entity requested is only an EntityProxy (and acceptProxies is false)
      • getEntityByGuid

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail getEntityByGuid​(crux.api.ICruxDatasource db,
                                                                                                                                                    String guid)
        Retrieve the requested entity from the Crux repository.
        Parameters:
        db - already opened point-in-time view of the database
        guid - of the entity to retrieve
        Returns:
        EntityDetail as it existed at the specified database's point-in-time view
      • findEntities

        public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> findEntities​(String entityTypeGUID,
                                                                                                                                                       List<String> entitySubtypeGUIDs,
                                                                                                                                                       org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties,
                                                                                                                                                       int fromEntityElement,
                                                                                                                                                       List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                                                                                                                       org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications,
                                                                                                                                                       Date asOfTime,
                                                                                                                                                       String sequencingProperty,
                                                                                                                                                       org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                                                                                                                                       int pageSize,
                                                                                                                                                       String userId)
                                                                                                                                                throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                                                                                                                                       org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryTimeoutException
        Search based on the provided parameters.
        Parameters:
        entityTypeGUID - see CruxOMRSMetadataCollection#findEntities
        entitySubtypeGUIDs - see CruxOMRSMetadataCollection#findEntities
        matchProperties - see CruxOMRSMetadataCollection#findEntities
        fromEntityElement - see CruxOMRSMetadataCollection#findEntities
        limitResultsByStatus - see CruxOMRSMetadataCollection#findEntities
        matchClassifications - see CruxOMRSMetadataCollection#findEntities
        asOfTime - see CruxOMRSMetadataCollection#findEntities
        sequencingProperty - see CruxOMRSMetadataCollection#findEntities
        sequencingOrder - see CruxOMRSMetadataCollection#findEntities
        pageSize - see CruxOMRSMetadataCollection#findEntities
        userId - of the user running the query
        Returns:
        List<EntityDetail>
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryTimeoutException - if the query runs longer than the defined threshold (default: 30s)
        See Also:
        CruxOMRSMetadataCollection.findEntities(String, String, List, SearchProperties, int, List, SearchClassifications, Date, String, SequencingOrder, int)
      • findEntitiesByText

        public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> findEntitiesByText​(String entityTypeGUID,
                                                                                                                                                             String searchCriteria,
                                                                                                                                                             int fromEntityElement,
                                                                                                                                                             List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                                                                                                                             org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications,
                                                                                                                                                             Date asOfTime,
                                                                                                                                                             String sequencingProperty,
                                                                                                                                                             org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                                                                                                                                             int pageSize,
                                                                                                                                                             String userId)
                                                                                                                                                      throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                                                                                                                                             org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryTimeoutException
        Search based on the provided parameters.
        Parameters:
        entityTypeGUID - see CruxOMRSMetadataCollection#findEntitiesByPropertyValue
        searchCriteria - see CruxOMRSMetadataCollection#findEntitiesByPropertyValue
        fromEntityElement - see CruxOMRSMetadataCollection#findEntitiesByPropertyValue
        limitResultsByStatus - see CruxOMRSMetadataCollection#findEntitiesByPropertyValue
        matchClassifications - see CruxOMRSMetadataCollection#findEntitiesByPropertyValue
        asOfTime - see CruxOMRSMetadataCollection#findEntitiesByPropertyValue
        sequencingProperty - see CruxOMRSMetadataCollection#findEntitiesByPropertyValue
        sequencingOrder - see CruxOMRSMetadataCollection#findEntitiesByPropertyValue
        pageSize - see CruxOMRSMetadataCollection#findEntitiesByPropertyValue
        userId - of the user running the query
        Returns:
        List<EntityDetail>
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryTimeoutException - if the query runs longer than the defined threshold (default: 30s)
        See Also:
        CruxOMRSMetadataCollection.findEntitiesByPropertyValue(String, String, String, int, List, List, Date, String, SequencingOrder, int)
      • findRelationshipsForEntity

        public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findRelationshipsForEntity​(String entityGUID,
                                                                                                                                                                     String relationshipTypeGUID,
                                                                                                                                                                     int fromRelationshipElement,
                                                                                                                                                                     List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                                                                                                                                     Date asOfTime,
                                                                                                                                                                     String sequencingProperty,
                                                                                                                                                                     org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                                                                                                                                                     int pageSize,
                                                                                                                                                                     String userId)
                                                                                                                                                              throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                                                                                                                                                     org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Find the relationships, limited by the specified criteria, for the provided entity.
        Parameters:
        entityGUID - of the entity for which to find relationships
        relationshipTypeGUID - to limit the relationship types to retrieve (optional)
        fromRelationshipElement - starting element for paging
        limitResultsByStatus - by which to limit results (optional)
        asOfTime - view of the relationships at this particular point in time
        sequencingProperty - by which to order the results (required if sequencingOrder involves a property)
        sequencingOrder - by which to order results (optional, will default to GUID)
        pageSize - maximum number of results per page
        userId - of the user running the query
        Returns:
        List<Relationship> list of the matching relationships
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing open Crux resources, or if the query runs longer than the defined threshold (default: 30s)
      • findActiveRelationshipsForEntity

        public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findActiveRelationshipsForEntity​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity,
                                                                                                                                                                           String userId)
                                                                                                                                                                    throws org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Find all active (non-deleted) relationships in this repository for the provided entity.
        Parameters:
        entity - for which to find relationships
        userId - of the user running the query
        Returns:
        List<Relationship> list of the homed relationships
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing open Crux resources, or if the query runs longer than the defined threshold (default: 30s)
      • findHomedRelationshipsForEntity

        public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findHomedRelationshipsForEntity​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity,
                                                                                                                                                                          String userId)
                                                                                                                                                                   throws org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Find all relationships homed in this repository for the provided entity.
        Parameters:
        entity - for which to find relationships
        userId - of the user running the query
        Returns:
        List<Relationship> list of the homed relationships
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing open Crux resources, or if the query runs longer than the defined threshold (default: 30s)
      • findNeighborhood

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceGraph findNeighborhood​(String entityGUID,
                                                                                                                                                      List<String> entityTypeGUIDs,
                                                                                                                                                      List<String> relationshipTypeGUIDs,
                                                                                                                                                      List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                                                                                                                      List<String> limitResultsByClassification,
                                                                                                                                                      Date asOfTime,
                                                                                                                                                      int level,
                                                                                                                                                      boolean includeRelationships)
                                                                                                                                               throws org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Find the entities and relationships that radiate out from the supplied entity GUID. The results are scoped by the provided type GUIDs, other limiters, and the level.
        Parameters:
        entityGUID - the starting point for the radiation
        entityTypeGUIDs - list of entity types to include in the query results (null means include all)
        relationshipTypeGUIDs - list of relationship types to include in the query results (null means include all)
        limitResultsByStatus - list of statuses to restrict results (null means include all)
        limitResultsByClassification - list of classifications that must be present on all returned entities
        asOfTime - historical query of the radiated relationships and entities (null means current values)
        level - the number of relationships out from the starting entity that
        includeRelationships - whether to include relationships in the resulting graph (true) or not (false)
        Returns:
        InstanceGraph of the neighborhood
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing open Crux resources, or if the query runs longer than the defined threshold (default: 30s)
      • getTraversalsBetweenEntities

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceGraph getTraversalsBetweenEntities​(String startEntityGUID,
                                                                                                                                                                  String endEntityGUID,
                                                                                                                                                                  List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                                                                                                                                  Date asOfTime)
                                                                                                                                                           throws org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityNotKnownException,
                                                                                                                                                                  org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Find all of the traversals that exist between the provided entities, based on the other provided criteria.
        Parameters:
        startEntityGUID - from which to start traversing
        endEntityGUID - at which to stop traversing
        limitResultsByStatus - to limit the entities that are traversed based on their status
        asOfTime - to find the traversals for a particular point-in-time
        Returns:
        InstanceGraph containing all of the relationships and entities between the start and end
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityNotKnownException - if the requested starting point is not known to the repository
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing an open Crux resource
      • findRelationships

        public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findRelationships​(String relationshipTypeGUID,
                                                                                                                                                            List<String> relationshipSubtypeGUIDs,
                                                                                                                                                            org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties,
                                                                                                                                                            int fromRelationshipElement,
                                                                                                                                                            List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                                                                                                                            Date asOfTime,
                                                                                                                                                            String sequencingProperty,
                                                                                                                                                            org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                                                                                                                                            int pageSize,
                                                                                                                                                            String userId)
                                                                                                                                                     throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                                                                                                                                            org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Search based on the provided parameters.
        Parameters:
        relationshipTypeGUID - see CruxOMRSMetadataCollection#findRelationships
        relationshipSubtypeGUIDs - see CruxOMRSMetadataCollection#findRelationships
        matchProperties - see CruxOMRSMetadataCollection#findRelationships
        fromRelationshipElement - see CruxOMRSMetadataCollection#findRelationships
        limitResultsByStatus - see CruxOMRSMetadataCollection#findRelationships
        asOfTime - see CruxOMRSMetadataCollection#findRelationships
        sequencingProperty - see CruxOMRSMetadataCollection#findRelationships
        sequencingOrder - see CruxOMRSMetadataCollection#findRelationships
        pageSize - see CruxOMRSMetadataCollection#findRelationships
        userId - of the user running the query
        Returns:
        List<Relationship>
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing open Crux resources, or if the query runs longer than the defined threshold (default: 30s)
        See Also:
        CruxOMRSMetadataCollection.findRelationships(String, String, List, SearchProperties, int, List, Date, String, SequencingOrder, int)
      • findRelationshipsByText

        public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findRelationshipsByText​(String relationshipTypeGUID,
                                                                                                                                                                  String searchCriteria,
                                                                                                                                                                  int fromRelationshipElement,
                                                                                                                                                                  List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                                                                                                                                  Date asOfTime,
                                                                                                                                                                  String sequencingProperty,
                                                                                                                                                                  org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                                                                                                                                                  int pageSize,
                                                                                                                                                                  String userId)
                                                                                                                                                           throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                                                                                                                                                  org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Search based on the provided parameters.
        Parameters:
        relationshipTypeGUID - see CruxOMRSMetadataCollection#findRelationshipsByPropertyValue
        searchCriteria - see CruxOMRSMetadataCollection#findRelationshipsByPropertyValue
        fromRelationshipElement - see CruxOMRSMetadataCollection#findRelationshipsByPropertyValue
        limitResultsByStatus - see CruxOMRSMetadataCollection#findRelationshipsByPropertyValue
        asOfTime - see CruxOMRSMetadataCollection#findRelationshipsByPropertyValue
        sequencingProperty - see CruxOMRSMetadataCollection#findRelationshipsByPropertyValue
        sequencingOrder - see CruxOMRSMetadataCollection#findRelationshipsByPropertyValue
        pageSize - see CruxOMRSMetadataCollection#findRelationshipsByPropertyValue
        userId - of the user running the query
        Returns:
        List<Relationship>
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing open Crux resources, or if the query runs longer than the defined threshold (default: 30s)
        See Also:
        CruxOMRSMetadataCollection.findRelationshipsByPropertyValue(String, String, String, int, List, Date, String, SequencingOrder, int)
      • createRelationship

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship createRelationship​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
        Create the provided relationship instance in the Crux repository.
        Parameters:
        relationship - to create
        Returns:
        Relationship that was created
      • addCreateRelationshipStatements

        public void addCreateRelationshipStatements​(crux.api.tx.Transaction.Builder tx,
                                                    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
        Retrieve the statements that need to be executed against Crux to create (persist) the relationship provided.
        Parameters:
        tx - the transaction through which to create the relationship
        relationship - to be created
      • purgeRelationship

        public void purgeRelationship​(String guid)
        Permanently delete the relationship (and all of its history) from the Crux repository. Note that this operation is NOT reversible!
        Parameters:
        guid - of the relationship to permanently delete
      • addPurgeRelationshipStatements

        public void addPurgeRelationshipStatements​(crux.api.tx.Transaction.Builder tx,
                                                   String guid)
        Retrieve the statements that need to be executed against Crux to permanently delete the relationship (and all of its history) from the Crux repository.
        Parameters:
        tx - the transaction through which to do the purge
        guid - of the relationship to permanently delete
      • updateRelationship

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship updateRelationship​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
        Update the provided relationship instance in the Crux repository.
        Parameters:
        relationship - to update
        Returns:
        Relationship that was updated
      • addUpdateRelationshipStatements

        public void addUpdateRelationshipStatements​(crux.api.tx.Transaction.Builder tx,
                                                    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
        Retrieve the statements that need to be executed against Crux to update the provided relationship instance in the Crux repository.
        Parameters:
        tx - the transaction through which to do the relationship update
        relationship - to update
      • getRelationship

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship getRelationship​(String guid,
                                                                                                                                                    Date asOfTime)
                                                                                                                                             throws org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Retrieve the requested relationship from the Crux repository.
        Parameters:
        guid - of the relationship to retrieve
        asOfTime - view of the relationship at this particular point in time
        Returns:
        Relationship as it existed at the specified point in time
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing an open Crux resource
      • restorePreviousVersionOfEntity

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail restorePreviousVersionOfEntity​(String userId,
                                                                                                                                                                   String guid)
                                                                                                                                                            throws org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Restore the previous version of the provided entity, and return the restored version (or null if there was no previous version and hence no restoration).
        Parameters:
        userId - of the user requesting the restoration
        guid - of the entity for which to restore the previous version
        Returns:
        EntityDetail giving the restored version (or null if there was no previous version to restore)
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing the lazy-evaluating cursor
      • restorePreviousVersionOfRelationship

        public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship restorePreviousVersionOfRelationship​(String userId,
                                                                                                                                                                         String guid)
                                                                                                                                                                  throws org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Restore the previous version of the provided relationship, and return the restored version (or null if there was no previous version and hence no restoration).
        Parameters:
        userId - of the user requesting the restoration
        guid - of the relationship for which to restore the previous version
        Returns:
        Relationship giving the restored version (or null if there was no previous version to restore)
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing an open Crux resource
      • getPreviousVersionsOfEntity

        public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> getPreviousVersionsOfEntity​(String guid,
                                                                                                                                                                      Date from,
                                                                                                                                                                      Date to,
                                                                                                                                                                      int offset,
                                                                                                                                                                      int pageSize,
                                                                                                                                                                      org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.HistorySequencingOrder order)
                                                                                                                                                               throws org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityNotKnownException,
                                                                                                                                                                      org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Retrieve previous versions of the entity between the provided dates, ordered as requested.
        Parameters:
        guid - of the entity for which to retrieve previous versions
        from - earliest date and time for which the versions to include were valid (inclusive)
        to - latest date and time for which the versions to include were valid (exclusive)
        offset - element from which to start (paging)
        pageSize - maximum number of results to include (paging)
        order - whether to order the results in reverse-chronological order (backwards) or chronologically (forwards)
        Returns:
        List<EntityDetail> giving all versions of the entity within the range requested
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityNotKnownException - if the requested entity was not known to the repository during the specified time range
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing the lazy-evaluating cursor
      • getPreviousVersionsOfRelationship

        public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> getPreviousVersionsOfRelationship​(String guid,
                                                                                                                                                                            Date from,
                                                                                                                                                                            Date to,
                                                                                                                                                                            int offset,
                                                                                                                                                                            int pageSize,
                                                                                                                                                                            org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.HistorySequencingOrder order)
                                                                                                                                                                     throws org.odpi.openmetadata.repositoryservices.ffdc.exception.RelationshipNotKnownException,
                                                                                                                                                                            org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Retrieve previous versions of the relationship between the provided dates, ordered as requested.
        Parameters:
        guid - of the relationship for which to retrieve previous versions
        from - earliest date and time for which the versions to include were valid (inclusive)
        to - latest date and time for which the versions to include were valid (exclusive)
        offset - element from which to start (paging)
        pageSize - maximum number of results to include (paging)
        order - whether to order the results in reverse-chronological order (backwards) or chronologically (forwards)
        Returns:
        List<Relationship> giving all versions of the relationship within the range requested
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RelationshipNotKnownException - if the requested relationship was not known to the repository during the specified time range
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing the lazy-evaluating cursor
      • saveReferenceCopy

        public void saveReferenceCopy​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity)
                               throws org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityConflictException
        Save the provided entity as a reference copy. This is only possible if there is no existing entity with the same GUID, or if there is an existing entity with this GUID and its metadataCollectionId matches. Any other scenario is an error for a reference copy.
        Parameters:
        entity - to save as a reference copy
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityConflictException - the entity conflicts with an existing entity (different metadata collection IDs)
      • addSaveReferenceCopyStatements

        public void addSaveReferenceCopyStatements​(crux.api.tx.Transaction.Builder tx,
                                                   org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship relationship)
                                            throws org.odpi.openmetadata.repositoryservices.ffdc.exception.RelationshipConflictException,
                                                   org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
        Retrieve the statements that need to be executed against Crux to save the provided relationship as a reference copy. This is only possible if there is no existing relationship with the same GUID, or if there is an existing relationship with this GUID and its metadataCollectionId matches. Any other scenario is an error for a reference copy.
        Parameters:
        tx - the transaction through which to save the reference copy
        relationship - to save as a reference copy
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RelationshipConflictException - the relationship conflicts with an existing relationship (different metadata collection IDs)
        org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if any issue closing an open Crux resource
      • getCruxObjectByReference

        public crux.api.CruxDocument getCruxObjectByReference​(String reference)
        Retrieve the current version of the requested reference's details from the Crux repository.
        Parameters:
        reference - indicating the primary key of the Crux object to retrieve
        Returns:
        CruxDocument of the object's properties
      • getCruxObjectByReference

        public crux.api.CruxDocument getCruxObjectByReference​(String reference,
                                                              Date asOfTime)
        Retrieve the requested reference's details from the Crux repository.
        Parameters:
        reference - indicating the primary key of the Crux object to retrieve
        asOfTime - view of the object at this particular point in time (or null for current)
        Returns:
        CruxDocument of the object's properties
      • getCruxObjectByReference

        public crux.api.CruxDocument getCruxObjectByReference​(crux.api.ICruxDatasource db,
                                                              String reference)
        Retrieve the requested reference's details from an already-open Crux repository.
        Parameters:
        db - from which to retrieve the details
        reference - indicating the primary key of the Crux object to retrieve
        Returns:
        CruxDocument of the object's properties
      • getCruxObjectByReference

        public crux.api.CruxDocument getCruxObjectByReference​(String reference,
                                                              Map<clojure.lang.Keyword,​?> txnDetails)
        Retrieve the requested reference's details from the Crux repository at the precise version indicated by the provided transaction details (as returned by an entity history call, must include the valid-time and tx-time).
        Parameters:
        reference - indicating the primary key of the Crux object to retrieve
        txnDetails - containing the valid-time and tx-time of the precise version of the document to retrieve
        Returns:
        CruxDocument of the object's properties
      • searchCrux

        public Collection<List<?>> searchCrux​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category,
                                              String typeGuid,
                                              List<String> subtypeGuids,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties,
                                              int fromElement,
                                              List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications,
                                              Date asOfTime,
                                              String sequencingProperty,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                              int pageSize,
                                              String namespace,
                                              String userId)
                                       throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                              TimeoutException
        Search Crux based on the provided parameters (should work across both Entities and Relationships).
        Parameters:
        category - to limit the search to either entities or relationships (required)
        typeGuid - to limit the search by type (optional)
        subtypeGuids - to limit the search to a set of subtypes (optional)
        matchProperties - by which to limit the results (optional)
        fromElement - starting element for paging
        limitResultsByStatus - by which to limit results (optional)
        matchClassifications - by which to limit entity results (must be null for relationships) (optional)
        asOfTime - for a historical search (optional, null will give current results)
        sequencingProperty - by which to order the results (required if sequencingOrder involves a property)
        sequencingOrder - by which to order results (optional, will default to GUID)
        pageSize - maximum number of results per page
        namespace - by which to qualify the matchProperties
        userId - of the user running the query
        Returns:
        Collection<List<?>> list of the Crux document references that match
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        TimeoutException - if the query runs longer than the defined threshold (default: 30s)
      • searchCrux

        public Collection<List<?>> searchCrux​(crux.api.ICruxDatasource db,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category,
                                              String typeGuid,
                                              List<String> subtypeGuids,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties matchProperties,
                                              int fromElement,
                                              List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications,
                                              String sequencingProperty,
                                              org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                              int pageSize,
                                              String namespace,
                                              String userId)
                                       throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                              TimeoutException
        Search Crux based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).
        Parameters:
        db - already opened point-in-time view of the database
        category - to limit the search to either entities or relationships (required)
        typeGuid - to limit the search by type (optional)
        subtypeGuids - to limit the search to a set of subtypes (optional)
        matchProperties - by which to limit the results (optional)
        fromElement - starting element for paging
        limitResultsByStatus - by which to limit results (optional)
        matchClassifications - by which to limit entity results (must be null for relationships) (optional)
        sequencingProperty - by which to order the results (required if sequencingOrder involves a property)
        sequencingOrder - by which to order results (optional, will default to GUID)
        pageSize - maximum number of results per page
        namespace - by which to qualify the matchProperties
        userId - of the user running the query
        Returns:
        Collection<List<?>> list of the Crux document references that match
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        TimeoutException - if the query runs longer than the defined threshold (default: 30s)
      • searchCruxText

        public Collection<List<?>> searchCruxText​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category,
                                                  String typeGuid,
                                                  String searchCriteria,
                                                  int fromElement,
                                                  List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                  org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications,
                                                  Date asOfTime,
                                                  String sequencingProperty,
                                                  org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                                  int pageSize,
                                                  String namespace,
                                                  String userId)
                                           throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                                  TimeoutException
        Search all text properties in Crux based on the provided parameters (should work across both Entities and Relationships).
        Parameters:
        category - to limit the search to either entities or relationships (required)
        typeGuid - to limit the search by type (optional)
        searchCriteria - by which to limit the results (required, must be a Java regular expression)
        fromElement - starting element for paging
        limitResultsByStatus - by which to limit results (optional)
        matchClassifications - by which to limit entity results (must be null for relationships) (optional)
        asOfTime - for a historical search (optional, null will give current results)
        sequencingProperty - by which to order the results (required if sequencingOrder involves a property)
        sequencingOrder - by which to order results (optional, will default to GUID)
        pageSize - maximum number of results per page
        namespace - by which to qualify the matchProperties
        userId - of the user running the query
        Returns:
        Collection<List<?>> list of the Crux document references that match
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        TimeoutException - if the query runs longer than the defined threshold (default: 30s)
      • searchCruxText

        public Collection<List<?>> searchCruxText​(crux.api.ICruxDatasource db,
                                                  org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefCategory category,
                                                  String typeGuid,
                                                  String searchCriteria,
                                                  int fromElement,
                                                  List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                  org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications,
                                                  String sequencingProperty,
                                                  org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                                  int pageSize,
                                                  String namespace,
                                                  String userId)
                                           throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                                  TimeoutException
        Search all text properties in Crux based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).
        Parameters:
        db - already opened point-in-time view of the database
        category - to limit the search to either entities or relationships (required)
        typeGuid - to limit the search by type (optional)
        searchCriteria - by which to limit the results (required, must be a Java regular expression)
        fromElement - starting element for paging
        limitResultsByStatus - by which to limit results (optional)
        matchClassifications - by which to limit entity results (must be null for relationships) (optional)
        sequencingProperty - by which to order the results (required if sequencingOrder involves a property)
        sequencingOrder - by which to order results (optional, will default to GUID)
        pageSize - maximum number of results per page
        namespace - by which to qualify the matchProperties
        userId - of the user running the query
        Returns:
        Collection<List<?>> list of the Crux document references that match
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        TimeoutException - if the query runs longer than the defined threshold (default: 30s)
      • findEntityRelationships

        public Collection<List<?>> findEntityRelationships​(crux.api.ICruxDatasource db,
                                                           String entityGUID,
                                                           String relationshipTypeGUID,
                                                           int fromRelationshipElement,
                                                           List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                           String sequencingProperty,
                                                           org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder,
                                                           int pageSize,
                                                           String userId)
                                                    throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException,
                                                           TimeoutException
        Find the relationships that match the provided parameters.
        Parameters:
        db - already opened point-in-time view of the database
        entityGUID - of the entity for which to find relationships
        relationshipTypeGUID - to limit the relationship types to retrieve (optional)
        fromRelationshipElement - starting element for paging
        limitResultsByStatus - by which to limit results (optional)
        sequencingProperty - by which to order the results (required if sequencingOrder involves a property)
        sequencingOrder - by which to order results (optional, will default to GUID)
        pageSize - maximum number of results per page
        userId - of the user running the query
        Returns:
        Collection<List<?>> list of the Crux document references that match
        Throws:
        org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
        TimeoutException - if the query runs longer than the defined threshold (default: 30s)
      • findEntityRelationships

        public Collection<List<?>> findEntityRelationships​(crux.api.ICruxDatasource db,
                                                           String entityGUID,
                                                           String userId,
                                                           boolean includeDeleted)
                                                    throws TimeoutException
        Find the relationships that match the provided parameters.
        Parameters:
        db - already opened point-in-time view of the database
        entityGUID - for which to find relationships
        userId - of the user running the query
        includeDeleted - if true, include deleted relationships in the results (otherwise exclude them)
        Returns:
        Collection<List<?>> list of the Crux document references that match
        Throws:
        TimeoutException - if the query runs longer than the defined threshold (default: 30s)
      • findHomedEntityRelationships

        public Collection<List<?>> findHomedEntityRelationships​(crux.api.ICruxDatasource db,
                                                                org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entity,
                                                                String userId)
                                                         throws TimeoutException
        Find the relationships that match the provided parameters.
        Parameters:
        db - already opened point-in-time view of the database
        entity - for which to find relationships
        userId - of the user running the query
        Returns:
        Collection<List<?>> list of the Crux document references that match
        Throws:
        TimeoutException - if the query runs longer than the defined threshold (default: 30s)
      • findDirectNeighbors

        public Collection<List<?>> findDirectNeighbors​(crux.api.ICruxDatasource db,
                                                       String entityGUID,
                                                       List<String> entityTypeGUIDs,
                                                       List<String> relationshipTypeGUIDs,
                                                       List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus,
                                                       List<String> limitResultsByClassification)
                                                throws TimeoutException
        Find the immediate neighbors (1-degree separated entities and the relationships between) using the provided criteria.
        Parameters:
        db - already opened point-in-view of the database
        entityGUID - of the entity for which to find immediate relationships
        entityTypeGUIDs - of the entity type definitions by which to restrict entities in the results
        relationshipTypeGUIDs - of the relationship type definitions by which to restrict relationships in the results
        limitResultsByStatus - by which to limit relationships
        limitResultsByClassification - by which to limit the entities in the results
        Returns:
        Collection<List<?>> of tuples of relationships and entities found in the results
        Throws:
        TimeoutException - if the query runs longer than the defined threshold (default: 30s)
      • runTx

        public crux.api.TransactionInstant runTx​(crux.api.tx.Transaction statements)
        Run multiple statements through Crux as a single transaction.
        Parameters:
        statements - the transaction to submit
        Returns:
        TransactionInstant transaction details
      • getCruxAPI

        public crux.api.ICruxAPI getCruxAPI()
        Retrieve the Crux 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:
        ICruxAPI
      • put

        public static void put​(crux.api.tx.Transaction.Builder tx,
                               crux.api.CruxDocument cruxDoc)
        Add a write operation to the transaction (applicable for any write operation, since it is append-only). Note: this should be used rather than calling '.put' directly against the transaction builder, as this method will set the historical date based on the information within the document itself (if any), allowing us to have a historical view for things like reference copies.
        Parameters:
        tx - the transaction through which to do the write operation
        cruxDoc - the document to write to the repository
      • evict

        public static void evict​(crux.api.tx.Transaction.Builder tx,
                                 String docRef)
        Add eviction of the specified docRef to the transaction (applicable for permanently removing anything by its "primary key").
        Parameters:
        tx - the transaction through which to do the eviction
        docRef - giving the "primary key" of the record to be permanently removed
      • 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