Line |
Branch |
Exec |
Source |
1 |
|
|
/** |
2 |
|
|
* This file is part of the CernVM File System. |
3 |
|
|
*/ |
4 |
|
|
|
5 |
|
|
#ifndef CVMFS_NOTIFY_MESSAGES_H_ |
6 |
|
|
#define CVMFS_NOTIFY_MESSAGES_H_ |
7 |
|
|
|
8 |
|
|
#include <string> |
9 |
|
|
|
10 |
|
|
namespace notify { |
11 |
|
|
|
12 |
|
|
namespace msg { |
13 |
|
|
|
14 |
|
|
enum Version { kProtocolVersion = 1 }; |
15 |
|
|
|
16 |
|
|
/** |
17 |
|
|
* The base class of all notification messages |
18 |
|
|
* |
19 |
|
|
* All notifications inherit from this base class and need to implement |
20 |
|
|
* the JSON serialization and deserialization methods. |
21 |
|
|
*/ |
22 |
|
|
class Message { |
23 |
|
|
public: |
24 |
|
|
virtual void ToJSONString(std::string* s) = 0; |
25 |
|
|
virtual bool FromJSONString(const std::string& s) = 0; |
26 |
|
|
|
27 |
|
6 |
virtual ~Message() {} |
28 |
|
|
}; |
29 |
|
|
|
30 |
|
|
/** |
31 |
|
|
* Activity notification |
32 |
|
|
* |
33 |
|
|
* The activity message informs about the current revision of a repository. It |
34 |
|
|
* contains a timestamp, repository name and the repository manifest. |
35 |
|
|
*/ |
36 |
|
|
class Activity : public Message { |
37 |
|
|
public: |
38 |
|
|
Activity(); |
39 |
|
|
virtual ~Activity(); |
40 |
|
|
|
41 |
|
|
bool operator==(const Activity& other) const; |
42 |
|
|
|
43 |
|
|
virtual void ToJSONString(std::string* s); |
44 |
|
|
virtual bool FromJSONString(const std::string& s); |
45 |
|
|
|
46 |
|
|
int version_; |
47 |
|
|
std::string timestamp_; |
48 |
|
|
std::string repository_; |
49 |
|
|
std::string manifest_; |
50 |
|
|
}; |
51 |
|
|
|
52 |
|
|
} // namespace msg |
53 |
|
|
|
54 |
|
|
} // namespace notify |
55 |
|
|
|
56 |
|
|
#endif // CVMFS_NOTIFY_MESSAGES_H_ |
57 |
|
|
|