Class RequestParserHelper
java.lang.Object
fr.gouv.vitam.common.database.parser.request.multiple.RequestParserHelper
RequestParser Helper to get the correct Request Parser from String or from Json.
Note however that is should be better to create the correct Parser based one the source of the request:
- POST: insert
- PATCH: update
- DELETE: delete
- GET: select
- PUT: delete and insert
Note however that is should be better to create the correct Parser based one the source of the request:
- POST: insert
- PATCH: update
- DELETE: delete
- GET: select
- PUT: delete and insert
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequestParserMultiple
getParser
(com.fasterxml.jackson.databind.JsonNode jsonRequest) Create one Parser for Internal API according to:
InsertParser if { $roots: root, $query : query, $filter : filter, $data : data}
UpdateParser if { $roots: root, $query : query, $filter : filter, $action : action }
SelectParser if { $roots: roots, $query : query, $filter : filter, $projection : projection }
DeleteParser if { $roots: roots, $query : query, $filter : multi }static RequestParserMultiple
getParser
(com.fasterxml.jackson.databind.JsonNode jsonRequest, VarNameAdapter varNameAdapter) Create one Parser for Metadata according to:
InsertParser if { $roots: root, $query : query, $filter : filter, $data : data}
UpdateParser if { $roots: root, $query : query, $filter : filter, $action : action }
SelectParser if { $roots: roots, $query : query, $filter : filter, $projection : projection }
DeleteParser if { $roots: roots, $query : query, $filter : multi }
-
Method Details
-
getParser
public static RequestParserMultiple getParser(com.fasterxml.jackson.databind.JsonNode jsonRequest) throws InvalidParseOperationException Create one Parser for Internal API according to:
InsertParser if { $roots: root, $query : query, $filter : filter, $data : data}
UpdateParser if { $roots: root, $query : query, $filter : filter, $action : action }
SelectParser if { $roots: roots, $query : query, $filter : filter, $projection : projection }
DeleteParser if { $roots: roots, $query : query, $filter : multi }- Parameters:
jsonRequest
- the request to parse- Returns:
- the appropriate RequestParser
- Throws:
InvalidParseOperationException
- if jsonRequest could not parse to JSON
-
getParser
public static RequestParserMultiple getParser(com.fasterxml.jackson.databind.JsonNode jsonRequest, VarNameAdapter varNameAdapter) throws InvalidParseOperationException Create one Parser for Metadata according to:
InsertParser if { $roots: root, $query : query, $filter : filter, $data : data}
UpdateParser if { $roots: root, $query : query, $filter : filter, $action : action }
SelectParser if { $roots: roots, $query : query, $filter : filter, $projection : projection }
DeleteParser if { $roots: roots, $query : query, $filter : multi }- Parameters:
jsonRequest
- the request to parsevarNameAdapter
- the VarNameAdapter to use with the created Parser- Returns:
- the appropriate RequestParser
- Throws:
InvalidParseOperationException
- if jsonRequest could not parse to JSON
-