Class MetadataJsonResponseUtils
- java.lang.Object
-
- fr.gouv.vitam.metadata.core.utils.MetadataJsonResponseUtils
-
public final class MetadataJsonResponseUtils extends java.lang.Object
The purpose of this class is to centralize the generation of a metadata json response
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.fasterxml.jackson.databind.node.ArrayNode
populateJSONObjectResponse(Result result, RequestParserMultiple selectRequest)
create Json responsestatic com.fasterxml.jackson.databind.node.ArrayNode
populateJSONObjectResponse(Result result, java.util.Map<java.lang.String,java.util.List<java.lang.String>> diff)
create Json response with diff information
-
-
-
Method Detail
-
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, java.util.Map<java.lang.String,java.util.List<java.lang.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)
-
-