public interface PersistedHippoEventListener
HippoEvents
after they occurred in the repository, across a repository cluster.
Such a listener must be registered as listener on the PersistedHippoEventsService
through the
HippoServiceRegistry
, like for example:
HippoServiceRegistry.registerService(myPersistedHippoEventListener, PersistedHippoEventsService.class);
A PersistedHippoEventListener must provide a (cluster node instance unique) channel name which will be used to track which persisted events already have been delivered to the listener.
A listener will get a consistent and ordered delivery of all events within a specific getEventCategory()
(or all if unspecified) through that channel, but such events
will only be delivered once (within one cluster node) through that channel.
Therefore there should only be one listener (registered) per channel per cluster node.
If more than one listener is registered on one channel, only one will get the events delivered!
A listener also has to define through onlyNewEvents()
if it should receive persisted events even from before
the first time registration on its channel
(for as much is looked back in time,
depending on the service configuration), or only events after the first time channel registration will be delivered.
Modifier and Type | Method and Description |
---|---|
String |
getChannelName() |
String |
getEventCategory() |
void |
onHippoEvent(org.onehippo.cms7.event.HippoEvent event)
Persisted HippoEvents will be delivered through this method.
|
boolean |
onlyNewEvents() |
String getEventCategory()
null
to indicate all events.String getChannelName()
boolean onlyNewEvents()
getChannelName()
will
be delivered.void onHippoEvent(org.onehippo.cms7.event.HippoEvent event)
event
- the eventCopyright © 2007–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.