libepp_nicbr
RGPRestore.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id$ */
7 #ifndef __RGP_RESTORE_H__
8 #define __RGP_RESTORE_H__
9 
10 #include <string>
11 
12 #include "libepp_nicbr.H"
13 
14 using std::string;
15 
16 LIBEPP_NICBR_NS_BEGIN
17 
19 class RGPReport
20 {
21 public:
24  {
25  this->reset();
26  }
27 
29 
33  void set_pre_data(const string &pre_data)
34  {
35  _pre_data = pre_data;
36  }
37 
39 
43  string get_pre_data() const
44  {
45  return _pre_data;
46  }
47 
49 
53  void set_post_data(const string &post_data)
54  {
55  _post_data = post_data;
56  }
57 
59 
63  string get_post_data() const
64  {
65  return _post_data;
66  }
67 
69 
73  void set_del_time(const string &del_time)
74  {
75  _del_time = del_time;
76  }
77 
79 
83  string get_del_time() const
84  {
85  return _del_time;
86  }
87 
89 
93  void set_res_time(const string &res_time)
94  {
95  _res_time = res_time;
96  }
97 
99 
103  string get_res_time() const
104  {
105  return _res_time;
106  }
107 
109 
113  void set_res_reason(const string &res_reason)
114  {
115  _res_reason = res_reason;
116  }
117 
119 
123  string get_res_reason() const
124  {
125  return _res_reason;
126  }
127 
129 
134  void set_statement1(const string &statement1)
135  {
136  _statement1 = statement1;
137  }
138 
139 
141 
147  void set_statement1(const string &statement1, const string &lang)
148  {
149  _statement1 = statement1;
150  _statement1_lang = lang;
151  }
152 
154 
159  string get_statement1() const
160  {
161  return _statement1;
162  }
163 
165 
168  string get_statement1_lang() const
169  {
170  return _statement1_lang;
171  }
172 
174 
178  void set_statement2(const string &statement2)
179  {
180  _statement2 = statement2;
181  }
182 
184 
189  void set_statement2(const string &statement2, const string &lang)
190  {
191  _statement2 = statement2;
192  _statement2_lang = lang;
193  }
194 
196 
200  string get_statement2() const
201  {
202  return _statement2;
203  }
204 
206 
209  string get_statement2_lang() const
210  {
211  return _statement2_lang;
212  }
213 
215 
219  void set_other(const string &other)
220  {
221  _other = other;
222  }
223 
225 
229  string get_other() const
230  {
231  return _other;
232  }
233 
235  void reset()
236  {
237  _pre_data = "";
238  _post_data = "";
239  _del_time = "";
240  _res_time = "";
241  _res_reason = "";
242  _statement1 = "";
243  _statement1_lang = "";
244  _statement2 = "";
245  _statement2_lang = "";
246  _other = "";
247  }
248 
249 private:
252  string _pre_data;
253 
256  string _post_data;
257 
260  string _del_time;
261 
264  string _res_time;
265 
267  string _res_reason;
268 
272  string _statement1;
273 
275  string _statement1_lang;
276 
279  string _statement2;
280 
282  string _statement2_lang;
283 
286  string _other;
287 };
288 
290 class RGPRestore {
291 public:
293  class Operation
294  {
295  public:
297  enum Value {
298  NONE,
299  REQUEST,
300  REPORT
301  };
302 
305 
309  static string toString(const Value value)
310  {
311  switch(value) {
312  case NONE:
313  break;
314  case REQUEST:
315  return "request";
316  case REPORT:
317  return "report";
318  }
319 
320  return "";
321  }
322 
323  static Value fromString(const string &value)
324  {
325  if (value == "request") {
326  return REQUEST;
327  } else if (value == "report") {
328  return REPORT;
329  }
330 
331  return NONE;
332  }
333  };
334 
337  {
338  this->reset();
339  }
340 
342 
346  void set_operation(const Operation::Value operation)
347  {
348  _operation = operation;
349  }
350 
352 
357  {
358  return _operation;
359  }
360 
362 
365  void set_report(const RGPReport &report)
366  {
367  _report = report;
368  }
369 
371 
375  {
376  return _report;
377  }
378 
380  void reset()
381  {
382  _operation = Operation::NONE;
383  _report.reset();
384  }
385 
386 private:
388  Operation::Value _operation;
389 
391  RGPReport _report;
392 };
393 
394 LIBEPP_NICBR_NS_END
395 
396 #endif // __RGP_RESTORE_H__
RGPReport()
Default constructor.
Definition: RGPRestore.H:23
void set_res_time(const string &res_time)
Sets the res time.
Definition: RGPRestore.H:93
void reset()
Reset all object attributes.
Definition: RGPRestore.H:380
string get_statement1() const
Returns the statement.
Definition: RGPRestore.H:159
Operation::Value get_operation() const
Returns the operation.
Definition: RGPRestore.H:356
string get_res_time() const
Returns the res time.
Definition: RGPRestore.H:103
void set_statement2(const string &statement2, const string &lang)
Sets the statement and language.
Definition: RGPRestore.H:189
string get_pre_data() const
Returns the pre data.
Definition: RGPRestore.H:43
Project defines.
string get_statement2() const
Returns the statement.
Definition: RGPRestore.H:200
void set_report(const RGPReport &report)
Sets the report.
Definition: RGPRestore.H:365
void set_operation(const Operation::Value operation)
Sets the operation.
Definition: RGPRestore.H:346
string get_del_time() const
Returns the del time.
Definition: RGPRestore.H:83
void set_statement1(const string &statement1, const string &lang)
Sets the statement and language.
Definition: RGPRestore.H:147
void set_statement2(const string &statement2)
Sets the statement.
Definition: RGPRestore.H:178
RGPRestore()
Default constructor.
Definition: RGPRestore.H:336
void set_del_time(const string &del_time)
Sets the del time.
Definition: RGPRestore.H:73
void set_other(const string &other)
Sets the other.
Definition: RGPRestore.H:219
EPP RGPReport Class.
Definition: RGPRestore.H:19
void reset()
Reset all object attributes.
Definition: RGPRestore.H:235
string get_statement2_lang() const
Returns the statement language.
Definition: RGPRestore.H:209
EPP RGPRestore Operation Class.
Definition: RGPRestore.H:293
static string toString(const Value value)
Definition: RGPRestore.H:309
void set_statement1(const string &statement1)
Sets the statement.
Definition: RGPRestore.H:134
string get_statement1_lang() const
Returns the statement language.
Definition: RGPRestore.H:168
RGPReport get_report() const
Returns the report.
Definition: RGPRestore.H:374
void set_res_reason(const string &res_reason)
Sets the res reason.
Definition: RGPRestore.H:113
Value
List of RGP restore operations acording to RFC 3915.
Definition: RGPRestore.H:297
EPP RGPRestore Class.
Definition: RGPRestore.H:290
void set_pre_data(const string &pre_data)
Sets the pre data.
Definition: RGPRestore.H:33
string get_res_reason() const
Returns the res reason.
Definition: RGPRestore.H:123
string get_other() const
Returns the other.
Definition: RGPRestore.H:229
string get_post_data() const
Returns the post data.
Definition: RGPRestore.H:63
void set_post_data(const string &post_data)
Sets the post data.
Definition: RGPRestore.H:53