libepp_nicbr
DefRegCheckRsp.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id$ */
7 #ifndef __DEF_REG_CHECK_RSP_H__
8 #define __DEF_REG_CHECK_RSP_H__
9 
10 #include <list>
11 #include <string>
12 
13 #include "libepp_nicbr.H"
14 
15 #include "Response.H"
16 #include "CommonData.H"
17 
18 using std::list;
19 using std::string;
20 
21 LIBEPP_NICBR_NS_BEGIN
22 
24 class DefRegCheckRsp : public Response
25 {
26 public:
28  class Name : public DefRegName
29  {
30  public:
32  Name() :
33  DefRegName(),
34  _avail(false),
35  _reason("")
36  {
37  }
38 
40  /*
41  @param avail object availability
42  */
43  void set_avail(const bool avail)
44  {
45  _avail = avail;
46  }
47 
49  /*
50  @return object availability
51  */
52  bool is_avail() const
53  {
54  return _avail;
55  }
56 
58  /*
59  @param reason unavailability reason message
60  */
61  void set_reason(const string &reason)
62  {
63  _reason = reason;
64  }
65 
67  /*
68  @return object unavailability reason
69  */
70  string get_reason() const
71  {
72  return _reason;
73  }
74 
75  private:
77  bool _avail;
79  string _reason;
80  };
81 
83  DefRegCheckRsp(bool reset = true) : Response(false)
84  {
85  if (reset) {
86  this->reset();
87  }
88  }
89 
92  /*
93  @param name name availability
94  */
95  void add_name(const Name &name) { _availability_list.push_back(name); }
96 
98  /*
99  @return list of name with their availability
100  */
101  list<Name> get_names() const { return _availability_list; }
102 
104  void reset()
105  {
106  Response::reset();
107  _availability_list.clear();
108  }
109 
110 protected:
112  list<Name> _availability_list;
113 };
114 
115 LIBEPP_NICBR_NS_END
116 
117 #endif // __DEF_REG_CHECK_RSP_H__
DefRegCheckRsp(bool reset=true)
Default constructor.
Definition: DefRegCheckRsp.H:83
EPP NameRsp Class.
Definition: DefRegCheckRsp.H:28
EPP DefRegCheckRsp Class.
Definition: DefRegCheckRsp.H:24
EPP Response Class.
Definition: Response.H:24
Name()
Default constructor.
Definition: DefRegCheckRsp.H:32
Project defines.
EPP CommonData Class.
EPP defensive registration Name Class.
Definition: CommonData.H:797
bool is_avail() const
Returns object availability.
Definition: DefRegCheckRsp.H:52
EPP Response Class.
string get_reason() const
Returns object unavailability reason.
Definition: DefRegCheckRsp.H:70
void set_avail(const bool avail)
Set the object availability.
Definition: DefRegCheckRsp.H:43
list< Name > get_names() const
Returns list of names with their availability.
Definition: DefRegCheckRsp.H:101
list< Name > _availability_list
Defensive registration name list.
Definition: DefRegCheckRsp.H:112
void set_reason(const string &reason)
Sets the object unavailability reason.
Definition: DefRegCheckRsp.H:61
void reset()
Resets object attributes.
Definition: DefRegCheckRsp.H:104
void add_name(const Name &name)
Definition: DefRegCheckRsp.H:95
void reset()
reset attributes
Definition: Response.H:161