|
Eclipse Remote Application Platform | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SettingStore
A setting store is a persistent store for user-specific settings (i.e. key/value pairs). The data in this store is kept beyond the scope of a single session.
A setting store instance is always associated with the current user session. Any settings being
put into the store (via setAttribute(String, String)) are considered persisted from that
point on.
To retrieve data stored in a previous session, a client can invoke the method
loadById(String) with the ID of the session to load into the store. This will load any
data stored under that id into the current setting store.
The framework will assign a new setting store to each new UI session, based on the current
session id. After the user has authenticated, application developers can use the
loadById(String) method to initialize the store with persisted data stored under that id
during a previous session. Obviously, any data that is set into the store from that point on,
will also be persisted under the current id and will also be available in the future.
Custom setting store implementations are supported, those must provide a corresponding
SettingStoreFactory.
FileSettingStore| Method Summary | |
|---|---|
void |
addSettingStoreListener(SettingStoreListener listener)
Attaches the given listener to this setting store. |
java.lang.String |
getAttribute(java.lang.String name)
Returns the attribute stored under the specified name in this setting store. |
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Returns an Enumeration of strings with the names of all attributes in this setting
store. |
java.lang.String |
getId()
Returns the unique identifier of this setting store. |
void |
loadById(java.lang.String id)
Replaces the contents of this setting store with the persisted contents associated with the given ID. |
void |
removeAttribute(java.lang.String name)
Removes the attribute stored under the specified name from this setting store. |
void |
removeSettingStoreListener(SettingStoreListener listener)
Removes the given listener from this setting store. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Stores a given attribute in this setting store, using the name specified. |
| Method Detail |
|---|
java.lang.String getAttribute(java.lang.String name)
getAttribute in interface ISettingStorename - a non-null String specifying the name of the attribute
null if no attribute is
stored under that namejava.util.Enumeration<java.lang.String> getAttributeNames()
Enumeration of strings with the names of all attributes in this setting
store.
getAttributeNames in interface ISettingStorenull
void setAttribute(java.lang.String name,
java.lang.String value)
throws java.io.IOException
If the value is null, this has the same effect as calling
removeAttribute(String).
SettingStoreListeners attached to this instance will be notified after an attribute has
been stored.
setAttribute in interface ISettingStorename - the name of the attribute, must not be null or emptyvalue - the attribute to store, may be null
java.io.IOException - if the load operation failed to complete normally
void removeAttribute(java.lang.String name)
throws java.io.IOException
SettingStoreListeners attached to this instance will be notified after an attribute has
been removed.
removeAttribute in interface ISettingStorename - the name of the attribute to remove, must not be null
java.io.IOException - if the remove operation failed to complete normally
void loadById(java.lang.String id)
throws java.io.IOException
The attributes of this setting store will remain associated with the old id, but will be
removed from this store instance. SettingStoreListeners attached to this store
will receive a notification for each removed attribute.
During the load operation this store will be filled with the attributes associated with the new
ID. SettingStoreListeners attached to this store will receive a notification for each
added attribute.
After the load operation this store will only hold attributes associated with the new id value.
loadById in interface ISettingStoreid - the ID of the settings to load, must not be null or empty
java.io.IOException - if the load operation failed to complete normally
java.lang.IllegalArgumentException - if the given id is emptyjava.lang.String getId()
getId in interface ISettingStorenullvoid addSettingStoreListener(SettingStoreListener listener)
addSettingStoreListener in interface ISettingStorelistener - the listener to add, must not be nullvoid removeSettingStoreListener(SettingStoreListener listener)
removeSettingStoreListener in interface ISettingStorelistener - the listener to remove, must not be null
|
Eclipse Remote Application Platform | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright (c) EclipseSource and others 2002, 2013. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0