Package ch.tocco.nice2.usersettings.impl
Class PreferencesStoreImpl
java.lang.Object
ch.tocco.nice2.usersettings.impl.PreferencesStoreImpl
- All Implemented Interfaces:
PreferencesStore
-
Constructor Summary
ConstructorDescriptionPreferencesStoreImpl
(QueryBuilderFactory queryBuilderFactory, Context context, PrincipalService principalService, BusinessUnitManager businessUnitManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteKeys
(Node node, Set<String> keys, @Nullable Principal principal) Removes all settings of the given keys from the given node.void
deleteNode
(Node node, boolean subNodes, @Nullable Principal principal) Deletes all preferences entries for the given node using the given or current principal and current business unit.void
deleteValue
(Node node, String key, String value) Removes all settings of the given key value combination from the given node regardless of the principalloadPreferences
(Node node, @Nullable Principal principal) Loads the preferences map from the store for the given node.loadValues
(Node node, Iterable<String> keys, @Nullable Principal principal) Loads a single values from the given or current users settings associated to the current buseiness unit.void
savePreferences
(Node node, @Nullable Principal principal, Map<String, String> values, Set<String> removeKeys) Persists the new values for the given node.
-
Constructor Details
-
PreferencesStoreImpl
public PreferencesStoreImpl(@Lazy QueryBuilderFactory queryBuilderFactory, Context context, @Lazy PrincipalService principalService, @Lazy BusinessUnitManager businessUnitManager)
-
-
Method Details
-
savePreferences
public void savePreferences(Node node, @Nullable @Nullable Principal principal, Map<String, String> values, Set<String> removeKeys) Description copied from interface:PreferencesStore
Persists the new values for the given node. The keys in the set removeKeys get removed from the store. It is assumed that no key in the removeKeys set has a mapping in the new values map. The keyset of the map and the removedKeys are always considered disjoint.- Specified by:
savePreferences
in interfacePreferencesStore
-
loadPreferences
Description copied from interface:PreferencesStore
Loads the preferences map from the store for the given node.- Specified by:
loadPreferences
in interfacePreferencesStore
-
loadValues
public Map<String,String> loadValues(Node node, Iterable<String> keys, @Nullable @Nullable Principal principal) Description copied from interface:PreferencesStore
Loads a single values from the given or current users settings associated to the current buseiness unit.- Specified by:
loadValues
in interfacePreferencesStore
-
deleteNode
Description copied from interface:PreferencesStore
Deletes all preferences entries for the given node using the given or current principal and current business unit.- Specified by:
deleteNode
in interfacePreferencesStore
- Parameters:
subNodes
- also delete sub nodes
-
deleteKeys
Description copied from interface:PreferencesStore
Removes all settings of the given keys from the given node. Only settings for the current principal and current business unit are considered.- Specified by:
deleteKeys
in interfacePreferencesStore
-
deleteValue
Description copied from interface:PreferencesStore
Removes all settings of the given key value combination from the given node regardless of the principal- Specified by:
deleteValue
in interfacePreferencesStore
-