|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.jcr.JCRMailRepository
public class JCRMailRepository
Mail repository that is backed by a JCR content repository.
| Field Summary | |
|---|---|
protected javax.jcr.Credentials |
credentials
Login credentials for accessing the repository. |
protected org.apache.commons.logging.Log |
logger
|
protected java.lang.String |
path
Path (relative to root) of the mail repository within the workspace. |
protected javax.jcr.Repository |
repository
JCR content repository used as the mail repository. |
protected java.lang.String |
workspace
Name of the workspace used as the mail repository. |
| Fields inherited from interface org.apache.james.services.MailRepository |
|---|
MAIL, ROLE |
| Constructor Summary | |
|---|---|
JCRMailRepository()
For setter injection. |
|
JCRMailRepository(javax.jcr.Repository repository,
javax.jcr.Credentials credentials,
java.lang.String workspace,
java.lang.String path,
org.apache.commons.logging.Log logger)
Maximal constructor for injection. |
|
JCRMailRepository(javax.jcr.Repository repository,
org.apache.commons.logging.Log logger)
Minimal constructor for injection. |
|
| Method Summary | |
|---|---|
javax.jcr.Credentials |
getCredentials()
Returns the login credentials for accessing the repository. |
org.apache.commons.logging.Log |
getLogger()
Gets the current logger. |
java.lang.String |
getPath()
Returns the path of the mail repository within the workspace. |
javax.jcr.Repository |
getRepository()
Retuns the JCR content repository used as the mail repository. |
java.lang.String |
getWorkspace()
Returns the name of the workspace used as the mail repository. |
java.util.Iterator |
list()
List string keys of messages in repository. |
boolean |
lock(java.lang.String key)
Obtains a lock on a message identified by key |
protected javax.jcr.Session |
login()
Logs into a new session. |
protected javax.jcr.NodeIterator |
query(javax.jcr.Session session,
java.lang.String xpath)
|
void |
remove(java.util.Collection mails)
Remove an Collection of mails from the repository |
void |
remove(org.apache.mailet.Mail mail)
Removes a specified message |
void |
remove(java.lang.String key)
Removes a message identified by key. |
org.apache.mailet.Mail |
retrieve(java.lang.String key)
Retrieves a message given a key. |
void |
setCredentials(javax.jcr.Credentials credentials)
Sets the login credentials for accessing the repository. |
void |
setLogger(org.apache.commons.logging.Log logger)
Sets the current logger. |
void |
setPath(java.lang.String path)
Sets the path of the mail repository within the workspace. |
void |
setRepository(javax.jcr.Repository repository)
Sets the JCR content repository to be used as the mail repository. |
void |
setWorkspace(java.lang.String workspace)
Sets the name of the workspace used as the mail repository. |
void |
store(org.apache.mailet.Mail mail)
Stores a message in this repository. |
protected java.lang.String |
toSafeName(java.lang.String key)
|
boolean |
unlock(java.lang.String key)
Releases a lock on a message identified the key |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.commons.logging.Log logger
protected javax.jcr.Repository repository
protected javax.jcr.Credentials credentials
null (the default) to use default credentials.
protected java.lang.String workspace
null (the default) to use the default workspace.
protected java.lang.String path
| Constructor Detail |
|---|
public JCRMailRepository()
public JCRMailRepository(javax.jcr.Repository repository,
javax.jcr.Credentials credentials,
java.lang.String workspace,
java.lang.String path,
org.apache.commons.logging.Log logger)
repository - not nullcredentials - login credentials for accessing the repository
or null to use default credentialsworkspace - name of the workspace used as the mail repository.
or null to use default workspacepath - path (relative to root) of the user node within the workspace,
or null to use default.
public JCRMailRepository(javax.jcr.Repository repository,
org.apache.commons.logging.Log logger)
repository - not null| Method Detail |
|---|
public java.util.Iterator list()
throws javax.mail.MessagingException
MailRepository
list in interface MailRepositoryIterator over the list of keys in the repository
javax.mail.MessagingException
public org.apache.mailet.Mail retrieve(java.lang.String key)
throws javax.mail.MessagingException
MailRepository
retrieve in interface MailRepositorykey - the key of the message to retrieve
javax.mail.MessagingException
public void store(org.apache.mailet.Mail mail)
throws javax.mail.MessagingException
MailRepository
store in interface MailRepositorymail - the mail message to store
javax.mail.MessagingException
public void remove(java.lang.String key)
throws javax.mail.MessagingException
MailRepository
remove in interface MailRepositorykey - the key of the message to be removed from the repository
javax.mail.MessagingException
public void remove(org.apache.mailet.Mail mail)
throws javax.mail.MessagingException
MailRepository
remove in interface MailRepositorymail - the message to be removed from the repository
javax.mail.MessagingException
public void remove(java.util.Collection mails)
throws javax.mail.MessagingException
MailRepository
remove in interface MailRepositorymails - The Collection of MailImpl's to delete
javax.mail.MessagingException
public boolean lock(java.lang.String key)
throws javax.mail.MessagingException
MailRepository
lock in interface MailRepositorykey - the key of the message to be locked
javax.mail.MessagingException
public boolean unlock(java.lang.String key)
throws javax.mail.MessagingException
MailRepository
unlock in interface MailRepositorykey - the key of the message to be unlocked
javax.mail.MessagingExceptionpublic final org.apache.commons.logging.Log getLogger()
public final void setLogger(org.apache.commons.logging.Log logger)
logger - the logger to set, not nullpublic javax.jcr.Repository getRepository()
public void setRepository(javax.jcr.Repository repository)
repository - JCR content repositorypublic javax.jcr.Credentials getCredentials()
null if using the default credentialspublic void setCredentials(javax.jcr.Credentials credentials)
credentials - login credentials,
or null to use the default credentialspublic java.lang.String getWorkspace()
null if using the default workspacepublic void setWorkspace(java.lang.String workspace)
workspace - workspace name,
or null to use the default workspacepublic java.lang.String getPath()
public void setPath(java.lang.String path)
path - repository path
protected javax.jcr.Session login()
throws javax.jcr.LoginException,
javax.jcr.NoSuchWorkspaceException,
javax.jcr.RepositoryException
javax.jcr.LoginException - when login fails
javax.jcr.NoSuchWorkspaceException - when workspace does not exist
javax.jcr.RepositoryException - when access failsprotected java.lang.String toSafeName(java.lang.String key)
protected javax.jcr.NodeIterator query(javax.jcr.Session session,
java.lang.String xpath)
throws javax.jcr.RepositoryException,
javax.jcr.query.InvalidQueryException
javax.jcr.RepositoryException
javax.jcr.query.InvalidQueryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||