|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.james.mailrepository.AbstractMailRepository
org.apache.james.mailrepository.JDBCMailRepository
public class JDBCMailRepository
Implementation of a MailRepository on a database.
Requires a configuration element in the .conf.xml file of the form:
<repository destinationURL="db://<datasource>/<table_name>/<repository_name>"
type="MAIL"
model="SYNCHRONOUS"/>
</repository>
destinationURL specifies..(Serge??)
Type can be SPOOL or MAIL
Model is currently not used and may be dropped
Requires a logger called MailRepository.
| Field Summary | |
|---|---|
protected org.apache.avalon.excalibur.datasource.DataSourceComponent |
datasource
The JDBC datasource that provides the JDBC connection |
protected java.lang.String |
datasourceName
The name of the datasource used by this repository |
protected org.apache.avalon.cornerstone.services.datasources.DataSourceSelector |
datasources
The selector used to obtain the JDBC datasource |
protected boolean |
jdbcMailAttributesReady
"Support for Mail Attributes under JDBC repositories is ready" indicator. |
protected java.lang.String |
repositoryName
The repository name parsed from the destination URL |
protected SqlResources |
sqlQueries
Contains all of the sql strings for this component. |
protected java.lang.String |
tableName
The table name parsed from the destination URL |
protected JDBCUtil |
theJDBCUtil
The JDBCUtil helper class |
| Fields inherited from class org.apache.james.mailrepository.AbstractMailRepository |
|---|
DEEP_DEBUG, store |
| Fields inherited from interface org.apache.james.services.MailRepository |
|---|
MAIL, ROLE |
| Constructor Summary | |
|---|---|
JDBCMailRepository()
|
|
| Method Summary | |
|---|---|
protected void |
checkJdbcAttributesSupport(java.sql.DatabaseMetaData dbMetaData)
Checks whether support for JDBC Mail atributes is activated for this repository and if everything is consistent. |
void |
configure(org.apache.avalon.framework.configuration.Configuration conf)
|
boolean |
equals(java.lang.Object obj)
|
protected java.sql.Connection |
getConnection()
Gets the SQL connection to be used by this JDBCMailRepository |
int |
hashCode()
Provide a hash code that is consistent with equals for this class |
void |
initialize()
Initialises the JDBC repository. |
protected void |
internalRemove(java.lang.String key)
|
protected void |
internalStore(org.apache.mailet.Mail mc)
|
java.util.Iterator |
list()
List string keys of messages in repository. |
org.apache.mailet.Mail |
retrieve(java.lang.String key)
Retrieves a message given a key. |
void |
service(org.apache.avalon.framework.service.ServiceManager componentManager)
|
void |
setDatasources(org.apache.avalon.cornerstone.services.datasources.DataSourceSelector datasources)
|
| Methods inherited from class org.apache.james.mailrepository.AbstractMailRepository |
|---|
lock, remove, remove, remove, store, unlock |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String tableName
protected java.lang.String repositoryName
protected org.apache.avalon.cornerstone.services.datasources.DataSourceSelector datasources
protected org.apache.avalon.excalibur.datasource.DataSourceComponent datasource
protected java.lang.String datasourceName
protected SqlResources sqlQueries
protected JDBCUtil theJDBCUtil
protected boolean jdbcMailAttributesReady
| Constructor Detail |
|---|
public JDBCMailRepository()
| Method Detail |
|---|
public void setDatasources(org.apache.avalon.cornerstone.services.datasources.DataSourceSelector datasources)
public void service(org.apache.avalon.framework.service.ServiceManager componentManager)
throws org.apache.avalon.framework.service.ServiceException
service in interface org.apache.avalon.framework.service.Serviceableservice in class AbstractMailRepositoryorg.apache.avalon.framework.service.ServiceExceptionServiceable.service(ServiceManager)
public void configure(org.apache.avalon.framework.configuration.Configuration conf)
throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationExceptionConfigurable.configure(Configuration)
public void initialize()
throws java.lang.Exception
initialize in interface org.apache.avalon.framework.activity.Initializableinitialize in class AbstractMailRepositoryjava.lang.Exception - if an error occursInitializable.initialize()
protected void checkJdbcAttributesSupport(java.sql.DatabaseMetaData dbMetaData)
throws java.sql.SQLException
dbMetaData - the database metadata to be used to look up the column
java.sql.SQLException - if a fatal situation is met
protected void internalStore(org.apache.mailet.Mail mc)
throws java.io.IOException,
javax.mail.MessagingException
internalStore in class AbstractMailRepositoryjava.io.IOException
javax.mail.MessagingExceptionAbstractMailRepository.internalStore(Mail)
public org.apache.mailet.Mail retrieve(java.lang.String key)
throws javax.mail.MessagingException
MailRepository
key - the key of the message to retrieve
javax.mail.MessagingExceptionMailRepository.retrieve(String)
protected void internalRemove(java.lang.String key)
throws javax.mail.MessagingException
internalRemove in class AbstractMailRepositoryjavax.mail.MessagingExceptionAbstractMailRepository.internalRemove(String)
public java.util.Iterator list()
throws javax.mail.MessagingException
MailRepository
Iterator over the list of keys in the repository
javax.mail.MessagingExceptionMailRepository.list()
protected java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLException - if there is an issue with getting the connectionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(Object)public int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||