org.apache.james.services
Interface MailRepository

All Known Subinterfaces:
SpoolRepository
All Known Implementing Classes:
AvalonMailRepository, AvalonSpoolRepository, JDBCMailRepository, JDBCSpoolRepository

public interface MailRepository

Interface for a Repository to store Mails.

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

Field Summary
static String MAIL
          Define a MAIL repository.
 
Method Summary
 Iterator list()
          List string keys of messages in repository.
 boolean lock(String key)
          Obtains a lock on a message identified by 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 the key
 

Field Detail

MAIL

public static final String MAIL
Define a MAIL repository. MAILS are stored in the specified destination.

See Also:
Constant Field Values
Method Detail

store

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

Parameters:
mc - the mail message to store

list

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

Returns:
an Iterator over the list of keys in the repository

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

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

Parameters:
mail - the message to be removed from the repository

remove

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

Parameters:
key - the key of the message to be removed from the repository

lock

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

Parameters:
key - the key of the message to be locked
Returns:
true if successfully obtained the lock, false otherwise

unlock

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

Parameters:
key - the key of the message to be unlocked
Returns:
true if successfully released the lock, false otherwise


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