org.apache.james.services
Interface SpoolRepository

All Superinterfaces:
MailRepository
All Known Implementing Classes:
AvalonSpoolRepository, JDBCSpoolRepository, MailStoreSpoolRepository

public interface SpoolRepository
extends MailRepository

Interface for a Repository for Spooling Mails. A spool repository is a transitory repository which should empty itself if inbound deliveries stop.

Version:
1.0.0, 24/04/1999

Nested Class Summary
static interface SpoolRepository.AcceptFilter
          Implementations of AcceptFilter can be used to select which mails a SpoolRepository implementation returns from its accept (AcceptFilter) method
 
Field Summary
static java.lang.String ROLE
          The component role used by components implementing this service
static java.lang.String SPOOL
          Define a STREAM repository.
 
Fields inherited from interface org.apache.james.services.MailRepository
MAIL
 
Method Summary
 Mail accept()
          Returns an arbitrarily selected mail deposited in this Repository.
 Mail accept(long delay)
          Returns an arbitrarily select mail deposited in this Repository that is either ready immediately for delivery, or is younger than it's last_updated plus the number of failed attempts times the delay time.
 Mail accept(SpoolRepository.AcceptFilter filter)
          Returns an arbitrarily select mail deposited in this Repository for which the supplied filter's accept method returns true.
 
Methods inherited from interface org.apache.james.services.MailRepository
list, lock, remove, remove, remove, retrieve, store, unlock
 

Field Detail

ROLE

static final java.lang.String ROLE
The component role used by components implementing this service

See Also:
Constant Field Values

SPOOL

static final java.lang.String SPOOL
Define a STREAM repository. Streams are stored in the specified destination.

See Also:
Constant Field Values
Method Detail

accept

Mail accept()
            throws java.lang.InterruptedException
Returns an arbitrarily selected mail deposited in this Repository. Usage: SpoolManager calls accept() to see if there are any unprocessed mails in the spool repository.

Returns:
the mail
Throws:
java.lang.InterruptedException

accept

Mail accept(long delay)
            throws java.lang.InterruptedException
Returns an arbitrarily select mail deposited in this Repository that is either ready immediately for delivery, or is younger than it's last_updated plus the number of failed attempts times the delay time. Usage: RemoteDeliverySpool calls accept() with some delay and should block until an unprocessed mail is available.

Returns:
the mail
Throws:
java.lang.InterruptedException

accept

Mail accept(SpoolRepository.AcceptFilter filter)
            throws java.lang.InterruptedException
Returns an arbitrarily select mail deposited in this Repository for which the supplied filter's accept method returns true. Usage: RemoteDeliverySpool calls accept(filter) with some a filter which determines based on number of retries if the mail is ready for processing. If no message is ready the method will block until one is, the amount of time to block is determined by calling the filters getWaitTime method.

Returns:
the mail
Throws:
java.lang.InterruptedException


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.