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
Partial Request Parser (common base): { $roots: root, $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
ConstructorDescriptionConstructor for Internal APIRequestParserMultiple
(VarNameAdapter adapter) Constructor for Metadata -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 partget ScrollIdint
get ScrollTimeoutfinal int
boolean
boolean
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, query ] or { query } if one level onlyprotected void
rootParse
(com.fasterxml.jackson.databind.JsonNode rootNode) Will be used as extra arguments in the first querytoString()
boolean
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
-
Field Details
-
lastDepth
protected int lastDepthLast computed Depth
-
-
Constructor Details
-
RequestParserMultiple
public RequestParserMultiple()Constructor for Internal API -
RequestParserMultiple
Constructor for Metadata- Parameters:
adapter
- VarNameAdapter
-
-
Method Details
-
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
- 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
-
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
- 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
get ScrollId- Returns:
- the limit
-
getFinalScrollTimeout
public int getFinalScrollTimeout()get ScrollTimeout- Returns:
- ScrollTimeout
-