public class RestClientService extends AbstractRestClientService
IRemoteService
.AbstractClientService.AsyncResult, AbstractClientService.UriRequest
AbstractRemoteService.AsyncArgs, AbstractRemoteService.ProxyClassLoader
Modifier and Type | Field and Description |
---|---|
static int |
connectRequestTimeout |
static int |
connectTimeout |
protected static java.lang.String |
DEFAULT_HTTP_CONTENT_CHARSET |
protected static int |
DEFAULT_RESPONSE_BUFFER_SIZE |
protected org.apache.http.client.HttpClient |
httpClient |
protected int |
responseBufferSize |
static int |
socketTimeout |
container, registration
EMPTY_ARGS, futureExecutorService, futureExecutorServiceMaxThreads, iFutureExecutor
Constructor and Description |
---|
RestClientService(RestClientContainer container,
RemoteServiceClientRegistration registration) |
Modifier and Type | Method and Description |
---|---|
protected void |
addRequestHeaders(org.apache.http.message.AbstractHttpMessage httpMethod,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpRequestBase |
createAndPrepareHttpMethod(AbstractClientService.UriRequest request) |
protected org.apache.http.client.methods.HttpRequestBase |
createAndPrepareHttpMethod(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpDelete |
createDeleteMethod(java.lang.String uri) |
protected org.apache.http.client.methods.HttpGet |
createGetMethod(java.lang.String uri) |
protected org.apache.http.client.HttpClient |
createHttpClient() |
protected org.apache.http.client.methods.HttpPatch |
createPatchMethod(java.lang.String uri) |
protected org.apache.http.client.methods.HttpPost |
createPostMethod(java.lang.String uri) |
protected org.apache.http.client.methods.HttpPut |
createPutMethod(java.lang.String uri) |
protected byte[] |
getResponseAsBytes(org.apache.http.HttpResponse response) |
protected org.apache.http.client.entity.UrlEncodedFormEntity |
getUrlEncodedFormEntity(java.util.List list,
AbstractEntityRequestType postRequestType) |
protected java.lang.Object |
invokeRemoteCall(IRemoteCall call,
IRemoteCallable callable)
Calls the Rest service with given URL of IRestCall.
|
protected org.apache.http.client.methods.HttpRequestBase |
prepareDeleteMethod(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpRequestBase |
prepareGetMethod(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected void |
prepareHttpMethod(org.apache.http.client.methods.HttpRequestBase httpMethod,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpRequestBase |
preparePatchMethod(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpRequestBase |
preparePostMethod(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpRequestBase |
preparePutMethod(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected boolean |
retrieveErrorResponseBody(org.apache.http.HttpResponse response) |
protected void |
setupAuthenticaton(org.apache.http.client.HttpClient httpClient,
org.apache.http.client.methods.HttpRequestBase method) |
protected void |
setupHttpMethod(org.apache.http.client.methods.HttpRequestBase httpMethod,
IRemoteCall call,
IRemoteCallable callable) |
protected void |
setupTimeouts(org.apache.http.client.HttpClient httpClient,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.NameValuePair[] |
toNameValuePairs(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable) |
handleException, handleException, logException, logWarning, trace
callAsync, callAsync, callAsync, callAsync, callSync, createUriRequest, fireAsync, getCallMethodNameForProxyInvoke, getCallParametersForProxyInvoke, getClientContainer, getInterfaceClassNames, getNextRequestID, getRegistration, getRemoteServiceID, getRemoteServiceReference, handleInvokeException, invokeSync, prepareEndpointAddress, prepareParameters, processResponse
addAsyncProxyClasses, addRemoteServiceProxyToProxy, callAsync, callAsyncWithResult, callCompletableAsync, callFutureAsync, callFutureAsync, convertInterfaceNameToAsyncInterfaceName, createProxy, createProxy, createRemoteCall, dispose, findAsyncRemoteServiceProxyClass, findAsyncRemoteServiceProxyClass, getAsyncArgs, getAsyncInvokeMethodName, getAsyncRemoteCall, getCallTimeoutForProxyInvoke, getDefaultTimeout, getFutureExecutorService, getIFutureExecutor, getProxy, getProxy, getRemoteService, getRemoteServiceProxyCreator, handleInvokeSyncException, handleProxyException, invoke, invokeAsync, invokeObject, isAsync, loadInterfaceClass, loadInterfaceClass, setFutureExecutorService, setIFutureExecutor
callFuture
public static final int socketTimeout
public static final int connectRequestTimeout
public static final int connectTimeout
protected static final int DEFAULT_RESPONSE_BUFFER_SIZE
protected static final java.lang.String DEFAULT_HTTP_CONTENT_CHARSET
protected org.apache.http.client.HttpClient httpClient
protected int responseBufferSize
public RestClientService(RestClientContainer container, RemoteServiceClientRegistration registration)
protected org.apache.http.client.HttpClient createHttpClient()
protected org.apache.http.client.methods.HttpGet createGetMethod(java.lang.String uri)
protected org.apache.http.client.methods.HttpPost createPostMethod(java.lang.String uri)
protected org.apache.http.client.methods.HttpPut createPutMethod(java.lang.String uri)
protected org.apache.http.client.methods.HttpDelete createDeleteMethod(java.lang.String uri)
protected org.apache.http.client.methods.HttpPatch createPatchMethod(java.lang.String uri)
protected org.apache.http.client.methods.HttpRequestBase createAndPrepareHttpMethod(AbstractClientService.UriRequest request)
protected java.lang.Object invokeRemoteCall(IRemoteCall call, IRemoteCallable callable) throws ECFException
invokeRemoteCall
in class AbstractClientService
call
- The remote call to make. Must not be null
.callable
- The callable with default parameters to use to make the call.null
if an
error occurs.ECFException
- thrown if the call fails.protected boolean retrieveErrorResponseBody(org.apache.http.HttpResponse response)
protected byte[] getResponseAsBytes(org.apache.http.HttpResponse response) throws java.io.IOException
java.io.IOException
protected void setupTimeouts(org.apache.http.client.HttpClient httpClient, IRemoteCall call, IRemoteCallable callable)
protected void addRequestHeaders(org.apache.http.message.AbstractHttpMessage httpMethod, IRemoteCall call, IRemoteCallable callable)
protected org.apache.http.client.methods.HttpRequestBase createAndPrepareHttpMethod(java.lang.String uri, IRemoteCall call, IRemoteCallable callable) throws RestException
RestException
protected void prepareHttpMethod(org.apache.http.client.methods.HttpRequestBase httpMethod, IRemoteCall call, IRemoteCallable callable)
protected void setupHttpMethod(org.apache.http.client.methods.HttpRequestBase httpMethod, IRemoteCall call, IRemoteCallable callable)
protected org.apache.http.client.methods.HttpRequestBase prepareDeleteMethod(java.lang.String uri, IRemoteCall call, IRemoteCallable callable) throws RestException
RestException
protected org.apache.http.client.methods.HttpRequestBase preparePutMethod(java.lang.String uri, IRemoteCall call, IRemoteCallable callable) throws java.io.NotSerializableException, java.io.UnsupportedEncodingException
java.io.NotSerializableException
java.io.UnsupportedEncodingException
protected org.apache.http.client.methods.HttpRequestBase preparePatchMethod(java.lang.String uri, IRemoteCall call, IRemoteCallable callable) throws java.io.NotSerializableException, java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
ECFException
java.io.NotSerializableException
protected org.apache.http.client.methods.HttpRequestBase preparePostMethod(java.lang.String uri, IRemoteCall call, IRemoteCallable callable) throws java.io.NotSerializableException, java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
ECFException
java.io.NotSerializableException
protected org.apache.http.client.methods.HttpRequestBase prepareGetMethod(java.lang.String uri, IRemoteCall call, IRemoteCallable callable) throws java.io.NotSerializableException
java.io.NotSerializableException
ECFException
protected org.apache.http.client.entity.UrlEncodedFormEntity getUrlEncodedFormEntity(java.util.List list, AbstractEntityRequestType postRequestType) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
protected org.apache.http.NameValuePair[] toNameValuePairs(java.lang.String uri, IRemoteCall call, IRemoteCallable callable) throws java.io.NotSerializableException
java.io.NotSerializableException
protected void setupAuthenticaton(org.apache.http.client.HttpClient httpClient, org.apache.http.client.methods.HttpRequestBase method)