@ConfigurationDescription(properties={@Property(name="IsCritical",type=BOOLEAN,defaultValue="true",description="Whether the event handler is critical and problems handling the event should abort all handling of the current event."),,,,,,,,,,,,,,,,,}) public class MailFlagHandler extends AbstractEventHandler
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
CHANGE_FLAG_ANSWERED
Whether to change the answered flag of the messages from mail events.
|
protected boolean |
CHANGE_FLAG_DELETED
Whether to change the deleted flag of the messages from mail events.
|
protected boolean |
CHANGE_FLAG_DRAFT
Whether to change the draft flag of the messages from mail events.
|
protected boolean |
CHANGE_FLAG_FLAGGED
Whether to change the flagged flag of the messages from mail events.
|
protected boolean |
CHANGE_FLAG_RECENT
Whether to change the recent flag of the messages from mail events.
|
protected boolean |
CHANGE_FLAG_SEEN
Whether to change the seen flag of the messages from mail events.
|
protected boolean |
CHANGE_FLAG_USER
Whether to change the user flag of the messages from mail events.
|
static java.lang.String |
CONF_CHANGE_FLAG_ANSWERED
Configuration key for whether to change the answered flag of the messages
from mail events.
|
static java.lang.String |
CONF_CHANGE_FLAG_DELETED
Configuration key for whether to change the deleted flag of the messages
from mail events.
|
static java.lang.String |
CONF_CHANGE_FLAG_DRAFT
Configuration key for whether to change the draft flag of the messages from
mail events.
|
static java.lang.String |
CONF_CHANGE_FLAG_FLAGGED
Configuration key for whether to change the flagged flag of the messages
from mail events.
|
static java.lang.String |
CONF_CHANGE_FLAG_RECENT
Configuration key for whether to change the recent flag of the messages
from mail events.
|
static java.lang.String |
CONF_CHANGE_FLAG_SEEN
Configuration key for whether to change the seen flag of the messages from
mail events.
|
static java.lang.String |
CONF_CHANGE_FLAG_USER
Configuration key for whether to change the user flag of the messages from
mail events.
|
static java.lang.String |
CONF_EXPUNGE
Configuration key for whether the folder of messages from mail events
should be expunged.
|
static java.lang.String |
CONF_HANDLE_CONSUMED
Configuration key for whether this handler should also handle (set flags,
move, expunge) messages of which the corresponding mail event has been
consumed.
|
protected static java.lang.String |
CONF_IS_CRITICAL
Configuration key: Whether the event handler is critical and problems
handling the event should abort all handling of the current event.
|
static java.lang.String |
CONF_SET_FLAG_ANSWERED
Configuration key for how to set the answered flag of messages from mail
events.
|
static java.lang.String |
CONF_SET_FLAG_DELETED
Configuration key for how to set the deleted flag of messages from mail
events.
|
static java.lang.String |
CONF_SET_FLAG_DRAFT
Configuration key for how to set the draft flag of messages from mail
events.
|
static java.lang.String |
CONF_SET_FLAG_FLAGGED
Configuration key for how to set the flagged flag of messages from mail
events.
|
static java.lang.String |
CONF_SET_FLAG_RECENT
Configuration key for how to set the recent flag of messages from mail
events.
|
static java.lang.String |
CONF_SET_FLAG_SEEN
Configuration key for how to set the seen flag of messages from mail
events.
|
static java.lang.String |
CONF_SET_FLAG_USER
Configuration key for how to set the user flag of messages from mail
events.
|
static java.lang.String |
CONF_TARGET_FOLDER
Configuration key for the name of the target folder in case the messages of
mail events should be moved.
|
protected boolean |
EXPUNGE
Whether the folder of messages from mail events should be expunged.
|
protected boolean |
HANDLE_CONSUMED
Whether this handler should also handle (set flags, move, expunge) messages
of which the corresponding mail event has been consumed.
|
protected boolean |
SET_FLAG_ANSWERED
How to set the answered flag of messages from mail events.
|
protected boolean |
SET_FLAG_DELETED
How to set the deleted flag of messages from mail events.
|
protected boolean |
SET_FLAG_DRAFT
How to set the draft flag of messages from mail events.
|
protected boolean |
SET_FLAG_FLAGGED
How to set the flagged flag of messages from mail events.
|
protected boolean |
SET_FLAG_RECENT
How to set the recent flag of messages from mail events.
|
protected boolean |
SET_FLAG_SEEN
How to set the seen flag of messages from mail events.
|
protected boolean |
SET_FLAG_USER
How to set the user flag of messages from mail events.
|
protected java.lang.String |
TARGET_FOLDER
The name of the target folder in case the messages of mail events should be
moved.
|
consuming, critical, exclusive, id, interruptible, logger| Constructor and Description |
|---|
MailFlagHandler(Configuration conf,
EventManager eventManager,
Registry registry)
Default constructor for a plugin of an
EventManager
called by a service registry. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
handleEvent(Event eve,
boolean consumed)
This method actually processes an event.
|
getID, isConsuming, isCritical, isExclusive, isInterruptibleprotected static final java.lang.String CONF_IS_CRITICAL
public static final java.lang.String CONF_HANDLE_CONSUMED
protected final boolean HANDLE_CONSUMED
public static final java.lang.String CONF_CHANGE_FLAG_ANSWERED
public static final java.lang.String CONF_SET_FLAG_ANSWERED
protected final boolean CHANGE_FLAG_ANSWERED
protected final boolean SET_FLAG_ANSWERED
public static final java.lang.String CONF_CHANGE_FLAG_DELETED
public static final java.lang.String CONF_SET_FLAG_DELETED
protected final boolean CHANGE_FLAG_DELETED
protected final boolean SET_FLAG_DELETED
public static final java.lang.String CONF_CHANGE_FLAG_DRAFT
public static final java.lang.String CONF_SET_FLAG_DRAFT
protected final boolean CHANGE_FLAG_DRAFT
protected final boolean SET_FLAG_DRAFT
public static final java.lang.String CONF_CHANGE_FLAG_FLAGGED
public static final java.lang.String CONF_SET_FLAG_FLAGGED
protected final boolean CHANGE_FLAG_FLAGGED
protected final boolean SET_FLAG_FLAGGED
public static final java.lang.String CONF_CHANGE_FLAG_RECENT
public static final java.lang.String CONF_SET_FLAG_RECENT
protected final boolean CHANGE_FLAG_RECENT
protected final boolean SET_FLAG_RECENT
public static final java.lang.String CONF_CHANGE_FLAG_SEEN
public static final java.lang.String CONF_SET_FLAG_SEEN
protected final boolean CHANGE_FLAG_SEEN
protected final boolean SET_FLAG_SEEN
public static final java.lang.String CONF_CHANGE_FLAG_USER
public static final java.lang.String CONF_SET_FLAG_USER
protected final boolean CHANGE_FLAG_USER
protected final boolean SET_FLAG_USER
public static final java.lang.String CONF_TARGET_FOLDER
protected final java.lang.String TARGET_FOLDER
public static final java.lang.String CONF_EXPUNGE
protected final boolean EXPUNGE
public MailFlagHandler(Configuration conf, EventManager eventManager, Registry registry)
EventManager
called by a service registry. This constructor just reads the configuration
values.conf - The configuration as provided from the registry.eventManager - The event manager this event handler is a plugin of.registry - The registry of this plugin.public boolean handleEvent(Event eve, boolean consumed) throws EventHandlingException
EventHandlereve - The event that occurred and for which this event handler is
registered.consumed - Whether the event has been consumed by a previous event
handler.true).EventHandlingException - If there have been problems handling the
event, an EventHandlingException may be thrown. If
this is critical, the event handling for the current event will
stop. If it is non-critical, other event handlers will also get
the event for handling it.