Jwma

dtw.webmail.plugin
Interface PreferencesPersistencePlugin

All Superinterfaces:
JwmaPlugin
All Known Implementing Classes:
CastorSQLPreferencesPersistence, CastorXMLPreferencesPersistence

public interface PreferencesPersistencePlugin
extends JwmaPlugin

Interface for a plugin that handles persistency of user preferences.

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

Method Summary
 JwmaPreferencesImpl getPreferencesTemplate(JwmaSession session)
          Returns a copy of the template JwmaPreferencesImpl instance.
 boolean isPersistent(java.lang.String identity)
          Tests if preferences for the given user exist on the store.
 JwmaPreferencesImpl loadPreferences(java.lang.String identity)
          Loads the given user's preferences from the persistent store and returns them as a JwmaPreferencesImpl instance.
 void savePreferences(JwmaPreferencesImpl prefs)
          Saves the given preferences to the persistent store.
 void setPreferencesTemplate(JwmaPreferencesImpl template)
          Sets the template JwmaPreferencesImpl instance.
 
Methods inherited from interface dtw.webmail.plugin.JwmaPlugin
activate, deactivate
 

Method Detail

loadPreferences

public JwmaPreferencesImpl loadPreferences(java.lang.String identity)
                                    throws JwmaException
Loads the given user's preferences from the persistent store and returns them as a JwmaPreferencesImpl instance.

If preferences for the given user do not exist on the store, the method returns null.

Parameters:
identity - a String representing the user (in a unique way).
Returns:
the JwmaPreferencesImpl instance.
Throws:
JwmaException - if an I/O error occurs.
See Also:
JwmaPreferencesImpl, JwmaPreferences.getUserIdentity()

savePreferences

public void savePreferences(JwmaPreferencesImpl prefs)
                     throws JwmaException
Saves the given preferences to the persistent store.

If the preferences do not exist on the store, the method should create them, otherwise update the existing version.
The identity is retrieved using the getUserIdentity() method of the given JwmaPreferencesImpl instance.

Parameters:
prefs - the JwmaPreferencesImpl instance to saved.
Throws:
JwmaException - if an I/O error occurs.
See Also:
JwmaPreferencesImpl, JwmaPreferences.getUserIdentity()

isPersistent

public boolean isPersistent(java.lang.String identity)
                     throws JwmaException
Tests if preferences for the given user exist on the store.

Parameters:
identity - a String representing the user (in a unique way).
Throws:
JwmaException - if an I/O error occurs.
See Also:
JwmaPreferences.getUserIdentity()

getPreferencesTemplate

public JwmaPreferencesImpl getPreferencesTemplate(JwmaSession session)
Returns a copy of the template JwmaPreferencesImpl instance.

Parameters:
session - the actual JwmaSession instance.
Returns:
the template JwmaPreferencesImpl instance.
See Also:
JwmaPreferencesImpl

setPreferencesTemplate

public void setPreferencesTemplate(JwmaPreferencesImpl template)
                            throws JwmaException
Sets the template JwmaPreferencesImpl instance.

The caller assumes that the plugin handles the persistence of the passed in template instance.

Parameters:
template - JwmaPreferencesImpl instance.
Throws:
JwmaException - if an I/O error occurs.
See Also:
JwmaPreferencesImpl

Jwma

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