org.objectledge.mail
Class DummyMailingListsManager

java.lang.Object
  extended by org.objectledge.mail.DummyMailingListsManager
All Implemented Interfaces:
MailingListsManager

public class DummyMailingListsManager
extends Object
implements MailingListsManager

A dummy implmentation MailingListsManager. This operation reports UNAVAILABLE status

Version:
$Id: DummyMailingListsManager.java,v 1.5 2006/04/26 10:36:43 rafal Exp $
Author:
RafaƂ Krzewski

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.objectledge.mail.MailingListsManager
MailingListsManager.Status
 
Field Summary
private static MailingListsException SUPPORT_UNAVAILABLE_EXCEPTION
          Exception thrown when methods other than getStaus() is called.
 
Constructor Summary
DummyMailingListsManager()
           
 
Method Summary
 String createList(String name, String domain, String[] administrators, String password, boolean notify, Locale locale, boolean moderated)
          Create new mailing list.
 void deleteList(String name, boolean deleteArchived)
          Delete mailing list.
 List<String> getAvailableDomains()
          Get all e-mail domains configured in the system.
 List<Locale> getAvailableLocales()
          Get all available locales.
 MailingList getList(javax.mail.Message message)
          Returns the mailing list that that the given message belongs to, if any.
 MailingList getList(String name)
          Get mailing list, using system administrator's credantials.
 MailingList getList(String name, String password)
          Get mailing list.
 List<String> getLists()
          Get all lists.
 javax.mail.Store getMessageStore()
          Open a connection to the incoming message store.
 List<String> getPublicLists()
          Get all advertised lists.
 MailingListsManager.Status getStatus()
          Checks the manager's status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUPPORT_UNAVAILABLE_EXCEPTION

private static final MailingListsException SUPPORT_UNAVAILABLE_EXCEPTION
Exception thrown when methods other than getStaus() is called.

Constructor Detail

DummyMailingListsManager

public DummyMailingListsManager()
Method Detail

getStatus

public MailingListsManager.Status getStatus()
Checks the manager's status.

When UNOPERATIONAL status is returned, all relevant information should be written to the server logs.

When UNOPERATIONAL or UNAVAILABLE status is returned, all methods except this one are free to throw any exceptions as will, with unspecified side effects. In short - don't call them.

Specified by:
getStatus in interface MailingListsManager
Returns:
the manager status.

createList

public String createList(String name,
                         String domain,
                         String[] administrators,
                         String password,
                         boolean notify,
                         Locale locale,
                         boolean moderated)
                  throws MailingListsException
Create new mailing list.

Specified by:
createList in interface MailingListsManager
Parameters:
name - the name of the list.
domain - the email domain.
administrators - list of administrators's email addresses
password - the administrator password, auto generated if null
notify - if true send notification about list creation.
locale - mailing list locale.
moderated - should member postings be moderated.
Throws:
MailingListsException - if ml creation failed.

deleteList

public void deleteList(String name,
                       boolean deleteArchived)
                throws MailingListsException
Delete mailing list.

Specified by:
deleteList in interface MailingListsManager
Parameters:
name - name of the list to delete.
deleteArchived - delete if true
Throws:
MailingListsException - if ml deletion failed.

getList

public MailingList getList(String name,
                           String password)
                    throws MailingListsException
Get mailing list.

Specified by:
getList in interface MailingListsManager
Parameters:
name - name of the list.
password - the password.
Throws:
MailingListsException

getList

public MailingList getList(String name)
                    throws MailingListsException
Get mailing list, using system administrator's credantials.

Specified by:
getList in interface MailingListsManager
Parameters:
name - name of the list.
Throws:
MailingListsException

getPublicLists

public List<String> getPublicLists()
                            throws MailingListsException
Get all advertised lists.

Specified by:
getPublicLists in interface MailingListsManager
Returns:
the list of public lists.
Throws:
MailingListsException - if something goes wrong.

getLists

public List<String> getLists()
                      throws MailingListsException
Get all lists.

Specified by:
getLists in interface MailingListsManager
Returns:
the list of all lists.
Throws:
MailingListsException - if something goes wrong;

getAvailableLocales

public List<Locale> getAvailableLocales()
                                 throws MailingListsException
Get all available locales.

Specified by:
getAvailableLocales in interface MailingListsManager
Returns:
the list of locales.
Throws:
MailingListsException

getAvailableDomains

public List<String> getAvailableDomains()
                                 throws MailingListsException
Get all e-mail domains configured in the system.

Specified by:
getAvailableDomains in interface MailingListsManager
Returns:
e-mail domains configured in the system.
Throws:
MailingListsException

getMessageStore

public javax.mail.Store getMessageStore()
                                 throws MailingListsException
Open a connection to the incoming message store.

Specified by:
getMessageStore in interface MailingListsManager
Returns:
message store.
Throws:
MailingListsException

getList

public MailingList getList(javax.mail.Message message)
                    throws MailingListsException
Returns the mailing list that that the given message belongs to, if any. All operations on a list acquire with this method will be performed using site administrators credentials.

Specified by:
getList in interface MailingListsManager
Returns:
MailingList object, or null if the message does not belong to a mailing list.
Throws:
MailingListsException


Copyright © 2003-2006 objectledge.org. All Rights Reserved.