Class LinkEventFactory

java.lang.Object
org.openhab.core.events.AbstractEventFactory
org.openhab.core.thing.link.events.LinkEventFactory
All Implemented Interfaces:
EventFactory

@NonNullByDefault public class LinkEventFactory extends AbstractEventFactory
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 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 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
    • 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