Package org.openhab.core.automation
Class ManagedRuleProvider
java.lang.Object
org.openhab.core.common.registry.AbstractProvider<Rule>
org.openhab.core.common.registry.AbstractManagedProvider<Rule,String,RuleDTO>
org.openhab.core.automation.ManagedRuleProvider
- All Implemented Interfaces:
RuleProvider,ManagedProvider<Rule,,String> Provider<Rule>
@NonNullByDefault
public class ManagedRuleProvider
extends AbstractManagedProvider<Rule,String,RuleDTO>
implements RuleProvider
Implementation of a rule provider that uses the storage service for persistence
- Author:
- Yordan Mihaylov - Initial contribution, Ana Dimova - Persistence implementation, Kai Kreuzer - refactored (managed) provider and registry implementation, Markus Rathgeb - fix mapping between element and persistable element
-
Field Summary
Fields inherited from class org.openhab.core.common.registry.AbstractManagedProvider
loggerFields inherited from class org.openhab.core.common.registry.AbstractProvider
listeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the name of storage, that is used to persist the elements.protected StringkeyToString(String key) Transforms the key into a string representation.protected @Nullable RuleConverts the persistable element into the original element.protected RuleDTOtoPersistableElement(Rule element) Converts the original element into an element that can be persisted.Methods inherited from class org.openhab.core.common.registry.AbstractManagedProvider
add, get, getAll, remove, updateMethods inherited from class org.openhab.core.common.registry.AbstractProvider
addProviderChangeListener, notifyListenersAboutAddedElement, notifyListenersAboutRemovedElement, notifyListenersAboutUpdatedElement, removeProviderChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openhab.core.common.registry.Provider
addProviderChangeListener, getAll, removeProviderChangeListener
-
Constructor Details
-
ManagedRuleProvider
-
-
Method Details
-
getStorageName
Description copied from class:AbstractManagedProviderReturns the name of storage, that is used to persist the elements.- Specified by:
getStorageNamein classAbstractManagedProvider<Rule,String, RuleDTO> - Returns:
- name of the storage
-
keyToString
Description copied from class:AbstractManagedProviderTransforms the key into a string representation.- Specified by:
keyToStringin classAbstractManagedProvider<Rule,String, RuleDTO> - Parameters:
key- key- Returns:
- string representation of the key
-
toElement
Description copied from class:AbstractManagedProviderConverts the persistable element into the original element.- Specified by:
toElementin classAbstractManagedProvider<Rule,String, RuleDTO> - Parameters:
key- keypersistableElement- persistable element- Returns:
- original element
-
toPersistableElement
Description copied from class:AbstractManagedProviderConverts the original element into an element that can be persisted.- Specified by:
toPersistableElementin classAbstractManagedProvider<Rule,String, RuleDTO> - Parameters:
element- original element- Returns:
- persistable element
-