Package org.openhab.core.thing
Interface ThingRegistry
- All Known Implementing Classes:
ProviderThingRegistryDelegate
ThingRegistry tracks all Things from different ThingProviders 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 ThingcreateThingOfType(ThingTypeUID thingTypeUID, @Nullable ThingUID thingUID, @Nullable ThingUID bridgeUID, @Nullable String label, Configuration configuration) Creates a thing based on the given configuration properties@Nullable ThingforceRemove(ThingUID thingUID) @Nullable ThingReturns a thing for a given UID or null if no thing was found.@Nullable ChannelgetChannel(ChannelUID channelUID) Returns a channel for the given channel UID or null if no channel was found@Nullable ThingvoidupdateConfiguration(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 theThingspecified by the givenThingUID. Unlike in otherRegistrys,Things don't get removed immediately. Instead, the correspondingThingHandleris given the chance to perform any required removal handling before it actually gets removed.If for any reasons the
Thingshould be removed immediately without any prior processing, useforceRemove(ThingUID)instead. -
forceRemove
Removes theThingspecified by the givenThingUID. If the correspondingThingHandlershould 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
-