org.apache.james.mailrepository
Class AvalonMailRepository

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLogEnabled
        |
        +--org.apache.james.mailrepository.AvalonMailRepository
All Implemented Interfaces:
Component, Composable, Configurable, Initializable, LogEnabled, MailRepository
Direct Known Subclasses:
AvalonSpoolRepository

public class AvalonMailRepository
extends AbstractLogEnabled
implements MailRepository, Component, Configurable, Composable, Initializable

Implementation of a MailRepository on a FileSystem. Requires a configuration element in the .conf.xml file of the form: Requires a logger called MailRepository.

Version:
1.0.0, 24/04/1999
Author:
Federico Barbieri , Charles Benett

Field Summary
protected static boolean DEEP_DEBUG
          Whether 'deep debugging' is turned on.
 
Fields inherited from interface org.apache.james.services.MailRepository
MAIL
 
Constructor Summary
AvalonMailRepository()
           
 
Method Summary
 void compose(ComponentManager componentManager)
           
 void configure(Configuration conf)
           
 void initialize()
           
 Iterator list()
          List string keys of messages in repository.
 boolean lock(String key)
          Obtains a lock on a message identified by a key
 void remove(MailImpl mail)
          Removes a specified message
 void remove(String key)
          Removes a message identified by key.
 MailImpl retrieve(String key)
          Retrieves a message given a key.
 void store(MailImpl mc)
          Stores a message in this repository.
 boolean unlock(String key)
          Releases a lock on a message identified by a key
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEEP_DEBUG

protected static final boolean DEEP_DEBUG
Whether 'deep debugging' is turned on.

See Also:
Constant Field Values
Constructor Detail

AvalonMailRepository

public AvalonMailRepository()
Method Detail

compose

public void compose(ComponentManager componentManager)
             throws ComponentException
Specified by:
compose in interface Composable
ComponentException
See Also:
Composable.compose(ComponentManager)

configure

public void configure(Configuration conf)
               throws ConfigurationException
Specified by:
configure in interface Configurable
ConfigurationException
See Also:
Configurable.configure(Configuration)

initialize

public void initialize()
                throws Exception
Specified by:
initialize in interface Initializable
Exception
See Also:
Initializable.initialize()

unlock

public boolean unlock(String key)
Releases a lock on a message identified by a key

Specified by:
unlock in interface MailRepository
Parameters:
key - the key of the message to be unlocked
Returns:
true if successfully released the lock, false otherwise

lock

public boolean lock(String key)
Obtains a lock on a message identified by a key

Specified by:
lock in interface MailRepository
Parameters:
key - the key of the message to be locked
Returns:
true if successfully obtained the lock, false otherwise

store

public void store(MailImpl mc)
Stores a message in this repository. Shouldn't this return the key under which it is stored?

Specified by:
store in interface MailRepository
Parameters:
mc - the mail message to store

retrieve

public MailImpl retrieve(String key)
Retrieves a message given a key. At the moment, keys can be obtained from list() in superinterface Store.Repository

Specified by:
retrieve in interface MailRepository
Parameters:
key - the key of the message to retrieve
Returns:
the mail corresponding to this key, null if none exists

remove

public void remove(MailImpl mail)
Removes a specified message

Specified by:
remove in interface MailRepository
Parameters:
mail - the message to be removed from the repository

remove

public void remove(String key)
Removes a message identified by key.

Specified by:
remove in interface MailRepository
Parameters:
key - the key of the message to be removed from the repository

list

public Iterator list()
List string keys of messages in repository.

Specified by:
list in interface MailRepository
Returns:
an Iterator over the list of keys in the repository


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."