Revert changes for 5502.
This commit is contained in:
parent
fab00ca3a0
commit
ee4ecacbdb
|
@ -93,10 +93,6 @@ public enum Pointcut implements IPointcut {
|
||||||
* <li>
|
* <li>
|
||||||
* ca.uhn.fhir.rest.client.api.IRestfulClient - The client object making the request
|
* ca.uhn.fhir.rest.client.api.IRestfulClient - The client object making the request
|
||||||
* </li>
|
* </li>
|
||||||
* <li>
|
|
||||||
* ca.uhn.fhir.rest.client.api.ClientResponseContext - Contains an IHttpRequest, an IHttpResponse, and an IRestfulClient
|
|
||||||
* and also allows the client to mutate the contained IHttpResponse
|
|
||||||
* </li>
|
|
||||||
* </ul>
|
* </ul>
|
||||||
* </p>
|
* </p>
|
||||||
* Hook methods must return <code>void</code>.
|
* Hook methods must return <code>void</code>.
|
||||||
|
@ -105,8 +101,7 @@ public enum Pointcut implements IPointcut {
|
||||||
void.class,
|
void.class,
|
||||||
"ca.uhn.fhir.rest.client.api.IHttpRequest",
|
"ca.uhn.fhir.rest.client.api.IHttpRequest",
|
||||||
"ca.uhn.fhir.rest.client.api.IHttpResponse",
|
"ca.uhn.fhir.rest.client.api.IHttpResponse",
|
||||||
"ca.uhn.fhir.rest.client.api.IRestfulClient",
|
"ca.uhn.fhir.rest.client.api.IRestfulClient"),
|
||||||
"ca.uhn.fhir.rest.client.api.ClientResponseContext"),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <b>Server Hook:</b>
|
* <b>Server Hook:</b>
|
||||||
|
|
|
@ -353,24 +353,13 @@ public abstract class BaseClient implements IRestfulClient {
|
||||||
|
|
||||||
response = httpRequest.execute();
|
response = httpRequest.execute();
|
||||||
|
|
||||||
final Class<? extends IBaseResource> returnType = (binding instanceof ResourceResponseHandler)
|
|
||||||
? ((ResourceResponseHandler<? extends IBaseResource>) binding).getReturnType()
|
|
||||||
: null;
|
|
||||||
|
|
||||||
final ClientResponseContext clientResponseContext =
|
|
||||||
new ClientResponseContext(httpRequest, response, this, getFhirContext(), returnType);
|
|
||||||
HookParams responseParams = new HookParams();
|
HookParams responseParams = new HookParams();
|
||||||
responseParams.add(IHttpRequest.class, httpRequest);
|
responseParams.add(IHttpRequest.class, httpRequest);
|
||||||
responseParams.add(IHttpResponse.class, response);
|
responseParams.add(IHttpResponse.class, response);
|
||||||
responseParams.add(IRestfulClient.class, this);
|
responseParams.add(IRestfulClient.class, this);
|
||||||
responseParams.add(ClientResponseContext.class, clientResponseContext);
|
|
||||||
|
|
||||||
getInterceptorService().callHooks(Pointcut.CLIENT_RESPONSE, responseParams);
|
getInterceptorService().callHooks(Pointcut.CLIENT_RESPONSE, responseParams);
|
||||||
|
|
||||||
// Replace the contents of the response with whatever the hook returned, or the same response as before if
|
|
||||||
// it no-op'd
|
|
||||||
response = clientResponseContext.getHttpResponse();
|
|
||||||
|
|
||||||
String mimeType;
|
String mimeType;
|
||||||
if (Constants.STATUS_HTTP_204_NO_CONTENT == response.getStatus()) {
|
if (Constants.STATUS_HTTP_204_NO_CONTENT == response.getStatus()) {
|
||||||
mimeType = null;
|
mimeType = null;
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
type: add
|
|
||||||
issue: 5502
|
|
||||||
jira: SMILE-7262
|
|
||||||
title: "It is now possible to mutate an HTTP response from the CLIENT_RESPONSE Pointcut, and pass this mutated response
|
|
||||||
to downstream processing."
|
|
Loading…
Reference in New Issue