Class AbstractIncomingMailFetchCriteria
- java.lang.Object
-
- com.jalios.jcms.mail.listener.criteria.AbstractIncomingMailFetchCriteria
-
- All Implemented Interfaces:
FetchCriteria
- Direct Known Subclasses:
AuthkeyIncomingMailFetchCriteria
,MemberIncomingMailFetchCriteria
,NoCheckIncomingMailFetchCriteria
,SingleMemberIncomingMailFetchCriteria
,ThreadIncomingMailFetchCriteria
public abstract class AbstractIncomingMailFetchCriteria extends java.lang.Object implements FetchCriteria
Abstract class for Incoming Mail fetching criterias validation.Goal is to test the context of the fetching process, (eg: Mail's workspace, Mail's author) depending on which FetchCriteria is used.
Example of a fetching Criteria:
NoCheckIncomingMailFetchCriteria
.- Since:
- jcms-9.0.0
- Version:
- $Revision: 125583 $
- Author:
- Sylvain Devaux
-
-
Constructor Summary
Constructors Constructor Description AbstractIncomingMailFetchCriteria(IncomingMailFetching fetching)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Member
getAuthor()
Category[]
getAvailableCategories()
Get the default categories to set on the new MailMessage.IncomingMailFetching
getFetching()
Workspace
getWorkspace()
boolean
isMatchingCheck()
void
setFields()
Sets criteria's author and workspace fields on the mail being fetched.boolean
validate()
A default validation of a Mail fetching.boolean
validateAttachments()
protected boolean
validateAuthkey(Member author, java.lang.String recipient)
Utility method to validate a recipient address given an author.boolean
validateAuthor()
protected static boolean
validateAuthor(Member author, MailMessage mail)
Check that given Member is not disabled, and he can publish required Types.boolean
validateWorkspace()
protected static boolean
validateWorkspace(Workspace ws, MailMessage mail)
Check that given Workspace is not closed, not model, and allows required Types publication.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jalios.jcms.mail.listener.criteria.FetchCriteria
getId
-
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
channel
protected static final Channel channel
-
-
Constructor Detail
-
AbstractIncomingMailFetchCriteria
public AbstractIncomingMailFetchCriteria(IncomingMailFetching fetching)
-
-
Method Detail
-
validate
public boolean validate()
A default validation of a Mail fetching.- Specified by:
validate
in interfaceFetchCriteria
- Returns:
- true if the context validates the criteria, and the Mail should be fetched.
- Since:
- jcms-9.0.0
-
validateAuthkey
protected boolean validateAuthkey(Member author, java.lang.String recipient)
Utility method to validate a recipient address given an author.- Parameters:
author
- the authorrecipient
- the recipient to test if it contains author's authkey- Returns:
- true if recipient matches author's authkey
- Since:
- jcms-9.0.0
-
validateAuthor
public boolean validateAuthor()
- Specified by:
validateAuthor
in interfaceFetchCriteria
- Returns:
- true if author validates
validateAuthor(Member, MailMessage)
. - Since:
- jcms-9.0.0
-
validateWorkspace
public boolean validateWorkspace()
- Specified by:
validateWorkspace
in interfaceFetchCriteria
- Returns:
- true if workspace's state is compliant with Mail Message fetching.
- Since:
- jcms-9.0.0
-
validateAttachments
public boolean validateAttachments()
-
isMatchingCheck
public boolean isMatchingCheck()
- Specified by:
isMatchingCheck
in interfaceFetchCriteria
- Returns:
- true if current id equals the Criteria's check being processed.
- See Also:
FetchCriteria.isMatchingCheck()
-
validateWorkspace
protected static boolean validateWorkspace(Workspace ws, MailMessage mail)
Check that given Workspace is not closed, not model, and allows required Types publication.Static method for it to be possibly called manually.
- Parameters:
ws
- workspace to validatemail
- the mail to fetch.- Returns:
- true if author exist and is enabled
- Since:
- jcms-9.0.0
-
validateAuthor
protected static boolean validateAuthor(Member author, MailMessage mail)
Check that given Member is not disabled, and he can publish required Types.Static method for it to be possibly called manually.
- Parameters:
author
- author to validatemail
- the mail to fetch.- Returns:
- true if author exist and is enabled
- Since:
- jcms-9.0.0
-
getAuthor
public Member getAuthor()
- Specified by:
getAuthor
in interfaceFetchCriteria
- Returns:
- the Member to use as Mail's author.
- Since:
- jcms-9.0.0
-
getWorkspace
public Workspace getWorkspace()
- Specified by:
getWorkspace
in interfaceFetchCriteria
- Returns:
- the Workspace to use as Mail's workspace.
- Since:
- jcms-9.0.0
-
setFields
public void setFields()
Sets criteria's author and workspace fields on the mail being fetched.Sets the default categories if any
- Specified by:
setFields
in interfaceFetchCriteria
- Since:
- jcms-9.0.0
- See Also:
getWorkspace()
,getAvailableCategories()
-
getAvailableCategories
public Category[] getAvailableCategories()
Get the default categories to set on the new MailMessage.If a workspace is available, returns its wsTypeEntry's categories.
Else, return TypeEntry's categories.
- Returns:
- the default categories to set
-
getFetching
public IncomingMailFetching getFetching()
- Specified by:
getFetching
in interfaceFetchCriteria
- Returns:
- the Fetching process.
- Since:
- jcms-9.0.0
- See Also:
FetchCriteria.getFetching()
-
-