Package step.core.controller
Class ControllerSettingAccessorImpl
java.lang.Object
step.core.accessors.AbstractAccessor<ControllerSetting>
step.core.controller.ControllerSettingAccessorImpl
- All Implemented Interfaces:
step.core.accessors.Accessor<ControllerSetting>
,ControllerSettingAccessor
- Direct Known Subclasses:
InMemoryControllerSettingAccessor
public class ControllerSettingAccessorImpl
extends step.core.accessors.AbstractAccessor<ControllerSetting>
implements ControllerSettingAccessor
-
Field Summary
Fields inherited from class step.core.accessors.AbstractAccessor
collectionDriver, newVersionThresholdMs, versionedCollectionDriver
-
Constructor Summary
ConstructorDescriptionControllerSettingAccessorImpl
(step.core.collections.Collection<ControllerSetting> collectionDriver) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHook
(String key, ControllerSettingHook hook) protected void
callHookOnSettingRemove
(ControllerSetting deletedSetting, ControllerSettingHook hook, boolean ignoreError) protected void
callHookOnSettingSave
(ControllerSetting res, ControllerSettingHook hook, boolean ignoreError) protected void
callHooksForChangedKey
(ControllerSetting oldValueWithChangedKey) Calls the onSettingRemove hooks when key is changed in some controller setting (the value with old key is handled as removed)createSettingIfNotExisting
(String key, String value) protected List<ControllerSettingHook>
getHooksBySettingKey
(String settingKey) protected Map<String,
List<ControllerSettingHook>> boolean
getSettingByKey
(String key) void
remove
(org.bson.types.ObjectId id) boolean
removeHook
(String key, ControllerSettingHook hook) protected void
rollbackOldValue
(org.bson.types.ObjectId settingId, ControllerSetting oldValue, Exception ex) void
save
(Iterable<ControllerSetting> entities) save
(ControllerSetting entity) updateOrCreateSetting
(String key, String value) Methods inherited from class step.core.accessors.AbstractAccessor
createOrUpdateCompoundIndex, createOrUpdateIndex, enableVersioning, findByAttributes, findByAttributes, findByCriteria, findManyByAttributes, findManyByAttributes, findManyByCriteria, get, get, getAll, getCollectionDriver, getHistory, getRange, isVersioningEnabled, restoreVersion, stream, streamLazy
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface step.core.accessors.Accessor
enableVersioning, findByAttributes, findByAttributes, findByCriteria, findManyByAttributes, findManyByAttributes, findManyByCriteria, get, get, getAll, getCollectionDriver, getHistory, getRange, isVersioningEnabled, restoreVersion, stream, streamLazy
-
Constructor Details
-
ControllerSettingAccessorImpl
public ControllerSettingAccessorImpl(step.core.collections.Collection<ControllerSetting> collectionDriver)
-
-
Method Details
-
getSettingByKey
- Specified by:
getSettingByKey
in interfaceControllerSettingAccessor
-
addHook
- Specified by:
addHook
in interfaceControllerSettingAccessor
-
removeHook
- Specified by:
removeHook
in interfaceControllerSettingAccessor
-
save
- Specified by:
save
in interfacestep.core.accessors.Accessor<ControllerSetting>
- Specified by:
save
in interfaceControllerSettingAccessor
- Overrides:
save
in classstep.core.accessors.AbstractAccessor<ControllerSetting>
-
save
- Specified by:
save
in interfacestep.core.accessors.Accessor<ControllerSetting>
- Overrides:
save
in classstep.core.accessors.AbstractAccessor<ControllerSetting>
-
remove
public void remove(org.bson.types.ObjectId id) - Specified by:
remove
in interfacestep.core.accessors.Accessor<ControllerSetting>
- Overrides:
remove
in classstep.core.accessors.AbstractAccessor<ControllerSetting>
-
rollbackOldValue
protected void rollbackOldValue(org.bson.types.ObjectId settingId, ControllerSetting oldValue, Exception ex) -
callHooksForChangedKey
Calls the onSettingRemove hooks when key is changed in some controller setting (the value with old key is handled as removed) -
callHookOnSettingRemove
protected void callHookOnSettingRemove(ControllerSetting deletedSetting, ControllerSettingHook hook, boolean ignoreError) -
callHookOnSettingSave
protected void callHookOnSettingSave(ControllerSetting res, ControllerSettingHook hook, boolean ignoreError) -
getHooksBySettingKey
-
getHooksMap
-
updateOrCreateSetting
- Specified by:
updateOrCreateSetting
in interfaceControllerSettingAccessor
-
createSettingIfNotExisting
- Specified by:
createSettingIfNotExisting
in interfaceControllerSettingAccessor
-
getSettingAsBoolean
- Specified by:
getSettingAsBoolean
in interfaceControllerSettingAccessor
-