Class ProjectionValueSerializer
java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.queries.ProjectionValueSerializer
Serializes the embedded Property values projected by an
_emit query as a read does.
An embedded value is serialized by PropertyElementManagement.getJsonNode(ODocument):
an Encrypted value is therefore returned encrypted with the key of the Context of the request.
When the caller reads the sensitive metadata identity fields redacted, a projected Metadata
value is redacted too. A projected value holding no embedded value is left to the query
executor.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanWhether the caller reads the sensitive metadata identity fields redacted.protected final org.gcube.com.fasterxml.jackson.databind.ObjectMapperIn-use Jackson object mapper. -
Constructor Summary
ConstructorsConstructorDescriptionProjectionValueSerializer(boolean maskMetadata) Creates a newProjectionValueSerializer. -
Method Summary
-
Field Details
-
objectMapper
protected final org.gcube.com.fasterxml.jackson.databind.ObjectMapper objectMapperIn-use Jackson object mapper. -
maskMetadata
protected final boolean maskMetadataWhether the caller reads the sensitive metadata identity fields redacted.
-
-
Constructor Details
-
ProjectionValueSerializer
public ProjectionValueSerializer(boolean maskMetadata) Creates a newProjectionValueSerializer.- Parameters:
maskMetadata-trueif the caller reads the sensitive metadata identity fields redacted
-
-
Method Details
-
serialize
public org.gcube.com.fasterxml.jackson.databind.JsonNode serialize(Object value) throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Serializes a projected value that is, or holds, an embedded Property value.- Parameters:
value- the projected value- Returns:
- the JSON representation, or
nullif the value neither is nor holds an embedded value - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException- if the value is a record instead of a property valueorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the value cannot be serialized
-