Package org.openhab.core.thing.firmware
Class FirmwareEventFactory
java.lang.Object
org.openhab.core.events.AbstractEventFactory
org.openhab.core.thing.firmware.FirmwareEventFactory
- All Implemented Interfaces:
EventFactory
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Event
createEventByType
(String eventType, String topic, String payload, @Nullable String source) Create a new event instance based on the event type.static FirmwareStatusInfoEvent
createFirmwareStatusInfoEvent
(FirmwareStatusInfo firmwareStatusInfo) Creates a newFirmwareStatusInfoEvent
.Creates a newFirmwareUpdateProgressInfoEvent
.createFirmwareUpdateResultInfoEvent
(FirmwareUpdateResultInfo firmwareUpdateResultInfo) Creates a newFirmwareUpdateResultInfoEvent
.Methods inherited from class org.openhab.core.events.AbstractEventFactory
checkNotNull, checkNotNullOrEmpty, createEvent, deserializePayload, getSupportedEventTypes, getTopicElements, serializePayload
-
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 classAbstractEventFactory
- Parameters:
eventType
- the event typetopic
- the topicpayload
- the payloadsource
- 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) Creates a newFirmwareStatusInfoEvent
.- Parameters:
firmwareStatusInfo
- the firmware status information (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) Creates a newFirmwareUpdateProgressInfoEvent
.- Parameters:
progressInfo
- the progress information of the firmware update process (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) Creates a newFirmwareUpdateResultInfoEvent
.- Parameters:
firmwareUpdateResultInfo
- the firmware update result information (must not be null)- Returns:
- the corresponding firmware update result info event
- Throws:
IllegalArgumentException
- if given firmware update result info event is null
-