use of ddf.catalog.event.SubscriptionNotFoundException in project ddf by codice.
the class ExceptionsTest method testSubscriptionNotFoundException.
@Test
public void testSubscriptionNotFoundException() {
SubscriptionNotFoundException snfe = new SubscriptionNotFoundException(msg);
assertEquals(snfe.getMessage(), msg);
snfe = new SubscriptionNotFoundException(testCause);
assertEquals(snfe.getCause(), testCause);
snfe = new SubscriptionNotFoundException(msg, testCause);
assertEquals(snfe.getMessage(), msg);
assertEquals(snfe.getCause(), testCause);
}
use of ddf.catalog.event.SubscriptionNotFoundException in project ddf by codice.
the class EventProcessorImpl method updateSubscription.
@Override
public void updateSubscription(Subscription subscription, String subscriptionId) throws SubscriptionNotFoundException {
String methodName = "updateSubscription";
LOGGER.debug("ENTERING: {}", methodName);
try {
deleteSubscription(subscriptionId);
createSubscription(subscription, subscriptionId);
LOGGER.debug("Updated {}", subscriptionId);
} catch (Exception e) {
LOGGER.info("Could not update subscription", e);
throw new SubscriptionNotFoundException(e);
}
LOGGER.debug("EXITING: {}", methodName);
}
use of ddf.catalog.event.SubscriptionNotFoundException in project ddf by codice.
the class EventProcessorImpl method deleteSubscription.
@Override
public void deleteSubscription(String subscriptionId) throws SubscriptionNotFoundException {
String methodName = "deleteSubscription";
LOGGER.debug("ENTERING: {}", methodName);
try {
LOGGER.debug("Removing subscription: {}", subscriptionId);
ServiceRegistration sr = (ServiceRegistration) existingSubscriptions.get(subscriptionId);
if (sr != null) {
sr.unregister();
LOGGER.debug("Removal complete");
existingSubscriptions.remove(subscriptionId);
} else {
LOGGER.debug("Unable to find existing subscription: {}. May already be deleted.", subscriptionId);
}
} catch (Exception e) {
LOGGER.debug("Could not delete subscription for {}", subscriptionId);
LOGGER.info("Exception deleting subscription", e);
}
LOGGER.debug("EXITING: " + methodName);
}
Aggregations