|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.mailrepository.lib.AbstractMailRepository
org.apache.james.mailrepository.jdbc.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 DataSource |
datasource
The JDBC datasource that provides the JDBC connection |
protected String |
datasourceName
The name of the datasource used by this repository |
protected boolean |
jdbcMailAttributesReady
"Support for Mail Attributes under JDBC repositories is ready" indicator. |
protected String |
repositoryName
The repository name parsed from the destination URL |
protected SqlResources |
sqlQueries
Contains all of the sql strings for this component. |
protected 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.lib.AbstractMailRepository |
|---|
DEEP_DEBUG |
| Constructor Summary | |
|---|---|
JDBCMailRepository()
|
|
| Method Summary | |
|---|---|
protected void |
checkJdbcAttributesSupport(DatabaseMetaData dbMetaData)
Checks whether support for JDBC Mail atributes is activated for this repository and if everything is consistent. Looks for both the "updateMessageAttributesSQL" and "retrieveMessageAttributesSQL" statements in sqlResources and for a table column named "message_attributes". |
protected void |
doConfigure(org.apache.commons.configuration.HierarchicalConfiguration configuration)
|
boolean |
equals(Object obj)
|
protected 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 |
init()
Initialises the JDBC repository. |
protected void |
internalRemove(String key)
|
protected void |
internalStore(org.apache.mailet.Mail mc)
|
Iterator |
list()
|
org.apache.mailet.Mail |
retrieve(String key)
|
void |
setDatasource(DataSource datasource)
|
void |
setFileSystem(FileSystem fileSystem)
|
| Methods inherited from class org.apache.james.mailrepository.lib.AbstractMailRepository |
|---|
configure, getLogger, lock, remove, remove, remove, setLog, store, unlock |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String tableName
protected String repositoryName
protected DataSource datasource
protected String datasourceName
protected SqlResources sqlQueries
protected JDBCUtil theJDBCUtil
protected boolean jdbcMailAttributesReady
| Constructor Detail |
|---|
public JDBCMailRepository()
| Method Detail |
|---|
public void setDatasource(DataSource datasource)
public void setFileSystem(FileSystem fileSystem)
protected void doConfigure(org.apache.commons.configuration.HierarchicalConfiguration configuration)
throws org.apache.commons.configuration.ConfigurationException
doConfigure in class AbstractMailRepositoryorg.apache.commons.configuration.ConfigurationException
@PostConstruct
public void init()
throws Exception
Exception - if an error occurs
protected void checkJdbcAttributesSupport(DatabaseMetaData dbMetaData)
throws SQLException
dbMetaData - the database metadata to be used to look up the column
SQLException - if a fatal situation is met
protected void internalStore(org.apache.mailet.Mail mc)
throws IOException,
javax.mail.MessagingException
internalStore in class AbstractMailRepositoryIOException
javax.mail.MessagingExceptionAbstractMailRepository.internalStore(Mail)
public org.apache.mailet.Mail retrieve(String key)
throws javax.mail.MessagingException
javax.mail.MessagingExceptionMailRepository.retrieve(String)
protected void internalRemove(String key)
throws javax.mail.MessagingException
internalRemove in class AbstractMailRepositoryjavax.mail.MessagingExceptionAbstractMailRepository.internalRemove(String)
public Iterator list()
throws javax.mail.MessagingException
javax.mail.MessagingExceptionMailRepository.list()
protected Connection getConnection()
throws SQLException
SQLException - if there is an issue with getting the connectionpublic boolean equals(Object obj)
equals in class ObjectObject.equals(Object)public int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||