public class MailAccount
extends java.lang.Object
Modifier and Type | Field and 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 |
host |
protected boolean |
imapssl |
protected java.lang.String |
label |
protected java.lang.String |
login |
protected java.lang.String |
mbox |
protected java.lang.String |
name |
protected java.lang.String |
password |
protected int |
port |
protected JProperties |
properties |
protected java.lang.String |
protocol |
static java.lang.String |
REVISION |
protected java.lang.String |
schedule |
protected Workspace |
ws |
Constructor and Description |
---|
MailAccount() |
MailAccount(java.lang.String name,
java.lang.String label,
Member author,
Workspace ws,
java.lang.String host,
int port,
java.lang.String protocol,
java.lang.String login,
java.lang.String password,
java.lang.String mbox,
java.lang.String schedule,
boolean expunge,
boolean imapssl) |
Modifier and Type | Method and Description |
---|---|
void |
closeQuietly(javax.mail.Folder folder,
boolean expunge)
Close the given folder catching exceptions
|
javax.mail.Store |
connect() |
javax.mail.Folder |
connect(int mode)
Connect to the account, open the store and retrieve the folder.
|
protected java.util.List<javax.mail.Message> |
doFetch(javax.mail.Folder folder) |
protected boolean |
expunged(javax.mail.Message msg,
java.lang.String msgId)
Flags the message to remove when the folder is closed
Performs additional tasks.
|
java.util.List<javax.mail.Message> |
fetch(javax.mail.Folder folder)
Fetch message from the given folder.
|
Member |
getAuthor() |
int |
getDBMailMessageCount()
Returns the count of DBMailMessage stored in DataBase for this account
|
java.lang.String |
getHost() |
java.lang.String |
getLabel() |
int |
getLastFetchCount()
Returns the number of mail fetched on latest fetch with this account
|
java.util.Date |
getLastFetchDate()
Returns Date of latest fetch with this account
|
java.lang.String |
getLogin() |
static MailAccount |
getMailAccount(java.lang.String label,
java.lang.String name,
LangProperties props) |
java.lang.String |
getMbox() |
java.lang.String |
getName() |
java.util.Properties |
getPorperties() |
int |
getPort() |
protected java.io.File |
getPropertyFile() |
java.lang.String |
getProtocol() |
java.lang.String |
getSchedule() |
javax.mail.Session |
getSession() |
Workspace |
getWorkspace() |
boolean |
isEnabled()
Retuns true if this account is enable
|
boolean |
isExpunged() |
boolean |
isImapSSL() |
protected void |
loadProperties() |
void |
markAsExpunge(java.util.Set<java.lang.String> msgIdSet)
Mark given msg Ids as expunge on next fetch
|
protected void |
saveProperties() |
void |
setAuthor(Member author) |
void |
setExpunge(boolean expunge) |
void |
setHost(java.lang.String host) |
void |
setImapSSL(boolean imapssl) |
void |
setLabel(java.lang.String label) |
void |
setLogin(java.lang.String login) |
void |
setMbox(java.lang.String mbox) |
void |
setName(java.lang.String name) |
void |
setPassword(java.lang.String password) |
void |
setPort(int port) |
void |
setProtocol(java.lang.String protocol) |
void |
setSchedule(java.lang.String schedule) |
void |
setWorkspace(Workspace ws) |
java.lang.String |
toString() |
public static final java.lang.String REVISION
protected java.lang.String name
protected java.lang.String label
protected java.lang.String host
protected int port
protected java.lang.String protocol
protected java.lang.String login
protected java.lang.String password
protected java.lang.String mbox
protected java.lang.String schedule
protected boolean enabled
protected boolean expunge
protected boolean imapssl
protected Member author
protected Workspace ws
protected JProperties properties
protected long fetchDate
protected int fetchCount
protected java.util.Set<java.lang.String> expungeSet
public MailAccount()
public MailAccount(java.lang.String name, java.lang.String label, Member author, Workspace ws, java.lang.String host, int port, java.lang.String protocol, java.lang.String login, java.lang.String password, java.lang.String mbox, java.lang.String schedule, boolean expunge, boolean imapssl)
public static MailAccount getMailAccount(java.lang.String label, java.lang.String name, LangProperties props)
protected java.io.File getPropertyFile()
protected void loadProperties()
protected void saveProperties()
public java.util.List<javax.mail.Message> fetch(javax.mail.Folder folder) throws javax.mail.MessagingException
folder
- the FOlder to fetchjavax.mail.MessagingException
protected java.util.List<javax.mail.Message> doFetch(javax.mail.Folder folder) throws javax.mail.MessagingException
javax.mail.MessagingException
public java.util.Properties getPorperties()
public javax.mail.Session getSession()
public javax.mail.Store connect() throws javax.mail.NoSuchProviderException, javax.mail.MessagingException
javax.mail.NoSuchProviderException
javax.mail.MessagingException
public javax.mail.Folder connect(int mode) throws javax.mail.NoSuchProviderException, javax.mail.MessagingException
mode
- the open mode Folder.READ_ONLY or Folder.READ_WRITEjavax.mail.NoSuchProviderException
javax.mail.MessagingException
public void closeQuietly(javax.mail.Folder folder, boolean expunge)
folder
- the Folderexpunge
- Expunge (permanently remove) messages marked DELETED.protected boolean expunged(javax.mail.Message msg, java.lang.String msgId)
msg
- the MessagemsgId
- the Message Idpublic void markAsExpunge(java.util.Set<java.lang.String> msgIdSet)
msgIdSet
- Set of msgIdpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean isEnabled()
public int getDBMailMessageCount()
public java.util.Date getLastFetchDate()
public int getLastFetchCount()
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
public Member getAuthor()
public void setAuthor(Member author)
public Workspace getWorkspace()
public void setWorkspace(Workspace ws)
public java.lang.String getHost()
public void setHost(java.lang.String host)
public int getPort()
public void setPort(int port)
public java.lang.String getProtocol()
public void setProtocol(java.lang.String protocol)
public java.lang.String getLogin()
public void setLogin(java.lang.String login)
public void setPassword(java.lang.String password)
public java.lang.String getMbox()
public void setMbox(java.lang.String mbox)
public java.lang.String getSchedule()
public void setSchedule(java.lang.String schedule)
public boolean isExpunged()
public void setExpunge(boolean expunge)
public boolean isImapSSL()
public void setImapSSL(boolean imapssl)
Copyright © 2001-2010 Jalios SA. All Rights Reserved.