Cleanup of subscription processing

This commit is contained in:
jamesagnew 2018-08-06 18:37:12 -04:00
parent 6586fc438d
commit c98a1e0c62
2 changed files with 11 additions and 6 deletions

View File

@ -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.

View File

@ -351,12 +351,16 @@ public abstract class BaseSubscriptionInterceptor<S extends IBaseResource> 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<S extends IBaseResource> 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());
}