public class UrlConnectionOperations
extends org.apache.hadoop.conf.Configured
| Constructor and Description |
|---|
UrlConnectionOperations(org.apache.hadoop.conf.Configuration conf)
Create an instance off the configuration.
|
| Modifier and Type | Method and Description |
|---|---|
HttpOperationResponse |
execGet(URL url) |
HttpOperationResponse |
execHttpOperation(HttpVerb verb,
URL url,
byte[] payload,
String contentType) |
boolean |
isUseSpnego() |
HttpURLConnection |
openConnection(URL url)
Opens a url with cache disabled, redirect handled in
(JDK) implementation.
|
void |
setUseSpnego(boolean useSpnego) |
static void |
uprateFaults(HttpVerb verb,
String url,
int resultCode,
String bodyAsString,
byte[] body)
Uprate error codes 400 and up into faults;
404 is converted to a
NotFoundException,
401 to ForbiddenException |
public UrlConnectionOperations(org.apache.hadoop.conf.Configuration conf)
conf - configpublic boolean isUseSpnego()
public void setUseSpnego(boolean useSpnego)
public HttpURLConnection openConnection(URL url) throws IOException, org.apache.hadoop.security.authentication.client.AuthenticationException
url - to openIOExceptionorg.apache.hadoop.security.authentication.client.AuthenticationException - authentication failurepublic HttpOperationResponse execGet(URL url) throws IOException, org.apache.hadoop.security.authentication.client.AuthenticationException
IOExceptionorg.apache.hadoop.security.authentication.client.AuthenticationExceptionpublic HttpOperationResponse execHttpOperation(HttpVerb verb, URL url, byte[] payload, String contentType) throws IOException, org.apache.hadoop.security.authentication.client.AuthenticationException
IOExceptionorg.apache.hadoop.security.authentication.client.AuthenticationExceptionpublic static void uprateFaults(HttpVerb verb, String url, int resultCode, String bodyAsString, byte[] body) throws IOException
NotFoundException,
401 to ForbiddenExceptionverb - HTTP Verb usedurl - URL as stringresultCode - response from the requestbodyAsString - body - optional body of the request @throws IOException if the result was considered a failureIOExceptionCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.