org.xwiki.ircbot.internal
Class XARImportEventListener
java.lang.Object
org.xwiki.ircbot.internal.XARImportEventListener
- All Implemented Interfaces:
- EventListener
@Component
@Named(value="ircxarimport")
@Singleton
public class XARImportEventListener
- extends Object
- implements EventListener
Send notifications to an IRC channel when a XAR is imported in the wiki.
- Since:
- 4.2M3
Field Summary |
static String |
XAR_IMPORT_COUNTER_KEY
Key under which we register both the fact that a XAR import has started and in which we also store the
number of documents modified. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XAR_IMPORT_COUNTER_KEY
public static final String XAR_IMPORT_COUNTER_KEY
- Key under which we register both the fact that a XAR import has started and in which we also store the
number of documents modified.
- See Also:
- Constant Field Values
XARImportEventListener
public XARImportEventListener()
getEvents
public List<Event> getEvents()
- Specified by:
getEvents
in interface EventListener
- Returns:
- the list of events this listener is configured to receive. This listener will be automatically
registered with this list of events against the
ObservationManager
. When an event occurs,
for each matching event in this list, the EventListener.onEvent(Event, Object, Object)
method will be
called.
getName
public String getName()
- Specified by:
getName
in interface EventListener
- Returns:
- the listener's name. It's a free form text identifying this listener instance in a unique manner.
This name is used for some operations in
ObservationManager
.
onEvent
public void onEvent(Event event,
Object source,
Object data)
- Description copied from interface:
EventListener
- The
ObservationManager
calls this method when an event matches one of the events
for which this listener is registered (see EventListener.getEvents()
.
- Specified by:
onEvent
in interface EventListener
- Parameters:
event
- the event triggered. Can be used to differentiate different events if your Object supports several
events for example.source
- the event source i.e. the object for which the event was triggered. For example this would be the
document Object if the event is a document update event.data
- some additional and optional data passed that can be acted on.