@NotThreadSafe public class HTTPSession extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HTTPSession.RetryHandler |
| Modifier and Type | Field and Description |
|---|---|
static String |
ACCEPT_ENCODING |
protected ucar.nc2.util.net.HTTPAuthStore |
authlocal |
static String |
BASIC |
protected boolean |
closed |
static String |
DIGEST |
protected org.apache.http.protocol.HttpContext |
execcontext |
protected static org.apache.http.HttpRequestInterceptor |
globaldebugrequest |
protected static org.apache.http.HttpResponseInterceptor |
globaldebugresponse |
static String |
HEADER_USERAGENT |
protected String |
identifier |
protected String |
legalurl |
protected org.apache.http.HttpRequestInterceptor |
localdebugrequest |
protected org.apache.http.HttpResponseInterceptor |
localdebugresponse |
protected ucar.nc2.util.net.HTTPSession.Settings |
localsettings |
static org.slf4j.Logger |
log |
protected List<HTTPMethod> |
methodList |
static String |
NTLM |
protected org.apache.http.impl.client.AbstractHttpClient |
sessionClient |
static String |
SSL |
static boolean |
TESTING |
| Constructor and Description |
|---|
HTTPSession() |
HTTPSession(String url) |
| Modifier and Type | Method and Description |
|---|---|
static String |
canonicalpath(String path)
Convert path to use '/' consistently and
to remove any trailing '/'
|
void |
clearState() |
void |
close()
Close the session.
|
static void |
debugGlobal(org.apache.http.HttpRequestInterceptor ireq,
org.apache.http.HttpResponseInterceptor iresp) |
static void |
debugHeaders() |
void |
debugSession(org.apache.http.HttpRequestInterceptor ireq,
org.apache.http.HttpResponseInterceptor iresp) |
protected static void |
defineCredentialsProvider(String principal,
org.apache.http.auth.AuthScope scope,
org.apache.http.client.CredentialsProvider provider,
ucar.nc2.util.net.HTTPAuthStore store) |
protected org.apache.http.HttpResponse |
execute(org.apache.http.client.methods.HttpRequestBase request) |
static String |
getCanonicalURL(String legalurl) |
List<org.apache.http.cookie.Cookie> |
getCookies() |
static List<org.apache.http.cookie.Cookie> |
getGlobalCookies() |
ucar.nc2.util.net.HTTPSession.Settings |
getGlobalSettings() |
static int |
getGlobalThreadCount() |
static String |
getGlobalUserAgent() |
int |
getMethodcount() |
static int |
getRetryCount() |
ucar.nc2.util.net.HTTPSession.Settings |
getSettings() |
String |
getURL() |
static String |
getUrlAsString(String url) |
boolean |
isClosed() |
protected static void |
kill() |
static int |
putUrlAsString(String content,
String url) |
static String |
removeprincipal(String u) |
protected void |
setAuthentication(HTTPCredentialsCache hap) |
void |
setCompression() |
void |
setConnectionTimeout(int timeout) |
void |
setCredentials(String scheme,
org.apache.http.auth.Credentials creds) |
void |
setCredentialsProvider(org.apache.http.auth.AuthScope scope,
org.apache.http.client.CredentialsProvider provider) |
void |
setCredentialsProvider(org.apache.http.client.CredentialsProvider provider) |
void |
setCredentialsProvider(String surl) |
void |
setCredentialsProvider(String scheme,
org.apache.http.client.CredentialsProvider provider) |
static void |
setGlobalCompression() |
static void |
setGlobalConnectionTimeout(int timeout) |
static void |
setGlobalCredentials(org.apache.http.auth.AuthScope scope,
org.apache.http.auth.Credentials creds) |
static void |
setGlobalCredentialsProvider(org.apache.http.auth.AuthScope scope,
org.apache.http.client.CredentialsProvider provider) |
static void |
setGlobalCredentialsProvider(org.apache.http.client.CredentialsProvider provider) |
static void |
setGlobalMaxConnections(int nthreads) |
static void |
setGlobalProxy(String host,
int port) |
static void |
setGlobalSoTimeout(int timeout) |
static void |
setGlobalThreadCount(int nthreads) |
static void |
setGlobalUserAgent(String userAgent) |
static void |
setInterceptors(HTTPSession session) |
void |
setMaxRedirects(int n) |
void |
setProxy(String host,
int port) |
static void |
setRetryCount(int count) |
void |
setSoTimeout(int timeout) |
void |
setUserAgent(String agent) |
protected static void |
track(HTTPSession session) |
public static final String HEADER_USERAGENT
public static final String ACCEPT_ENCODING
public static final String BASIC
public static final String DIGEST
public static final String NTLM
public static final String SSL
public static org.slf4j.Logger log
protected org.apache.http.impl.client.AbstractHttpClient sessionClient
protected List<HTTPMethod> methodList
protected String identifier
protected String legalurl
protected boolean closed
protected org.apache.http.protocol.HttpContext execcontext
protected ucar.nc2.util.net.HTTPSession.Settings localsettings
protected ucar.nc2.util.net.HTTPAuthStore authlocal
public static boolean TESTING
protected static org.apache.http.HttpRequestInterceptor globaldebugrequest
protected static org.apache.http.HttpResponseInterceptor globaldebugresponse
protected org.apache.http.HttpRequestInterceptor localdebugrequest
protected org.apache.http.HttpResponseInterceptor localdebugresponse
public HTTPSession()
throws HTTPException
HTTPExceptionpublic HTTPSession(String url) throws HTTPException
HTTPExceptionpublic ucar.nc2.util.net.HTTPSession.Settings getGlobalSettings()
public static void setGlobalUserAgent(String userAgent)
public static String getGlobalUserAgent()
public static void setGlobalThreadCount(int nthreads)
public static void setGlobalMaxConnections(int nthreads)
public static int getGlobalThreadCount()
public static List<org.apache.http.cookie.Cookie> getGlobalCookies()
public static void setGlobalConnectionTimeout(int timeout)
public static void setGlobalSoTimeout(int timeout)
public static void setGlobalProxy(String host, int port)
public static void setGlobalCompression()
protected static void defineCredentialsProvider(String principal, org.apache.http.auth.AuthScope scope, org.apache.http.client.CredentialsProvider provider, ucar.nc2.util.net.HTTPAuthStore store)
public static void setGlobalCredentialsProvider(org.apache.http.auth.AuthScope scope,
org.apache.http.client.CredentialsProvider provider)
public static void setGlobalCredentialsProvider(org.apache.http.client.CredentialsProvider provider)
public static void setGlobalCredentials(org.apache.http.auth.AuthScope scope,
org.apache.http.auth.Credentials creds)
public static int getRetryCount()
public static void setRetryCount(int count)
public static String canonicalpath(String path)
path - convert this pathpublic static String getUrlAsString(String url) throws HTTPException
HTTPExceptionpublic static int putUrlAsString(String content, String url) throws HTTPException
HTTPExceptionpublic ucar.nc2.util.net.HTTPSession.Settings getSettings()
public String getURL()
public void setUserAgent(String agent)
public void setSoTimeout(int timeout)
public void setConnectionTimeout(int timeout)
public void setMaxRedirects(int n)
public void setCompression()
public void close()
public List<org.apache.http.cookie.Cookie> getCookies()
public void clearState()
public void setProxy(String host, int port)
public void setCredentialsProvider(org.apache.http.auth.AuthScope scope,
org.apache.http.client.CredentialsProvider provider)
public void setCredentialsProvider(org.apache.http.client.CredentialsProvider provider)
public void setCredentialsProvider(String scheme, org.apache.http.client.CredentialsProvider provider)
public void setCredentials(String scheme, org.apache.http.auth.Credentials creds)
public void setCredentialsProvider(String surl) throws HTTPException
HTTPExceptionpublic boolean isClosed()
public int getMethodcount()
protected void setAuthentication(HTTPCredentialsCache hap)
protected org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpRequestBase request)
throws IOException
IOExceptionprotected static void kill()
protected static void track(HTTPSession session)
public static void setInterceptors(HTTPSession session)
public static void debugGlobal(org.apache.http.HttpRequestInterceptor ireq,
org.apache.http.HttpResponseInterceptor iresp)
public void debugSession(org.apache.http.HttpRequestInterceptor ireq,
org.apache.http.HttpResponseInterceptor iresp)
public static void debugHeaders()
Copyright © 1999–2014 UCAR/Unidata. All rights reserved.