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 ConfigStatusProviders 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
ConstructorsConstructorDescriptionConfigStatusService(EventPublisher eventPublisher, LocaleProvider localeProvider, TranslationProvider i18nProvider, BundleResolver bundleResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddConfigStatusProvider(ConfigStatusProvider configStatusProvider) voidconfigUpdated(ConfigStatusSource configStatusSource) Based on the givenConfigStatusSourcethis operation propagates a new configuration status for an entity after its configuration has been updated.@Nullable ConfigStatusInfogetConfigStatus(String entityId, @Nullable Locale locale) Retrieves theConfigStatusInfoof the entity by using the registeredConfigStatusProviderthat supports the given entity.protected voidremoveConfigStatusProvider(ConfigStatusProvider configStatusProvider)
-
Constructor Details
-
ConfigStatusService
public ConfigStatusService(EventPublisher eventPublisher, LocaleProvider localeProvider, TranslationProvider i18nProvider, BundleResolver bundleResolver)
-
-
Method Details
-
getConfigStatus
Retrieves theConfigStatusInfoof the entity by using the registeredConfigStatusProviderthat 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
ConfigStatusInfoor null if there is noConfigStatusProviderregistered that supports the given entity - Throws:
IllegalArgumentException- if given entityId is null or empty
-
configUpdated
Description copied from interface:ConfigStatusCallbackBased on the givenConfigStatusSourcethis operation propagates a new configuration status for an entity after its configuration has been updated.- Specified by:
configUpdatedin interfaceConfigStatusCallback- Parameters:
configStatusSource- the source of the configuration status
-
addConfigStatusProvider
-
removeConfigStatusProvider
-