Class AbstractSearchOperation

java.lang.Object
org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractReadOperation
org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractSearchOperation
Direct Known Subclasses:
AbstractEntitySearchOperation, AbstractRelationshipSearchOperation

public abstract class AbstractSearchOperation extends AbstractReadOperation
Base class that all search operations should implement.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final int
     
    protected final List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus>
     
    protected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications
     
    protected final int
     
    protected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder
     
    protected final String
     
    protected final String
     
    protected final String
     

    Fields inherited from class org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractReadOperation

    asOfTime, existingDB, xtdb
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractSearchOperation(XtdbOMRSRepositoryConnector xtdb, String typeGUID, 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 userId)
    Create a new search operation.
    protected
    AbstractSearchOperation(XtdbOMRSRepositoryConnector xtdb, String typeGUID, 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, xtdb.api.IXtdbDatasource existingDB, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId)
    Create a new search operation.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Collection<List<?>>
    deduplicateAndPage(xtdb.api.ICursor<List<?>> results, int fromElement, int pageSize)
    De-duplicate and return only the selected page of results from the provided collection of XTDB query results.
    protected abstract Collection<List<?>>
    runQuery(xtdb.api.IXtdbDatasource db)
    Interface that must be implemented to actually execute the query logic.
    protected Collection<List<?>>
    searchXtdb(xtdb.api.IXtdbDatasource 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 XTDB based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).
    protected Collection<List<?>>
    searchXtdbText(xtdb.api.IXtdbDatasource 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 XTDB based on the provided parameters, using an already-opened point-in-time view of the database (should work across both Entities and Relationships).
    protected void
    updateQuery(XtdbQuery query, 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, 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, String namespace, String userId)
    Update the provided query with the specified parameters.

    Methods inherited from class org.odpi.egeria.connectors.juxt.xtdb.readops.AbstractReadOperation

    getXtdbObjectByReference

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • typeGUID

      protected final String typeGUID
    • fromElement

      protected final int fromElement
    • limitResultsByStatus

      protected final List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus> limitResultsByStatus
    • matchClassifications

      protected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchClassifications matchClassifications
    • sequencingProperty

      protected final String sequencingProperty
    • sequencingOrder

      protected final org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder
    • pageSize

      protected final int pageSize
    • userId

      protected final String userId
  • Constructor Details

    • AbstractSearchOperation

      protected AbstractSearchOperation(XtdbOMRSRepositoryConnector xtdb, String typeGUID, 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 userId)
      Create a new search operation.
      Parameters:
      xtdb - connectivity to XTDB
      typeGUID - unique identifier of a type definition by which to limit results
      fromElement - starting element for paged results
      limitResultsByStatus - list of statuses by which to limit results
      matchClassifications - classification criteria by which to limit results
      asOfTime - the point-in-time for which to retrieve results
      sequencingProperty - the name of the property by which to sort results (only applicable when sorting by property)
      sequencingOrder - the mechanism to use for sorting results
      pageSize - the number of results to include per page
      userId - executing the search
    • AbstractSearchOperation

      protected AbstractSearchOperation(XtdbOMRSRepositoryConnector xtdb, String typeGUID, 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, xtdb.api.IXtdbDatasource existingDB, String sequencingProperty, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.SequencingOrder sequencingOrder, int pageSize, String userId)
      Create a new search operation.
      Parameters:
      xtdb - connectivity to XTDB
      typeGUID - unique identifier of a type definition by which to limit results
      fromElement - starting element for paged results
      limitResultsByStatus - list of statuses by which to limit results
      matchClassifications - classification criteria by which to limit results
      existingDB - the already-opened point-in-time from which to retrieve results
      sequencingProperty - the name of the property by which to sort results (only applicable when sorting by property)
      sequencingOrder - the mechanism to use for sorting results
      pageSize - the number of results to include per page
      userId - executing the search
  • Method Details

    • runQuery

      protected abstract Collection<List<?>> runQuery(xtdb.api.IXtdbDatasource db) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException, TimeoutException, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
      Interface that must be implemented to actually execute the query logic.
      Parameters:
      db - the datasource against which to run the query
      Returns:
      Collection<List<?>> of internal XT references (IDs) that match the query
      Throws:
      org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
      TimeoutException - if the query times out
      org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException - if there is any issue iterating through the results
    • searchXtdb

      protected Collection<List<?>> searchXtdb(xtdb.api.IXtdbDatasource 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, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
      Search XTDB 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 XTDB document references that match
      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 there is any issue iterating through the results
    • updateQuery

      protected void updateQuery(XtdbQuery query, 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, 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, String namespace, String userId) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException
      Update the provided query with the specified parameters.
      Parameters:
      query - into which to add conditions
      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)
      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)
      namespace - by which to qualify the matchProperties
      userId - of the user running the query
      Throws:
      org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException - if a requested type for searching is not known to the repository
    • searchXtdbText

      protected Collection<List<?>> searchXtdbText(xtdb.api.IXtdbDatasource 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, org.odpi.openmetadata.repositoryservices.ffdc.exception.RepositoryErrorException
      Search all text properties in XTDB 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 XTDB document references that match
      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 there is any issue iterating through the results
    • deduplicateAndPage

      protected Collection<List<?>> deduplicateAndPage(xtdb.api.ICursor<List<?>> results, int fromElement, int pageSize)
      De-duplicate and return only the selected page of results from the provided collection of XTDB query results.
      Parameters:
      results - from a XTDB query
      fromElement - starting point for the page
      pageSize - number of elements to include in the page
      Returns:
      Collection<List<?>> of only the single page of results specified