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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an element.voidDeprecated.@Nullable RuleReturns an element for the given key or null if no element for the given key exists.getAll()Returns a collection of all elements.@Nullable RuleRemoves an element and returns the removed element.voidremoveRule(String ruleUID) Deprecated.voidremoveRule(Rule rule) @Nullable RuleUpdates an element.Methods 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, removeProviderChangeListener
-
Constructor Details
-
ScriptedRuleProvider
public ScriptedRuleProvider()
-
-
Method Details
-
getAll
Description copied from interface:ProviderReturns a collection of all elements. -
get
Description copied from interface:ManagedProviderReturns an element for the given key or null if no element for the given key exists.- Specified by:
getin interfaceManagedProvider<Rule,String> - Parameters:
ruleUID- key- Returns:
- returns element or null, if no element for the given key exists
-
add
Description copied from interface:ManagedProviderAdds an element.- Specified by:
addin interfaceManagedProvider<Rule,String> - Parameters:
rule- element to be added
-
addRule
Deprecated. -
update
Description copied from interface:ManagedProviderUpdates an element.- Specified by:
updatein 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:ManagedProviderRemoves an element and returns the removed element.- Specified by:
removein 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
-