M -public abstract class HttpApache4Method<M extends org.apache.http.client.methods.HttpRequestBase> extends Object implements RIDCHttpMethod
| Modifier and Type | Field and Description |
|---|---|
protected HttpApache4Client |
httpClient |
protected M |
method |
protected IdcRequestConfig |
requestConfig |
protected ServiceLog |
serviceLog |
| Constructor and Description |
|---|
HttpApache4Method() |
| 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
|
RIDCHttpClient |
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
|
protected void |
logRequest(String logID, M method) |
protected void |
logResponse(String logID, M method, org.apache.http.HttpResponse httpResponse) |
void |
releaseConnection()
Release the connection
|
void |
setCookiePolicy(String cookiePolicy)
Set Cookie policy for this action
|
void |
setFollowRedirects(boolean followRedirects)
Set the follow directs option for the connection
|
void |
setParameter(String param, String value)
Set request parameters
|
void |
setQueryString(List<NameValuePair> nvpairList)
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
|
protected M extends org.apache.http.client.methods.HttpRequestBase method
protected HttpApache4Client httpClient
protected ServiceLog serviceLog
protected IdcRequestConfig requestConfig
public void addRequestHeader(String name, String value)
addRequestHeader in interface RIDCHttpMethodname - the header namevalue - the header valuepublic InputStream getResponseBodyAsStream() throws IOException
getResponseBodyAsStream in interface RIDCHttpMethodIOExceptionpublic RIDCHttpHeader getResponseHeader(String headerName)
getResponseHeader in interface RIDCHttpMethodheaderName - the header namepublic List<RIDCHttpHeader> getResponseHeaders()
getResponseHeaders in interface RIDCHttpMethodpublic int getStatusCode()
getStatusCode in interface RIDCHttpMethodpublic String getStatusLine()
getStatusLine in interface RIDCHttpMethodpublic URI getURI() throws URISyntaxException
getURI in interface RIDCHttpMethodURISyntaxExceptionpublic void releaseConnection()
releaseConnection in interface RIDCHttpMethodpublic void setCookiePolicy(String cookiePolicy)
setCookiePolicy in interface RIDCHttpMethodcookiePolicy -public void setFollowRedirects(boolean followRedirects)
setFollowRedirects in interface RIDCHttpMethodfollowRedirects -public void setRequestHeader(String headerName, String headerValue)
setRequestHeader in interface RIDCHttpMethodheaderName -headerValue -public void setParameter(String param, String value)
setParameter in interface RIDCHttpMethodparam - param namevalue - param valuepublic void setQueryString(List<NameValuePair> nvpairList)
setQueryString in interface RIDCHttpMethodnvpairList - the list of NameValuePair instancespublic RIDCHttpClient getRidcClient()
getRidcClient in interface RIDCHttpMethod
public int execute()
throws IOException
execute in interface RIDCHttpMethodIOExceptionpublic void setServiceLog(ServiceLog serviceLog)
setServiceLog in interface RIDCHttpMethodserviceLog -public void setRequestConfig(IdcRequestConfig requestConfig)
RIDCHttpMethodsetRequestConfig in interface RIDCHttpMethod