Class DefaultResponseParser
java.lang.Object
com.cognite.client.servicesV1.response.DefaultResponseParser
- All Implemented Interfaces:
ResponseParser<String>,Serializable
- Direct Known Subclasses:
FileUploadHeaderResponseParser,JsonDataItemResponseParser,JsonErrorItemResponseParser,JsonErrorMessageDuplicateResponseParser,JsonItemResponseParser,JsonRawRowResponseParser,JsonResponseParser,JsonStringAttributeResponseParser,JsonThreeDOutputsParser,TSPointsResponseParser
public abstract class DefaultResponseParser
extends Object
implements ResponseParser<String>, Serializable
The default response parser extracts results items from the
items node and
next cursor from the nextCursor node.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final org.slf4j.Loggerprotected static final intprotected final com.fasterxml.jackson.databind.ObjectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableList<String>extractItems(byte[] payload) Extract the results items from a response body.com.google.common.collect.ImmutableList<String>extractItems(String json) Extract the main items from a results json payload.extractNextCursor(byte[] payload) Extract the next cursor from a response body.extractNextCursor(String json) Extract the next cursor from a results json payload.protected StringparseToString(byte[] payload)
-
Field Details
-
MAX_LENGTH_JSON_LOG
protected static final int MAX_LENGTH_JSON_LOG- See Also:
-
LOG
protected final org.slf4j.Logger LOG -
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper -
instanceId
-
-
Constructor Details
-
DefaultResponseParser
public DefaultResponseParser()
-
-
Method Details
-
extractNextCursor
Extract the next cursor from a response body.- Specified by:
extractNextCursorin interfaceResponseParser<String>- Parameters:
payload- The reponse body- Returns:
- Throws:
ExceptionIOException
-
extractNextCursor
Extract the next cursor from a results json payload.- Parameters:
json- The results json payload- Returns:
- Throws:
IOExceptionException
-
extractItems
public com.google.common.collect.ImmutableList<String> extractItems(byte[] payload) throws Exception Extract the results items from a response body.- Specified by:
extractItemsin interfaceResponseParser<String>- Parameters:
payload- The reponse body- Returns:
- Throws:
Exception
-
extractItems
Extract the main items from a results json payload.- Parameters:
json- The results json payload- Returns:
- Throws:
IOExceptionException
-
parseToString
-