Commit | Line | Data |
---|---|---|
b1be615b | 1 | /** @file |
3a89ac31 | 2 | * @brief The abstract service class. This class represents all services. |
b1be615b BS |
3 | * |
4 | * | |
5 | * | |
6 | * @copyright Intra2net AG | |
7 | * @license GPLv2 | |
8 | */ | |
9 | ||
4545a371 BS |
10 | #ifndef SERVICE_H |
11 | #define SERVICE_H | |
12 | ||
88a594e8 BS |
13 | #include "logger.h" |
14 | ||
4545a371 BS |
15 | #include <string> |
16 | ||
2bc1878a | 17 | #include <boost/serialization/array.hpp> |
88a594e8 | 18 | #include <boost/shared_ptr.hpp> |
2bc1878a | 19 | |
3a89ac31 | 20 | |
4248e8ca TJ |
21 | class Service |
22 | { | |
2bc1878a | 23 | private: |
88a594e8 | 24 | |
3a89ac31 BS |
25 | std::string Protocol; |
26 | std::string Hostname; | |
27baf279 | 27 | |
3a89ac31 BS |
28 | std::string Login; |
29 | std::string Password; | |
30 | ||
025abebb | 31 | std::string ActualIP; |
3a89ac31 | 32 | |
2bc1878a | 33 | int Lastupdated; |
2bc1878a BS |
34 | |
35 | friend class boost::serialization::access; | |
36 | template<class Archive> | |
37 | void serialize(Archive &, const unsigned int); | |
38 | ||
88a594e8 | 39 | Logger::Ptr Log; |
27baf279 | 40 | |
4545a371 | 41 | public: |
88a594e8 BS |
42 | |
43 | typedef boost::shared_ptr<Service> Ptr; | |
44 | ||
4545a371 BS |
45 | Service(); |
46 | ||
4248e8ca | 47 | virtual ~Service(); |
4545a371 | 48 | |
8bca3c5d | 49 | virtual void update(const std::string&)=0; |
4545a371 | 50 | |
6d64d311 BS |
51 | virtual int get_timeout()=0; |
52 | virtual void set_timeout(const int)=0; | |
53 | ||
3a89ac31 BS |
54 | void set_protocol(const std::string&); |
55 | std::string get_protocol(); | |
56 | ||
57 | void set_hostname(const std::string&); | |
58 | std::string get_hostname(); | |
59 | ||
60 | void set_login(const std::string&); | |
61 | std::string get_login(); | |
62 | ||
63 | void set_password(const std::string&); | |
64 | std::string get_password(); | |
65 | ||
2bc1878a BS |
66 | void set_lastupdated(const int); |
67 | int get_lastupdated(); | |
68 | ||
27baf279 BS |
69 | void set_actual_ip(const std::string&); |
70 | std::string get_actual_ip(); | |
71 | ||
88a594e8 BS |
72 | void set_logger(const Logger::Ptr&); |
73 | Logger::Ptr get_logger(); | |
27baf279 | 74 | |
3a89ac31 BS |
75 | bool operator== (const Service&) const; |
76 | bool operator!= (const Service&) const; | |
4545a371 BS |
77 | }; |
78 | ||
79 | #endif |