public class AbfsJdkHttpOperation extends AbfsHttpOperation
AbfsHttpOperation for orchestrating calls using JDK's HttpURLConnection.AbfsHttpOperation.AbfsHttpOperationWithFixedResult| Constructor and Description |
|---|
AbfsJdkHttpOperation(URL url,
String method,
List<AbfsHttpHeader> requestHeaders,
Duration connectionTimeout,
Duration readTimeout)
Initializes a new HTTP request and opens the connection.
|
| Modifier and Type | Method and Description |
|---|---|
protected InputStream |
getContentInputStream()
Get the response stream from the connection.
|
protected InputStream |
getErrorStream()
Get the error stream from the connection.
|
String |
getResponseHeader(String httpHeader)
Get response header value for the given headerKey.
|
String |
getTracingContextSuffix()
Get the suffix to add to the tracing context that defines what http-client is
used to make the network call
|
void |
processResponse(byte[] buffer,
int offset,
int length)
Gets and processes the HTTP response.
|
void |
sendPayload(byte[] buffer,
int offset,
int length)
Sends the HTTP request.
|
void |
setRequestProperty(String key,
String value)
Set request header.
|
getAbfsHttpOperationWithFixedResult, getBytesReceived, getBytesSent, getClientRequestId, getExpectedAppendPos, getExpectedBytesToBeSent, getHost, getListResultSchema, getLogString, getMaskedEncodedUrl, getMaskedUrl, getMethod, getRecvLatency, getRequestId, getSendLatency, getStatusCode, getStatusDescription, getStorageErrorCode, getStorageErrorMessage, getUrl, isConnectionDisconnectedOnError, setBytesSent, setConnectionDisconnectedOnError, setConnectionTimeMs, setExpectedBytesToBeSent, setMaskForSAS, setRecvResponseTimeMs, setRequestId, setSendRequestTimeMs, setStatusCode, setStatusDescription, toStringpublic AbfsJdkHttpOperation(URL url, String method, List<AbfsHttpHeader> requestHeaders, Duration connectionTimeout, Duration readTimeout) throws IOException
url - The full URL including query string parameters.method - The HTTP method (PUT, PATCH, POST, GET, HEAD, or DELETE).requestHeaders - The HTTP request headers.READ_TIMEOUTconnectionTimeout - The Connection Timeout value to be used while establishing http connectionreadTimeout - The Read Timeout value to be used with http connection while making a requestIOException - if an error occurs.public String getResponseHeader(String httpHeader)
getResponseHeader in class AbfsHttpOperationhttpHeader - header key.public void sendPayload(byte[] buffer,
int offset,
int length)
throws IOException
sendPayload in class AbfsHttpOperationbuffer - the request entity body.offset - an offset into the buffer where the data beings.length - the length of the data in the buffer.IOException - if an error occurs.protected InputStream getContentInputStream() throws IOException
getContentInputStream in class AbfsHttpOperationIOException - if the response stream could not be created from the connection.public void processResponse(byte[] buffer,
int offset,
int length)
throws IOException
processResponse in class AbfsHttpOperationbuffer - a buffer to hold the response entity bodyoffset - an offset in the buffer where the data will being.length - the number of bytes to be written to the buffer.IOException - if an error occurs.public void setRequestProperty(String key, String value)
setRequestProperty in class AbfsHttpOperationkey - header key.value - header value.protected InputStream getErrorStream()
getErrorStream in class AbfsHttpOperationpublic String getTracingContextSuffix()
getTracingContextSuffix in class AbfsHttpOperationCopyright © 2008–2024 Apache Software Foundation. All rights reserved.