Package ddf.catalog.pubsub
Class EventProcessorImpl
java.lang.Object
ddf.catalog.pubsub.EventProcessorImpl
- All Implemented Interfaces:
ddf.catalog.event.EventProcessor,ddf.catalog.plugin.PostIngestPlugin,org.osgi.service.event.EventHandler
- Direct Known Subclasses:
FanoutEventProcessor
public class EventProcessorImpl
extends Object
implements ddf.catalog.event.EventProcessor, org.osgi.service.event.EventHandler, ddf.catalog.plugin.PostIngestPlugin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of metacard Date attributes that can be used for subscriptions. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.osgi.framework.BundleContextprotected ddf.catalog.CatalogFrameworkstatic final Stringstatic final doubleprotected org.osgi.service.event.EventAdminstatic final Stringprotected List<ddf.catalog.plugin.PreDeliveryPlugin> protected List<ddf.catalog.plugin.PreSubscriptionPlugin> Fields inherited from interface ddf.catalog.event.EventProcessor
EVENT_METACARD, EVENT_OLD_METACARD, EVENT_TIME, EVENTS_TOPIC_CREATED, EVENTS_TOPIC_DELETED, EVENTS_TOPIC_UPDATED -
Constructor Summary
ConstructorsConstructorDescriptionEventProcessorImpl(org.osgi.framework.BundleContext bundleContext, org.osgi.service.event.EventAdmin eventAdmin, List<ddf.catalog.plugin.PreSubscriptionPlugin> preSubscription, List<ddf.catalog.plugin.PreDeliveryPlugin> preDelivery, ddf.catalog.CatalogFramework catalog) -
Method Summary
Modifier and TypeMethodDescriptioncreateSubscription(ddf.catalog.event.Subscription subscription) voidcreateSubscription(ddf.catalog.event.Subscription subscription, String subscriptionId) voiddeleteSubscription(String subscriptionId) voiddestroy()voidhandleEvent(org.osgi.service.event.Event event) By default the Felix EventAdmin implementation has a timeout of 5000 ms.voidinit()voidnotifyCreated(ddf.catalog.data.Metacard newMetacard) voidnotifyDeleted(ddf.catalog.data.Metacard oldMetacard) voidnotifyUpdated(ddf.catalog.data.Metacard newMetacard, ddf.catalog.data.Metacard oldMetacard) protected voidPosts a Metacard to a given topicddf.catalog.operation.CreateResponseprocess(ddf.catalog.operation.CreateResponse createResponse) ddf.catalog.operation.DeleteResponseprocess(ddf.catalog.operation.DeleteResponse deleteResponse) ddf.catalog.operation.UpdateResponseprocess(ddf.catalog.operation.UpdateResponse updateResponse) static voidprocessEntry(ddf.catalog.data.Metacard metacard, String operation, org.osgi.service.event.EventAdmin eventAdmin) Processes an entry by adding properties from the metacard to the event.voidupdateSubscription(ddf.catalog.event.Subscription subscription, String subscriptionId)
-
Field Details
-
EQUATORIAL_RADIUS_IN_METERS
public static final double EQUATORIAL_RADIUS_IN_METERS- See Also:
-
ENTERING
- See Also:
-
EXITING
- See Also:
-
eventAdmin
protected org.osgi.service.event.EventAdmin eventAdmin -
bundleContext
protected org.osgi.framework.BundleContext bundleContext -
preSubscription
-
preDelivery
-
catalog
protected ddf.catalog.CatalogFramework catalog
-
-
Constructor Details
-
EventProcessorImpl
public EventProcessorImpl() -
EventProcessorImpl
-
-
Method Details
-
processEntry
public static void processEntry(ddf.catalog.data.Metacard metacard, String operation, org.osgi.service.event.EventAdmin eventAdmin) Processes an entry by adding properties from the metacard to the event. Then the eventAdmin is used to post the metacard properties as a single event.- Parameters:
metacard- - the metacard to processoperation- - The type of eventPubSubConstantseventAdmin- - OSGi EventAdmin service used post events
-
init
public void init() -
destroy
public void destroy() -
handleEvent
public void handleEvent(org.osgi.service.event.Event event) By default the Felix EventAdmin implementation has a timeout of 5000 ms. Your event handler has to return from the handle event method in this time frame. If it does not, it gets Blacklisted. Therefore, this method processes its events in a separate thread than the EventAdmin who called it.- Specified by:
handleEventin interfaceorg.osgi.service.event.EventHandler
-
createSubscription
public String createSubscription(ddf.catalog.event.Subscription subscription) throws ddf.catalog.event.InvalidSubscriptionException - Specified by:
createSubscriptionin interfaceddf.catalog.event.EventProcessor- Throws:
ddf.catalog.event.InvalidSubscriptionException
-
createSubscription
public void createSubscription(ddf.catalog.event.Subscription subscription, String subscriptionId) throws ddf.catalog.event.InvalidSubscriptionException, ddf.catalog.event.SubscriptionExistsException - Specified by:
createSubscriptionin interfaceddf.catalog.event.EventProcessor- Throws:
ddf.catalog.event.InvalidSubscriptionExceptionddf.catalog.event.SubscriptionExistsException
-
updateSubscription
public void updateSubscription(ddf.catalog.event.Subscription subscription, String subscriptionId) throws ddf.catalog.event.SubscriptionNotFoundException - Specified by:
updateSubscriptionin interfaceddf.catalog.event.EventProcessor- Throws:
ddf.catalog.event.SubscriptionNotFoundException
-
deleteSubscription
public void deleteSubscription(String subscriptionId) throws ddf.catalog.event.SubscriptionNotFoundException - Specified by:
deleteSubscriptionin interfaceddf.catalog.event.EventProcessor- Throws:
ddf.catalog.event.SubscriptionNotFoundException
-
notifyCreated
public void notifyCreated(ddf.catalog.data.Metacard newMetacard) - Specified by:
notifyCreatedin interfaceddf.catalog.event.EventProcessor
-
notifyUpdated
public void notifyUpdated(ddf.catalog.data.Metacard newMetacard, ddf.catalog.data.Metacard oldMetacard) - Specified by:
notifyUpdatedin interfaceddf.catalog.event.EventProcessor
-
notifyDeleted
public void notifyDeleted(ddf.catalog.data.Metacard oldMetacard) - Specified by:
notifyDeletedin interfaceddf.catalog.event.EventProcessor
-
postEvent
Posts a Metacard to a given topic- Parameters:
topic- - The topic to post the eventcard- - The Metacard that will be posted to the topic
-
process
public ddf.catalog.operation.CreateResponse process(ddf.catalog.operation.CreateResponse createResponse) throws ddf.catalog.plugin.PluginExecutionException - Specified by:
processin interfaceddf.catalog.plugin.PostIngestPlugin- Throws:
ddf.catalog.plugin.PluginExecutionException
-
process
public ddf.catalog.operation.UpdateResponse process(ddf.catalog.operation.UpdateResponse updateResponse) throws ddf.catalog.plugin.PluginExecutionException - Specified by:
processin interfaceddf.catalog.plugin.PostIngestPlugin- Throws:
ddf.catalog.plugin.PluginExecutionException
-
process
public ddf.catalog.operation.DeleteResponse process(ddf.catalog.operation.DeleteResponse deleteResponse) throws ddf.catalog.plugin.PluginExecutionException - Specified by:
processin interfaceddf.catalog.plugin.PostIngestPlugin- Throws:
ddf.catalog.plugin.PluginExecutionException
-