Package com.jalios.jcms.mail.listener
Class IncomingMailListener
- java.lang.Object
-
- com.jalios.jcms.mail.AbstractMailListener
-
- com.jalios.jcms.mail.listener.IncomingMailListener
-
- All Implemented Interfaces:
MailListener
,JPropertiesListener
,java.lang.Comparable
public class IncomingMailListener extends AbstractMailListener implements JPropertiesListener
- Since:
- jcms-6.1.0
- Version:
- $Revision: 119286 $
- Author:
- Jean-Philippe Encausse, Sylvain Devaux
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IncomingMailListener.IncomingMailCriteria
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Integer
CHECK_IS_AUTHKEY
static java.lang.Integer
CHECK_IS_MEMBER
static java.lang.Integer
CHECK_IS_MEMBER_SINGLE
static java.lang.Integer
CHECK_IS_THREAD
static java.lang.Integer
NO_CHECK
static java.lang.String
REVISION
-
Fields inherited from class com.jalios.jcms.mail.AbstractMailListener
order
-
-
Constructor Summary
Constructors Constructor Description IncomingMailListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMailPattern(java.lang.String pattern, IncomingMailListener.IncomingMailCriteria criteria)
Add the given pattern/check toIncomingMailListener
.boolean
fetchMessage(MailMessage mail, boolean stored, java.util.Map<java.lang.String,java.lang.Object> context)
Invoked after a mail was fetch.java.util.Map<java.lang.String,java.lang.String>
listAllPatterns()
Returns a Map of String pattern/check that can be used to display IncomingMailListener statusvoid
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.void
removeMailPattern(java.lang.String pattern)
Remove pattern previously addedprotected boolean
validateContext()
-
Methods inherited from class com.jalios.jcms.mail.AbstractMailListener
compareTo, equals, getOrder, setOrder
-
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
NO_CHECK
public static final java.lang.Integer NO_CHECK
-
CHECK_IS_MEMBER
public static final java.lang.Integer CHECK_IS_MEMBER
-
CHECK_IS_MEMBER_SINGLE
public static final java.lang.Integer CHECK_IS_MEMBER_SINGLE
-
CHECK_IS_AUTHKEY
public static final java.lang.Integer CHECK_IS_AUTHKEY
-
CHECK_IS_THREAD
public static final java.lang.Integer CHECK_IS_THREAD
-
-
Method Detail
-
addMailPattern
public void addMailPattern(java.lang.String pattern, IncomingMailListener.IncomingMailCriteria criteria)
Add the given pattern/check toIncomingMailListener
. Emails that match a pattern will be stored in database.- Parameters:
pattern
- String Regexp (eg .+@jcms.company.com)criteria
- structureIncomingMailListener.IncomingMailCriteria
-
removeMailPattern
public void removeMailPattern(java.lang.String pattern)
Remove pattern previously added- Parameters:
pattern
- String Regexp (eg .+@jcms.company.com)
-
listAllPatterns
public java.util.Map<java.lang.String,java.lang.String> listAllPatterns()
Returns a Map of String pattern/check that can be used to display IncomingMailListener status- Returns:
- Map of pattern description
-
propertiesChange
public void propertiesChange(JProperties properties)
Description copied from interface:JPropertiesListener
Invoked after properties have been modified in JCMS and save on disk.You cannot alter the value received in parameters.
Note that properties parameter may be null, a limited set of site properties, or all site properties.
To check that a property has been modified, reload the "current" property instead using
channel.getProperties
orchannel.getProperty
.- Specified by:
propertiesChange
in interfaceJPropertiesListener
- Parameters:
properties
- the properties which have been submitted to change
-
fetchMessage
public boolean fetchMessage(MailMessage mail, boolean stored, java.util.Map<java.lang.String,java.lang.Object> context)
Description copied from interface:MailListener
Invoked after a mail was fetch.- Specified by:
fetchMessage
in interfaceMailListener
- Overrides:
fetchMessage
in classAbstractMailListener
- Parameters:
mail
- the javax.mail.Message fetchedstored
- boolean to store MailMessage in JCMScontext
- a context used to store information- Returns:
- boolean stored
- See Also:
MailListener.fetchMessage(MailMessage, boolean, Map)
-
validateContext
protected boolean validateContext()
- Returns:
- true if context (channel,...) is in a valid state for fetching Message.
- Since:
- jcms-9.0.0
-
-