include/DomainUpdateCmd.H

Go to the documentation of this file.
00001 /* ${copyright}$ */
00002 /* $Id: DomainUpdateCmd.H 711 2006-05-03 16:55:52Z koji $ */
00007 #ifndef __DOMAIN_UPDATE_CMD_H__
00008 #define __DOMAIN_UPDATE_CMD_H__
00009 
00010 #include <string>
00011 #include <vector>
00012 #include <set>
00013 #include <map>
00014 
00015 #include "libepp_nicbr.H"
00016 
00017 #include "Command.H"
00018 #include "CommonData.H" // struct NameServer
00019 
00020 using std::string;
00021 using std::set;
00022 using std::map;
00023 using std::less;
00024 
00025 LIBEPP_NICBR_NS_BEGIN
00026 
00028 class DomainUpdateCmd : public Command
00029 {
00030 public:
00031   
00032   struct Status {
00033     string s;
00034     string lang;
00035     string msg;
00036     bool operator<(const Status &st) const {
00037       return s < st.s;
00038     }
00039   };
00040 
00042   DomainUpdateCmd(bool reset = true) : Command(false)
00043   {
00044     if (reset) {
00045       this->reset();
00046     }
00047   }
00048 
00050 
00053   void set_name(string name) { _name = name; }
00054 
00056 
00059   string get_name() { return _name; }
00060 
00062 
00065   void insert_nameserver_add(const struct NameServer &nameserver_add)
00066   {
00067     _nameserver_add.push_back(nameserver_add);
00068   }
00069   
00071 
00074   vector<struct NameServer> get_nameserver_add() { return _nameserver_add; }
00075   
00077 
00080   void insert_nameserver_rem(const struct NameServer &nameserver_rem)
00081   {
00082     _nameserver_rem.push_back(nameserver_rem);
00083   }
00084   
00086 
00089   vector<struct NameServer> get_nameserver_rem() { return _nameserver_rem; }
00090 
00092 
00096   void insert_contact_add(string type, string identification)
00097   {
00098     _contact_add[type] = identification;
00099   }
00100   
00102 
00105   map< string, string, less<string> > get_contact_add() 
00106   { 
00107     return _contact_add; 
00108   }
00109   
00111 
00115   void insert_contact_rem(string type, string identification)
00116   {
00117     _contact_rem[type] = identification;
00118   }
00119   
00121 
00124   map< string, string, less<string> > get_contact_rem() 
00125   { 
00126     return _contact_rem; 
00127   }
00128   
00130 
00133   void insert_status_add(const struct Status &status_add) 
00134   { 
00135     _status_add.insert(status_add);
00136   }
00137   
00139 
00142   set<struct Status> get_status_add() { return _status_add; }
00143 
00145 
00148   void insert_status_rem(const struct Status &status_rem) 
00149   { 
00150     _status_rem.insert(status_rem); 
00151   }
00152   
00154 
00157   set<struct Status> get_status_rem() { return _status_rem; }
00158   
00160 
00163   void set_registrant(const string &registrant) 
00164   {
00165     _registrant = registrant; 
00166     _registrant_f = true;
00167   };
00168   
00170 
00173   string get_registrant() { return _registrant; };
00174 
00176 
00179   void set_registrant_f(bool registrant_f) 
00180   {
00181     _registrant_f = registrant_f;
00182   };
00183   
00185 
00188   bool get_registrant_f() 
00189   {
00190     return _registrant_f;
00191   };
00192 
00194 
00197   void set_authInfo(const AuthInfo &authInfo)
00198   {
00199     _authInfo = authInfo;
00200   }
00201   
00203 
00206   AuthInfo get_authInfo() { return _authInfo; }
00207 
00209   void reset()
00210   {
00211     Command::reset();
00212     _name = "";
00213     _nameserver_add.clear();
00214     _nameserver_rem.clear();
00215     _contact_add.clear();
00216     _contact_rem.clear();
00217     _status_add.clear();
00218     _status_rem.clear();
00219     _registrant = "";
00220     _registrant_f = false;
00221     _authInfo.reset();
00222   }
00223   
00224 protected:
00226   string _name;
00227   
00229   vector<struct NameServer> _nameserver_add;
00230   
00232   vector<struct NameServer> _nameserver_rem;
00233   
00235   map< string, string, less<string> > _contact_add;
00236 
00238   map< string, string, less<string> > _contact_rem;
00239   
00241   set<struct Status> _status_add;
00242 
00244   set<struct Status> _status_rem;
00245 
00247   string _registrant;
00248   
00250   bool _registrant_f;
00251   
00253   AuthInfo _authInfo;
00254 };
00255 
00256 LIBEPP_NICBR_NS_END
00257 #endif //__DOMAIN_UPDATE_CMD_H__

Generated on Thu Jun 8 17:40:00 2006 for libepp_nicbr by  doxygen 1.4.6