Package org.openhab.core.events
Interface EventSubscriber
- All Known Implementing Classes:
AbstractItemEventSubscriber
,AbstractTypedEventSubscriber
,EventWebSocketAdapter
,SitemapSubscriptionService
@NonNullByDefault
public interface EventSubscriber
The
EventSubscriber
defines the callback interface for receiving events from
the openHAB event bus.- Author:
- Stefan Bußweiler - Initial contribution
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The constantALL_EVENT_TYPES
must be returned by thegetSubscribedEventTypes()
method, if the event subscriber should subscribe to all event types. -
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable EventFilter
Gets anEventFilter
in order to receive specific events if the filter applies.Gets the event types to which the event subscriber is subscribed to.void
Callback method for receivingEvent
s from the openHAB event bus.
-
Field Details
-
ALL_EVENT_TYPES
The constantALL_EVENT_TYPES
must be returned by thegetSubscribedEventTypes()
method, if the event subscriber should subscribe to all event types.- See Also:
-
-
Method Details
-
getSubscribedEventTypes
Gets the event types to which the event subscriber is subscribed to.- Returns:
- subscribed event types (not null)
-
getEventFilter
Gets anEventFilter
in order to receive specific events if the filter applies. If there is no filter all subscribed event types are received.- Returns:
- the event filter, or null
-
receive
Callback method for receivingEvent
s from the openHAB event bus. This method is called for every event where the event subscriber is subscribed to and the event filter applies.- Parameters:
event
- the received event (not null)
-