GSmtp::MessageStore Class Reference

A class which allows SMTP messages (envelope+content) to be stored and retrieved. More...

#include <gmessagestore.h>

Inheritance diagram for GSmtp::MessageStore:

GSmtp::FileStore

List of all members.

Public Member Functions

virtual ~MessageStore ()
 Destructor.
virtual std::auto_ptr< NewMessagenewMessage (const std::string &from)=0
 Creates a new message.
virtual bool empty () const =0
 Returns true if the message store is empty.
virtual std::auto_ptr
< StoredMessage
get (unsigned long id)=0
 Pulls a message out of the store.
virtual Iterator iterator (bool lock)=0
 Returns an iterator for stored messages.
virtual void repoll ()=0
 Ensures that the next updated() signal() has its parameter set to true.
virtual void updated ()=0
 Called by associated classes to indicate that the store has changed.
virtual G::Signal1< bool > & signal ()=0
 Provides a signal which is activated when something might have changed in the store.

Static Public Member Functions

static G::Path defaultDirectory ()
 Returns a default spool directory, such as "/usr/local/var/spool/emailrelay".

Classes

class  Iterator
 An iterator class for GSmtp::MessageStore. More...
class  IteratorImp
 A base class for MessageStore::Iterator implementations. More...


Detailed Description

A class which allows SMTP messages (envelope+content) to be stored and retrieved.

See also:
GSmtp::NewMessage, GSmtp::StoredMessage, GSmtp::ProtocolMessage

Definition at line 45 of file gmessagestore.h.


Constructor & Destructor Documentation

GSmtp::MessageStore::~MessageStore (  )  [virtual]

Destructor.

Definition at line 27 of file gmessagestore.cpp.


Member Function Documentation

G::Path GSmtp::MessageStore::defaultDirectory (  )  [static]

Returns a default spool directory, such as "/usr/local/var/spool/emailrelay".

(Typically has an os-specific implementation.)

Definition at line 30 of file gmessagestore_unix.cpp.

References G_SPOOLDIR.

Referenced by Main::Configuration::spoolDir(), and Main::CommandLineImp::switchSpec().

virtual std::auto_ptr<NewMessage> GSmtp::MessageStore::newMessage ( const std::string &  from  )  [pure virtual]

Creates a new message.

Implemented in GSmtp::FileStore.

Referenced by GSmtp::ProtocolMessageStore::setFrom().

virtual bool GSmtp::MessageStore::empty (  )  const [pure virtual]

Returns true if the message store is empty.

Implemented in GSmtp::FileStore.

Referenced by GSmtp::Client::sendMessages().

virtual std::auto_ptr<StoredMessage> GSmtp::MessageStore::get ( unsigned long  id  )  [pure virtual]

Pulls a message out of the store.

Throws execptions on error.

See also NewMessage::id().

As a side effect some stored messages may be marked as bad, or deleted (if they have no recipients).

Implemented in GSmtp::FileStore.

virtual Iterator GSmtp::MessageStore::iterator ( bool  lock  )  [pure virtual]

Returns an iterator for stored messages.

(Note that copies of iterators share state. For independent iterators call iterator() for each.)

If 'lock' is true then stored messages returned by the iterator are locked. Normally they are then processed (using StoredMessage::extractContentStream()) and then deleted (by StoredMessage::destroy()).

As a side effect of iteration when 'lock' is true, then some stored messages may be marked as bad, or deleted (if they have no recipients).

Implemented in GSmtp::FileStore.

Referenced by GSmtp::Client::onConnect().

virtual void GSmtp::MessageStore::repoll (  )  [pure virtual]

Ensures that the next updated() signal() has its parameter set to true.

Implemented in GSmtp::FileStore.

virtual void GSmtp::MessageStore::updated (  )  [pure virtual]

Called by associated classes to indicate that the store has changed.

Results in the signal() being emited.

Implemented in GSmtp::FileStore.

virtual G::Signal1<bool>& GSmtp::MessageStore::signal (  )  [pure virtual]

Provides a signal which is activated when something might have changed in the store.

The boolean parameter is used to indicate that repoll()ing is requested.

Implemented in GSmtp::FileStore.


The documentation for this class was generated from the following files:

Generated on Fri Apr 18 15:56:13 2008 for E-MailRelay by  doxygen 1.5.5