diff options
author | slewis | 2014-12-17 22:13:30 +0000 |
---|---|---|
committer | slewis | 2014-12-17 22:13:30 +0000 |
commit | 6fb313dd2092d4858f5ff3ba742f9a485e0ced8d (patch) | |
tree | 94fbf4a81d52c945d7fecfcd8c48b1358e1c936f | |
parent | 603b3fe41ba3323510b9f934b7a55dd51a189232 (diff) | |
download | org.eclipse.ecf-6fb313dd2092d4858f5ff3ba742f9a485e0ced8d.tar.gz org.eclipse.ecf-6fb313dd2092d4858f5ff3ba742f9a485e0ced8d.tar.xz org.eclipse.ecf-6fb313dd2092d4858f5ff3ba742f9a485e0ced8d.zip |
Improved newly added RestClientService protected methods.
Change-Id: If3f023a1a3d3ac87f8329b70e1349b176c55d4e8
-rw-r--r-- | framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java b/framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java index 2351bb52a..bc216a885 100644 --- a/framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java +++ b/framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java @@ -81,11 +81,7 @@ public class RestClientService extends AbstractRestClientService { return new HttpDelete(uri); } - protected HttpRequestBase prepareHttpMethod(HttpRequestBase httpMethod) { - return httpMethod; - } - - protected HttpRequestBase createAndPrepareHttpMethod(UriRequest request) { + protected HttpRequestBase createAndPrepareHttpMethod(UriRequest request, IRemoteCall call, IRemoteCallable callable) { HttpRequestBase httpMethod = null; String uri = request.getUri(); IRemoteCallableRequestType requestType = request.getRequestType(); @@ -97,7 +93,9 @@ public class RestClientService extends AbstractRestClientService { httpMethod = createPutMethod(uri); else if (requestType instanceof HttpDeleteRequestType) httpMethod = createDeleteMethod(uri); - return prepareHttpMethod(httpMethod); + // all prepare HttpMethod + prepareHttpMethod(httpMethod, call, callable); + return httpMethod; } /** @@ -116,7 +114,8 @@ public class RestClientService extends AbstractRestClientService { String endpointUri = prepareEndpointAddress(call, callable); trace("invokeRemoteCall", "prepared endpoint=" + endpointUri); //$NON-NLS-1$ //$NON-NLS-2$ UriRequest request = createUriRequest(endpointUri, call, callable); - HttpRequestBase httpMethod = (request == null) ? createAndPrepareHttpMethod(endpointUri, call, callable) : createAndPrepareHttpMethod(request); + // If the request + HttpRequestBase httpMethod = (request == null) ? createAndPrepareHttpMethod(endpointUri, call, callable) : createAndPrepareHttpMethod(request, call, callable); trace("invokeRemoteCall", "executing httpMethod" + httpMethod); //$NON-NLS-1$ //$NON-NLS-2$ // execute method byte[] responseBody = null; @@ -239,7 +238,7 @@ public class RestClientService extends AbstractRestClientService { addRequestHeaders(httpMethod, call, callable); // handle authentication setupAuthenticaton(httpClient, httpMethod); - // setup http method config (redirects, timesouts, etc) + // setup http method config (redirects, timeouts, etc) setupHttpMethod(httpMethod, call, callable); } |