de.bea.domingo.groupware
Class MailDatabase

java.lang.Object
  extended byde.bea.domingo.map.BaseDatabase
      extended byde.bea.domingo.groupware.MailDatabase
All Implemented Interfaces:
CalendarInterface, Mailbox

public final class MailDatabase
extends BaseDatabase
implements Mailbox, CalendarInterface

Interface to mail databases.

Author:
Kurt Riede

Constructor Summary
MailDatabase(DSession session, NotesLocation location)
          Constructor.
MailDatabase(java.lang.String locationUri)
          Constructor.
 
Method Summary
 Email forward(Email memo)
          Creates a new memo as a forward of an existing memo.
 Email forward(Email memo, boolean withAttachments)
          Creates a new memo as a forward to an existing memo.
 java.lang.Object getEmail(EmailDigest emailDigest)
          Returns the email represented by the given email-digest.
 java.util.Iterator getInbox()
          Returns an iterator over all mails in the Inbox.
 java.util.Iterator getInbox(boolean reverseOrder)
          Returns an iterator over all mails in the Inbox.

Depending on how the inbox is sorted (ascending or descending by date), choose where to start reading mails.

 java.util.List getObjects(java.util.Calendar from, java.util.Calendar to)
          Returns calendar objects within the specified time frame.
 Email newEmail()
          Creates a new Memo.
protected  void registerMappers()
          Registers all mappers needed for a mail database.
 void remove(Email memo)
          Deletes an existing memo.
 void remove(EmailDigest memo)
          Deletes an existing memo.
 Email reply(Email memo, boolean withHistory, boolean withAttachments)
          Creates a new memo as a reply to the sender of the original memo.
 Email replyToAll(Email memo, boolean withHistory, boolean withAttachments)
          Creates a new memo as a reply to all original recipients of the original memo.
 void save(CalendarEntry entry)
          Saves a new calendar entry.
 void saveAsDraft(Email memo)
          Sends a memo.
 void send(Email memo)
          Sends a memo.
 
Methods inherited from class de.bea.domingo.map.BaseDatabase
create, getDatabase, getSession, map, map, map, register, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailDatabase

public MailDatabase(java.lang.String locationUri)
             throws java.io.IOException,
                    DNotesException
Constructor.

Parameters:
locationUri - URI of location of database.
Throws:
java.io.IOException - if the location is not a valid notes location
DNotesException - if the database cannot be opened

MailDatabase

public MailDatabase(DSession session,
                    NotesLocation location)
             throws DNotesException
Constructor.

Parameters:
session - an existing domingo session
location - location of database.
Throws:
DNotesException - if the uri is invalid or the database cannot be opened
Method Detail

registerMappers

protected void registerMappers()
                        throws MapperRegistrationException
Registers all mappers needed for a mail database.

Specified by:
registerMappers in class BaseDatabase
Throws:
MapperRegistrationException - if an error occurred during registering a mapper
See Also:
BaseDatabase.registerMappers()

reply

public Email reply(Email memo,
                   boolean withHistory,
                   boolean withAttachments)
Creates a new memo as a reply to the sender of the original memo.

Specified by:
reply in interface Mailbox
Parameters:
memo - the memo to forward
withHistory - if the original mail should be included
withAttachments - if attachments should be included
Returns:
reply memo
See Also:
Mailbox.reply(de.bea.domingo.groupware.Email, boolean, boolean)

replyToAll

public Email replyToAll(Email memo,
                        boolean withHistory,
                        boolean withAttachments)
Creates a new memo as a reply to all original recipients of the original memo.

Specified by:
replyToAll in interface Mailbox
Parameters:
memo - the memo to forward
withHistory - if the original mail should be included
withAttachments - if attachments should be included
Returns:
reply memo
See Also:
Mailbox.replyToAll(de.bea.domingo.groupware.Email, boolean, boolean)

remove

public void remove(Email memo)
Deletes an existing memo.

Specified by:
remove in interface Mailbox
Parameters:
memo - a memo to delete
See Also:
Mailbox.remove(de.bea.domingo.groupware.Email)

remove

public void remove(EmailDigest memo)
Deletes an existing memo.

Specified by:
remove in interface Mailbox
Parameters:
memo - a memo digest to delete
See Also:
Mailbox.remove(de.bea.domingo.groupware.EmailDigest)

getObjects

public java.util.List getObjects(java.util.Calendar from,
                                 java.util.Calendar to)
Returns calendar objects within the specified time frame.

Specified by:
getObjects in interface CalendarInterface
Parameters:
from - start date
to - end date
Returns:
list of calendar entries
See Also:
CalendarInterface.getObjects(java.util.Calendar, java.util.Calendar)

getInbox

public java.util.Iterator getInbox()
Returns an iterator over all mails in the Inbox.

Specified by:
getInbox in interface Mailbox
Returns:
iterator over all mails in the Inbox
See Also:
Mailbox.getInbox()

getInbox

public java.util.Iterator getInbox(boolean reverseOrder)
Returns an iterator over all mails in the Inbox.

Depending on how the inbox is sorted (ascending or descending by date), choose where to start reading mails.

Specified by:
getInbox in interface Mailbox
Parameters:
reverseOrder - whether to start at the beginning or at the end
Returns:
iterator over all mails in the Inbox
See Also:
Mailbox.getInbox(boolean)

getEmail

public java.lang.Object getEmail(EmailDigest emailDigest)
Returns the email represented by the given email-digest.

Parameters:
emailDigest - an email-digest
Returns:
the corresponding email

newEmail

public Email newEmail()
Creates a new Memo.

Specified by:
newEmail in interface Mailbox
Returns:
the new Memo instance
See Also:
Mailbox.newEmail()

forward

public Email forward(Email memo)
Creates a new memo as a forward of an existing memo.

Specified by:
forward in interface Mailbox
Parameters:
memo - the memo to forward
Returns:
forward memo
See Also:
Mailbox.forward(de.bea.domingo.groupware.Email)

forward

public Email forward(Email memo,
                     boolean withAttachments)
Creates a new memo as a forward to an existing memo.

Specified by:
forward in interface Mailbox
Parameters:
memo - an existing memo
withAttachments - forward with or without attachments
Returns:
the reply memo
See Also:
Mailbox.forward(de.bea.domingo.groupware.Email, boolean)

saveAsDraft

public void saveAsDraft(Email memo)
Sends a memo.

Specified by:
saveAsDraft in interface Mailbox
Parameters:
memo - the memo to send
See Also:
Mailbox.saveAsDraft(de.bea.domingo.groupware.Email)

send

public void send(Email memo)
Sends a memo.

Specified by:
send in interface Mailbox
Parameters:
memo - the memo to send
See Also:
Mailbox.send(de.bea.domingo.groupware.Email)

save

public void save(CalendarEntry entry)
Saves a new calendar entry.

Specified by:
save in interface CalendarInterface
Parameters:
entry - the calendar entry to save
See Also:
CalendarInterface.save(de.bea.domingo.groupware.CalendarEntry)


Domingo Java-API