OSDN Git Service

ソースツリー再構成中(ほぼOK?)
[ultramonkey-l7/ultramonkey-l7-v3.git] / l7vsd / unit_tests / command_session_test / l7vsd_stub.h
1 #ifndef L7VSD_H
2 #define L7VSD_H
3
4 #include <list>
5 #include <boost/shared_ptr.hpp>
6 #include "error_code.h"
7 #include "l7vs_command.h"
8 #include "command_receiver.h"
9 #include "virtualservice_element.h"
10 #include "logger.h"
11 #include "parameter.h"
12 #include "replication_stub.h"
13
14 namespace       l7vs{
15 class   l7vsd{
16 public:
17         typedef std::list< virtualservice_element >                                     vselist_type;   //!< virtual service element list typedef
18
19         typedef std::list< std::pair<LOG_CATEGORY_TAG, LOG_LEVEL_TAG> > logstatus_list_type;    //!< logstatus list typedef
20
21         static  bool    list_vs_called;
22         static  bool    list_vs_v_called;
23         static  bool    add_vs_called;
24         static  bool    del_vs_called;
25         static  bool    edit_vs_called;
26         static  bool    add_rs_called;
27         static  bool    del_rs_called;
28         static  bool    edit_rs_called;
29         static  bool    flush_vs_called;
30         static  bool    rep_cmd_called;
31         static  bool    set_loglevel_called;
32         static  bool    snmp_set_loglevel_called;
33         static  bool    param_called;
34
35         static  bool    list_vs_fail;
36         static  bool    list_vs_v_fail;
37         static  bool    add_vs_fail;
38         static  bool    del_vs_fail;
39         static  bool    edit_vs_fail;
40         static  bool    add_rs_fail;
41         static  bool    del_rs_fail;
42         static  bool    edit_rs_fail;
43         static  bool    flush_vs_fail;
44         static  bool    rep_cmd_fail;
45         static  bool    set_loglevel_fail;
46         static  bool    snmp_set_loglevel_fail;
47         static  bool    param_fail;
48
49 public:
50         void    list_virtual_service( vselist_type*, error_code& err )
51         {
52                 list_vs_called = true;
53                 if(list_vs_fail)        err.setter( true, "");
54         }
55         void    list_virtual_service_verbose( l7vsd_response*, error_code& err )
56         {
57                 list_vs_v_called = true;
58                 if(list_vs_v_fail)      err.setter( true, "");
59         }
60         void    add_virtual_service( const virtualservice_element*, error_code& err )
61         {
62                 add_vs_called = true;
63                 if(add_vs_fail) err.setter( true, "");
64         }
65         void    del_virtual_service( const virtualservice_element*, error_code& err )
66         {
67                 del_vs_called = true;
68                 if(del_vs_fail) err.setter( true, "");
69         }
70         void    edit_virtual_service( const virtualservice_element*, error_code& err )
71         {
72                 edit_vs_called = true;
73                 if(edit_vs_fail)        err.setter( true, "");
74         }
75
76         void    add_real_server( const virtualservice_element*, error_code& err )
77         {
78                 add_rs_called = true;
79                 if(add_rs_fail) err.setter( true, "");
80         }
81         void    del_real_server( const virtualservice_element*, error_code& err )
82         {
83                 del_rs_called = true;
84                 if(del_rs_fail) err.setter( true, "");
85         }
86         void    edit_real_server( const virtualservice_element*, error_code& err )
87         {
88                 edit_rs_called = true;
89                 if(edit_rs_fail)        err.setter( true, "");
90         }
91
92         void    flush_virtual_service( error_code& err )
93         {
94                 flush_vs_called = true;
95                 if(flush_vs_fail)       err.setter( true, "");
96         }
97
98         void    replication_command( const l7vsadm_request::REPLICATION_COMMAND_TAG*, error_code& err )
99         {
100                 rep_cmd_called = true;
101                 if(rep_cmd_fail)        err.setter( true, "");
102         }
103         void    set_loglevel( const LOG_CATEGORY_TAG*, const LOG_LEVEL_TAG*, error_code& err )
104         {
105                 set_loglevel_called = true;
106                 if(set_loglevel_fail)   err.setter( true, "");
107         }
108         void    snmp_set_loglevel( const LOG_CATEGORY_TAG*, const LOG_LEVEL_TAG*, error_code& err )
109         {
110                 snmp_set_loglevel_called = true;
111                 if(snmp_set_loglevel_fail)      err.setter( true, "");
112         }
113         void    reload_parameter( const PARAMETER_COMPONENT_TAG*, error_code& err )
114         {
115                 param_called = true;
116                 if(param_fail)  err.setter( true, "");
117         }
118
119
120 };
121 }       //namespace     l7vs
122 #endif  //L7VSD_H