de.bea.domingo.groupware.map
Class MailDatabase

java.lang.Object
  extended by de.bea.domingo.map.BaseDatabase
      extended by de.bea.domingo.groupware.map.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(DDatabase database, java.lang.String owner)
          Constructor.
MailDatabase(DSession session, NotesLocation location, java.lang.String owner)
          Constructor.
MailDatabase(java.lang.String locationUri, java.lang.String owner)
          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.util.Iterator getCalendar()
          Returns an iterator over all entries in the Calendar.
 java.util.Iterator getCalendar(boolean reverseOrder)
          Returns an iterator over all entries in the Calendar.
 java.lang.Object getCalendarEntry(CalendarEntryDigest entryDigest)
          Returns the full calendar entry for a given calendar entry digest.
 java.lang.Object getCalendarEntry(java.lang.String unid)
          Returns a calendar entry for a given unid.
 Email 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.
 java.util.List getObjects(java.util.Calendar from, java.util.Calendar to)
          Returns calendar objects within the specified time frame.
 java.lang.String getOwner()
          Returns the name of the owner of a mailbox.
 Email newEmail()
          Creates a new Memo.
protected  void registerMappers()
          Registers all mappers needed for a mail database.
 void remove(CalendarEntry entry)
          Deletes an existing calendar entry.
 void remove(CalendarEntryDigest entryDigest)
          Deletes an existing calendar entry.
 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, getTitle, 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,
                    java.lang.String owner)
             throws java.io.IOException,
                    DNotesException
Constructor.

Parameters:
locationUri - URI of location of database.
owner - name of mailbox owner
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,
                    java.lang.String owner)
             throws DNotesException
Constructor.

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

MailDatabase

public MailDatabase(DDatabase database,
                    java.lang.String owner)
             throws DNotesException
Constructor.

Parameters:
database - a mail database
owner - name of mailbox owner
Throws:
DNotesException - if the database is invalid or 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()

getOwner

public java.lang.String getOwner()
Returns the name of the owner of a mailbox.

Specified by:
getOwner in interface Mailbox
Returns:
name of owner
See Also:
Mailbox.getOwner()

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)

getCalendar

public java.util.Iterator getCalendar()
Returns an iterator over all entries in the Calendar.

Specified by:
getCalendar in interface CalendarInterface
Returns:
iterator over all entries in the Calendar.
See Also:
CalendarInterface.getCalendar()

getCalendar

public java.util.Iterator getCalendar(boolean reverseOrder)
Returns an iterator over all entries in the Calendar.

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

Specified by:
getCalendar in interface CalendarInterface
Parameters:
reverseOrder - true if iterator should iterate in reverse order
Returns:
iterator over all entries in the Calendar.
See Also:
CalendarInterface.getCalendar(boolean reverseOrder)

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 Email getEmail(EmailDigest emailDigest)
Returns the email represented by the given email-digest.

Specified by:
getEmail in interface Mailbox
Parameters:
emailDigest - an email-digest
Returns:
the corresponding email

getCalendarEntry

public java.lang.Object getCalendarEntry(CalendarEntryDigest entryDigest)
Returns the full calendar entry for a given calendar entry digest.

Specified by:
getCalendarEntry in interface CalendarInterface
Parameters:
entryDigest - a calendar digest
Returns:
the full calendar entry

getCalendarEntry

public java.lang.Object getCalendarEntry(java.lang.String unid)
Returns a calendar entry for a given unid.

Specified by:
getCalendarEntry in interface CalendarInterface
Parameters:
unid - the Notes document unique id of the calendar entry.
Returns:
the calendar entry
See Also:
CalendarEntry.getAppointmentUnid()

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)

remove

public void remove(CalendarEntry entry)
Deletes an existing calendar entry.

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

remove

public void remove(CalendarEntryDigest entryDigest)
Deletes an existing calendar entry.

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


Domingo Java-API