From 5c0b3ea90538191a7ae9614af28b85e1688e82d6 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 25 Jan 2021 12:20:38 -0500 Subject: [PATCH] Add mutator for payload --- .../email/SubscriptionDeliveringEmailSubscriber.java | 2 +- .../rest/server/messaging/ResourceOperationMessage.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/SubscriptionDeliveringEmailSubscriber.java b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/SubscriptionDeliveringEmailSubscriber.java index 383b00a747b..80750c11ecc 100644 --- a/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/SubscriptionDeliveringEmailSubscriber.java +++ b/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/match/deliver/email/SubscriptionDeliveringEmailSubscriber.java @@ -55,7 +55,7 @@ public class SubscriptionDeliveringEmailSubscriber extends BaseSubscriptionDeliv @Override public void handleMessage(ResourceDeliveryMessage theMessage) throws Exception { CanonicalSubscription subscription = theMessage.getSubscription(); - + // The Subscription.endpoint is treated as the email "to" String endpointUrl = subscription.getEndpointUrl(); List destinationAddresses = new ArrayList<>(); diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/ResourceOperationMessage.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/ResourceOperationMessage.java index 1540e9f7180..9b5252662f9 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/ResourceOperationMessage.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/messaging/ResourceOperationMessage.java @@ -37,4 +37,12 @@ public class ResourceOperationMessage extends BaseResourceModifiedMessage { public ResourceOperationMessage(FhirContext theFhirContext, IBaseResource theNewResource, OperationTypeEnum theOperationType, RequestDetails theRequest) { super(theFhirContext, theNewResource, theOperationType, theRequest); } + + /** + * If you are using a non-fhir-resource payload, you may set the payload directly here instead of using the constructor. + * @param thePayload the payload of the message. + */ + public void setPayload(String thePayload) { + this.myPayload = thePayload; + } }