TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / src / anbox / container / management_api_message_processor.cpp
1 /*
2  * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3, as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranties of
10  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11  * PURPOSE.  See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 #include "anbox/container/management_api_message_processor.h"
19 #include "anbox/container/management_api_skeleton.h"
20 #include "anbox/rpc/template_message_processor.h"
21
22 #include "anbox_bridge.pb.h"
23 #include "anbox_container.pb.h"
24
25 namespace anbox {
26 namespace container {
27 ManagementApiMessageProcessor::ManagementApiMessageProcessor(
28     const std::shared_ptr<network::MessageSender> &sender,
29     const std::shared_ptr<rpc::PendingCallCache> &pending_calls,
30     const std::shared_ptr<ManagementApiSkeleton> &server)
31     : rpc::MessageProcessor(sender, pending_calls), server_(server) {}
32
33 ManagementApiMessageProcessor::~ManagementApiMessageProcessor() {}
34
35 void ManagementApiMessageProcessor::dispatch(rpc::Invocation const &invocation) {
36   if (invocation.method_name() == "start_container")
37     invoke(this, server_.get(), &ManagementApiSkeleton::start_container, invocation);
38   else if (invocation.method_name() == "stop_container")
39     invoke(this, server_.get(), &ManagementApiSkeleton::stop_container, invocation);
40 }
41
42 void ManagementApiMessageProcessor::process_event_sequence(
43     const std::string &) {}
44 }  // namespace container
45 }  // namespace anbox