|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dtw.webmail.plugin.std.CastorSQLPreferencesPersistence
A PreferencesPersistancePlugin implementation based on Castor JDO.
Stores the preferences in a database.
Constructor Summary | |
CastorSQLPreferencesPersistence()
|
Method Summary | |
void |
activate()
Activates the plugin for subsequent use. |
void |
deactivate()
Deactivates the plugin. |
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 class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CastorSQLPreferencesPersistence()
Method Detail |
public JwmaPreferencesImpl loadPreferences(java.lang.String identity) throws JwmaException
PreferencesPersistencePlugin
If preferences for the given user do not exist on the store, the method returns null.
loadPreferences
in interface PreferencesPersistencePlugin
identity
- a String representing the user
(in a unique way).
JwmaException
- if an I/O error occurs.JwmaPreferencesImpl
,
JwmaPreferences.getUserIdentity()
public void savePreferences(JwmaPreferencesImpl prefs) throws JwmaException
PreferencesPersistencePlugin
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.
savePreferences
in interface PreferencesPersistencePlugin
prefs
- the JwmaPreferencesImpl instance to
saved.
JwmaException
- if an I/O error occurs.JwmaPreferencesImpl
,
JwmaPreferences.getUserIdentity()
public boolean isPersistent(java.lang.String identity) throws JwmaException
PreferencesPersistencePlugin
isPersistent
in interface PreferencesPersistencePlugin
identity
- a String representing the user
(in a unique way).
JwmaException
- if an I/O error occurs.JwmaPreferences.getUserIdentity()
public JwmaPreferencesImpl getPreferencesTemplate(JwmaSession session)
PreferencesPersistencePlugin
getPreferencesTemplate
in interface PreferencesPersistencePlugin
session
- the actual JwmaSession instance.
JwmaPreferencesImpl
public void activate() throws JwmaException
JwmaPlugin
This method is called during bootstrap to allow an implementation to initialize properly. If the plugin cannot perform it's task, it has to throw a JwmaException.
activate
in interface JwmaPlugin
JwmaException
- if initialization failed.public void deactivate()
JwmaPlugin
This method is called during shutdown or probably on dynamic implementation exchange, to allow an implementation to finalize properly.
deactivate
in interface JwmaPlugin
public void setPreferencesTemplate(JwmaPreferencesImpl template) throws JwmaException
PreferencesPersistencePlugin
The caller assumes that the plugin handles the persistence of the passed in template instance.
setPreferencesTemplate
in interface PreferencesPersistencePlugin
template
- JwmaPreferencesImpl instance.
JwmaException
- if an I/O error occurs.JwmaPreferencesImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |