public final class ServiceResponseHandler extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ServiceResponseHandler.ApiName
Enums for Snowpipe REST API:
https://docs.snowflake.com/en/user-guide/data-load-snowpipe-rest-apis.html Used in
handleExceptionalStatus for logging purpose
|
| Constructor and Description |
|---|
ServiceResponseHandler() |
| Modifier and Type | Method and Description |
|---|---|
static ConfigureClientResponse |
unmarshallConfigureClientResponse(org.apache.http.HttpResponse response,
UUID requestId)
unmarshallConfigureClientResponse - Given an HttpResponse object, attempts to deserialize it
into a ConfigureClientResponse
|
static ClientStatusResponse |
unmarshallGetClientStatus(org.apache.http.HttpResponse response,
UUID requestId)
unmarshallGetClientStatus - Given an HttpResponse object, attempts to deserialize it into a
ClientStatusResponse
|
static HistoryRangeResponse |
unmarshallHistoryRangeResponse(org.apache.http.HttpResponse response,
UUID requestId)
Given an HttpResponse object - attempts to deserialize it into a HistoryRangeResponse
|
static HistoryResponse |
unmarshallHistoryResponse(org.apache.http.HttpResponse response,
UUID requestId)
unmarshallHistoryResponse Given an HttpResponse object - attempts to deserialize it into a
HistoryResponse object
|
static IngestResponse |
unmarshallIngestResponse(org.apache.http.HttpResponse response,
UUID requestId)
unmarshallIngestResponse Given an HttpResponse object - attempts to deserialize it into an
IngestResponse object
|
static <T> T |
unmarshallStreamingIngestResponse(org.apache.http.HttpResponse response,
Class<T> valueType,
ServiceResponseHandler.ApiName apiName)
unmarshallStreamingIngestResponse Given an HttpResponse object - attempts to deserialize it
into an Object based on input type
|
public static IngestResponse unmarshallIngestResponse(org.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
response - the HTTPResponse we want to distill into an IngestResponserequestId - IOException - if our entity is somehow corrupt or we can't get itIngestResponseException - - if we have an uncategorized network issueBackOffException - - if we have a 503 issuepublic static HistoryResponse unmarshallHistoryResponse(org.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
response - the HttpResponse object we are trying to deserializerequestId - IOException - if our entity is somehow corrupt or we can't get itIngestResponseException - - if we have an uncategorized network issueBackOffException - - if we have a 503 issuepublic static HistoryRangeResponse unmarshallHistoryRangeResponse(org.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
response - the HttpResponse object we are trying to deserializerequestId - IOException - if our entity is somehow corrupt or we can't get itIngestResponseException - - if we have an uncategorized network issueBackOffException - - if we have a 503 issuepublic static ConfigureClientResponse unmarshallConfigureClientResponse(org.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
response - HttpResponserequestId - IOException - if our entity is somehow corrupt or we can't get itIngestResponseException - - if we have an uncategorized network issueBackOffException - - if we have a 503 issuepublic static ClientStatusResponse unmarshallGetClientStatus(org.apache.http.HttpResponse response, UUID requestId) throws IOException, IngestResponseException, BackOffException
response - HttpResponserequestId - IOException - if our entity is somehow corrupt or we can't get itIngestResponseException - - if we have an uncategorized network issueBackOffException - - if we have a 503 issuepublic static <T> T unmarshallStreamingIngestResponse(org.apache.http.HttpResponse response,
Class<T> valueType,
ServiceResponseHandler.ApiName apiName)
throws IOException,
IngestResponseException
response - http response from servervalueType - the class typeapiName - enum to represent the corresponding api nameIOException - if a low-level I/O problemIngestResponseException - if received an exceptional status codeCopyright © 2022. All rights reserved.