RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
core/router/router_rest_api.h
00001 /* router_rest_api.h                                               -*- C++ -*-
00002    Jeremy Barnes, 7 November 2012
00003    Copyright (c) 2012 Datacratic Inc.  All rights reserved.
00004 
00005    Class to add an http monitor to a router.
00006 */
00007 
00008 #ifndef __router__router_rest_api_h__
00009 #define __router__router_rest_api_h__
00010 
00011 #include "soa/service/http_monitor.h"
00012 #include "soa/service/service_base.h"
00013 #include <string>
00014 
00015 namespace RTBKIT {
00016 
00017 struct Router;
00018 
00019 /******************************************************************************/
00020 /* ROUTER REST API CONNECTION                                                 */
00021 /******************************************************************************/
00022 
00023 struct RouterRestApiConnection
00024     : public HttpMonitorHandler<RouterRestApiConnection, Router*> {
00025 
00026     RouterRestApiConnection(const std::string& name,
00027                             Router* router);
00028 
00029     Router * router;
00030 
00031     virtual void doGet(const std::string& resource);
00032 
00033     virtual void doPost(const std::string& resource,
00034                         const std::string& payload);
00035 };
00036 
00037 typedef HttpMonitor<RouterRestApiConnection, Router*> RouterRestApi;
00038 
00039 } // namespace RTBKIT
00040 
00041 
00042 #endif /* __router__router_rest_api_h__ */
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator