This commit is contained in:
Ken Stevens 2019-02-02 19:07:06 -05:00
parent 37670ac039
commit 84db66d2e3
1 changed files with 9 additions and 11 deletions

View File

@ -62,25 +62,23 @@ public class StandaloneSubscriptionMessageHandler implements MessageHandler {
}
public void updateSubscriptionRegistryAndPerformMatching(ResourceModifiedMessage theResourceModifiedMessage) {
if (isSubscription(theResourceModifiedMessage)) {
handleSubscriptionActivation(theResourceModifiedMessage);
}
mySubscriptionMatchingSubscriber.matchActiveSubscriptionsAndDeliver(theResourceModifiedMessage);
}
private void handleSubscriptionActivation(ResourceModifiedMessage theResourceModifiedMessage) {
switch (theResourceModifiedMessage.getOperationType()) {
case DELETE:
mySubscriptionRegistry.unregisterSubscription(theResourceModifiedMessage.getId(myFhirContext));
break;
if (isSubscription(theResourceModifiedMessage)) {
mySubscriptionRegistry.unregisterSubscription(theResourceModifiedMessage.getId(myFhirContext));
}
return;
case CREATE:
case UPDATE:
registerActiveSubscription(theResourceModifiedMessage.getNewPayload(myFhirContext));
if (isSubscription(theResourceModifiedMessage)) {
registerActiveSubscription(theResourceModifiedMessage.getNewPayload(myFhirContext));
}
break;
default:
break;
}
mySubscriptionMatchingSubscriber.matchActiveSubscriptionsAndDeliver(theResourceModifiedMessage);
}
private boolean isSubscription(ResourceModifiedMessage theResourceModifiedMessage) {