Package org.openhab.core.events
Interface EventSubscriber
- All Known Implementing Classes:
AbstractItemEventSubscriber,AbstractTypedEventSubscriber,EventWebSocketAdapter,ItemChannelLinkRegistry,ScriptedThingProvider,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
FieldsModifier and TypeFieldDescriptionstatic final StringThe constantALL_EVENT_TYPESmust be returned by thegetSubscribedEventTypes()method, if the event subscriber should subscribe to all event types. -
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable EventFilterGets anEventFilterin order to receive specific events if the filter applies.Gets the event types to which the event subscriber is subscribed to.voidCallback method for receivingEvents from the openHAB event bus.
-
Field Details
-
ALL_EVENT_TYPES
The constantALL_EVENT_TYPESmust 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 anEventFilterin 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 receivingEvents 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)
-