|
Eclipse Remote Application Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.rap.rwt.service.FileSettingStore
public final class FileSettingStore
A setting store implementation that persists all settings on the file system using Java
Properties
files.
Field Summary | |
---|---|
static java.lang.String |
FILE_SETTING_STORE_DIR
This key (value "org.eclipse.rap.rwt.service.FileSettingStore.dir") can be used to configure the working directory for file settings stores. |
Constructor Summary | |
---|---|
FileSettingStore(java.io.File baseDirectory)
Creates an empty instance with a random unique ID. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_SETTING_STORE_DIR
FileSettingStoreFactory
.
Constructor Detail |
---|
public FileSettingStore(java.io.File baseDirectory)
loadById(String)
to initialize
an existing store with previously persisted attributes.
baseDirectory
- an existing directory to persist this store's settings in
java.lang.IllegalArgumentException
- if the given workDir
is not a directoryloadById(String)
Method Detail |
---|
public java.lang.String getId()
SettingStore
getId
in interface ISettingStore
getId
in interface SettingStore
null
public java.lang.String getAttribute(java.lang.String name)
SettingStore
getAttribute
in interface ISettingStore
getAttribute
in interface SettingStore
name
- a non-null String specifying the name of the attribute
null
if no attribute is
stored under that namepublic void setAttribute(java.lang.String name, java.lang.String value) throws java.io.IOException
SettingStore
If the value is null
, this has the same effect as calling
SettingStore.removeAttribute(String)
.
SettingStoreListener
s attached to this instance will be notified after an attribute has
been stored.
setAttribute
in interface ISettingStore
setAttribute
in interface SettingStore
name
- 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 normallypublic java.util.Enumeration<java.lang.String> getAttributeNames()
SettingStore
Enumeration
of strings with the names of all attributes in this setting
store.
getAttributeNames
in interface ISettingStore
getAttributeNames
in interface SettingStore
null
public void loadById(java.lang.String id) throws java.io.IOException
SettingStore
The attributes of this setting store will remain associated with the old id, but will be
removed from this store instance. SettingStoreListener
s 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. SettingStoreListener
s 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 ISettingStore
loadById
in interface SettingStore
id
- the ID of the settings to load, must not be null
or empty
java.io.IOException
- if the load operation failed to complete normallypublic void removeAttribute(java.lang.String name) throws java.io.IOException
SettingStore
SettingStoreListener
s attached to this instance will be notified after an attribute has
been removed.
removeAttribute
in interface ISettingStore
removeAttribute
in interface SettingStore
name
- the name of the attribute to remove, must not be null
java.io.IOException
- if the remove operation failed to complete normallypublic void addSettingStoreListener(SettingStoreListener listener)
SettingStore
addSettingStoreListener
in interface ISettingStore
addSettingStoreListener
in interface SettingStore
listener
- the listener to add, must not be null
public void removeSettingStoreListener(SettingStoreListener listener)
SettingStore
removeSettingStoreListener
in interface ISettingStore
removeSettingStoreListener
in interface SettingStore
listener
- 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, 2012. All rights reserved.