diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionDeliverySubscriber.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionDeliverySubscriber.java index ac85562506a..461cb3a798b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionDeliverySubscriber.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionDeliverySubscriber.java @@ -9,9 +9,9 @@ package ca.uhn.fhir.jpa.subscription; * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionInterceptor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionInterceptor.java index 58a01a2b4ac..3ac6b74f99f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionInterceptor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/BaseSubscriptionInterceptor.java @@ -351,12 +351,16 @@ public abstract class BaseSubscriptionInterceptor exten protected abstract void registerDeliverySubscriber(); - public void registerSubscription(IIdType theId, S theSubscription) { + @SuppressWarnings("UnusedReturnValue") + public CanonicalSubscription registerSubscription(IIdType theId, S theSubscription) { Validate.notNull(theId); Validate.notBlank(theId.getIdPart()); Validate.notNull(theSubscription); - myIdToSubscription.put(theId.getIdPart(), canonicalize(theSubscription)); + CanonicalSubscription canonicalized = canonicalize(theSubscription); + myIdToSubscription.put(theId.getIdPart(), canonicalized); + + return canonicalized; } protected void registerSubscriptionCheckingSubscriber() { @@ -525,11 +529,12 @@ public abstract class BaseSubscriptionInterceptor exten protected abstract void unregisterDeliverySubscriber(); - public void unregisterSubscription(IIdType theId) { + @SuppressWarnings("UnusedReturnValue") + public CanonicalSubscription unregisterSubscription(IIdType theId) { Validate.notNull(theId); Validate.notBlank(theId.getIdPart()); - myIdToSubscription.remove(theId.getIdPart()); + return myIdToSubscription.remove(theId.getIdPart()); }