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
loggerFields inherited from class org.openhab.core.common.registry.AbstractProvider
listeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the name of storage, that is used to persist the elements.protected StringkeyToString(ThingUID key) Transforms the key into a string representation.protected @Nullable ThingConverts the persistable element into the original element.protected org.openhab.core.thing.internal.ThingStorageEntitytoPersistableElement(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, updateMethods inherited from class org.openhab.core.common.registry.AbstractProvider
addProviderChangeListener, notifyListenersAboutAddedElement, notifyListenersAboutRemovedElement, notifyListenersAboutUpdatedElement, removeProviderChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openhab.core.common.registry.Provider
addProviderChangeListener, getAll, removeProviderChangeListener
-
Constructor Details
-
ManagedThingProvider
-
-
Method Details
-
getStorageName
Description copied from class:AbstractManagedProviderReturns the name of storage, that is used to persist the elements.- Specified by:
getStorageNamein classAbstractManagedProvider<Thing,ThingUID, org.openhab.core.thing.internal.ThingStorageEntity> - Returns:
- name of the storage
-
keyToString
Description copied from class:AbstractManagedProviderTransforms the key into a string representation.- Specified by:
keyToStringin 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:AbstractManagedProviderConverts the persistable element into the original element.- Specified by:
toElementin classAbstractManagedProvider<Thing,ThingUID, org.openhab.core.thing.internal.ThingStorageEntity> - Parameters:
key- keypersistableElement- persistable element- Returns:
- original element
-
toPersistableElement
Description copied from class:AbstractManagedProviderConverts the original element into an element that can be persisted.- Specified by:
toPersistableElementin classAbstractManagedProvider<Thing,ThingUID, org.openhab.core.thing.internal.ThingStorageEntity> - Parameters:
element- original element- Returns:
- persistable element
-