Package org.openhab.core.automation
Class ManagedRuleProvider
java.lang.Object
org.openhab.core.common.registry.AbstractProvider<E>
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
logger
Fields inherited from class org.openhab.core.common.registry.AbstractProvider
listeners
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns the name of storage, that is used to persist the elements.protected String
keyToString
(String key) Transforms the key into a string representation.protected @Nullable Rule
Converts the persistable element into the original element.protected RuleDTO
toPersistableElement
(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, update
Methods inherited from class org.openhab.core.common.registry.AbstractProvider
addProviderChangeListener, notifyListenersAboutAddedElement, notifyListenersAboutRemovedElement, notifyListenersAboutUpdatedElement, removeProviderChangeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openhab.core.common.registry.Provider
addProviderChangeListener, getAll, removeProviderChangeListener
-
Constructor Details
-
ManagedRuleProvider
-
-
Method Details
-
getStorageName
Description copied from class:AbstractManagedProvider
Returns the name of storage, that is used to persist the elements.- Specified by:
getStorageName
in classAbstractManagedProvider<Rule,
String, RuleDTO> - Returns:
- name of the storage
-
keyToString
Description copied from class:AbstractManagedProvider
Transforms the key into a string representation.- Specified by:
keyToString
in classAbstractManagedProvider<Rule,
String, RuleDTO> - Parameters:
key
- key- Returns:
- string representation of the key
-
toElement
Description copied from class:AbstractManagedProvider
Converts the persistable element into the original element.- Specified by:
toElement
in classAbstractManagedProvider<Rule,
String, RuleDTO> - Parameters:
key
- keypersistableElement
- persistable element- Returns:
- original element
-
toPersistableElement
Description copied from class:AbstractManagedProvider
Converts the original element into an element that can be persisted.- Specified by:
toPersistableElement
in classAbstractManagedProvider<Rule,
String, RuleDTO> - Parameters:
element
- original element- Returns:
- persistable element
-