Class RequestParserMultiple
- java.lang.Object
-
- fr.gouv.vitam.common.database.parser.request.AbstractParser<RequestMultiple>
-
- fr.gouv.vitam.common.database.parser.request.multiple.RequestParserMultiple
-
- Direct Known Subclasses:
DeleteParserMultiple
,InsertParserMultiple
,SelectParserMultiple
,UpdateParserMultiple
public abstract class RequestParserMultiple extends AbstractParser<RequestMultiple>
Partial Request Parser (common base): { $roots: root, $query : query, $filter : filter }
-
-
Field Summary
Fields Modifier and Type Field Description protected int
lastDepth
Last computed Depth-
Fields inherited from class fr.gouv.vitam.common.database.parser.request.AbstractParser
adapter, hasFullTextCurrentQuery, hasFullTextQuery, request, rootNode, sourceRequest
-
-
Constructor Summary
Constructors Constructor Description RequestParserMultiple()
Constructor for Internal APIRequestParserMultiple(VarNameAdapter adapter)
Constructor for Metadata
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
analyzeRootQuery(com.fasterxml.jackson.databind.JsonNode command)
{ expression, $exactdepth : exactdepth, $depth : /- depth }, $exactdepth and $depth being optional (mutual exclusive)protected void
filterParse(com.fasterxml.jackson.databind.JsonNode rootNode)
Filter partjava.lang.String
getFinalScrollId()
get ScrollIdint
getFinalScrollTimeout()
get ScrollTimeoutint
getLastDepth()
RequestMultiple
getRequest()
boolean
hintCache()
boolean
hintNoTimeout()
BuilderToken.FILTERARGS
model()
protected void
parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest)
protected void
parseQueryOnly(java.lang.String query)
protected void
queryParse(com.fasterxml.jackson.databind.JsonNode rootNode)
[ query, query ] or { query } if one level onlyprotected void
rootParse(com.fasterxml.jackson.databind.JsonNode rootNode)
Will be used as extra arguments in the first queryjava.lang.String
toString()
boolean
trackTotalHits()
Returns whether total hits is computed (defaults to false).-
Methods inherited from class fr.gouv.vitam.common.database.parser.request.AbstractParser
analyzeOneCommand, getAdapter, getNewRequest, getRootNode, getSource, hasFullTextQuery, parse, parseOrderByFilter
-
-
-
-
Constructor Detail
-
RequestParserMultiple
public RequestParserMultiple()
Constructor for Internal API
-
RequestParserMultiple
public RequestParserMultiple(VarNameAdapter adapter)
Constructor for Metadata- Parameters:
adapter
- VarNameAdapter
-
-
Method Detail
-
parseJson
protected void parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest) throws InvalidParseOperationException
- Overrides:
parseJson
in classAbstractParser<RequestMultiple>
- Parameters:
jsonRequest
- containing a parsed JSON as { $roots: root, $query : query, $filter : filter }- Throws:
InvalidParseOperationException
- if jsonRequest could not parse to JSON
-
parseQueryOnly
protected void parseQueryOnly(java.lang.String query) throws InvalidParseOperationException
- Parameters:
query
- containing only the JSON query part (no filter neither roots)- Throws:
InvalidParseOperationException
- if query could not parse to JSON
-
rootParse
protected void rootParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
Will be used as extra arguments in the first query- Parameters:
rootNode
- JsonNode the root of the request- Throws:
InvalidParseOperationException
- if rootNode could not parse to JSON
-
filterParse
protected void filterParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
Filter part- Parameters:
rootNode
- JsonNode The filter of the request- Throws:
InvalidParseOperationException
- if rootNode could not parse to JSON
-
queryParse
protected void queryParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
[ query, query ] or { query } if one level only- Parameters:
rootNode
- JsonNode the query of the request- Throws:
InvalidParseOperationException
- if rootNode could not parse to JSON
-
analyzeRootQuery
protected void analyzeRootQuery(com.fasterxml.jackson.databind.JsonNode command) throws InvalidParseOperationException, InvalidCreateOperationException
{ expression, $exactdepth : exactdepth, $depth : /- depth }, $exactdepth and $depth being optional (mutual exclusive)- Parameters:
command
- JsonNode- Throws:
InvalidParseOperationException
- if query could not parse to JSONInvalidCreateOperationException
- if could not create query in JSON
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getRequest
public RequestMultiple getRequest()
- Overrides:
getRequest
in classAbstractParser<RequestMultiple>
- Returns:
- the Request
-
getLastDepth
public final int getLastDepth()
- Specified by:
getLastDepth
in classAbstractParser<RequestMultiple>
- Returns:
- the lastDepth
-
hintCache
public boolean hintCache()
- Specified by:
hintCache
in classAbstractParser<RequestMultiple>
- Returns:
- True if the hint contains cache
-
hintNoTimeout
public boolean hintNoTimeout()
- Specified by:
hintNoTimeout
in classAbstractParser<RequestMultiple>
- Returns:
- True if the hint contains notimeout
-
model
public BuilderToken.FILTERARGS model()
- Specified by:
model
in classAbstractParser<RequestMultiple>
- Returns:
- the model between Units/ObjectGroups/Objects (in that order)
-
trackTotalHits
public boolean trackTotalHits()
Returns whether total hits is computed (defaults to false). See ES documentation for more details on "track_total_hits"
-
getFinalScrollId
public java.lang.String getFinalScrollId()
get ScrollId- Returns:
- the limit
-
getFinalScrollTimeout
public int getFinalScrollTimeout()
get ScrollTimeout- Returns:
- ScrollTimeout
-
-