Class FirmwareEventFactory

java.lang.Object
org.openhab.core.events.AbstractEventFactory
org.openhab.core.thing.firmware.FirmwareEventFactory
All Implemented Interfaces:
EventFactory

@NonNullByDefault public final class FirmwareEventFactory extends AbstractEventFactory
The FirmwareEventFactory is registered as an OSGi service and is responsible to create firmware events. It supports the following event types:
Author:
Thomas Höfer - Initial contribution, Dimitar Ivanov - Consolidated all the event information into the FirmwareStatusInfoEvent
  • Constructor Details

    • FirmwareEventFactory

      public FirmwareEventFactory()
      Creates a new firmware event factory.
  • Method Details

    • createEventByType

      protected Event createEventByType(String eventType, String topic, String payload, @Nullable String source) throws Exception
      Description copied from class: AbstractEventFactory
      Create a new event instance based on the event type.
      Specified by:
      createEventByType in class AbstractEventFactory
      Parameters:
      eventType - the event type
      topic - the topic
      payload - the payload
      source - the source, can be null
      Returns:
      the created event instance
      Throws:
      Exception - if the creation of the event fails
    • createFirmwareStatusInfoEvent

      public static FirmwareStatusInfoEvent createFirmwareStatusInfoEvent(FirmwareStatusInfo firmwareStatusInfo)
      Parameters:
      firmwareStatusInfo - the firmware status information (must not be null)
      thingUID - the thing UID for which the new firmware status info is to be sent (must not be null)
      Returns:
      the corresponding firmware status info event
      Throws:
      IllegalArgumentException - if given firmware status info is null
    • createFirmwareUpdateProgressInfoEvent

      public static FirmwareUpdateProgressInfoEvent createFirmwareUpdateProgressInfoEvent(FirmwareUpdateProgressInfo progressInfo)
      Parameters:
      progressInfo - the progress information of the firmware update process (must not be null)
      thingUID - the thing UID for which the progress info is to be sent (must not be null)
      Returns:
      the corresponding progress info event
      Throws:
      IllegalArgumentException - if given progress info is null
    • createFirmwareUpdateResultInfoEvent

      public static FirmwareUpdateResultInfoEvent createFirmwareUpdateResultInfoEvent(FirmwareUpdateResultInfo firmwareUpdateResultInfo)
      Parameters:
      firmwareUpdateResultInfo - the firmware update result information (must not be null)
      thingUID - the thing UID for which the result information is to be sent (must not be null)
      Returns:
      the corresponding firmware update result info event
      Throws:
      IllegalArgumentException - if given firmware update result info event is null