|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springbyexample.httpclient.AbstractHttpClientTemplate<RequestEntity> org.springbyexample.httpclient.HttpClientTemplate
@Component public class HttpClientTemplate
Template for easier use of HttpClient
.
Field Summary |
---|
Fields inherited from class org.springbyexample.httpclient.AbstractHttpClientTemplate |
---|
authenticationPreemptive, client, connectionManager, defaultUri, lCredentials |
Constructor Summary | |
---|---|
HttpClientTemplate()
Constructor. |
|
HttpClientTemplate(String defaultUri)
Constructor. |
|
HttpClientTemplate(String defaultUri,
boolean init)
Constructor. |
Method Summary | |
---|---|
void |
executePostMethod(byte[] input)
Execute post method. |
void |
executePostMethod(byte[] input,
ResponseCallback<?> callback)
Execute post method. |
void |
executePostMethod(InputStream input)
Execute post method. |
void |
executePostMethod(InputStream input,
ResponseCallback<?> callback)
Execute post method. |
void |
executePostMethod(String input)
Execute post method. |
void |
executePostMethod(String uri,
RequestEntity requestPayload,
Map<String,String> hParams,
ResponseCallback<?> callback)
Execute post method. |
void |
executePostMethod(String input,
ResponseCallback<?> callback)
Execute post method. |
protected void |
processHttpMethod(HttpMethod httpMethod,
ResponseCallback<?> callback)
Processes HttpMethod by executing the method,
validating the response, and calling the callback. |
Methods inherited from class org.springbyexample.httpclient.AbstractHttpClientTemplate |
---|
afterPropertiesSet, destroy, executeGetMethod, executeGetMethod, executeGetMethod, executeGetMethod, executeGetMethod, executeGetMethod, executePostMethod, executePostMethod, executePostMethod, executePostMethod, executePostMethod, getClient, getConnectionManager, getCredentials, getDefaultUri, isAuthenticationPreemptive, processHttpMethodParams, setAuthenticationPreemptive, setClient, setConnectionManager, setCredentials, setDefaultUri, validateResponse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpClientTemplate()
public HttpClientTemplate(String defaultUri)
defaultUri
- Default uri.public HttpClientTemplate(String defaultUri, boolean init)
defaultUri
- Default uri.init
- Whether or not to initialize the bean.Method Detail |
---|
public void executePostMethod(byte[] input)
input
- Byte array RequestEntity
to post
for the request's data.public void executePostMethod(byte[] input, ResponseCallback<?> callback)
input
- Byte array RequestEntity
to post
for the request's data.callback
- Callback with HTTP method's response.public void executePostMethod(String input)
input
- String
to post
for the request's data.public void executePostMethod(String input, ResponseCallback<?> callback)
input
- String
to post
for the request's data.callback
- Callback with HTTP method's response.public void executePostMethod(InputStream input)
input
- InputStream
to post
for the request's data.public void executePostMethod(InputStream input, ResponseCallback<?> callback)
input
- InputStream
to post
for the request's data.callback
- Callback with HTTP method's response.public void executePostMethod(String uri, RequestEntity requestPayload, Map<String,String> hParams, ResponseCallback<?> callback)
executePostMethod
in class AbstractHttpClientTemplate<RequestEntity>
uri
- URI to use when processing this HTTP request instead
of using the default URI.requestPayload
- RequestEntity
data to post.hParams
- Parameters for the HTTP post.callback
- Callback with HTTP method's response.protected void processHttpMethod(HttpMethod httpMethod, ResponseCallback<?> callback)
HttpMethod
by executing the method,
validating the response, and calling the callback.
processHttpMethod
in class AbstractHttpClientTemplate<RequestEntity>
httpMethod
- HttpMethod
to process.callback
- Callback with HTTP method's response.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |