Class ScriptedRuleProvider
java.lang.Object
org.openhab.core.common.registry.AbstractProvider<Rule>
org.openhab.core.automation.module.script.rulesupport.shared.ScriptedRuleProvider
- All Implemented Interfaces:
RuleProvider
,ManagedProvider<Rule,
,String> Provider<Rule>
@NonNullByDefault
public class ScriptedRuleProvider
extends AbstractProvider<Rule>
implements RuleProvider, ManagedProvider<Rule,String>
This RuleProvider keeps Rules added by scripts during runtime. This ensures that Rules are not kept on reboot,
but have to be added by the scripts again.
- Author:
- Simon Merschjohann - Initial contribution
-
Field Summary
Fields inherited from class org.openhab.core.common.registry.AbstractProvider
listeners
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an element.void
Deprecated.@Nullable Rule
Returns an element for the given key or null if no element for the given key exists.getAll()
Returns a collection of all elements.@Nullable Rule
Removes an element and returns the removed element.void
removeRule
(String ruleUID) Deprecated.void
removeRule
(Rule rule) @Nullable Rule
Updates an element.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, removeProviderChangeListener
-
Constructor Details
-
ScriptedRuleProvider
public ScriptedRuleProvider()
-
-
Method Details
-
getAll
Description copied from interface:Provider
Returns a collection of all elements. -
get
Description copied from interface:ManagedProvider
Returns an element for the given key or null if no element for the given key exists.- Specified by:
get
in interfaceManagedProvider<Rule,
String> - Parameters:
ruleUID
- key- Returns:
- returns element or null, if no element for the given key exists
-
add
Description copied from interface:ManagedProvider
Adds an element.- Specified by:
add
in interfaceManagedProvider<Rule,
String> - Parameters:
rule
- element to be added
-
addRule
Deprecated. -
update
Description copied from interface:ManagedProvider
Updates an element.- Specified by:
update
in interfaceManagedProvider<Rule,
String> - Parameters:
rule
- element to be updated- Returns:
- returns the old element or null if no element with the same key exists
-
remove
Description copied from interface:ManagedProvider
Removes an element and returns the removed element.- Specified by:
remove
in interfaceManagedProvider<Rule,
String> - Parameters:
ruleUID
- key of the element that should be removed- Returns:
- element that was removed, or null if no element with the given key exists
-
removeRule
Deprecated. -
removeRule
-