Class ManagedPersistenceServiceConfigurationProvider
java.lang.Object
org.openhab.core.common.registry.AbstractProvider<PersistenceServiceConfiguration>
org.openhab.core.common.registry.AbstractManagedProvider<PersistenceServiceConfiguration,String,PersistenceServiceConfigurationDTO>
org.openhab.core.persistence.registry.ManagedPersistenceServiceConfigurationProvider
- All Implemented Interfaces:
ManagedProvider<PersistenceServiceConfiguration,
,String> Provider<PersistenceServiceConfiguration>
,PersistenceServiceConfigurationProvider
@NonNullByDefault
public class ManagedPersistenceServiceConfigurationProvider
extends AbstractManagedProvider<PersistenceServiceConfiguration,String,PersistenceServiceConfigurationDTO>
implements PersistenceServiceConfigurationProvider
The
ManagedPersistenceServiceConfigurationProvider
implements a
PersistenceServiceConfigurationProvider
for managed configurations which are stored in a JSON database- Author:
- Jan N. Klug - Initial contribution
-
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
ConstructorDescriptionManagedPersistenceServiceConfigurationProvider
(StorageService storageService) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns the name of storage, that is used to persist the elements.protected String
keyToString
(String key) Transforms the key into a string representation.protected @Nullable PersistenceServiceConfiguration
toElement
(String key, PersistenceServiceConfigurationDTO persistableElement) Converts the persistable element into the original element.protected PersistenceServiceConfigurationDTO
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
-
ManagedPersistenceServiceConfigurationProvider
-
-
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<PersistenceServiceConfiguration,
String, PersistenceServiceConfigurationDTO> - Returns:
- name of the storage
-
keyToString
Description copied from class:AbstractManagedProvider
Transforms the key into a string representation.- Specified by:
keyToString
in classAbstractManagedProvider<PersistenceServiceConfiguration,
String, PersistenceServiceConfigurationDTO> - Parameters:
key
- key- Returns:
- string representation of the key
-
toElement
protected @Nullable PersistenceServiceConfiguration toElement(String key, PersistenceServiceConfigurationDTO persistableElement) Description copied from class:AbstractManagedProvider
Converts the persistable element into the original element.- Specified by:
toElement
in classAbstractManagedProvider<PersistenceServiceConfiguration,
String, PersistenceServiceConfigurationDTO> - Parameters:
key
- keypersistableElement
- persistable element- Returns:
- original element
-
toPersistableElement
protected PersistenceServiceConfigurationDTO toPersistableElement(PersistenceServiceConfiguration element) Description copied from class:AbstractManagedProvider
Converts the original element into an element that can be persisted.- Specified by:
toPersistableElement
in classAbstractManagedProvider<PersistenceServiceConfiguration,
String, PersistenceServiceConfigurationDTO> - Parameters:
element
- original element- Returns:
- persistable element
-