Package com.jalios.jcms.mail
Class MailAccount
- java.lang.Object
-
- com.jalios.jcms.mail.MailAccount
-
public class MailAccount extends java.lang.Object
- Author:
- Jean-Philippe Encausse
-
-
Field Summary
Fields Modifier and Type Field Description protected Member
author
protected boolean
enabled
protected boolean
expunge
protected java.util.Set<java.lang.String>
expungeSet
protected int
fetchCount
protected long
fetchDate
protected java.lang.String
label
protected java.lang.String
mbox
protected java.lang.String
name
protected JProperties
properties
protected AbstractMailProvider
provider
protected static java.lang.String
PROVIDER_NAME
protected java.lang.String
schedule
protected Workspace
ws
-
Constructor Summary
Constructors Modifier Constructor Description MailAccount()
protected
MailAccount(java.lang.String name, java.lang.String label, Member author, Workspace ws, AbstractMailProvider provider, java.lang.String mbox, java.lang.String schedule, boolean expunge)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endFetchTransaction(FetchMailTransaction mailTransaction)
void
expunge(FetchMailTransaction mailTransaction)
java.util.List<MailMessage>
fetch(FetchMailTransaction mailTransaction)
Member
getAuthor()
int
getDBMailMessageCount()
Returns the count of DBMailMessage stored in DataBase for this accountjava.lang.String
getLabel()
int
getLastFetchCount()
Returns the number of mail fetched on latest fetch with this accountjava.util.Date
getLastFetchDate()
Returns Date of latest fetch with this accountstatic MailAccount
getMailAccount(java.lang.String label, java.lang.String name, LangProperties props, java.util.Map<java.lang.String,AbstractMailProvider> providerMap)
java.lang.String
getMbox()
java.lang.String
getName()
protected java.io.File
getPropertyFile()
AbstractMailProvider
getProvider()
java.lang.String
getProviderName()
java.lang.String
getSchedule()
Workspace
getWorkspace()
boolean
isEnabled()
Retuns true if this account is enableboolean
isExpunged()
protected void
loadProperties()
protected void
saveProperties()
void
setAuthor(Member author)
void
setExpunge(boolean expunge)
void
setLabel(java.lang.String label)
void
setMbox(java.lang.String mbox)
void
setName(java.lang.String name)
void
setSchedule(java.lang.String schedule)
void
setWorkspace(Workspace ws)
FetchMailTransaction
startFetchTransaction()
java.lang.String
toString()
-
-
-
Field Detail
-
PROVIDER_NAME
protected static final java.lang.String PROVIDER_NAME
- See Also:
- Constant Field Values
-
name
protected java.lang.String name
-
label
protected java.lang.String label
-
provider
protected AbstractMailProvider provider
-
mbox
protected java.lang.String mbox
-
schedule
protected java.lang.String schedule
-
enabled
protected boolean enabled
-
expunge
protected boolean expunge
-
author
protected Member author
-
ws
protected Workspace ws
-
expungeSet
protected java.util.Set<java.lang.String> expungeSet
-
properties
protected JProperties properties
-
fetchDate
protected long fetchDate
-
fetchCount
protected int fetchCount
-
-
Constructor Detail
-
MailAccount
public MailAccount()
-
MailAccount
protected MailAccount(java.lang.String name, java.lang.String label, Member author, Workspace ws, AbstractMailProvider provider, java.lang.String mbox, java.lang.String schedule, boolean expunge)
-
-
Method Detail
-
getMailAccount
public static MailAccount getMailAccount(java.lang.String label, java.lang.String name, LangProperties props, java.util.Map<java.lang.String,AbstractMailProvider> providerMap)
-
getPropertyFile
protected java.io.File getPropertyFile()
-
loadProperties
protected void loadProperties()
-
saveProperties
protected void saveProperties()
-
fetch
public java.util.List<MailMessage> fetch(FetchMailTransaction mailTransaction) throws ServiceException
- Throws:
ServiceException
-
expunge
public void expunge(FetchMailTransaction mailTransaction) throws ServiceException
- Throws:
ServiceException
-
startFetchTransaction
public FetchMailTransaction startFetchTransaction() throws ServiceException
- Throws:
ServiceException
-
endFetchTransaction
public void endFetchTransaction(FetchMailTransaction mailTransaction) throws ServiceException
- Throws:
ServiceException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isEnabled
public boolean isEnabled()
Retuns true if this account is enable- Returns:
- boolean
-
getDBMailMessageCount
public int getDBMailMessageCount()
Returns the count of DBMailMessage stored in DataBase for this account- Returns:
- int DB count
-
getLastFetchDate
public java.util.Date getLastFetchDate()
Returns Date of latest fetch with this account- Returns:
- Date last fetch
-
getLastFetchCount
public int getLastFetchCount()
Returns the number of mail fetched on latest fetch with this account- Returns:
- int fetch count
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
getLabel
public java.lang.String getLabel()
-
setLabel
public void setLabel(java.lang.String label)
-
getAuthor
public Member getAuthor()
-
setAuthor
public void setAuthor(Member author)
-
getWorkspace
public Workspace getWorkspace()
-
setWorkspace
public void setWorkspace(Workspace ws)
-
getMbox
public java.lang.String getMbox()
-
setMbox
public void setMbox(java.lang.String mbox)
-
getSchedule
public java.lang.String getSchedule()
-
setSchedule
public void setSchedule(java.lang.String schedule)
-
isExpunged
public boolean isExpunged()
-
setExpunge
public void setExpunge(boolean expunge)
-
getProviderName
public java.lang.String getProviderName()
-
getProvider
public AbstractMailProvider getProvider()
-
-