Class LinkEventFactory
java.lang.Object
org.openhab.core.events.AbstractEventFactory
org.openhab.core.thing.link.events.LinkEventFactory
- All Implemented Interfaces:
EventFactory
This is an
EventFactory
for creating link events. The following event types are supported by this factory:
- Author:
- Dennis Nobel - Initial contribution, Kai Kreuzer - Removed Thing link events
-
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 ItemChannelLinkAddedEvent
createItemChannelLinkAddedEvent
(ItemChannelLink itemChannelLink) Creates an item channel link added event.static ItemChannelLinkRemovedEvent
createItemChannelLinkRemovedEvent
(ItemChannelLink itemChannelLink) Creates an item channel link removed event.Methods inherited from class org.openhab.core.events.AbstractEventFactory
checkNotNull, checkNotNullOrEmpty, createEvent, deserializePayload, getSupportedEventTypes, getTopicElements, serializePayload
-
Constructor Details
-
LinkEventFactory
public LinkEventFactory()Constructs a new LinkEventFactory.
-
-
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
-
createItemChannelLinkAddedEvent
public static ItemChannelLinkAddedEvent createItemChannelLinkAddedEvent(ItemChannelLink itemChannelLink) Creates an item channel link added event.- Parameters:
itemChannelLink
- item channel link- Returns:
- the created item channel link added event
- Throws:
IllegalArgumentException
- if item channel link is null
-
createItemChannelLinkRemovedEvent
public static ItemChannelLinkRemovedEvent createItemChannelLinkRemovedEvent(ItemChannelLink itemChannelLink) Creates an item channel link removed event.- Parameters:
itemChannelLink
- item channel link- Returns:
- the created item channel link removed event
- Throws:
IllegalArgumentException
- if item channel link is null
-