Package org.openhab.core.thing.firmware
Interface FirmwareRegistry
@NonNullByDefault
public interface FirmwareRegistry
The
FirmwareRegistry
is registered as an OSGi service and is responsible for tracking all
FirmwareProvider
s. For this reason it is the central instance to get access to all available firmwares. If a
locale is given to one of its operations then the following firmware attributes are localized:
- Author:
- Thomas Höfer - Initial contribution, Dimitar Ivanov - Extracted interface
-
Method Summary
Modifier and TypeMethodDescription@Nullable Firmware
getFirmware
(Thing thing, String firmwareVersion) Returns the firmware for the given thing and firmware version by using the locale provided by theLocaleProvider
.@Nullable Firmware
getFirmware
(Thing thing, String firmwareVersion, Locale locale) Returns the firmware for the given thing, firmware version and locale.getFirmwares
(Thing thing) Returns the collection of available firmwares for the given thing using the locale provided by theLocaleProvider
.getFirmwares
(Thing thing, @Nullable Locale locale) Returns the collection of available firmwares for the given thing and locale.@Nullable Firmware
getLatestFirmware
(Thing thing) Returns the latest firmware for the given thing, using the locale provided by theLocaleProvider
.@Nullable Firmware
getLatestFirmware
(Thing thing, @Nullable Locale locale) Returns the latest firmware for the given thing and locale.
-
Method Details
-
getFirmware
Returns the firmware for the given thing and firmware version by using the locale provided by theLocaleProvider
.- Parameters:
thing
- the thing for which the firmwares are to be retrieved (not null)firmwareVersion
- the version of the firmware to be retrieved (not null)- Returns:
- the corresponding firmware or null if no firmware was found
- Throws:
IllegalArgumentException
- if the thing is null; if the firmware version is null or empty
-
getFirmware
Returns the firmware for the given thing, firmware version and locale.- Parameters:
thing
- the thing for which the firmwares are to be retrieved (not null)firmwareVersion
- the version of the firmware to be retrieved (not null)locale
- the locale to be used (if null then the locale provided by theLocaleProvider
is used)- Returns:
- the corresponding firmware or null if no firmware was found
- Throws:
IllegalArgumentException
- if the thing is null; if the firmware version is null or empty
-
getLatestFirmware
Returns the latest firmware for the given thing, using the locale provided by theLocaleProvider
.- Parameters:
thing
- the thing for which the firmwares are to be retrieved (not null)- Returns:
- the corresponding latest firmware or null if no firmware was found
- Throws:
IllegalArgumentException
- if the thing is null
-
getLatestFirmware
Returns the latest firmware for the given thing and locale.- Parameters:
thing
- the thing for which the firmwares are to be retrieved (not null)locale
- the locale to be used (if null then the locale provided by theLocaleProvider
is used)- Returns:
- the corresponding latest firmware or null if no firmware was found
- Throws:
IllegalArgumentException
- if the thing is null
-
getFirmwares
Returns the collection of available firmwares for the given thing using the locale provided by theLocaleProvider
. The collection is sorted in descending order, i.e. the latest firmware will be the first element in the collection.- Parameters:
thing
- the thing for which the firmwares are to be retrieved (not null)- Returns:
- the collection of available firmwares for the given thing (not null)
- Throws:
IllegalArgumentException
- if the thing is null
-
getFirmwares
Returns the collection of available firmwares for the given thing and locale. The collection is sorted in descending order, i.e. the latest firmware will be the first element in the collection.- Parameters:
thing
- the thing for which the firmwares are to be retrieved (not null)locale
- the locale to be used (if null then the locale provided by theLocaleProvider
is used)- Returns:
- the collection of available firmwares for the given thing (not null)
- Throws:
IllegalArgumentException
- if the thing is null
-