3 #include <Poco/Timespan.h>
5 #include "core/CommandSender.h"
6 #include "gwmessage/GWDeviceAcceptRequest.h"
7 #include "gwmessage/GWListenRequest.h"
8 #include "gwmessage/GWSearchRequest.h"
9 #include "gwmessage/GWSetValueRequest.h"
10 #include "gwmessage/GWUnpairRequest.h"
11 #include "loop/StoppableRunnable.h"
12 #include "loop/StopControl.h"
13 #include "server/GWSConnector.h"
14 #include "server/GWSListener.h"
15 #include "util/Loggable.h"
39 void setConnector(GWSConnector::Ptr connector);
40 void setUnpairDuration(
const Poco::Timespan &duration);
54 void onRequest(GWRequest::Ptr request)
override;
57 void handleDeviceAccept(GWDeviceAcceptRequest::Ptr request);
58 void handleListen(GWListenRequest::Ptr request);
59 void handleSearch(GWSearchRequest::Ptr request);
60 void handleSetValue(GWSetValueRequest::Ptr request);
61 void handleUnpair(GWUnpairRequest::Ptr request);
62 void dispatch(Command::Ptr command, GWRequest::Ptr request);
66 typedef Poco::AutoPtr<RequestAnswer> Ptr;
70 GWRequest::Ptr request()
const;
73 GWRequest::Ptr m_request;
80 void respond(RequestAnswer::Ptr answer,
bool failed);
83 Poco::Timespan m_unpairDuration;
84 GWSConnector::Ptr m_connector;
Definition: AnswerQueue.h:22
void onRequest(GWRequest::Ptr request) override
Receive a request from the remote server, convert it to the appropriate Command instance and dispatch...
Definition: GWSCommandSender.cpp:55
Definition: GWSCommandSender.h:64
StopControl implements the stop mechanism generically.
Definition: StopControl.h:12
void respond(RequestAnswer::Ptr answer, bool failed)
When a RequestAnswer instance becomes finished, report its results to the remote server.
Definition: GWSCommandSender.cpp:122
void run() override
A loop that processes answers' updates of commands as created from the remote server requests...
Definition: GWSCommandSender.cpp:81
Definition: CommandSender.h:20
Definition: Loggable.h:19
void stop() override
Definition: GWSCommandSender.cpp:135
Definition: StoppableRunnable.h:8
GWSListener provides an interface for delivering of events and messages related to communication with...
Definition: GWSListener.h:19
Pass requests received from the remote server to the configured CommandDispatcher instance...
Definition: GWSCommandSender.h:31