Package org.apache.felix.prefs
Interface BackingStore
- All Known Implementing Classes:
DataFileBackingStoreImpl,StreamBackingStoreImpl
public interface BackingStore
The BackingStore for the preferences.
This interface allows for different implementation strategies.
-
Method Summary
Modifier and TypeMethodDescriptionLong[]Return all bundle ids for which preferences are stored..load(BackingStoreManager manager, PreferencesDescription desc) Load the preferences for the given description.loadAll(BackingStoreManager manager, Long bundleId) Load all preferences for this bundle.voidRemove all preferences stored for this bundle.voidstore(PreferencesImpl prefs) Store the current preferences and its children in the backing store.voidupdate(PreferencesImpl prefs) Update the current preferences and its children from the backing store.
-
Method Details
-
store
Store the current preferences and its children in the backing store. The store should check, if the preferences have changed, it should also check all children.- Parameters:
prefs- The preferences.- Throws:
org.osgi.service.prefs.BackingStoreException
-
update
Update the current preferences and its children from the backing store.- Throws:
org.osgi.service.prefs.BackingStoreException
-
availableBundles
Long[] availableBundles()Return all bundle ids for which preferences are stored..- Returns:
- Return an array of bundle ids or an empty array.
-
remove
Remove all preferences stored for this bundle.- Parameters:
bundleId- The bundle id.- Throws:
org.osgi.service.prefs.BackingStoreException
-
load
PreferencesImpl load(BackingStoreManager manager, PreferencesDescription desc) throws org.osgi.service.prefs.BackingStoreException Load the preferences for the given description.- Parameters:
manager- The backing store manager which should be passed to new preferences implementations.desc-- Returns:
- A new preferences object or null if it's not available in the backing store.
- Throws:
org.osgi.service.prefs.BackingStoreException
-
loadAll
PreferencesImpl[] loadAll(BackingStoreManager manager, Long bundleId) throws org.osgi.service.prefs.BackingStoreException Load all preferences for this bundle.- Parameters:
manager- The backing store manager which should be passed to new preferences implementations.bundleId- The bundle id.- Returns:
- An array with the preferences or an empty array.
- Throws:
org.osgi.service.prefs.BackingStoreException
-