Package org.openhab.core.thing
Class ManagedThingProvider
java.lang.Object
org.openhab.core.common.registry.AbstractProvider<Thing>
org.openhab.core.common.registry.AbstractManagedProvider<Thing,ThingUID,org.openhab.core.thing.internal.ThingStorageEntity>
org.openhab.core.thing.ManagedThingProvider
- All Implemented Interfaces:
ManagedProvider<Thing,
,ThingUID> Provider<Thing>
,ThingProvider
@NonNullByDefault
public class ManagedThingProvider
extends AbstractManagedProvider<Thing,ThingUID,org.openhab.core.thing.internal.ThingStorageEntity>
implements ThingProvider
ManagedThingProvider
is an OSGi service, that allows to add or remove
things at runtime by calling AbstractManagedProvider.add(E)
or
AbstractManagedProvider.remove(K)
. An added thing is
automatically exposed to the ThingRegistry
.- Author:
- Oliver Libutzki - Initial contribution, Dennis Nobel - Integrated Storage, Michael Grammling - Added dynamic configuration update
-
Field Summary
Fields inherited from class org.openhab.core.common.registry.AbstractManagedProvider
logger
Fields inherited from class org.openhab.core.common.registry.AbstractProvider
listeners
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns the name of storage, that is used to persist the elements.protected String
keyToString
(ThingUID key) Transforms the key into a string representation.protected @Nullable Thing
Converts the persistable element into the original element.protected org.openhab.core.thing.internal.ThingStorageEntity
toPersistableElement
(Thing element) Converts the original element into an element that can be persisted.Methods inherited from class org.openhab.core.common.registry.AbstractManagedProvider
add, get, getAll, remove, update
Methods inherited from class org.openhab.core.common.registry.AbstractProvider
addProviderChangeListener, notifyListenersAboutAddedElement, notifyListenersAboutRemovedElement, notifyListenersAboutUpdatedElement, removeProviderChangeListener
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.common.registry.Provider
addProviderChangeListener, getAll, removeProviderChangeListener
-
Constructor Details
-
ManagedThingProvider
-
-
Method Details
-
getStorageName
Description copied from class:AbstractManagedProvider
Returns the name of storage, that is used to persist the elements.- Specified by:
getStorageName
in classAbstractManagedProvider<Thing,
ThingUID, org.openhab.core.thing.internal.ThingStorageEntity> - Returns:
- name of the storage
-
keyToString
Description copied from class:AbstractManagedProvider
Transforms the key into a string representation.- Specified by:
keyToString
in classAbstractManagedProvider<Thing,
ThingUID, org.openhab.core.thing.internal.ThingStorageEntity> - Parameters:
key
- key- Returns:
- string representation of the key
-
toElement
protected @Nullable Thing toElement(String key, org.openhab.core.thing.internal.ThingStorageEntity persistableElement) Description copied from class:AbstractManagedProvider
Converts the persistable element into the original element.- Specified by:
toElement
in classAbstractManagedProvider<Thing,
ThingUID, org.openhab.core.thing.internal.ThingStorageEntity> - Parameters:
key
- keypersistableElement
- persistable element- Returns:
- original element
-
toPersistableElement
Description copied from class:AbstractManagedProvider
Converts the original element into an element that can be persisted.- Specified by:
toPersistableElement
in classAbstractManagedProvider<Thing,
ThingUID, org.openhab.core.thing.internal.ThingStorageEntity> - Parameters:
element
- original element- Returns:
- persistable element
-