public class HttpURLConnectionClient extends Object implements RIDCHttpClient
HttpURLConnection
Constructor and Description |
---|
HttpURLConnectionClient(IdcHttpClientConfig config) |
Modifier and Type | Method and Description |
---|---|
void |
addCookie(RIDCCookie cookie)
Add cookie to the connection
|
void |
clear()
Clear the params and headers from the connection
|
List<RIDCCookie> |
getCookies()
Get the cookies from the connection
|
Object |
getDelegateObject()
Returns the underlying client object
|
HttpURLConnectionGetMethod |
getGetMethod(String url)
Get the method to execute for HTTP GET
|
HttpURLConnectionPostMethod |
getPostMethod(String url)
Get the method to execute for HTTP POST
|
void |
resetState()
Reset the state of the connection
|
void |
setAuthenticationPreemptive(boolean b)
Set authentication preemptive
|
void |
setCredentials(String scope,
Credentials idcCredentials)
Set credentials for the connection
|
void |
setProxy(String proxyHost,
int proxyPort,
String proxyUsername,
String proxyPassword,
String proxyRealm)
Set proxy for the connection
|
void |
setSocketTimeout(int socketTimeout)
Set the socket timeout
|
public HttpURLConnectionClient(IdcHttpClientConfig config) throws IdcClientException
IdcClientException
public void addCookie(RIDCCookie cookie)
RIDCHttpClient
addCookie
in interface RIDCHttpClient
public void clear()
RIDCHttpClient
clear
in interface RIDCHttpClient
public List<RIDCCookie> getCookies()
RIDCHttpClient
getCookies
in interface RIDCHttpClient
public void resetState()
RIDCHttpClient
resetState
in interface RIDCHttpClient
public void setAuthenticationPreemptive(boolean b)
RIDCHttpClient
setAuthenticationPreemptive
in interface RIDCHttpClient
public void setCredentials(String scope, Credentials idcCredentials)
RIDCHttpClient
setCredentials
in interface RIDCHttpClient
public void setProxy(String proxyHost, int proxyPort, String proxyUsername, String proxyPassword, String proxyRealm)
RIDCHttpClient
setProxy
in interface RIDCHttpClient
proxyHost
- proxy host nameproxyPort
- proxy host portproxyUsername
- proxy user name, null if not requiredproxyPassword
- proxy user password, null if not requiredproxyRealm
- proxy realm, null if not requiredpublic void setSocketTimeout(int socketTimeout)
RIDCHttpClient
setSocketTimeout
in interface RIDCHttpClient
socketTimeout
- timeout value on milli secondspublic HttpURLConnectionGetMethod getGetMethod(String url)
RIDCHttpClient
getGetMethod
in interface RIDCHttpClient
url
- the urlpublic HttpURLConnectionPostMethod getPostMethod(String url)
RIDCHttpClient
getPostMethod
in interface RIDCHttpClient
url
- the urlpublic Object getDelegateObject()
RIDCHttpClient
getDelegateObject
in interface RIDCHttpClient