libepp_nicbr
BrOrgCreateCmd.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: BrOrgCreateCmd.H 1254 2014-11-25 16:39:51Z rafael $ */
6 #ifndef __BR_ORG_CREATE_CMD_H__
7 #define __BR_ORG_CREATE_CMD_H__
8 
9 #include <string>
10 #include <map>
11 #include <vector>
12 
13 #include "libepp_nicbr.H"
14 
15 #include "ContactCreateCmd.H"
16 
17 using std::string;
18 using std::map;
19 using std::less;
20 using std::vector;
21 
22 LIBEPP_NICBR_NS_BEGIN
23 
26 {
27 public:
29  BrOrgCreateCmd(bool reset = true) : ContactCreateCmd(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
69  {
70  return _responsible;
71  }
72 
74 
77  void set_responsible_f(const bool responsible_f)
78  {
79  _responsible_f = responsible_f;
80  }
81 
83 
86  bool get_responsible_f() const
87  {
88  return _responsible_f;
89  }
90 
92 
96  void insert_contact(const string &type, const string &id)
97  {
98  _contact_list[type] = id;
99  }
100 
102 
105  map< string, string, less<string> > get_contact_list() const
106  {
107  return _contact_list;
108  }
109 
111  // LACNIC Org extension methods
112 
114 
117  void set_type(const string &type)
118  {
119  _type = type;
120  }
121 
123 
126  string get_type() const
127  {
128  return _type;
129  }
130 
132 
135  void set_epp_password(const string &password)
136  {
137  _epp_password = password;
138  }
139 
141 
144  string get_epp_password() const
145  {
146  return _epp_password;
147  }
148 
151  /*
152  @param ip IP or range
153  */
154  void insert_epp_ip(const string &ip)
155  {
156  _epp_ips.push_back(ip);
157  }
158 
161  /*
162  @return list of EPP IPs or ranges
163  */
164  vector<string> get_epp_ips() const
165  {
166  return _epp_ips;
167  }
168 
170  /*
171  @param type renewal type
172  */
173  void insert_renewal_type(const string &type)
174  {
175  _renewal_types.push_back(type);
176  }
177 
179  /*
180  @param types renewal types
181  */
182  void set_renewal_types(const vector<string> &types)
183  {
184  _renewal_types = types;
185  }
186 
188  /*
189  @return list of renewal types of an organization
190  */
191  vector<string> get_renewal_types() const
192  {
193  return _renewal_types;
194  }
195 
197  /*
198  @param resources_class for now can be "all-resources" or "non-legacy-only"
199  */
200  void set_resources_class(const string &resources_class)
201  {
202  _resources_class = resources_class;
203  }
204 
206  /*
207  @return organization resources class
208  */
209  string get_resources_class() const
210  {
211  return _resources_class;
212  }
213 
215  void reset()
216  {
218  _organization = "";
219  _responsible = "";
220  _responsible_f = false;
221  _contact_list.clear();
222  _type = "";
223  _epp_password = "";
224  _epp_ips.clear();
225  _renewal_types.clear();
226  _resources_class = "";
227  }
228 
229 protected:
232 
234  string _responsible;
235 
238 
240  map<string, string, less<string> > _contact_list;
241 
243  // LACNIC Org extension methods
244 
246  string _type;
247 
250 
253  vector<string> _epp_ips;
254 
256  vector<string> _renewal_types;
257 
263 };
264 
265 LIBEPP_NICBR_NS_END
266 #endif //__BR_ORG_CREATE_CMD_H__
string get_resources_class() const
Returns the organization resources class.
Definition: BrOrgCreateCmd.H:209
string get_organization() const
Returns the Organization.
Definition: BrOrgCreateCmd.H:49
string get_type() const
Returns the organization type.
Definition: BrOrgCreateCmd.H:126
EPP ContactCreateCmd Class.
void insert_contact(const string &type, const string &id)
Inserts a Contact into the list.
Definition: BrOrgCreateCmd.H:96
string _responsible
Person responsible for the organization.
Definition: BrOrgCreateCmd.H:234
Project defines.
void set_organization(const string &organization)
Sets Organization attribute.
Definition: BrOrgCreateCmd.H:40
map< string, string, less< string > > get_contact_list() const
Returns the Contact List.
Definition: BrOrgCreateCmd.H:105
void insert_epp_ip(const string &ip)
Definition: BrOrgCreateCmd.H:154
vector< string > _renewal_types
List of category and characteristics of the organization.
Definition: BrOrgCreateCmd.H:256
string _resources_class
Definition: BrOrgCreateCmd.H:262
bool get_responsible_f() const
Returns the responsible change flag.
Definition: BrOrgCreateCmd.H:86
void reset()
reset attributes
Definition: BrOrgCreateCmd.H:215
void insert_renewal_type(const string &type)
Inserts a renewal type.
Definition: BrOrgCreateCmd.H:173
string _organization
map with organization attribute
Definition: BrOrgCreateCmd.H:231
EPP ContactCreateCmd Class.
Definition: ContactCreateCmd.H:26
string _epp_password
EPP password for authentication.
Definition: BrOrgCreateCmd.H:249
map< string, string, less< string > > _contact_list
Human Contacts.
Definition: BrOrgCreateCmd.H:240
vector< string > get_epp_ips() const
Definition: BrOrgCreateCmd.H:164
void reset()
Resets object attributes.
Definition: ContactCreateCmd.H:133
vector< string > get_renewal_types() const
Returns list of renewal types of an organization.
Definition: BrOrgCreateCmd.H:191
vector< string > _epp_ips
Definition: BrOrgCreateCmd.H:253
void set_responsible(const string &responsible)
Sets the responsible for the organization.
Definition: BrOrgCreateCmd.H:58
bool _responsible_f
Responsible change flag.
Definition: BrOrgCreateCmd.H:237
BrOrgCreateCmd(bool reset=true)
Default constructor.
Definition: BrOrgCreateCmd.H:29
void set_renewal_types(const vector< string > &types)
Sets the organization category and characteristics.
Definition: BrOrgCreateCmd.H:182
EPP BrOrgCreateCmd Class.
Definition: BrOrgCreateCmd.H:25
void set_epp_password(const string &password)
Sets the EPP password.
Definition: BrOrgCreateCmd.H:135
string get_epp_password() const
Returns the EPP password.
Definition: BrOrgCreateCmd.H:144
void set_resources_class(const string &resources_class)
Sets the organization resources class.
Definition: BrOrgCreateCmd.H:200
string get_responsible() const
Returns the responsible for the organization.
Definition: BrOrgCreateCmd.H:68
string _type
Define the organization type.
Definition: BrOrgCreateCmd.H:246
void set_responsible_f(const bool responsible_f)
Sets the responsible change flag.
Definition: BrOrgCreateCmd.H:77
void set_type(const string &type)
Sets the organization type.
Definition: BrOrgCreateCmd.H:117