public interface ConfigStorage
Modifier and Type | Method and Description |
---|---|
void |
commit()
Tells the storage to asynchronously save its
data to the underlying resource location.
|
void |
commitNow() |
java.lang.Object |
getValue(java.lang.String path)
Returns the object currently being stored
for the given path.
|
boolean |
hasUnsavedChanges() |
void |
setRegistry(ConfigRegistry registry)
Sets the
ConfigRegistry for this
storage. |
void |
setValue(java.lang.String path,
java.lang.Object value)
Stores the new value for the given path.
|
void |
update()
Tells the storage to asynchronously reload its
data from whatever source it is linked with.
|
void |
updateNow()
Loads data synchronously from the underlying data storage.
|
void setRegistry(ConfigRegistry registry)
ConfigRegistry
for this
storage.The registry should only be used for callback reasons when data in the storage has been updated and entries in the registry have to be synchronized.
registry
- java.lang.Object getValue(java.lang.String path)
Note that a storage is not meant to hold
every data within a ConfigRegistry
and
may therefore return null
for a lot
of paths.
Often only values that differ from the default values
are forwarded to a storage instance.
path
- void setValue(java.lang.String path, java.lang.Object value)
The actual further reaction to this call is implementation dependent. Some storages will mirror every change instantly to the underlying storage back-end, others will delay such saving or even omit it totally and rely on user side decisions.
path
- value
- void update()
void updateNow()
void commit()
void commitNow()
boolean hasUnsavedChanges()