Class TopicFilterMapper
java.lang.Object
org.openhab.core.io.websocket.event.TopicFilterMapper
The
TopicFilterMapper is used for mapping topic filter expression from the topic filter WebSocketEvent to
TopicEventFilter.- Author:
- Florian Hotze - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable TopicEventFiltermapTopicsToExcludeFilter(List<String> topics) Maps the topic expressions to aTopicEventFilterfor event exclusion.static @Nullable TopicEventFiltermapTopicsToIncludeFilter(List<String> topics) Maps the topic expressions to aTopicEventFilterfor event inclusion.
-
Method Details
-
mapTopicsToIncludeFilter
public static @Nullable TopicEventFilter mapTopicsToIncludeFilter(List<String> topics) throws EventProcessingException Maps the topic expressions to aTopicEventFilterfor event inclusion.- Parameters:
topics- the topic expressions- Returns:
- the
TopicEventFilteror `null` if there are no inclusions defined - Throws:
EventProcessingException- if a topic expression is invalid, i.e. neither a valid topic value, expression using the * wildcard or regular expression
-
mapTopicsToExcludeFilter
public static @Nullable TopicEventFilter mapTopicsToExcludeFilter(List<String> topics) throws EventProcessingException Maps the topic expressions to aTopicEventFilterfor event exclusion.- Parameters:
topics- the topic expressions- Returns:
- the
TopicEventFilteror `null` if there are no exclusions defined - Throws:
EventProcessingException- if a topic expression is invalid, i.e. neither a valid topic value, expression using the * wildcard or regular expression
-