Jwma

dtw.webmail
Class JwmaKernel

java.lang.Object
  |
  +--dtw.webmail.JwmaKernel

public class JwmaKernel
extends java.lang.Object

A kernel that represents a hub for internal "globally" used jwma functions & data (system settings). This class implements the singleton pattern, which means there is only one instance throughout run-time.

Version:
0.9.7 07/02/2003
Author:
Dieter Wimberger

Field Summary
static java.lang.String ACCOUNT_CREATION_VIEW
          Defines the abstract account creation view.
static java.lang.String ADMIN_ERROR_VIEW
          Defines the abstract admin error view.
static java.lang.String ADMIN_LOGIN_VIEW
          Defines the abstract admin login view.
static java.lang.String ADMIN_MENU_VIEW
          Defines the abstract admin menu view.
static java.lang.String ADMIN_PREFERENCES_VIEW
          Defines the abstract admin preferences view.
static java.lang.String ADMIN_SETTINGS_VIEW
          Defines the abstract admin settings view.
static java.lang.String ADMIN_STATUS_VIEW
          Defines the abstract admin status view.
static java.lang.String COMPOSE_VIEW
          Defines the abstract compose view.
static java.lang.String CONTACT_EDIT_VIEW
          Defines the abstract contact edit view.
static java.lang.String CONTACT_VIEW
          Defines the abstract contact view.
static java.lang.String CONTACTGROUP_EDIT_VIEW
          Defines the abstract contact group edit view.
static java.lang.String CONTACTGROUP_VIEW
          Defines the abstract contact group view.
static java.lang.String CONTACTS_VIEW
          Defines the abstract contacts view.
static int DATA_DIR
          Defines the data directory.
static java.lang.String ERROR_VIEW
          Defines the abstract error view.
static int ETC_DIR
          Defines the root directory.
static java.lang.String FIRSTTIME_VIEW
          Defines the abstract error firsttime view.
static java.lang.String FOLDER_VIEW
          Defines the abstract folder view.
static int LOG_DIR
          Defines the root directory.
static java.lang.String LOGIN_VIEW
          Defines the abstract login view.
static java.lang.String LOGOUT_VIEW
          Defines the abstract loggedout view.
static java.lang.String MAILBOX_VIEW
          Defines the abstract mailbox view.
static java.lang.String MESSAGE_VIEW
          Defines the abstract message view.
static java.lang.String PREFERENCES_VIEW
          Defines the abstract preferences view.
static int ROOT_DIR
          Defines the root directory.
static java.lang.String SUBSCRIBED_VIEW
          Defines the abstract subscribe view.
static java.lang.String UNSUBSCRIBED_VIEW
          Defines the abstract unsubscribe view.
 
Method Summary
 java.lang.String getAdminControllerUrl()
          Returns the admin controller URL setting of the local jwma installation.
 JwmaConfiguration getConfiguration()
          Returns the active JwmaConfiguration instance.
 ContactManagementPlugin getContactManagementPlugin()
          Returns the active and activated ContactManagementPlugin instance that provides contact management related functionality.
 java.lang.String getContactsControllerUrl()
          Returns the contacts controller URL setting of the local jwma installation.
 java.lang.String getDirectoryPath(int DIRECTORY)
          Returns the path of the given directory.
 java.lang.String getErrorMessage(java.lang.String key)
          Returns the error message for the given key in the set system locale.
 int getKernelStatus()
          Returns the kernel status as int.
 java.lang.String getLogMessage(java.lang.String key)
          Returns the log message for the given key in the set system locale.
 java.lang.String getMainControllerUrl()
          Returns the controller URL setting of the local jwma installation.
 net.wimpi.text.Processor getMessageProcessor(java.lang.String name)
          Returns the message processor indicated by the given name.
 PreferencesPersistencePlugin getPrefsPersistencePlugin()
          Returns the active and activated PreferencesPersistencePlugin instance that provides the persistency related functionality.
 RandomAppendPlugin getRandomAppendPlugin()
          Returns the active and activated RandomAppendPlugin instance that provides random appending functionality.
static JwmaKernel getReference()
          Returns the reference of the JwmaKernel singleton instance.
 java.lang.ClassLoader getResourceClassLoader()
          Returns the class loader for i18n resource bundles.
 java.lang.String getSendMailControllerUrl()
          Returns the sendmail controller URL setting of the local jwma installation.
 java.lang.String getViewUrl(java.lang.String view)
          Returns the site's configured view URL for the given view as String.
 boolean isJwmaStatusEnabled()
          Tests if status is enabled.
 java.lang.String[] listDirectories()
          Lists the directories jwma needs to access.
 java.lang.String[] listFiles()
          Lists the files jwma needs to access.
 java.lang.String[] listMessageProcessors()
           
 void setJwmaStatusEnabled(boolean enabled)
          Sets the flag that controls if the system's status is enabled.
 void setup(java.lang.String path)
          Prepares the kernel for service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGIN_VIEW

