5 #include <Poco/Mutex.h>
6 #include <Poco/SharedPtr.h>
8 #include "commands/NewDeviceCommand.h"
9 #include "commands/ServerDeviceListCommand.h"
10 #include "commands/ServerLastValueCommand.h"
11 #include "core/CommandHandler.h"
12 #include "gwmessage/GWDeviceListResponse.h"
13 #include "gwmessage/GWLastValueResponse.h"
14 #include "server/GWSConnector.h"
15 #include "server/GWSListener.h"
16 #include "util/Loggable.h"
35 typedef Poco::SharedPtr<GWSCommandHandler> Ptr;
39 void setConnector(GWSConnector::Ptr connector);
41 bool accept(
const Command::Ptr cmd)
override;
42 void handle(Command::Ptr cmd, Answer::Ptr answer)
override;
48 void onResponse(
const GWResponse::Ptr response)
override;
51 void handleNewDevice(NewDeviceCommand::Ptr cmd, Answer::Ptr answer);
52 void handleDeviceList(ServerDeviceListCommand::Ptr cmd, Answer::Ptr answer);
53 void handleLastValue(ServerLastValueCommand::Ptr cmd, Answer::Ptr answer);
54 void sendRequest(GWRequest::Ptr request, Result::Ptr answer);
55 void sendRequestUnsafe(GWRequest::Ptr request, Result::Ptr answer);
57 void onSpecificResponse(
const GWResponse::Ptr response, Result::Ptr result);
58 void onDeviceListResponse(
const GWDeviceListResponse::Ptr response, Result::Ptr result);
59 void onLastValueResponse(
const GWLastValueResponse::Ptr response, Result::Ptr result);
62 GWSConnector::Ptr m_connector;
63 std::map<GlobalID, Result::Ptr> m_pending;
64 Poco::FastMutex m_lock;
Definition: CommandHandler.h:18
Handle requests to the remote server:
Definition: GWSCommandHandler.h:30
Definition: Loggable.h:19
void onResponse(const GWResponse::Ptr response) override
Check whether the responses associated with a pending command. If it is, update its result according ...
Definition: GWSCommandHandler.cpp:116
GWSListener provides an interface for delivering of events and messages related to communication with...
Definition: GWSListener.h:19