libepp_nicbr
AsnUpdateCmd.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: AsnUpdateCmd.H 1245 2014-11-17 16:50:01Z rafael $ */
7 #ifndef __ASNUPDATECMD_H__
8 #define __ASNUPDATECMD_H__
9 
10 #include <map>
11 #include <string>
12 #include <vector>
13 
14 #include "libepp_nicbr.H"
15 
16 #include "Command.H"
17 
18 using std::map;
19 using std::string;
20 using std::vector;
21 
22 LIBEPP_NICBR_NS_BEGIN
23 
25 class AsnUpdateCmd : public Command
26 {
27 public:
29  AsnUpdateCmd(bool reset = true) : Command(false)
30  {
31  if (reset) {
32  this->reset();
33  }
34  }
35 
37 
40  void set_asn(const int asn)
41  {
42  _asn = asn;
43  }
44 
46 
49  int get_asn() const
50  {
51  return _asn;
52  }
53 
55 
58  void set_organization(const string &organization)
59  {
60  _organization = organization;
61  }
62 
64 
67  string get_organization() const
68  {
69  return _organization;
70  }
71 
72  void set_creation_date(const string &creation_date)
73  {
74  _creation_date = creation_date;
75  }
76 
77  string get_creation_date() const
78  {
79  return _creation_date;
80  }
81 
83 
87  void insert_contact_add(const string &type, const string &identification)
88  {
89  _contacts_add[type] = identification;
90  }
91 
93 
96  map< string, string, less<string> > get_contacts_add() const
97  {
98  return _contacts_add;
99  }
100 
102 
106  void insert_contact_rem(const string &type, const string &identification)
107  {
108  _contacts_rem[type] = identification;
109  }
110 
112 
115  map< string, string, less<string> > get_contacts_rem() const
116  {
117  return _contacts_rem;
118  }
119 
121 
124  void insert_as_in_add(const string &policy)
125  {
126  _as_in_add.push_back(policy);
127  }
128 
130 
133  vector<string> get_as_in_add() const
134  {
135  return _as_in_add;
136  }
137 
139 
142  void insert_as_in_rem(const string &policy)
143  {
144  _as_in_rem.push_back(policy);
145  }
146 
148 
151  vector<string> get_as_in_rem() const
152  {
153  return _as_in_rem;
154  }
155 
157 
160  void insert_as_out_add(const string &policy)
161  {
162  _as_out_add.push_back(policy);
163  }
164 
166 
169  vector<string> get_as_out_add() const
170  {
171  return _as_out_add;
172  }
173 
175 
178  void insert_as_out_rem(const string &policy)
179  {
180  _as_out_rem.push_back(policy);
181  }
182 
184 
187  vector<string> get_as_out_rem() const
188  {
189  return _as_out_rem;
190  }
191 
192  void reset()
193  {
194  Command::reset();
195  _asn = 0;
196  _organization = "";
197  _contacts_add.clear();
198  _contacts_rem.clear();
199  _creation_date.clear();
200  _as_in_add.clear();
201  _as_in_rem.clear();
202  _as_out_add.clear();
203  _as_out_rem.clear();
204  }
205 
206 protected:
208  int _asn;
209 
212 
215 
217  map< string, string, less<string> > _contacts_add;
218 
220  map< string, string, less<string> > _contacts_rem;
221 
223  vector<string> _as_in_add;
224 
226  vector<string> _as_in_rem;
227 
228  // as-out policy to be added
229  vector<string> _as_out_add;
230 
231  // as-out policy to be removed
232  vector<string> _as_out_rem;
233 };
234 
235 LIBEPP_NICBR_NS_END
236 #endif // __ASNUPDATECMD_H__
void set_asn(const int asn)
Sets asn.
Definition: AsnUpdateCmd.H:40
map< string, string, less< string > > get_contacts_add() const
Returns map of other contacts to be added.
Definition: AsnUpdateCmd.H:96
map< string, string, less< string > > _contacts_rem
contacts to be removed
Definition: AsnUpdateCmd.H:220
vector< string > _as_in_rem
as-in policy to be removed
Definition: AsnUpdateCmd.H:226
string _creation_date
object creation date
Definition: AsnUpdateCmd.H:214
void insert_contact_rem(const string &type, const string &identification)
Inserts a contact to be removed.
Definition: AsnUpdateCmd.H:106
vector< string > get_as_out_add() const
Returns list of all AS output policies to be added.
Definition: AsnUpdateCmd.H:169
int _asn
autonomous system number
Definition: AsnUpdateCmd.H:208
vector< string > get_as_in_add() const
Returns list of all AS input policies to be added.
Definition: AsnUpdateCmd.H:133
Project defines.
vector< string > get_as_out_rem() const
Returns list of all AS output policies to be removed.
Definition: AsnUpdateCmd.H:187
void insert_as_out_add(const string &policy)
Inserts an AS output policy to be added.
Definition: AsnUpdateCmd.H:160
void set_organization(const string &organization)
Sets organization.
Definition: AsnUpdateCmd.H:58
EPP AsnUpdate Class.
Definition: AsnUpdateCmd.H:25
string _organization
organization associated with the asn
Definition: AsnUpdateCmd.H:211
AsnUpdateCmd(bool reset=true)
Default constructor.
Definition: AsnUpdateCmd.H:29
vector< string > get_as_in_rem() const
Returns list of all AS input policies to be removed.
Definition: AsnUpdateCmd.H:151
void insert_as_in_add(const string &policy)
Inserts an AS input policy to be added.
Definition: AsnUpdateCmd.H:124
void insert_as_out_rem(const string &policy)
Inserts an AS output policy to be removed.
Definition: AsnUpdateCmd.H:178
void insert_as_in_rem(const string &policy)
Inserts an AS input policy to be removed.
Definition: AsnUpdateCmd.H:142
vector< string > _as_in_add
as-in policy to be added
Definition: AsnUpdateCmd.H:223
void insert_contact_add(const string &type, const string &identification)
Inserts a contact to be added.
Definition: AsnUpdateCmd.H:87
void reset()
Reset object attributes.
Definition: Command.H:33
EPP Command Class.
Definition: Command.H:18
EPP Command Class.
int get_asn() const
Returns asn.
Definition: AsnUpdateCmd.H:49
map< string, string, less< string > > _contacts_add
contacts to be added
Definition: AsnUpdateCmd.H:217
map< string, string, less< string > > get_contacts_rem() const
Returns map of other contacts to be removed.
Definition: AsnUpdateCmd.H:115
string get_organization() const
Returns organization associated with the asn.
Definition: AsnUpdateCmd.H:67