Class ThingEventFactory

    • Constructor Detail

      • ThingEventFactory

        public ThingEventFactory()
        Constructs a new ThingEventFactory.
    • Method Detail

      • createTriggerEvent

        public static ChannelTriggeredEvent createTriggerEvent​(String event,
                                                               ChannelUID channel)
        Creates a trigger event from a Type.
        Parameters:
        event - Event.
        channel - Channel which triggered the event.
        Returns:
        Created trigger event.
      • createTriggerEvent

        public ChannelTriggeredEvent createTriggerEvent​(String topic,
                                                        String payload,
                                                        String source)
        Creates a trigger event from a payload.
        Parameters:
        topic - Event topic
        source - Event source
        payload - Payload
        Returns:
        created trigger event
      • createStatusInfoEvent

        public static ThingStatusInfoEvent createStatusInfoEvent​(ThingUID thingUID,
                                                                 ThingStatusInfo thingStatusInfo)
        Creates a new thing status info event based on a thing UID and a thing status info object.
        Parameters:
        thingUID - the thing UID
        thingStatusInfo - the thing status info object
        Returns:
        the created thing status info event
        Throws:
        IllegalArgumentException - if thingUID or thingStatusInfo is null
      • createStatusInfoChangedEvent

        public static ThingStatusInfoChangedEvent createStatusInfoChangedEvent​(ThingUID thingUID,
                                                                               ThingStatusInfo thingStatusInfo,
                                                                               ThingStatusInfo oldThingStatusInfo)
        Creates a new thing status info changed event based on a thing UID, a thing status info and the old thing status info object.
        Parameters:
        thingUID - the thing UID
        thingStatusInfo - the thing status info object
        oldThingStatusInfo - the old thing status info object
        Returns:
        the created thing status info changed event
        Throws:
        IllegalArgumentException - if thingUID or thingStatusInfo is null
      • createAddedEvent

        public static ThingAddedEvent createAddedEvent​(Thing thing)
        Creates a thing added event.
        Parameters:
        thing - the thing
        Returns:
        the created thing added event
        Throws:
        IllegalArgumentException - if thing is null
      • createRemovedEvent

        public static ThingRemovedEvent createRemovedEvent​(Thing thing)
        Creates a thing removed event.
        Parameters:
        thing - the thing
        Returns:
        the created thing removed event
        Throws:
        IllegalArgumentException - if thing is null
      • createUpdateEvent

        public static ThingUpdatedEvent createUpdateEvent​(Thing thing,
                                                          Thing oldThing)
        Creates a thing updated event.
        Parameters:
        thing - the thing
        oldThing - the old thing
        Returns:
        the created thing updated event
        Throws:
        IllegalArgumentException - if thing or oldThing is null