libepp_nicbr
BrOrgUpdateCmd.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: BrOrgUpdateCmd.H 1256 2014-12-01 13:02:14Z rafael $ */
7 #ifndef __BR_ORG_UPDATE_CMD_H__
8 #define __BR_ORG_UPDATE_CMD_H__
9 
10 #include <string>
11 #include <map>
12 
13 
14 #include "libepp_nicbr.H"
15 
16 #include "ContactUpdateCmd.H"
17 #include "CommonData.H"
18 
19 using std::string;
20 using std::map;
21 
22 LIBEPP_NICBR_NS_BEGIN
23 
26 {
27 public:
29  BrOrgUpdateCmd(bool reset = true) : ContactUpdateCmd(false)
30  {
31  if (reset) {
32  this->reset();
33  }
34  }
35 
37 
40  void set_organization(const string &organization)
41  {
42  _organization = organization;
43  }
44 
46 
49  string get_organization() const
50  {
51  return _organization;
52  }
53 
55 
58  void set_responsible(const string &responsible)
59  {
60  _responsible = responsible;
61  _responsible_f = true;
62  }
63 
65 
68  string get_responsible() const { return _responsible; };
69 
71 
74  void set_responsible_f(const bool responsible_f)
75  {
76  _responsible_f = responsible_f;
77  };
78 
80 
83  bool get_responsible_f() const
84  {
85  return _responsible_f;
86  };
87 
89 
92  void set_exDate(const string& exDate) { _exDate = exDate; }
93 
95 
98  string get_exDate() const { return _exDate; }
99 
101 
105  void insert_contact_add(const string &type, const string &id)
106  {
107  _contact_list_add[type] = id;
108  }
109 
111 
114  map< string, string, less<string> > get_contact_list_add() const
115  {
116  return _contact_list_add;
117  }
118 
120 
124  void insert_contact_rem(const string &type, const string &id)
125  {
126  _contact_list_rem[type] = id;
127  }
128 
130 
133  map< string, string, less<string> > get_contact_list_rem() const
134  {
135  return _contact_list_rem;
136  }
137 
139 
143  void set_suspended(const bool suspended)
144  {
145  if (suspended) {
146  _suspended = SuspendedStatus::SUSPENDED;
147  } else {
148  _suspended = SuspendedStatus::NORMAL;
149  }
150  }
151 
153 
156  SuspendedStatus::Value get_suspended() const { return _suspended; }
157 
159 
162  void set_type(const string &type)
163  {
164  _type = type;
165  }
166 
168 
171  string get_type() const
172  {
173  return _type;
174  }
175 
177  // LACNIC Org extension methods
178 
180 
183  void set_epp_status(const string &epp_status)
184  {
185  _epp_status = epp_status;
186  }
187 
189 
192  string get_epp_status() const
193  {
194  return _epp_status;
195  }
196 
198 
201  void set_epp_password(const string &password)
202  {
203  _epp_password = password;
204  }
205 
207 
210  string get_epp_password() const
211  {
212  return _epp_password;
213  }
214 
217  /*
218  @param ip IP or range
219  */
220  void insert_epp_ip_add(const string &ip)
221  {
222  _epp_ips_add.push_back(ip);
223  }
224 
227  /*
228  @return list of EPP IPs or ranges
229  */
230  vector<string> get_epp_ips_add() const
231  {
232  return _epp_ips_add;
233  }
234 
237  /*
238  @param ip IP or range
239  */
240  void insert_epp_ip_rem(const string &ip)
241  {
242  _epp_ips_rem.push_back(ip);
243  }
244 
247  /*
248  @return list of EPP IPs or ranges
249  */
250  vector<string> get_epp_ips_rem() const
251  {
252  return _epp_ips_rem;
253  }
254 
256  /*
257  @param type renewal type
258  */
259  void insert_renewal_type_add(const string &type)
260  {
261  _renewal_types_add.push_back(type);
262  }
263 
265  /*
266  @return renewal types
267  */
268  vector<string> get_renewal_types_add() const
269  {
270  return _renewal_types_add;
271  }
272 
274  /*
275  @param type renewal type
276  */
277  void insert_renewal_type_rem(const string &type)
278  {
279  _renewal_types_rem.push_back(type);
280  }
281 
283  /*
284  @return renewal types
285  */
286  vector<string> get_renewal_types_rem() const
287  {
288  return _renewal_types_rem;
289  }
290 
292  /*
293  @param resources_class for now can be "all-resources" or "non-legacy-only"
294  */
295  void set_resources_class(const string &resources_class)
296  {
297  _resources_class = resources_class;
298  }
299 
301  /*
302  @return organization resources class
303  */
304  string get_resources_class() const
305  {
306  return _resources_class;
307  }
308 
310  /*
311  @param password legacy organization password
312  */
313  void set_password(const string &password)
314  {
315  _password = password;
316  }
317 
319  /*
320  @return legacy organization password
321  */
322  string get_password() const
323  {
324  return _password;
325  }
326 
328  void reset()
329  {
331  _organization = "";
332  _contact_list_add.clear();
333  _contact_list_rem.clear();
334  _responsible = "";
335  _responsible_f = false;
336  _exDate = "";
337  _suspended = SuspendedStatus::UNDEFINED;
338  _type = "";
339  _epp_status = "";
340  _epp_password = "";
341  _epp_ips_add.clear();
342  _epp_ips_rem.clear();
343  _renewal_types_add.clear();
344  _renewal_types_rem.clear();
345  _resources_class = "";
346  _password = "";
347  }
348 
349 protected:
352 
354  string _responsible;
355 
358 
361  string _exDate;
362 
364  map<string, string, less<string> > _contact_list_add;
365 
367  map<string, string, less<string> > _contact_list_rem;
368 
370  SuspendedStatus::Value _suspended;
371 
373  // LACNIC Org extension methods
374 
376  string _type;
377 
379  string _epp_status;
380 
383 
386  vector<string> _epp_ips_add;
387 
390  vector<string> _epp_ips_rem;
391 
394  vector<string> _renewal_types_add;
395 
398  vector<string> _renewal_types_rem;
399 
405 
407  string _password;
408 };
409 
410 LIBEPP_NICBR_NS_END
411 #endif //__BR_ORG_UPDATE_CMD_H__
SuspendedStatus::Value _suspended
Suspend organization by payment.
Definition: BrOrgUpdateCmd.H:370
map< string, string, less< string > > get_contact_list_add() const
Returns the Contact List of additions.
Definition: BrOrgUpdateCmd.H:114
string get_epp_status() const
Returns the EPP Status.
Definition: BrOrgUpdateCmd.H:192
map< string, string, less< string > > _contact_list_add
Human Contacts to add.
Definition: BrOrgUpdateCmd.H:364
string get_exDate() const
Returns expiration date.
Definition: BrOrgUpdateCmd.H:98
SuspendedStatus::Value get_suspended() const
Returns suspended by payment flag.
Definition: BrOrgUpdateCmd.H:156
vector< string > get_epp_ips_add() const
Definition: BrOrgUpdateCmd.H:230
map< string, string, less< string > > get_contact_list_rem() const
Returns the Contact List.
Definition: BrOrgUpdateCmd.H:133
void set_responsible_f(const bool responsible_f)
Sets the responsible change flag.
Definition: BrOrgUpdateCmd.H:74
Project defines.
EPP CommonData Class.
string get_organization() const
Returns the Organization.
Definition: BrOrgUpdateCmd.H:49
vector< string > _epp_ips_rem
Definition: BrOrgUpdateCmd.H:390
vector< string > get_epp_ips_rem() const
Definition: BrOrgUpdateCmd.H:250
string _resources_class
Definition: BrOrgUpdateCmd.H:404
void set_suspended(const bool suspended)
Sets suspended by payment flag.
Definition: BrOrgUpdateCmd.H:143
void set_responsible(const string &responsible)
Sets Responsible for the organization.
Definition: BrOrgUpdateCmd.H:58
string _password
Authenticate updates of legacy organizations.
Definition: BrOrgUpdateCmd.H:407
vector< string > _epp_ips_add
Definition: BrOrgUpdateCmd.H:386
EPP BrOrgUpdateCmd Class.
Definition: BrOrgUpdateCmd.H:25
EPP ContactUpdateCmd Class.
string _type
Define the organization type.
Definition: BrOrgUpdateCmd.H:376
string _organization
map with organization attribute
Definition: BrOrgUpdateCmd.H:351
void insert_renewal_type_add(const string &type)
Inserts a renewal type to be added.
Definition: BrOrgUpdateCmd.H:259
void set_epp_password(const string &password)
Sets the EPP password.
Definition: BrOrgUpdateCmd.H:201
vector< string > get_renewal_types_add() const
Returns the renewal types to be added.
Definition: BrOrgUpdateCmd.H:268
void insert_epp_ip_rem(const string &ip)
Definition: BrOrgUpdateCmd.H:240
string get_resources_class() const
Returns the organization resources class.
Definition: BrOrgUpdateCmd.H:304
void insert_contact_rem(const string &type, const string &id)
Inserts a Contact into the list of deletions.
Definition: BrOrgUpdateCmd.H:124
void set_epp_status(const string &epp_status)
Sets the EPP Status.
Definition: BrOrgUpdateCmd.H:183
string get_type() const
Returns the organization type.
Definition: BrOrgUpdateCmd.H:171
BrOrgUpdateCmd(bool reset=true)
Default constructor.
Definition: BrOrgUpdateCmd.H:29
void insert_contact_add(const string &type, const string &id)
Inserts a Contact into the list of additions.
Definition: BrOrgUpdateCmd.H:105
bool get_responsible_f() const
Returns the responsible change flag.
Definition: BrOrgUpdateCmd.H:83
string get_password() const
Returns the legacy organization password.
Definition: BrOrgUpdateCmd.H:322
void set_exDate(const string &exDate)
Sets expiration date.
Definition: BrOrgUpdateCmd.H:92
string _exDate
Definition: BrOrgUpdateCmd.H:361
string get_responsible() const
Returns Responsible for the organization.
Definition: BrOrgUpdateCmd.H:68
string _epp_password
EPP password for authentication.
Definition: BrOrgUpdateCmd.H:382
vector< string > get_renewal_types_rem() const
Returns the renewal types to be removed.
Definition: BrOrgUpdateCmd.H:286
void set_type(const string &type)
Sets the organization type.
Definition: BrOrgUpdateCmd.H:162
void set_password(const string &password)
Sets the legacy organization password.
Definition: BrOrgUpdateCmd.H:313
map< string, string, less< string > > _contact_list_rem
Human Contacts to remove.
Definition: BrOrgUpdateCmd.H:367
void reset()
reset attributes
Definition: BrOrgUpdateCmd.H:328
void set_organization(const string &organization)
Sets Organization attribute.
Definition: BrOrgUpdateCmd.H:40
void insert_renewal_type_rem(const string &type)
Inserts a renewal type to be removed.
Definition: BrOrgUpdateCmd.H:277
string _responsible
Person responsible for the organization.
Definition: BrOrgUpdateCmd.H:354
EPP ContactUpdateCmd Class.
Definition: ContactUpdateCmd.H:26
void reset()
Resets the data in the object.
Definition: ContactUpdateCmd.H:223
vector< string > _renewal_types_add
Definition: BrOrgUpdateCmd.H:394
void insert_epp_ip_add(const string &ip)
Definition: BrOrgUpdateCmd.H:220
void set_resources_class(const string &resources_class)
Sets the organization resources class.
Definition: BrOrgUpdateCmd.H:295
string get_epp_password() const
Returns the EPP password.
Definition: BrOrgUpdateCmd.H:210
string _epp_status
Define the EPP Status.
Definition: BrOrgUpdateCmd.H:379
bool _responsible_f
Responsible change flag.
Definition: BrOrgUpdateCmd.H:357
vector< string > _renewal_types_rem
Definition: BrOrgUpdateCmd.H:398