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
ConstructorDescriptionConfigStatusBridgeHandler
(Bridge bridge) Creates a new instance of this class for the givenBridge
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleConfigurationUpdate
(Map<String, Object> configurationParameters) Handles a configuration update.void
setConfigStatusCallback
(@Nullable ConfigStatusCallback configStatusCallback) Sets the givenConfigStatusCallback
for theConfigStatusProvider
.boolean
supportsEntity
(String entityId) Determines if theConfigStatusProvider
instance can provide the configuration status information for the given entity.protected void
updateConfiguration
(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, getThing
Methods 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, validateConfigurationParameters
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.config.core.status.ConfigStatusProvider
getConfigStatus
Methods 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:ConfigStatusProvider
Determines if theConfigStatusProvider
instance can provide the configuration status information for the given entity.- Specified by:
supportsEntity
in interfaceConfigStatusProvider
- Parameters:
entityId
- the id of the entity whose configuration status information is to be provided- Returns:
- true, if the
ConfigStatusProvider
instance supports the given entity, otherwise false
-
setConfigStatusCallback
Description copied from interface:ConfigStatusProvider
Sets the givenConfigStatusCallback
for theConfigStatusProvider
.- Specified by:
setConfigStatusCallback
in interfaceConfigStatusProvider
- Parameters:
configStatusCallback
- the configuration status callback to be set
-
handleConfigurationUpdate
Description copied from interface:ThingHandler
Handles a configuration update.Note: An implementing class needs to persist the configuration changes if necessary.
- Specified by:
handleConfigurationUpdate
in interfaceThingHandler
- Overrides:
handleConfigurationUpdate
in classBaseThingHandler
- Parameters:
configurationParameters
- map of changed configuration parameters
-
updateConfiguration
Description copied from class:BaseThingHandler
Updates 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:
updateConfiguration
in classBaseThingHandler
- Parameters:
configuration
- configuration, that was updated and should be persisted
-