Interface EventProcessor
- a method of creating, updating, and deleting subscriptions.
- a method of broadcasting events when
Metacards are created, updated, or deleted.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.This constant is implementation specific and will be removed from APIstatic final StringDeprecated.This constant is implementation specific and will be removed from APIstatic final StringDeprecated.This constant is implementation specific and will be removed from APIstatic final StringDeprecated.This constant is implementation specific and will be removed from APIstatic final StringDeprecated.This constant is implementation specific and will be removed from APIstatic final StringDeprecated.This constant is implementation specific and will be removed from API -
Method Summary
Modifier and TypeMethodDescriptioncreateSubscription(Subscription subscription) Create aSubscriptionwith an automatically-generated id.voidcreateSubscription(Subscription subscription, String subscriptionId) Register aSubscriptionwith thisCatalogFramework.voiddeleteSubscription(String subscriptionId) Deletes the subscription associated with the given id.voidnotifyCreated(Metacard newMetacard) voidnotifyDeleted(Metacard oldMetacard) voidnotifyUpdated(Metacard newMetacard, Metacard oldMetacard) voidupdateSubscription(Subscription subscription, String subcriptionId) Updates the subscription associated with the given id.
-
Field Details
-
EVENT_METACARD
Deprecated.This constant is implementation specific and will be removed from API- See Also:
-
EVENT_OLD_METACARD
Deprecated.This constant is implementation specific and will be removed from API- See Also:
-
EVENT_TIME
Deprecated.This constant is implementation specific and will be removed from API- See Also:
-
EVENTS_TOPIC_CREATED
Deprecated.This constant is implementation specific and will be removed from API- See Also:
-
EVENTS_TOPIC_UPDATED
Deprecated.This constant is implementation specific and will be removed from API- See Also:
-
EVENTS_TOPIC_DELETED
Deprecated.This constant is implementation specific and will be removed from API- See Also:
-
-
Method Details
-
createSubscription
Create aSubscriptionwith an automatically-generated id.- Parameters:
subscription- theSubscriptionto register- Returns:
Stringan id for the registeredSubscriptionthat can be used later by calling#unsubscribe(String)- Throws:
InvalidSubscriptionException- if thisEventProcessorcan not support theFilterof the providedSubscription.- See Also:
-
createSubscription
void createSubscription(Subscription subscription, String subscriptionId) throws InvalidSubscriptionException, SubscriptionExistsException Register aSubscriptionwith thisCatalogFramework.Note:
Subscriptions are transient, not durable, i.e., only maintained in memory and will be lost if DDF is shutdown.
Durability must be implemented by the client bundle (typically an endpoint - refer toDurableSubscriptionfor an example).Note: A
Subscriptioncan also be registered using the whiteboard model:
To register aSubscriptionvia the whiteboard model, simply register any implementation ofSubscriptionwith OSGi registry under the interfaceSubscription. To unregister theSubscription, simply unregister the service that was originally registered.Subscriptions registered in this manner do not get a subscription id and cannot be unsubscribed via theEventProcessorImplementations of this method must call thePreSubscriptionPlugin.process(Subscription)method for each- Parameters:
subscription- theSubscriptionto registersubscriptionId- the desired id- Throws:
InvalidSubscriptionException- if thisEventProcessorcan not support theFilterof the providedSubscription.SubscriptionExistsException- if a subscription with this ID already exists
-
updateSubscription
void updateSubscription(Subscription subscription, String subcriptionId) throws SubscriptionNotFoundException Updates the subscription associated with the given id.- Parameters:
subscription- the subscription to updatesubcriptionId- the subscription id to identify the subscription- Throws:
SubscriptionNotFoundException- if the subscription was not found
-
deleteSubscription
Deletes the subscription associated with the given id.- Parameters:
user- deleting the subscriptionsubscriptionId- the subscription id to identify the subscription to delete- Throws:
SubscriptionNotFoundException- if the subscription was not found
-
notifyCreated
Notify thisEventProcessorthat aMetacard(or equivalent) has been created in aRemoteSource.Implementations of this method must:
- Call the
PreDeliveryPlugin.processCreate(Metacard)method for all of the registeredPreDeliveryPlugins - Call the
DeliveryMethod.created(Metacard)method of theDeliveryMethodof matchingSubscriptions with the newMetacardcreated.
- Parameters:
newMetacard- the newly createdMetacard- See Also:
- Call the
-
notifyUpdated
Notify thisEventProcessorthat aMetacard(or equivalent) has been updated in aRemoteSource.Implementations of this method must:
-
Call
- Call all registered implementations of
DeliveryMethodwith the updatedMetacard.
PreDeliveryPlugin.processUpdateHit(ddf.catalog.operation.Update)method of all registeredPreDeliveryPlugins when aMetacardhas been updated and the new version matches aSubscriptionCallPreDeliveryPlugin.processUpdateMiss(ddf.catalog.operation.Update)method of all registeredPreDeliveryPlugins when aMetacardhas been updated and the new version matches aSubscriptionbut the old version does not - Call all registered implementations of
-
notifyDeleted
Notify thisEventProcessorthat aMetacard(or equivalent) has been deleted in aRemoteSource.Implementations of this method must:
- If possible (that is, the
Metacardis fully populated) call all active matchingSubscriptions associatedDeliveryMethod.deleted(Metacard)with theMetacardthat was deleted.- If impossible (this is, the
Metacardonly hasMetacard.getId(), call all activeSubscriptions.- Parameters:
oldMetacard- the deletedMetacard- See Also:
- If possible (that is, the
-