libepp_nicbr
ContactUpdateCmd.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: ContactUpdateCmd.H 1243 2014-11-14 17:16:47Z rafael $ */
7 #ifndef __CONTACT_UPDATE_CMD_H__
8 #define __CONTACT_UPDATE_CMD_H__
9 
10 #include <string>
11 #include <set>
12 #include <memory>
13 
14 #include "libepp_nicbr.H"
15 
16 #include "Command.H"
17 #include "CommonData.H"
18 
19 using std::string;
20 using std::set;
21 using std::auto_ptr;
22 
23 LIBEPP_NICBR_NS_BEGIN
24 
26 class ContactUpdateCmd : public Command
27 {
28 public:
29 
31  ContactUpdateCmd(bool reset = true) : Command(false)
32  {
33  if (reset) {
34  this->reset();
35  }
36  }
37 
39 
42  void insert_status_list_add(const string &status_add)
43  {
44  _status_list_add.insert(status_add);
45  }
46 
48 
51  void insert_status_list_rem(const string &status_rem)
52  {
53  _status_list_rem.insert(status_rem);
54  }
55 
57 
60  set<string> get_status_list_add() const { return _status_list_add; }
61 
63 
66  set<string> get_status_list_rem() const { return _status_list_rem; }
67 
69 
72  void set_common_data(const CommonData &common)
73  {
74  _common = common;
75  }
76 
78 
81  CommonData get_common_data() const { return _common; }
82 
84 
87  void set_authInfo(const AuthInfo &authInfo)
88  {
89  _authInfo = authInfo;
90  }
91 
93 
96  AuthInfo get_authInfo() const { return _authInfo; }
97 
99 
102  void set_password(const string &password)
103  {
104  _password = password;
105  }
106 
108 
111  string get_password() const
112  {
113  return _password;
114  }
115 
117 
120  void set_reminder(const string &reminder)
121  {
122  _reminder = reminder;
123  }
124 
126 
129  string get_reminder() const
130  {
131  return _reminder;
132  }
133 
135 
138  void set_language(const string &language)
139  {
140  _language = language;
141  }
142 
144 
147  string get_language() const
148  {
149  return _language;
150  }
151 
153 
156  void set_properties_add(const vector<string>& properties)
157  {
158  _properties_add = properties;
159  }
160 
162 
165  void insert_property_add(const string& property)
166  {
167  _properties_add.push_back(property);
168  }
169 
172 
175  vector<string> get_properties_add()
176  {
177  return _properties_add;
178  }
179 
181 
184  void set_properties_rem(const vector<string>& properties)
185  {
186  _properties_rem = properties;
187  }
188 
190 
193  void insert_property_rem(const string& property)
194  {
195  _properties_rem.push_back(property);
196  }
197 
200 
203  vector<string> get_properties_rem()
204  {
205  return _properties_rem;
206  }
207 
209  bool has_extension() const {
211  }
212 
215  return !_password.empty() ||
216  !_reminder.empty() ||
217  !_language.empty() ||
218  !_properties_add.empty() ||
219  !_properties_rem.empty();
220  }
221 
223  void reset()
224  {
225  Command::reset();
226  _status_list_add.clear();
227  _status_list_rem.clear();
228  _common.reset();
229  _authInfo.reset();
230  _password = "";
231  _reminder = "";
232  _language = "";
233  _properties_add.clear();
234  _properties_rem.clear();
235  }
236 
237 protected:
239  set<string> _status_list_add;
240 
242  set<string> _status_list_rem;
243 
246 
249 
251  string _password;
252 
254  string _reminder;
255 
257  string _language;
258 
260  vector<string> _properties_add;
261 
263  vector<string> _properties_rem;
264 };
265 
266 LIBEPP_NICBR_NS_END
267 #endif //__CONTACT_UPDATE_CMD_H__
void set_properties_add(const vector< string > &properties)
Sets the properties to be associated with the contact.
Definition: ContactUpdateCmd.H:156
void set_properties_rem(const vector< string > &properties)
Sets the properties that are going to be removed of the contact.
Definition: ContactUpdateCmd.H:184
AuthInfo get_authInfo() const
Returns authorization information.
Definition: ContactUpdateCmd.H:96
Project defines.
EPP CommonData Class.
void insert_property_add(const string &property)
Adds a property to the vector of properties.
Definition: ContactUpdateCmd.H:165
void insert_status_list_add(const string &status_add)
Inserts a status to the object.
Definition: ContactUpdateCmd.H:42
string get_language() const
Returns the language.
Definition: ContactUpdateCmd.H:147
bool has_lacnic_contact_extension() const
Check if there is lacnic contact extension.
Definition: ContactUpdateCmd.H:214
set< string > get_status_list_add() const
Returns the list of status to be added to the object.
Definition: ContactUpdateCmd.H:60
bool has_extension() const
Check if there is any extension.
Definition: ContactUpdateCmd.H:209
string get_reminder() const
Returns the reminder.
Definition: ContactUpdateCmd.H:129
string get_password() const
Returns the password.
Definition: ContactUpdateCmd.H:111
set< string > get_status_list_rem() const
Returns the list of status to be removed from the object.
Definition: ContactUpdateCmd.H:66
void insert_property_rem(const string &property)
Adds a property to be removed from the contact.
Definition: ContactUpdateCmd.H:193
set< string > _status_list_rem
Status list to be removed to the object.
Definition: ContactUpdateCmd.H:242
void set_reminder(const string &reminder)
Sets reminder attribute.
Definition: ContactUpdateCmd.H:120
string _language
contact's preferred language (lacnic contact extension)
Definition: ContactUpdateCmd.H:257
void set_authInfo(const AuthInfo &authInfo)
Sets authorization information.
Definition: ContactUpdateCmd.H:87
CommonData get_common_data() const
Returns the common data object.
Definition: ContactUpdateCmd.H:81
void set_common_data(const CommonData &common)
Sets the common data object.
Definition: ContactUpdateCmd.H:72
vector< string > get_properties_rem()
Definition: ContactUpdateCmd.H:203
void reset()
Reset all object attributes.
Definition: CommonData.H:152
AuthInfo _authInfo
authorization information
Definition: ContactUpdateCmd.H:248
vector< string > _properties_add
properties to be added to the object (lacnic contact extension)
Definition: ContactUpdateCmd.H:260
EPP CommonData Class.
Definition: CommonData.H:487
vector< string > get_properties_add()
Definition: ContactUpdateCmd.H:175
CommonData _common
Common data object.
Definition: ContactUpdateCmd.H:245
void reset()
Reset object attributes.
Definition: Command.H:33
void insert_status_list_rem(const string &status_rem)
Removes a status from the object.
Definition: ContactUpdateCmd.H:51
set< string > _status_list_add
Status List to be added to the object.
Definition: ContactUpdateCmd.H:239
EPP Command Class.
Definition: Command.H:18
ContactUpdateCmd(bool reset=true)
Default constructor.
Definition: ContactUpdateCmd.H:31
void set_password(const string &password)
Sets password attribute.
Definition: ContactUpdateCmd.H:102
EPP Command Class.
vector< string > _properties_rem
properties to be removed of the object (lacnic contact extension)
Definition: ContactUpdateCmd.H:263
EPP ContactUpdateCmd Class.
Definition: ContactUpdateCmd.H:26
void reset()
Resets the data in the object.
Definition: ContactUpdateCmd.H:223
string _password
contact's password (lacnic contact extension)
Definition: ContactUpdateCmd.H:251
string _reminder
contact's tip to remember the password (lacnic contact extension)
Definition: ContactUpdateCmd.H:254
void set_language(const string &language)
Sets language attribute.
Definition: ContactUpdateCmd.H:138
AuthInfo Class.
Definition: CommonData.H:83
void reset()
reset attributes