Class ConfigStatusService
java.lang.Object
org.openhab.core.config.core.status.ConfigStatusService
- All Implemented Interfaces:
ConfigStatusCallback
@NonNullByDefault
public final class ConfigStatusService
extends Object
implements ConfigStatusCallback
The
ConfigStatusService
provides the ConfigStatusInfo
for a specific entity. For this purpose
it loops over all registered ConfigStatusProvider
s and returns the ConfigStatusInfo
for the matching
ConfigStatusProvider
.- Author:
- Thomas Höfer - Initial contribution, Chris Jackson - Allow null messages, Markus Rathgeb - Add locale provider support
-
Constructor Summary
ConstructorDescriptionConfigStatusService
(EventPublisher eventPublisher, LocaleProvider localeProvider, TranslationProvider i18nProvider, BundleResolver bundleResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addConfigStatusProvider
(ConfigStatusProvider configStatusProvider) void
configUpdated
(ConfigStatusSource configStatusSource) Based on the givenConfigStatusSource
this operation propagates a new configuration status for an entity after its configuration has been updated.@Nullable ConfigStatusInfo
getConfigStatus
(String entityId, @Nullable Locale locale) Retrieves theConfigStatusInfo
of the entity by using the registeredConfigStatusProvider
that supports the given entity.protected void
removeConfigStatusProvider
(ConfigStatusProvider configStatusProvider)
-
Constructor Details
-
ConfigStatusService
public ConfigStatusService(EventPublisher eventPublisher, LocaleProvider localeProvider, TranslationProvider i18nProvider, BundleResolver bundleResolver)
-
-
Method Details
-
getConfigStatus
Retrieves theConfigStatusInfo
of the entity by using the registeredConfigStatusProvider
that supports the given entity.- Parameters:
entityId
- the id of the entity whose configuration status information is to be retrieved (must not be null or empty)locale
- the locale to be used for the corresponding configuration status messages; if null then the default local will be used- Returns:
- the
ConfigStatusInfo
or null if there is noConfigStatusProvider
registered that supports the given entity - Throws:
IllegalArgumentException
- if given entityId is null or empty
-
configUpdated
Description copied from interface:ConfigStatusCallback
Based on the givenConfigStatusSource
this operation propagates a new configuration status for an entity after its configuration has been updated.- Specified by:
configUpdated
in interfaceConfigStatusCallback
- Parameters:
configStatusSource
- the source of the configuration status
-
addConfigStatusProvider
-
removeConfigStatusProvider
-