2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
23 $Date: 2010/01/19 11:09:48 $
34 #include "user_stat.h"
35 #include "user_conf.h"
36 #include "corp_conf.h"
37 #include "service_conf.h"
38 #include "admin_conf.h"
39 #include "tariff_conf.h"
40 #include "base_settings.h"
41 #include "stg_message.h"
44 //-----------------------------------------------------------------------------
48 virtual ~BASE_STORE(){};
49 virtual int GetUsersList(vector<string> * usersList) const = 0;
50 virtual int AddUser(const string & login) const = 0;
51 virtual int DelUser(const string & login) const = 0;
52 virtual int SaveUserStat(const USER_STAT & stat, const string & login) const = 0;
53 virtual int SaveUserConf(const USER_CONF & conf, const string & login) const = 0;
54 virtual int RestoreUserStat(USER_STAT * stat, const string & login) const = 0;
55 virtual int RestoreUserConf(USER_CONF * conf, const string & login) const = 0;
57 virtual int WriteUserChgLog(const string & login,
58 const string & admLogin,
60 const string & paramName,
61 const string & oldValue,
62 const string & newValue,
63 const string & message = "") const = 0;
65 virtual int WriteUserConnect(const string & login, uint32_t ip) const = 0;
67 virtual int WriteUserDisconnect(const string & login,
69 const DIR_TRAFF & down,
70 const DIR_TRAFF & sessionUp,
71 const DIR_TRAFF & sessionDown,
74 const std::string & reason) const = 0;
76 virtual int WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> & statTree,
78 const string & login) const = 0;
80 virtual int AddMessage(STG_MSG * msg, const string & login) const = 0;
81 virtual int EditMessage(const STG_MSG & msg, const string & login) const = 0;
82 virtual int GetMessage(uint64_t id, STG_MSG * msg, const string & login) const = 0;
83 virtual int DelMessage(uint64_t id, const string & login) const = 0;
84 virtual int GetMessageHdrs(vector<STG_MSG_HDR> * hdrsList, const string & login) const = 0;
87 virtual int SaveMonthStat(const USER_STAT & stat, int month, int year, const string & login) const = 0;
89 virtual int GetAdminsList(vector<string> * adminsList) const = 0;
90 virtual int SaveAdmin(const ADMIN_CONF & ac) const = 0;
91 virtual int RestoreAdmin(ADMIN_CONF * ac, const string & login) const = 0;
92 virtual int AddAdmin(const string & login) const = 0;
93 virtual int DelAdmin(const string & login) const = 0;
95 virtual int GetTariffsList(vector<string> * tariffsList) const = 0;
96 virtual int AddTariff(const string & name) const = 0;
97 virtual int DelTariff(const string & name) const = 0;
98 virtual int SaveTariff(const TARIFF_DATA & td, const string & tariffName) const = 0;
99 virtual int RestoreTariff(TARIFF_DATA * td, const string & tariffName) const = 0;
101 virtual int GetCorpsList(vector<string> * corpsList) const = 0;
102 virtual int SaveCorp(const CORP_CONF & cc) const = 0;
103 virtual int RestoreCorp(CORP_CONF * cc, const string & name) const = 0;
104 virtual int AddCorp(const string & name) const = 0;
105 virtual int DelCorp(const string & name) const = 0;
107 virtual int GetServicesList(vector<string> * corpsList) const = 0;
108 virtual int SaveService(const SERVICE_CONF & sc) const = 0;
109 virtual int RestoreService(SERVICE_CONF * sc, const string & name) const = 0;
110 virtual int AddService(const string & name) const = 0;
111 virtual int DelService(const string & name) const = 0;
113 virtual void SetSettings(const MODULE_SETTINGS & s) = 0;
114 virtual int ParseSettings() = 0;
115 virtual const string & GetStrError() const = 0;
116 virtual const string & GetVersion() const = 0;
118 //-----------------------------------------------------------------------------
120 #endif //BASE_STORE_H