IoT::WebEvent

class WebEventNotifier

File Information

Library: IoT/WebEvent
Package: WebEventNotifier
Header: IoT/WebEvent/WebEventNotifier.h

Description

A simplified Remoting-capable interface to the Poco::OSP::WebEvent::WebEventService, usable from both C++ and JavaScript.

Inheritance

Known Derived Classes: WebEventNotifierImpl

Member Summary

Member Functions: clearEventFilter, notify, setEventSubjectNameFilter, setEventSubjectRegexFilter

Types Aliases

Ptr

using Ptr = Poco::AutoPtr < WebEventNotifier >;

Constructors

WebEventNotifier

WebEventNotifier();

Creates the Device.

Destructor

~WebEventNotifier virtual

virtual ~WebEventNotifier();

Destroys the Device.

Member Functions

clearEventFilter virtual

virtual void clearEventFilter(
    const std::string & subscriberURI
) = 0;

Clears any event filter that has been set with setEventSubjectFilter().

notify virtual

virtual void notify(
    const std::string & subjectName,
    const std::string & data
) = 0;

Notify all registered subscribers to the given subject, using the given data, which is typically a serialized JSON or XML document in UTF-8 encoding.

Sending the notification is done asynchronously. If a notification cannot be delivered to a subscriber due to a network issue, the subscriber will be removed and its WebSocket closed.

setEventSubjectNameFilter virtual

virtual void setEventSubjectNameFilter(
    const std::string & subscriberURI,
    const std::string & subjectName
) = 0;

Sets a filter on the event to only report events with the given subjectName.

setEventSubjectRegexFilter virtual

virtual void setEventSubjectRegexFilter(
    const std::string & subscriberURI,
    const std::string & regex
) = 0;

Sets a filter on the event to only report events with the subjectName matching the specified regex.

Variables

event

Poco::BasicEvent < const EventNotification > event;

Fired when an event notification has been sent, either by calling notify(), or by a client sending a NOTIFY message to the server over a web socket.

This event is fired for all subjects. It's the responsibility of the delegate function to filter out ignore events not of interest.

Securely control IoT edge devices from anywhere   Connect a Device