Class AbstractRequest

java.lang.Object
fr.gouv.vitam.common.database.builder.request.AbstractRequest
Direct Known Subclasses:
RequestMultiple, RequestSingle

public abstract class AbstractRequest extends Object
Common Abstract Request
  • Field Details

    • filter

      protected com.fasterxml.jackson.databind.node.ObjectNode filter
    • projection

      protected com.fasterxml.jackson.databind.node.ObjectNode projection
  • Constructor Details

    • AbstractRequest

      public AbstractRequest()
  • Method Details

    • resetHintFilter

      public final AbstractRequest resetHintFilter()
      Returns:
      this Request
    • resetFilter

      public final AbstractRequest resetFilter()
      Returns:
      this Request
    • reset

      public AbstractRequest reset()
      Returns:
      this Request
    • addHintFilter

      public final AbstractRequest addHintFilter(String... hints) throws InvalidParseOperationException
      Parameters:
      hints - list of hint
      Returns:
      this Request
      Throws:
      InvalidParseOperationException - when query is invalid
    • addHintFilter

      public final AbstractRequest addHintFilter(com.fasterxml.jackson.databind.JsonNode filterContent)
      Parameters:
      filterContent - json filter
      Returns:
      this Request
    • setFilter

      public AbstractRequest setFilter(com.fasterxml.jackson.databind.JsonNode filterContent) throws InvalidParseOperationException
      Parameters:
      filterContent - json filter
      Returns:
      this Request
      Throws:
      InvalidParseOperationException - when query is invalid
    • parseFilter

      public final AbstractRequest parseFilter(String filter) throws InvalidParseOperationException
      Parameters:
      filter - String filter
      Returns:
      this Request
      Throws:
      InvalidParseOperationException - when query is invalid
    • getFilter

      public final com.fasterxml.jackson.databind.node.ObjectNode getFilter()
      Returns:
      the filter
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setQuery

      public abstract AbstractRequest setQuery(Query query) throws InvalidCreateOperationException
      Set the query of request: in case of multi-query request: re-initialize list of query
      Parameters:
      query - of request
      Returns:
      this request
      Throws:
      InvalidCreateOperationException - when query is invalid
    • getNbQueries

      public abstract int getNbQueries()
      Returns:
      the number of queries
    • getQueries

      public abstract List<Query> getQueries()
      Returns:
      the queries list
    • getRoots

      public abstract Set<String> getRoots()
      Returns:
      the queries list
    • getData

      public abstract com.fasterxml.jackson.databind.JsonNode getData()
      Returns:
      the data
    • getActions

      public abstract List<Action> getActions()
      Returns:
      list of actions
    • getAllProjection

      public abstract boolean getAllProjection()
      Returns:
      True if the projection is not restricted
    • getProjection

      public abstract com.fasterxml.jackson.databind.node.ObjectNode getProjection()
      Returns:
      the projection
    • selectResetLimitFilter

      protected final AbstractRequest selectResetLimitFilter()
      Returns:
      this Query
    • selectResetOrderByFilter

      protected final AbstractRequest selectResetOrderByFilter()
      Returns:
      this Query
    • selectResetUsedProjection

      protected final AbstractRequest selectResetUsedProjection()
      Returns:
      this Query
    • selectReset

      protected final AbstractRequest selectReset()
    • selectSetScrollFilter

      protected final AbstractRequest selectSetScrollFilter(String scrollId, int scrollTimeout, int limit)
      Parameters:
      scrollId - ignored if empty or null
      scrollTimeout - ignored if 0
      limit - ignored if 0
      Returns:
      this Query
    • selectSetLimitFilter

      protected final AbstractRequest selectSetLimitFilter(long offset, long limit)
      Parameters:
      offset - ignored if 0
      limit - ignored if 0
      Returns:
      this Query
    • selectSetLimitFilter

      protected final AbstractRequest selectSetLimitFilter(com.fasterxml.jackson.databind.JsonNode filterContent)
      Parameters:
      filterContent - json filter
      Returns:
      this Query
    • selectParseLimitFilter

      protected final AbstractRequest selectParseLimitFilter(String filter) throws InvalidParseOperationException
      Parameters:
      filter - string filter
      Returns:
      this Query
      Throws:
      InvalidParseOperationException - when query is invalid
    • selectAddOrderByAscFilter

      protected final AbstractRequest selectAddOrderByAscFilter(String... variableNames) throws InvalidParseOperationException
      Parameters:
      variableNames - list of key name
      Returns:
      this Query
      Throws:
      InvalidParseOperationException - when query is invalid
    • selectAddOrderByDescFilter

      protected final AbstractRequest selectAddOrderByDescFilter(String... variableNames) throws InvalidParseOperationException
      Parameters:
      variableNames - list of key name
      Returns:
      this Query
      Throws:
      InvalidParseOperationException - when query is invalid
    • selectAddOrderByFilter

      protected final AbstractRequest selectAddOrderByFilter(com.fasterxml.jackson.databind.JsonNode filterContent) throws InvalidParseOperationException
      Parameters:
      filterContent - json filter
      Returns:
      this Query
      Throws:
      InvalidParseOperationException - when query is invalid
    • selectParseOrderByFilter

      protected final AbstractRequest selectParseOrderByFilter(String filter) throws InvalidParseOperationException
      Parameters:
      filter - string filter
      Returns:
      this Query
      Throws:
      InvalidParseOperationException - when query is invalid
    • selectSetFilter

      protected final AbstractRequest selectSetFilter(com.fasterxml.jackson.databind.JsonNode filterContent) throws InvalidParseOperationException
      Throws:
      InvalidParseOperationException
    • selectAddUsedProjection

      protected final AbstractRequest selectAddUsedProjection(String... variableNames) throws InvalidParseOperationException
      Parameters:
      variableNames - list of key name
      Returns:
      this Query
      Throws:
      InvalidParseOperationException - when query is invalid
    • selectAddUnusedProjection

      protected final AbstractRequest selectAddUnusedProjection(String... variableNames) throws InvalidParseOperationException
      Parameters:
      variableNames - list of key name
      Returns:
      this Query
      Throws:
      InvalidParseOperationException - when query is invalid
    • selectAddProjection

      protected final AbstractRequest selectAddProjection(com.fasterxml.jackson.databind.JsonNode projectionContent)
      Parameters:
      projectionContent - json projection
      Returns:
      this Query
    • selectParseProjection

      protected final AbstractRequest selectParseProjection(String projection) throws InvalidParseOperationException
      Parameters:
      projection - string projection
      Returns:
      this Query
      Throws:
      InvalidParseOperationException - when query is invalid
    • selectSetProjection

      protected AbstractRequest selectSetProjection(com.fasterxml.jackson.databind.JsonNode projectionContent) throws InvalidParseOperationException
      Parameters:
      projectionContent - json projection
      Returns:
      this Query
      Throws:
      InvalidParseOperationException - when query is invalid
    • getFinal

      protected abstract com.fasterxml.jackson.databind.node.ObjectNode getFinal()
      Get the json final of request
      Returns:
      the Final json containing all 2 parts: query and filter
    • selectGetFinalSelect

      protected final com.fasterxml.jackson.databind.node.ObjectNode selectGetFinalSelect()
      Returns:
      the Final Select containing all 3 parts: query, filter and projection
    • selectGetAllProjection

      protected boolean selectGetAllProjection()
      Returns:
      True if the projection is not restricted
    • selectGetProjection

      protected com.fasterxml.jackson.databind.node.ObjectNode selectGetProjection()
      Returns:
      the projection