Cleanup of subscription processing
This commit is contained in:
parent
6586fc438d
commit
c98a1e0c62
|
@ -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.
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue