|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--dtw.webmail.plugin.std.CastorXMLPreferencesPersistence
A PreferencesPersistancePlugin implementation based on Castor XML marshalling/unmarshalling.
Stores the preferences as XML files.
| Constructor Summary | |
CastorXMLPreferencesPersistence()
|
|
| 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 CastorXMLPreferencesPersistence()
| Method Detail |
public JwmaPreferencesImpl loadPreferences(java.lang.String identity)
throws JwmaException
PreferencesPersistencePluginIf preferences for the given user do not exist on the store, the method returns null.
loadPreferences in interface PreferencesPersistencePluginidentity - 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 PreferencesPersistencePluginprefs - 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 PreferencesPersistencePluginidentity - 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 PreferencesPersistencePluginsession - the actual JwmaSession instance.
JwmaPreferencesImpl
public void activate()
throws JwmaException
JwmaPluginThis 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 JwmaPluginJwmaException - if initialization failed.public void deactivate()
JwmaPluginThis 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
PreferencesPersistencePluginThe caller assumes that the plugin handles the persistence of the passed in template instance.
setPreferencesTemplate in interface PreferencesPersistencePlugintemplate - 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 | |||||||||