public static final java.lang.String LOGIN_VIEW
Defines the abstract login view.

See Also:
Constant Field Values

ERROR_VIEW

public static final java.lang.String ERROR_VIEW
Defines the abstract error view.

See Also:
Constant Field Values

LOGOUT_VIEW

public static final java.lang.String LOGOUT_VIEW
Defines the abstract loggedout view.

See Also:
Constant Field Values

SUBSCRIBED_VIEW

public static final java.lang.String SUBSCRIBED_VIEW
Defines the abstract subscribe view.

See Also:
Constant Field Values

UNSUBSCRIBED_VIEW

public static final java.lang.String UNSUBSCRIBED_VIEW
Defines the abstract unsubscribe view.

See Also:
Constant Field Values

FOLDER_VIEW

public static final java.lang.String FOLDER_VIEW
Defines the abstract folder view.

See Also:
Constant Field Values

MAILBOX_VIEW

public static final java.lang.String MAILBOX_VIEW
Defines the abstract mailbox view.

See Also:
Constant Field Values

MESSAGE_VIEW

public static final java.lang.String MESSAGE_VIEW
Defines the abstract message view.

See Also:
Constant Field Values

COMPOSE_VIEW

public static final java.lang.String COMPOSE_VIEW
Defines the abstract compose view.

See Also:
Constant Field Values

PREFERENCES_VIEW

public static final java.lang.String PREFERENCES_VIEW
Defines the abstract preferences view.

See Also:
Constant Field Values

FIRSTTIME_VIEW

public static final java.lang.String FIRSTTIME_VIEW
Defines the abstract error firsttime view.

See Also:
Constant Field Values

CONTACTS_VIEW

public static final java.lang.String CONTACTS_VIEW
Defines the abstract contacts view.

See Also:
Constant Field Values

CONTACT_VIEW

public static final java.lang.String CONTACT_VIEW
Defines the abstract contact view.

See Also:
Constant Field Values

CONTACT_EDIT_VIEW

public static final java.lang.String CONTACT_EDIT_VIEW
Defines the abstract contact edit view.

See Also:
Constant Field Values

CONTACTGROUP_VIEW

public static final java.lang.String CONTACTGROUP_VIEW
Defines the abstract contact group view.

See Also:
Constant Field Values

CONTACTGROUP_EDIT_VIEW

public static final java.lang.String CONTACTGROUP_EDIT_VIEW
Defines the abstract contact group edit view.

See Also:
Constant Field Values

ADMIN_STATUS_VIEW

public static final java.lang.String ADMIN_STATUS_VIEW
Defines the abstract admin status view.

See Also:
Constant Field Values

ADMIN_PREFERENCES_VIEW

public static final java.lang.String ADMIN_PREFERENCES_VIEW
Defines the abstract admin preferences view.

See Also:
Constant Field Values

ADMIN_SETTINGS_VIEW

public static final java.lang.String ADMIN_SETTINGS_VIEW
Defines the abstract admin settings view.

See Also:
Constant Field Values

ADMIN_LOGIN_VIEW

public static final java.lang.String ADMIN_LOGIN_VIEW
Defines the abstract admin login view.

See Also:
Constant Field Values

ADMIN_MENU_VIEW

public static final java.lang.String ADMIN_MENU_VIEW
Defines the abstract admin menu view.

See Also:
Constant Field Values

ADMIN_ERROR_VIEW

public static final java.lang.String ADMIN_ERROR_VIEW
Defines the abstract admin error view.

See Also:
Constant Field Values

ACCOUNT_CREATION_VIEW

public static final java.lang.String ACCOUNT_CREATION_VIEW
Defines the abstract account creation view.

See Also:
Constant Field Values

ROOT_DIR

public static final int ROOT_DIR
Defines the root directory.

See Also:
Constant Field Values

ETC_DIR

public static final int ETC_DIR
Defines the root directory.

See Also:
Constant Field Values

LOG_DIR

public static final int LOG_DIR
Defines the root directory.

See Also:
Constant Field Values

DATA_DIR

public static final int DATA_DIR
Defines the data directory.

See Also:
Constant Field Values
Method Detail

setup

public void setup(java.lang.String path)
           throws java.lang.Exception
Prepares the kernel for service.

Parameters:
path - representing the root directory where jwma's files reside, as String.
Throws:
java.lang.Exception - when it fails to load the properties or set up system functionality according to the settings in the properties.

getConfiguration

public JwmaConfiguration getConfiguration()
Returns the active JwmaConfiguration instance.

Returns:
a JwmaConfiguration instance.

getMainControllerUrl

public java.lang.String getMainControllerUrl()
Returns the controller URL setting of the local jwma installation.

Returns:
local controller's URL as String.

getSendMailControllerUrl

public java.lang.String getSendMailControllerUrl()
Returns the sendmail controller URL setting of the local jwma installation.

Returns:
local sendmail controller's URL as String.

getAdminControllerUrl

public java.lang.String getAdminControllerUrl()
Returns the admin controller URL setting of the local jwma installation.

Returns:
local admin controller's URL as String.

getContactsControllerUrl

public java.lang.String getContactsControllerUrl()
Returns the contacts controller URL setting of the local jwma installation.

Returns:
local contacts controller's URL as String.

getViewUrl

public java.lang.String getViewUrl(java.lang.String view)
Returns the site's configured view URL for the given view as String.

The String parameter passed in has to be one of the defined abstract view constants.

Parameters:
view - representing one of the constants defining an abstract view.
Returns:
local configured view URL of a given abstract view as String.
See Also:
LOGIN_VIEW, ERROR_VIEW, LOGOUT_VIEW, FOLDER_VIEW, MESSAGE_VIEW, PREFERENCES_VIEW, COMPOSE_VIEW, FIRSTTIME_VIEW, CONTACTS_VIEW, CONTACT_VIEW, CONTACT_EDIT_VIEW, CONTACTGROUP_VIEW, CONTACTGROUP_EDIT_VIEW

getPrefsPersistencePlugin

public PreferencesPersistencePlugin getPrefsPersistencePlugin()
Returns the active and activated PreferencesPersistencePlugin instance that provides the persistency related functionality.

See Also:
PreferencesPersistencePlugin

getRandomAppendPlugin

public RandomAppendPlugin getRandomAppendPlugin()
Returns the active and activated RandomAppendPlugin instance that provides random appending functionality. This method returns null if no such plugin is registered.

See Also:
RandomAppendPlugin

getContactManagementPlugin

public ContactManagementPlugin getContactManagementPlugin()
Returns the active and activated ContactManagementPlugin instance that provides contact management related functionality.

See Also:
ContactManagementPlugin

getResourceClassLoader

public java.lang.ClassLoader getResourceClassLoader()
Returns the class loader for i18n resource bundles.

Returns:
the ClassLoader used for loading i18n ResourceBundles.

getErrorMessage

public java.lang.String getErrorMessage(java.lang.String key)
Returns the error message for the given key in the set system locale.

Returns:
the error message as localized String.

getLogMessage

public java.lang.String getLogMessage(java.lang.String key)
Returns the log message for the given key in the set system locale.

Returns:
the log message as localized String.

isJwmaStatusEnabled

public boolean isJwmaStatusEnabled()
Tests if status is enabled.

Returns:
true if status is enabled, false otherwise.

setJwmaStatusEnabled

public void setJwmaStatusEnabled(boolean enabled)
Sets the flag that controls if the system's status is enabled.


getKernelStatus

public int getKernelStatus()
Returns the kernel status as int.
  1. Directories set
  2. Settings loaded
  3. Logs prepared
  4. Loaded error messages
  5. prepared preferences persistency
  6. prepared text processing
  7. prepared mail services
  8. prepared view urls

Returns:
kernel status as int.

listDirectories

public java.lang.String[] listDirectories()
Lists the directories jwma needs to access.

Returns:
array of strings representing the directories.

getDirectoryPath

public java.lang.String getDirectoryPath(int DIRECTORY)
Returns the path of the given directory.


listFiles

public java.lang.String[] listFiles()
Lists the files jwma needs to access.

Returns:
array of strings representing the files.

getMessageProcessor

public net.wimpi.text.Processor getMessageProcessor(java.lang.String name)
Returns the message processor indicated by the given name. If the name does not refer to any processing pipe, then the default processing pipe will be returned.

Parameters:
name - String that should represent a valid processing pipe name.
Returns:
Processor to be used for message processing.

listMessageProcessors

public java.lang.String[] listMessageProcessors()

getReference

public static JwmaKernel getReference()
Returns the reference of the JwmaKernel singleton instance.

Note:this also implements kind of a factory method pattern. If the singleton instance does not exist yet, it will be created.

Returns:
reference of the JwmaKernel singleton instance.

Jwma

Copyright © 2000-2003 jwma team (All Rights Reserved.)