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
loggerFields inherited from class org.openhab.core.common.registry.AbstractProvider
listeners -
Constructor Summary
ConstructorsConstructorDescriptionManagedPersistenceServiceConfigurationProvider(StorageService storageService) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the name of storage, that is used to persist the elements.protected StringkeyToString(String key) Transforms the key into a string representation.protected @Nullable PersistenceServiceConfigurationtoElement(String key, PersistenceServiceConfigurationDTO persistableElement) Converts the persistable element into the original element.protected PersistenceServiceConfigurationDTOConverts 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
-
ManagedPersistenceServiceConfigurationProvider
-
-
Method Details
-
getStorageName
Description copied from class:AbstractManagedProviderReturns the name of storage, that is used to persist the elements.- Specified by:
getStorageNamein classAbstractManagedProvider<PersistenceServiceConfiguration,String, PersistenceServiceConfigurationDTO> - Returns:
- name of the storage
-
keyToString
Description copied from class:AbstractManagedProviderTransforms the key into a string representation.- Specified by:
keyToStringin 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:AbstractManagedProviderConverts the persistable element into the original element.- Specified by:
toElementin classAbstractManagedProvider<PersistenceServiceConfiguration,String, PersistenceServiceConfigurationDTO> - Parameters:
key- keypersistableElement- persistable element- Returns:
- original element
-
toPersistableElement
protected PersistenceServiceConfigurationDTO toPersistableElement(PersistenceServiceConfiguration element) Description copied from class:AbstractManagedProviderConverts the original element into an element that can be persisted.- Specified by:
toPersistableElementin classAbstractManagedProvider<PersistenceServiceConfiguration,String, PersistenceServiceConfigurationDTO> - Parameters:
element- original element- Returns:
- persistable element
-