public interface PurgeEventListener
extends java.util.EventListener
A registered listener will receive all purge events fired by the event sender.
For example, a listener on the PurgingService that only wants to know when purge complete should implement the purgEvent() method that looks something like:
public void purgeEvent (PurgeEvent pEvent) { if(pEvent.getState() == PurgeEvent.END_STATE_SUCCESS){ // recreate database indexes that may be defunct as a result of large number of // delete operations performed during purge. } }Or one could trigger a database and file system back before a purge starts like this *
public void purgeEvent (PurgeEvent pEvent) { if(pEvent.getState() == PurgeEvent.START_STATE){ // run native code to backup databases and file systems. if(backUpFailed) pEvent.interrupt("This listener's name", "Database backup failed."); } }Listeners can interrupt a purge upon receiving an event by calling interrupt() on the event. Note: that a purge may not be interruptible in certain states.
PurgeEvent
,
PurgeEventSender
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
Modifier and Type | Method and Description |
---|---|
void |
purgeEvent(PurgeEvent pEvent)
Method called during a purge process.
|
static final java.lang.String CLASS_VERSION
void purgeEvent(PurgeEvent pEvent)
PurgeEvent.getState()
method to get the
state of the purge process which can be one of the following:
PurgeEvent.START_STATE
Validations have passed and purge is about to start when
this event is sent. Assets cannot be edited and deployments cannot
be kicked off while this call is being processed.
PurgeEvent.PRE_COMMIT_STATE
Method called before a purge is about to commit its work.
If an interrupt is called on the given event, purge process will be
rolled back.
PurgeEvent.END_STATE_SUCCESS
A purge has committed successfully.
PurgeEvent.END_STATE_FAILURE
A purge has ended in failure.
Calling interrupt on event will cause an error.