Package org.openhab.core.thing.binding
Class ConfigStatusBridgeHandler
java.lang.Object
org.openhab.core.thing.binding.BaseThingHandler
org.openhab.core.thing.binding.BaseBridgeHandler
org.openhab.core.thing.binding.ConfigStatusBridgeHandler
- All Implemented Interfaces:
ConfigStatusProvider,BridgeHandler,ThingHandler
@NonNullByDefault
public abstract class ConfigStatusBridgeHandler
extends BaseBridgeHandler
implements ConfigStatusProvider
The
ConfigStatusBridgeHandler is an extension of BaseBridgeHandler that implements the
ConfigStatusProvider interface. It provides default implementations for
ConfigStatusProvider.supportsEntity(String)ConfigStatusProvider.setConfigStatusCallback(ConfigStatusCallback)
ThingHandler.handleConfigurationUpdate(Map) and
BaseThingHandler.updateConfiguration(Configuration) to initiate a propagation of a new
configuration status. So sub classes need only to provide the current configuration status by implementing
ConfigStatusProvider.getConfigStatus().- Author:
- Thomas Höfer - Initial contribution
-
Field Summary
Fields inherited from class org.openhab.core.thing.binding.BaseThingHandler
scheduler, thing -
Constructor Summary
ConstructorsConstructorDescriptionConfigStatusBridgeHandler(Bridge bridge) Creates a new instance of this class for the givenBridge. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleConfigurationUpdate(Map<String, Object> configurationParameters) Handles a configuration update.voidsetConfigStatusCallback(@Nullable ConfigStatusCallback configStatusCallback) Sets the givenConfigStatusCallbackfor theConfigStatusProvider.booleansupportsEntity(String entityId) Determines if theConfigStatusProviderinstance can provide the configuration status information for the given entity.protected voidupdateConfiguration(Configuration configuration) Updates the configuration of the thing and informs the framework about it.Methods inherited from class org.openhab.core.thing.binding.BaseBridgeHandler
childHandlerDisposed, childHandlerInitialized, editThing, getThingMethods inherited from class org.openhab.core.thing.binding.BaseThingHandler
bridgeStatusChanged, changeThingType, channelLinked, channelUnlinked, dispose, editConfiguration, editProperties, getBridge, getCallback, getConfig, getConfigAs, getConfigDescription, getConfigDescription, handleRemoval, isInitialized, isLinked, isLinked, isModifyingCurrentConfig, postCommand, postCommand, sendTimeSeries, sendTimeSeries, setCallback, thingUpdated, triggerChannel, triggerChannel, triggerChannel, triggerChannel, updateProperties, updateProperty, updateState, updateState, updateStatus, updateStatus, updateStatus, updateThing, validateConfigurationParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openhab.core.config.core.status.ConfigStatusProvider
getConfigStatusMethods inherited from interface org.openhab.core.thing.binding.ThingHandler
bridgeStatusChanged, channelLinked, channelUnlinked, dispose, getServices, handleCommand, handleRemoval, initialize, setCallback, thingUpdated
-
Constructor Details
-
ConfigStatusBridgeHandler
Creates a new instance of this class for the givenBridge.- Parameters:
bridge- the bridge for this handler
-
-
Method Details
-
supportsEntity
Description copied from interface:ConfigStatusProviderDetermines if theConfigStatusProviderinstance can provide the configuration status information for the given entity.- Specified by:
supportsEntityin interfaceConfigStatusProvider- Parameters:
entityId- the id of the entity whose configuration status information is to be provided- Returns:
- true, if the
ConfigStatusProviderinstance supports the given entity, otherwise false
-
setConfigStatusCallback
Description copied from interface:ConfigStatusProviderSets the givenConfigStatusCallbackfor theConfigStatusProvider.- Specified by:
setConfigStatusCallbackin interfaceConfigStatusProvider- Parameters:
configStatusCallback- the configuration status callback to be set
-
handleConfigurationUpdate
Description copied from interface:ThingHandlerHandles a configuration update.Note: An implementing class needs to persist the configuration changes if necessary.
- Specified by:
handleConfigurationUpdatein interfaceThingHandler- Overrides:
handleConfigurationUpdatein classBaseThingHandler- Parameters:
configurationParameters- map of changed configuration parameters
-
updateConfiguration
Description copied from class:BaseThingHandlerUpdates the configuration of the thing and informs the framework about it. Any method overriding this method has to make sure that only valid configurations are passed to the callback. This can be achieved by callingThingHandlerCallback.validateConfigurationParameters(Thing, Map).- Overrides:
updateConfigurationin classBaseThingHandler- Parameters:
configuration- configuration, that was updated and should be persisted
-