Package org.openhab.core.thing
Interface ThingRegistry
ThingRegistry
tracks all Thing
s from different ThingProvider
s and provides access to them.
The ThingRegistry
supports adding of listeners (see ThingRegistryChangeListener
) and trackers
(see ThingTracker
).- Author:
- Dennis Nobel - Initial contribution, Oliver Libutzki - Extracted ManagedThingProvider
-
Method Summary
Modifier and TypeMethodDescription@Nullable Thing
createThingOfType
(ThingTypeUID thingTypeUID, @Nullable ThingUID thingUID, @Nullable ThingUID bridgeUID, @Nullable String label, Configuration configuration) Creates a thing based on the given configuration properties@Nullable Thing
forceRemove
(ThingUID thingUID) @Nullable Thing
Returns a thing for a given UID or null if no thing was found.@Nullable Channel
getChannel
(ChannelUID channelUID) Returns a channel for the given channel UID or null if no channel was found@Nullable Thing
void
updateConfiguration
(ThingUID thingUID, Map<String, Object> configurationParameters) Updates the configuration of a thing for the given UID.Methods inherited from interface org.openhab.core.common.registry.Registry
add, addRegistryChangeListener, getAll, removeRegistryChangeListener, stream, update
-
Method Details
-
get
Returns a thing for a given UID or null if no thing was found. -
getChannel
Returns a channel for the given channel UID or null if no channel was found- Parameters:
channelUID
- channel UID- Returns:
- channel for the given channel UID or null of no channel was found
-
updateConfiguration
Updates the configuration of a thing for the given UID.- Parameters:
thingUID
- thing UIDconfigurationParameters
- configuration parameters- Throws:
ConfigValidationException
- if one or more of the given configuration parameters do not match their declarations in the configuration descriptionIllegalArgumentException
- if no thing with the given UID existsIllegalStateException
- if no handler is attached to the thing
-
remove
Initiates the removal process for theThing
specified by the givenThingUID
. Unlike in otherRegistry
s,Thing
s don't get removed immediately. Instead, the correspondingThingHandler
is given the chance to perform any required removal handling before it actually gets removed.If for any reasons the
Thing
should be removed immediately without any prior processing, useforceRemove(ThingUID)
instead. -
forceRemove
Removes theThing
specified by the givenThingUID
. If the correspondingThingHandler
should be given the chance to perform any removal operations, useremove(ThingUID)
instead. -
createThingOfType
@Nullable Thing createThingOfType(ThingTypeUID thingTypeUID, @Nullable ThingUID thingUID, @Nullable ThingUID bridgeUID, @Nullable String label, Configuration configuration) Creates a thing based on the given configuration properties- Parameters:
thingTypeUID
- thing type unique idthingUID
- thing unique id which should be created. This id might be null.bridgeUID
- the thing's bridge. Null if there is no bridge or if the thing is a bridge by itself.configuration
- the configuration- Returns:
- the created thing
-