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 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(String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpDelete |
createDeleteMethod(String uri) |
protected org.apache.http.client.methods.HttpGet |
createGetMethod(String uri) |
protected org.apache.http.client.HttpClient |
createHttpClient() |
protected org.apache.http.client.methods.HttpPatch |
createPatchMethod(String uri) |
protected org.apache.http.client.methods.HttpPost |
createPostMethod(String uri) |
protected org.apache.http.client.methods.HttpPut |
createPutMethod(String uri) |
protected byte[] |
getResponseAsBytes(org.apache.http.HttpResponse response) |
protected org.apache.http.client.entity.UrlEncodedFormEntity |
getUrlEncodedFormEntity(List list,
AbstractEntityRequestType postRequestType) |
protected Object |
invokeRemoteCall(IRemoteCall call,
IRemoteCallable callable)
Calls the Rest service with given URL of IRestCall.
|
protected org.apache.http.client.methods.HttpRequestBase |
prepareDeleteMethod(String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpRequestBase |
prepareGetMethod(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(String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpRequestBase |
preparePostMethod(String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected org.apache.http.client.methods.HttpRequestBase |
preparePutMethod(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(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, callAsync, callAsyncWithResult, callAsyncWithTimeout, callAsyncWithTimeout, callCompletableAsync, callFutureAsync, callFutureAsync, callSync, convertInterfaceNameToAsyncInterfaceName, createProxy, createProxy, createRCCE, createRCCEFailure, createRCCESuccess, createRemoteCall, dispose, findAsyncRemoteServiceProxyClass, findAsyncRemoteServiceProxyClass, getAsyncArgs, getAsyncInvokeMethodName, getAsyncRemoteCall, getCallTimeoutForProxyInvoke, getDefaultTimeout, getFutureExecutorService, getIFutureExecutor, getProxy, getProxy, getRemoteService, getRemoteServiceProxyCreator, handleInvokeSyncException, handleProxyException, invoke, invokeAsync, invokeObject, invokeReturnAsync, isAsync, isInterfaceAsync, isMethodAsync, isOSGIAsync, loadInterfaceClass, loadInterfaceClass, setFutureExecutorService, setIFutureExecutor
callFuture, isReturnAsync
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 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(String uri)
protected org.apache.http.client.methods.HttpPost createPostMethod(String uri)
protected org.apache.http.client.methods.HttpPut createPutMethod(String uri)
protected org.apache.http.client.methods.HttpDelete createDeleteMethod(String uri)
protected org.apache.http.client.methods.HttpPatch createPatchMethod(String uri)
protected org.apache.http.client.methods.HttpRequestBase createAndPrepareHttpMethod(AbstractClientService.UriRequest request)
protected 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 IOException
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(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(String uri, IRemoteCall call, IRemoteCallable callable) throws RestException
RestException
protected org.apache.http.client.methods.HttpRequestBase preparePutMethod(String uri, IRemoteCall call, IRemoteCallable callable) throws NotSerializableException, UnsupportedEncodingException
protected org.apache.http.client.methods.HttpRequestBase preparePatchMethod(String uri, IRemoteCall call, IRemoteCallable callable) throws NotSerializableException, UnsupportedEncodingException
UnsupportedEncodingException
ECFException
NotSerializableException
protected org.apache.http.client.methods.HttpRequestBase preparePostMethod(String uri, IRemoteCall call, IRemoteCallable callable) throws NotSerializableException, UnsupportedEncodingException
protected org.apache.http.client.methods.HttpRequestBase prepareGetMethod(String uri, IRemoteCall call, IRemoteCallable callable) throws NotSerializableException
NotSerializableException
ECFException
protected org.apache.http.client.entity.UrlEncodedFormEntity getUrlEncodedFormEntity(List list, AbstractEntityRequestType postRequestType) throws UnsupportedEncodingException
UnsupportedEncodingException
protected org.apache.http.NameValuePair[] toNameValuePairs(String uri, IRemoteCall call, IRemoteCallable callable) throws NotSerializableException
NotSerializableException
protected void setupAuthenticaton(org.apache.http.client.HttpClient httpClient, org.apache.http.client.methods.HttpRequestBase method)
Copyright © 2004–2020 Eclipse Foundation. All rights reserved.