diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoMessageHeaderDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoMessageHeaderDstu2.java index fd9342332dd..f1e282b1476 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoMessageHeaderDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoMessageHeaderDstu2.java @@ -27,11 +27,6 @@ import org.hl7.fhir.instance.model.api.IBaseBundle; public class FhirResourceDaoMessageHeaderDstu2 extends FhirResourceDaoDstu2 implements IFhirResourceDaoMessageHeader { - @Override - public IBaseBundle messageHeaderProcessMessage(RequestDetails theRequestDetails, IBaseBundle theMessage) { - return FhirResourceDaoMessageHeaderDstu2.throwProcessMessageNotImplemented(); - } - public static IBaseBundle throwProcessMessageNotImplemented() { throw new NotImplementedOperationException("This operation is not yet implemented on this server"); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java index 9db169e2236..ba2456f61d2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java @@ -60,6 +60,7 @@ import ca.uhn.fhir.util.UrlUtil; import ca.uhn.fhir.util.UrlUtil.UrlParts; import com.google.common.collect.ArrayListMultimap; import org.apache.http.NameValuePair; +import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.springframework.beans.factory.annotation.Autowired; @@ -665,7 +666,11 @@ public class FhirSystemDaoDstu2 extends BaseHapiFhirSystemDao { return Integer.toString(theStatusCode) + " " + defaultString(Constants.HTTP_STATUS_NAMES.get(theStatusCode)); } - //@formatter:off + @Override + public IBaseBundle processMessage(RequestDetails theRequestDetails, IBaseBundle theMessage) { + return FhirResourceDaoMessageHeaderDstu2.throwProcessMessageNotImplemented(); + } + /** * Transaction Order, per the spec: @@ -675,7 +680,6 @@ public class FhirSystemDaoDstu2 extends BaseHapiFhirSystemDao { * Process any PUT interactions * Process any GET interactions */ - //@formatter:off public class TransactionSorter implements Comparator { @Override diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDaoMessageHeader.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDaoMessageHeader.java index cf9f7b2ba56..aac377ca26e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDaoMessageHeader.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDaoMessageHeader.java @@ -1,7 +1,5 @@ package ca.uhn.fhir.jpa.dao; -import ca.uhn.fhir.rest.api.server.RequestDetails; -import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; /* @@ -25,7 +23,5 @@ import org.hl7.fhir.instance.model.api.IBaseResource; */ public interface IFhirResourceDaoMessageHeader extends IFhirResourceDao { - - IBaseBundle messageHeaderProcessMessage(RequestDetails theRequestDetails, IBaseBundle theMessage); - + // nothing right now } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirSystemDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirSystemDao.java index 5eaff8d1e11..0a95155cde8 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirSystemDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirSystemDao.java @@ -24,6 +24,7 @@ import ca.uhn.fhir.jpa.util.ExpungeOptions; import ca.uhn.fhir.jpa.util.ExpungeOutcome; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.RequestDetails; +import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; import javax.annotation.Nullable; @@ -60,6 +61,12 @@ public interface IFhirSystemDao extends IDao { */ MT metaGetOperation(RequestDetails theRequestDetails); + /** + * Implementations may implement this method to implement the $process-message + * operation + */ + IBaseBundle processMessage(RequestDetails theRequestDetails, IBaseBundle theMessage); + T transaction(RequestDetails theRequestDetails, T theResources); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoMessageHeaderDstu3.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoMessageHeaderDstu3.java index 9c60a9bb8d9..0836f245146 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoMessageHeaderDstu3.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoMessageHeaderDstu3.java @@ -20,17 +20,9 @@ package ca.uhn.fhir.jpa.dao.dstu3; * #L% */ -import ca.uhn.fhir.jpa.dao.FhirResourceDaoMessageHeaderDstu2; import ca.uhn.fhir.jpa.dao.IFhirResourceDaoMessageHeader; -import ca.uhn.fhir.rest.api.server.RequestDetails; import org.hl7.fhir.dstu3.model.MessageHeader; -import org.hl7.fhir.instance.model.api.IBaseBundle; public class FhirResourceDaoMessageHeaderDstu3 extends FhirResourceDaoDstu3 implements IFhirResourceDaoMessageHeader { - - @Override - public IBaseBundle messageHeaderProcessMessage(RequestDetails theRequestDetails, IBaseBundle theMessage) { - return FhirResourceDaoMessageHeaderDstu2.throwProcessMessageNotImplemented(); - } - + // nothing right now } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3.java index 6c39955216c..28232c93cd5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3.java @@ -21,6 +21,7 @@ package ca.uhn.fhir.jpa.dao.dstu3; */ import ca.uhn.fhir.jpa.dao.BaseHapiFhirSystemDao; +import ca.uhn.fhir.jpa.dao.FhirResourceDaoMessageHeaderDstu2; import ca.uhn.fhir.jpa.dao.TransactionProcessor; import ca.uhn.fhir.jpa.model.entity.TagDefinition; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; @@ -29,6 +30,7 @@ import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetai import org.hl7.fhir.dstu3.model.Bundle; import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent; import org.hl7.fhir.dstu3.model.Meta; +import org.hl7.fhir.instance.model.api.IBaseBundle; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -79,6 +81,11 @@ public class FhirSystemDaoDstu3 extends BaseHapiFhirSystemDao { return retVal; } + @Override + public IBaseBundle processMessage(RequestDetails theRequestDetails, IBaseBundle theMessage) { + return FhirResourceDaoMessageHeaderDstu2.throwProcessMessageNotImplemented(); + } + @Transactional(propagation = Propagation.NEVER) @Override public Bundle transaction(RequestDetails theRequestDetails, Bundle theRequest) { @@ -86,4 +93,5 @@ public class FhirSystemDaoDstu3 extends BaseHapiFhirSystemDao { } + } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoMessageHeaderR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoMessageHeaderR4.java index 5ea9cbd346f..78711636936 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoMessageHeaderR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoMessageHeaderR4.java @@ -20,17 +20,9 @@ package ca.uhn.fhir.jpa.dao.r4; * #L% */ -import ca.uhn.fhir.jpa.dao.FhirResourceDaoMessageHeaderDstu2; import ca.uhn.fhir.jpa.dao.IFhirResourceDaoMessageHeader; -import ca.uhn.fhir.rest.api.server.RequestDetails; -import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.r4.model.MessageHeader; public class FhirResourceDaoMessageHeaderR4 extends FhirResourceDaoR4 implements IFhirResourceDaoMessageHeader { - - @Override - public IBaseBundle messageHeaderProcessMessage(RequestDetails theRequestDetails, IBaseBundle theMessage) { - return FhirResourceDaoMessageHeaderDstu2.throwProcessMessageNotImplemented(); - } - + // nothing right now } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4.java index 52fdd464868..d144cb0a2fb 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirSystemDaoR4.java @@ -21,11 +21,13 @@ package ca.uhn.fhir.jpa.dao.r4; */ import ca.uhn.fhir.jpa.dao.BaseHapiFhirSystemDao; +import ca.uhn.fhir.jpa.dao.FhirResourceDaoMessageHeaderDstu2; import ca.uhn.fhir.jpa.dao.TransactionProcessor; import ca.uhn.fhir.jpa.model.entity.TagDefinition; import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails; +import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Meta; @@ -64,6 +66,11 @@ public class FhirSystemDaoR4 extends BaseHapiFhirSystemDao { return toMeta(tagDefinitions); } + @Override + public IBaseBundle processMessage(RequestDetails theRequestDetails, IBaseBundle theMessage) { + return FhirResourceDaoMessageHeaderDstu2.throwProcessMessageNotImplemented(); + } + protected Meta toMeta(Collection tagDefinitions) { Meta retVal = new Meta(); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProviderMessageHeaderDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProviderMessageHeaderDstu2.java index b6b88afa538..ca127ad36c0 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProviderMessageHeaderDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProviderMessageHeaderDstu2.java @@ -1,16 +1,6 @@ package ca.uhn.fhir.jpa.provider; -import ca.uhn.fhir.jpa.dao.IFhirResourceDaoMessageHeader; -import ca.uhn.fhir.jpa.util.JpaConstants; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.dstu2.resource.Bundle; import ca.uhn.fhir.model.dstu2.resource.MessageHeader; -import ca.uhn.fhir.rest.annotation.Operation; -import ca.uhn.fhir.rest.annotation.OperationParam; -import ca.uhn.fhir.rest.api.server.RequestDetails; -import org.hl7.fhir.instance.model.api.IBaseBundle; - -import javax.servlet.http.HttpServletRequest; /* * #%L @@ -33,29 +23,5 @@ import javax.servlet.http.HttpServletRequest; */ public class BaseJpaResourceProviderMessageHeaderDstu2 extends JpaResourceProviderDstu2 { - - - /** - * /MessageHeader/$process-message - */ - @Operation(name = JpaConstants.OPERATION_PROCESS_MESSAGE, idempotent = false) - public IBaseBundle processMessage( - HttpServletRequest theServletRequest, - RequestDetails theRequestDetails, - - @OperationParam(name = "content", min = 1, max = 1) - @Description(formalDefinition = "The message to process (or, if using asynchronous messaging, it may be a response message to accept)") - Bundle theMessageToProcess - ) { - - startRequest(theServletRequest); - try { - return ((IFhirResourceDaoMessageHeader) getDao()).messageHeaderProcessMessage(theRequestDetails, theMessageToProcess); - } finally { - endRequest(theServletRequest); - } - - } - - + // nothing now } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaSystemProviderDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaSystemProviderDstu2.java index d641654aa72..dbe2c3aac62 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaSystemProviderDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaSystemProviderDstu2.java @@ -18,11 +18,13 @@ import ca.uhn.fhir.rest.annotation.*; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.IntegerType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import javax.servlet.http.HttpServletRequest; import java.util.Collections; import java.util.List; import java.util.Map; @@ -248,6 +250,28 @@ public class JpaSystemProviderDstu2 extends BaseJpaSystemProviderDstu2Plus { - - - /** - * /MessageHeader/$process-message - */ - @Operation(name = JpaConstants.OPERATION_PROCESS_MESSAGE, idempotent = false) - public IBaseBundle processMessage( - HttpServletRequest theServletRequest, - RequestDetails theRequestDetails, - - @OperationParam(name = "content", min = 1, max = 1) - @Description(formalDefinition = "The message to process (or, if using asynchronous messaging, it may be a response message to accept)") - Bundle theMessageToProcess - ) { - - startRequest(theServletRequest); - try { - return ((IFhirResourceDaoMessageHeader) getDao()).messageHeaderProcessMessage(theRequestDetails, theMessageToProcess); - } finally { - endRequest(theServletRequest); - } - - } - - + // nothing now } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/dstu3/JpaSystemProviderDstu3.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/dstu3/JpaSystemProviderDstu3.java index 38401daabb1..92d54e272a5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/dstu3/JpaSystemProviderDstu3.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/dstu3/JpaSystemProviderDstu3.java @@ -15,10 +15,12 @@ import org.hl7.fhir.convertors.VersionConvertor_30_40; import org.hl7.fhir.dstu3.model.*; import org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IIdType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import javax.servlet.http.HttpServletRequest; import java.util.Collections; import java.util.List; import java.util.Map; @@ -250,6 +252,28 @@ public class JpaSystemProviderDstu3 extends BaseJpaSystemProviderDstu2Plus { - - - /** - * /MessageHeader/$process-message - */ - @Operation(name = JpaConstants.OPERATION_PROCESS_MESSAGE, idempotent = false) - public IBaseBundle processMessage( - HttpServletRequest theServletRequest, - RequestDetails theRequestDetails, - - @OperationParam(name = "content", min = 1, max = 1) - @Description(formalDefinition = "The message to process (or, if using asynchronous messaging, it may be a response message to accept)") - Bundle theMessageToProcess - ) { - - startRequest(theServletRequest); - try { - return ((IFhirResourceDaoMessageHeader) getDao()).messageHeaderProcessMessage(theRequestDetails, theMessageToProcess); - } finally { - endRequest(theServletRequest); - } - - } - - + // nothing right now } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/JpaSystemProviderR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/JpaSystemProviderR4.java index a4571afd64e..448c013d617 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/JpaSystemProviderR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/r4/JpaSystemProviderR4.java @@ -10,12 +10,14 @@ import ca.uhn.fhir.rest.annotation.*; import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; +import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.*; import org.hl7.fhir.r4.model.Parameters.ParametersParameterComponent; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import javax.servlet.http.HttpServletRequest; import java.util.Collections; import java.util.List; import java.util.Map; @@ -229,6 +231,28 @@ public class JpaSystemProviderR4 extends BaseJpaSystemProviderDstu2Plus buildRuleList(RequestDetails theRequestDetails) { return new RuleBuilder() - .allow("RULE 1").operation().named("process-message").onType(MessageHeader.class).andRequireExplicitResponseAuthorization().andThen() + .allow("RULE 1").operation().named("process-message").onServer().andRequireExplicitResponseAuthorization().andThen() .build(); } }); @@ -1743,7 +1743,7 @@ public class AuthorizationInterceptorDstu3Test { // With body ourHitMethod = false; - httpPost = new HttpPost("http://localhost:" + ourPort + "/MessageHeader/$process-message"); + httpPost = new HttpPost("http://localhost:" + ourPort + "/$process-message"); httpPost.setEntity(new StringEntity(inputString, ContentType.create(Constants.CT_FHIR_JSON_NEW, Charsets.UTF_8))); status = ourClient.execute(httpPost); response = extractResponseAndClose(status); @@ -1753,7 +1753,7 @@ public class AuthorizationInterceptorDstu3Test { // With body ourHitMethod = false; - HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/MessageHeader/$process-message"); + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/$process-message"); status = ourClient.execute(httpGet); response = extractResponseAndClose(status); ourLog.info(response); @@ -3348,21 +3348,6 @@ public class AuthorizationInterceptorDstu3Test { } - public static class DummyMessageHeaderResourceProvider implements IResourceProvider { - - - @Override - public Class getResourceType() { - return MessageHeader.class; - } - - @Operation(name = "process-message", idempotent = true) - public Parameters operation0(@OperationParam(name = "content") Bundle theInput) { - ourHitMethod = true; - return (Parameters) new Parameters().setId("1"); - } - - } public static class DummyDiagnosticReportResourceProvider implements IResourceProvider { @@ -3633,6 +3618,13 @@ public class AuthorizationInterceptorDstu3Test { return (Parameters) new Parameters().setId("1"); } + @Operation(name = "process-message", idempotent = true) + public Parameters processMessage(@OperationParam(name = "content") Bundle theInput) { + ourHitMethod = true; + return (Parameters) new Parameters().setId("1"); + } + + @Transaction() public Bundle search(IRequestOperationCallback theRequestOperationCallback, @TransactionParam Bundle theInput) { ourHitMethod = true; @@ -3664,13 +3656,12 @@ public class AuthorizationInterceptorDstu3Test { DummyEncounterResourceProvider encProv = new DummyEncounterResourceProvider(); DummyCarePlanResourceProvider cpProv = new DummyCarePlanResourceProvider(); DummyDiagnosticReportResourceProvider drProv = new DummyDiagnosticReportResourceProvider(); - DummyMessageHeaderResourceProvider mshProv = new DummyMessageHeaderResourceProvider(); PlainProvider plainProvider = new PlainProvider(); ServletHandler proxyHandler = new ServletHandler(); ourServlet = new RestfulServer(ourCtx); ourServlet.setFhirContext(ourCtx); - ourServlet.setResourceProviders(patProvider, obsProv, encProv, cpProv, orgProv, drProv, mshProv); + ourServlet.setResourceProviders(patProvider, obsProv, encProv, cpProv, orgProv, drProv); ourServlet.setPlainProviders(plainProvider); ourServlet.setPagingProvider(new FifoMemoryPagingProvider(100)); ourServlet.setDefaultResponseEncoding(EncodingEnum.JSON);