use of org.codice.ddf.catalog.subscriptionstore.internal.SubscriptionStoreException in project ddf by codice.
the class SubscriptionPersistor method insert.
/**
* Add the subscription metadata to the persistent store using its id for the document key.
* <p>
* Insertion operations with the same key overwrite the previous value, which means a duplicate
* being added is a no-op, minus the network overhead.
*
* @param metadata the subscription metadata to add to the persistent store.
* @throws SubscriptionStoreException if a problem occurs during insert.
*/
public void insert(SubscriptionMetadata metadata) {
LOGGER.debug("Adding [{}] to persistence store. ", metadata.getId());
PersistentItem persistentSubscription = metadataToPersistentItem(metadata);
try {
persistentStore.add(PersistentStore.EVENT_SUBSCRIPTIONS_TYPE, persistentSubscription);
} catch (PersistenceException e) {
throw new SubscriptionStoreException("Exception while persisting subscription: ", e);
}
}
Aggregations