Interface FirmwareRegistry


@NonNullByDefault public interface FirmwareRegistry
The FirmwareRegistry is registered as an OSGi service and is responsible for tracking all FirmwareProviders. 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 Details

    • getFirmware

      @Nullable Firmware getFirmware(Thing thing, String firmwareVersion)
      Returns the firmware for the given thing and firmware version by using the locale provided by the LocaleProvider.
      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

      @Nullable Firmware getFirmware(Thing thing, String firmwareVersion, Locale locale)
      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 the LocaleProvider 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

      @Nullable Firmware getLatestFirmware(Thing thing)
      Returns the latest firmware for the given thing, using the locale provided by the LocaleProvider.
      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

      @Nullable Firmware getLatestFirmware(Thing thing, @Nullable Locale locale)
      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 the LocaleProvider is used)
      Returns:
      the corresponding latest firmware or null if no firmware was found
      Throws:
      IllegalArgumentException - if the thing is null
    • getFirmwares

      Collection<Firmware> getFirmwares(Thing thing)
      Returns the collection of available firmwares for the given thing using the locale provided by the LocaleProvider. 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

      Collection<Firmware> getFirmwares(Thing thing, @Nullable Locale locale)
      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 the LocaleProvider is used)
      Returns:
      the collection of available firmwares for the given thing (not null)
      Throws:
      IllegalArgumentException - if the thing is null