Package fr.gouv.vitam.common.database.parser.request.single

# Class RequestParserSingle

java.lang.Object
fr.gouv.vitam.common.database.parser.request.AbstractParser<RequestSingle>
fr.gouv.vitam.common.database.parser.request.single.RequestParserSingle

Direct Known Subclasses:
  `DeleteParserSingle`, `InsertParserSingle`, `SelectParserSingle`, `UpdateParserSingle`

public abstract class RequestParserSingle extends AbstractParser<RequestSingle>
Single Request Parser (common base) { $query : query, $filter : filter }

- ## Field Summary

  ### Fields inherited from class fr.gouv.vitam.common.database.parser.request.AbstractParser

  `adapter, hasFullTextCurrentQuery, hasFullTextQuery, request, rootNode, sourceRequest`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RequestParserSingle()`
  Constructor for Internal API
  `RequestParserSingle(VarNameAdapter adapter)`
  Constructor for Masterdata

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addCondition(Query condition)`
  Allow to add one condition to the current parsed Request Example:
  `protected void`
  `analyzeRootQuery(com.fasterxml.jackson.databind.JsonNode command)`
  { expression }
  `protected void`
  `filterParse(com.fasterxml.jackson.databind.JsonNode rootNode)`
  Filter part
  `int`
  `getLastDepth()`
  `boolean`
  `hintCache()`
  `boolean`
  `hintNoTimeout()`
  `BuilderToken.FILTERARGS`
  `model()`
  `protected void`
  `parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest)`
  `protected void`
  `parseQueryOnly(String query)`
  `protected void`
  `queryParse(com.fasterxml.jackson.databind.JsonNode rootNode)`
  { query } if one level only
  `String`
  `toString()`

  ### Methods inherited from class fr.gouv.vitam.common.database.parser.request.AbstractParser

  `analyzeOneCommand, analyzeOneFacet, getAdapter, getNewRequest, getRequest, getRootNode, getSource, hasFullTextQuery, parse, parseOrderByFilter`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### RequestParserSingle

    public RequestParserSingle()
    Constructor for Internal API

  - ### RequestParserSingle

    public RequestParserSingle(VarNameAdapter adapter)
    Constructor for Masterdata
    Parameters:
      `adapter` - VarNameAdapter

- ## Method Details

  - ### parseJson

    protected void parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest) throws InvalidParseOperationException
    Overrides:
      `parseJson` in class `AbstractParser<RequestSingle>`
    Parameters:
      `jsonRequest` - containing a parsed JSON as { $query : query, $filter : filter }
    Throws:
      `InvalidParseOperationException` - if jsonRequest could not parse to JSON

  - ### parseQueryOnly

    protected void parseQueryOnly(String query) throws InvalidParseOperationException
    Parameters:
      `query` - containing only the JSON query part (no filter)
    Throws:
      `InvalidParseOperationException` - if query could not parse to JSON or sanity check to query is in error

  - ### filterParse

    protected void filterParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
    Filter part
    Parameters:
      `rootNode` - JsonNode
    Throws:
      `InvalidParseOperationException` - if rootNode could not parse to JSON

  - ### queryParse

    protected void queryParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
    { query } if one level only
    Parameters:
      `rootNode` - JsonNode
    Throws:
      `InvalidParseOperationException` - if rootNode could not parse to JSON

  - ### analyzeRootQuery

    protected void analyzeRootQuery(com.fasterxml.jackson.databind.JsonNode command) throws InvalidParseOperationException, InvalidCreateOperationException
    { expression }
    Parameters:
      `command` - JsonNode
    Throws:
      `InvalidParseOperationException` - if command is null or command could not parse to JSON
      `InvalidCreateOperationException` - if could not set query to request or analyzeOneCommand is in error

  - ### addCondition

    public void addCondition(Query condition) throws InvalidCreateOperationException, InvalidParseOperationException
    Allow to add one condition to the current parsed Request Example:

           SelectParserSingle parser = new SelectParserSingle(...);
           parser.parse(jsonQuery);
           parser.addCondition(eq(FieldName, value));
           JsonNode newJsonQuery = parser.getRootNode();

    Parameters:
      `condition` - the condition to add
    Throws:
      `InvalidCreateOperationException` - when invalid create query exception occurred
      `InvalidParseOperationException` - hen invalid parse data to create query

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### hintNoTimeout

    public boolean hintNoTimeout()
    Specified by:
      `hintNoTimeout` in class `AbstractParser<RequestSingle>`
    Returns:
      True if the hint contains notimeout

  - ### getLastDepth

    public int getLastDepth()
    Specified by:
      `getLastDepth` in class `AbstractParser<RequestSingle>`
    Returns:
      int the depth of the query

  - ### model

    public BuilderToken.FILTERARGS model()
    Specified by:
      `model` in class `AbstractParser<RequestSingle>`
    Returns:
      FILTERARGS the filter argument

  - ### hintCache

    public boolean hintCache()
    Specified by:
      `hintCache` in class `AbstractParser<RequestSingle>`
    Returns:
      true if not cache hint