public abstract class HttpURLConnectionMethod extends Object implements RIDCHttpMethod
Modifier and Type | Field and Description |
---|---|
protected IdcRequestConfig |
requestConfig |
protected ServiceLog |
serviceLog |
Modifier | Constructor and Description |
---|---|
protected |
HttpURLConnectionMethod(String uri,
String method,
HttpURLConnectionClient client) |
Modifier and Type | Method and Description |
---|---|
void |
addRequestHeader(String name,
String value)
Add a request header
|
int |
execute()
Execute the request
|
InputStream |
getResponseBodyAsStream()
Get the response as a stream
|
RIDCHttpHeader |
getResponseHeader(String headerName)
Get response header
|
List<RIDCHttpHeader> |
getResponseHeaders()
Get all response headers
|
HttpURLConnectionClient |
getRidcClient()
Get the connection instance that this method is associated with
|
int |
getStatusCode()
Get the status code of the response
|
String |
getStatusLine()
Get the status line of the response
|
URI |
getURI()
Get the uri of the request
|
void |
releaseConnection()
Release the connection
|
void |
setCookiePolicy(String policy)
Set Cookie policy for this action
|
void |
setParameter(String param,
String value)
Set request parameters
|
void |
setQueryString(List<NameValuePair> paramList)
Set the query string for the request
|
void |
setRequestConfig(IdcRequestConfig requestConfig)
Set the request-specific config for the request
|
void |
setRequestHeader(String headerName,
String headerValue)
Set the request header for the request
|
void |
setServiceLog(ServiceLog serviceLog)
Set the service log for the request
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setFollowRedirects
protected ServiceLog serviceLog
protected IdcRequestConfig requestConfig
protected HttpURLConnectionMethod(String uri, String method, HttpURLConnectionClient client)
public void addRequestHeader(String name, String value)
RIDCHttpMethod
addRequestHeader
in interface RIDCHttpMethod
name
- the header namevalue
- the header valuepublic InputStream getResponseBodyAsStream() throws IOException, ProtocolException
RIDCHttpMethod
getResponseBodyAsStream
in interface RIDCHttpMethod
IOException
ProtocolException
public RIDCHttpHeader getResponseHeader(String headerName) throws ProtocolException
RIDCHttpMethod
getResponseHeader
in interface RIDCHttpMethod
ProtocolException
public List<RIDCHttpHeader> getResponseHeaders() throws ProtocolException
RIDCHttpMethod
getResponseHeaders
in interface RIDCHttpMethod
ProtocolException
public int getStatusCode() throws ProtocolException
RIDCHttpMethod
getStatusCode
in interface RIDCHttpMethod
ProtocolException
public String getStatusLine() throws ProtocolException
RIDCHttpMethod
getStatusLine
in interface RIDCHttpMethod
ProtocolException
public URI getURI() throws URISyntaxException
RIDCHttpMethod
getURI
in interface RIDCHttpMethod
URISyntaxException
public void releaseConnection()
RIDCHttpMethod
releaseConnection
in interface RIDCHttpMethod
public void setCookiePolicy(String policy)
RIDCHttpMethod
setCookiePolicy
in interface RIDCHttpMethod
public void setParameter(String param, String value)
RIDCHttpMethod
setParameter
in interface RIDCHttpMethod
param
- param namevalue
- param valuepublic void setQueryString(List<NameValuePair> paramList)
RIDCHttpMethod
setQueryString
in interface RIDCHttpMethod
public void setRequestHeader(String headerName, String headerValue)
RIDCHttpMethod
setRequestHeader
in interface RIDCHttpMethod
public HttpURLConnectionClient getRidcClient()
RIDCHttpMethod
getRidcClient
in interface RIDCHttpMethod
public int execute() throws IOException, ProtocolException
RIDCHttpMethod
execute
in interface RIDCHttpMethod
IOException
ProtocolException
public void setServiceLog(ServiceLog serviceLog)
RIDCHttpMethod
setServiceLog
in interface RIDCHttpMethod
public void setRequestConfig(IdcRequestConfig requestConfig)
RIDCHttpMethod
setRequestConfig
in interface RIDCHttpMethod