Class MetadataJsonResponseUtils
java.lang.Object
fr.gouv.vitam.metadata.core.utils.MetadataJsonResponseUtils
The purpose of this class is to centralize the generation of a metadata json response
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.node.ArrayNode
populateJSONObjectResponse
(Result result, RequestParserMultiple selectRequest) create Json responsestatic com.fasterxml.jackson.databind.node.ArrayNode
create Json response with diff information
-
Method Details
-
populateJSONObjectResponse
public static com.fasterxml.jackson.databind.node.ArrayNode populateJSONObjectResponse(Result result, RequestParserMultiple selectRequest) throws InvalidParseOperationException create Json response- Parameters:
result
- contains final unit(s)/ObjectGroup(s) list
can be emptyselectRequest
- the select request of type RequestParserMultiple- Returns:
- ArrayNode {$hits{},$context{},$result:[{}....{}],}
$context will be added later (Access) $result array of units or ObjectGroup (can be empty) - Throws:
InvalidParseOperationException
- thrown when json query is not valid
-
populateJSONObjectResponse
public static com.fasterxml.jackson.databind.node.ArrayNode populateJSONObjectResponse(Result result, Map<String, List<String>> diff) create Json response with diff information- Parameters:
result
- contains final unit(s)/ObjectGroup(s) list
can be emptydiff
- the diff map list with the unit id as key and the diff list as value- Returns:
- JsonNode {$hits{},$context{},$result:[{_id:...,_diff:...}},...{}]}
$context will be added later (Access) $result array of units or ObjectGroup (can be empty)
-