include/DomainUpdateCmd.H

Go to the documentation of this file.
00001 /* ${copyright}$ */
00002 /* $Id: DomainUpdateCmd.H 536 2006-03-03 15:00:29Z cesar $ */
00007 #ifndef __DOMAIN_UPDATE_CMD_H__
00008 #define __DOMAIN_UPDATE_CMD_H__
00009 
00010 #include <string>
00011 #include <set>
00012 #include <map>
00013 
00014 #include "libepp_nicbr.H"
00015 
00016 #include "Command.H"
00017 #include "CommonData.H" // struct NameServer
00018 
00019 using std::string;
00020 using std::set;
00021 using std::map;
00022 using std::less;
00023 
00024 LIBEPP_NICBR_NS_BEGIN
00025 
00027 class DomainUpdateCmd : public Command
00028 {
00029 public:
00030   
00031   struct Status {
00032     string s;
00033     string lang;
00034     string msg;
00035     bool operator<(const Status &st) const {
00036       return s < st.s;
00037     }
00038   };
00039 
00041   DomainUpdateCmd(bool reset = true) : Command(false)
00042   {
00043     if (reset) {
00044       this->reset();
00045     }
00046   }
00047 
00049 
00052   void set_name(string name) { _name = name; }
00053 
00055 
00058   string get_name() { return _name; }
00059 
00061 
00064   void insert_nameserver_add(const struct NameServer &nameserver_add)
00065   {
00066     _nameserver_add.insert(nameserver_add);
00067   }
00068   
00070 
00073   set<struct NameServer> get_nameserver_add() { return _nameserver_add; }
00074   
00076 
00079   void insert_nameserver_rem(const struct NameServer &nameserver_rem)
00080   {
00081     _nameserver_rem.insert(nameserver_rem);
00082   }
00083   
00085 
00088   set<struct NameServer> get_nameserver_rem() { return _nameserver_rem; }
00089 
00091 
00095   void insert_contact_add(string type, string identification)
00096   {
00097     _contact_add[type] = identification;
00098   }
00099   
00101 
00104   map< string, string, less<string> > get_contact_add() 
00105   { 
00106     return _contact_add; 
00107   }
00108   
00110 
00114   void insert_contact_rem(string type, string identification)
00115   {
00116     _contact_rem[type] = identification;
00117   }
00118   
00120 
00123   map< string, string, less<string> > get_contact_rem() 
00124   { 
00125     return _contact_rem; 
00126   }
00127   
00129 
00132   void insert_status_add(const struct Status &status_add) 
00133   { 
00134     _status_add.insert(status_add);
00135   }
00136   
00138 
00141   set<struct Status> get_status_add() { return _status_add; }
00142 
00144 
00147   void insert_status_rem(const struct Status &status_rem) 
00148   { 
00149     _status_rem.insert(status_rem); 
00150   }
00151   
00153 
00156   set<struct Status> get_status_rem() { return _status_rem; }
00157   
00158   // Sets registrant
00162   void set_registrant(const string &registrant) { _registrant = registrant; };
00163 
00164   // Returns registrant
00168   string get_registrant() { return _registrant; };
00169 
00171 
00174   void set_authInfo(const AuthInfo &authInfo)
00175   {
00176     _authInfo = authInfo;
00177   }
00178   
00180 
00183   AuthInfo get_authInfo() { return _authInfo; }
00184 
00186   void reset()
00187   {
00188     Command::reset();
00189     _name = "";
00190     _nameserver_add.clear();
00191     _nameserver_rem.clear();
00192     _contact_add.clear();
00193     _contact_rem.clear();
00194     _status_add.clear();
00195     _status_rem.clear();
00196     _registrant = "";
00197     _authInfo.reset();
00198   }
00199   
00200 protected:
00202   string _name;
00203   
00205   set<struct NameServer> _nameserver_add;
00206   
00208   set<struct NameServer> _nameserver_rem;
00209   
00211   map< string, string, less<string> > _contact_add;
00212 
00214   map< string, string, less<string> > _contact_rem;
00215   
00217   set<struct Status> _status_add;
00218 
00220   set<struct Status> _status_rem;
00221 
00223   string _registrant;
00224 
00226   AuthInfo _authInfo;
00227 };
00228 
00229 LIBEPP_NICBR_NS_END
00230 #endif //__DOMAIN_UPDATE_CMD_H__

Generated on Wed Mar 22 14:18:27 2006 for libepp_nicbr by  doxygen 1.4.6