include/DomainCreateCmd.H

Go to the documentation of this file.
00001 /* ${copyright}$ */
00002 /* $Id: DomainCreateCmd.H 919 2007-08-30 14:43:07Z eduardo $ */
00007 #ifndef __DOMAIN_CREATE_CMD_H__
00008 #define __DOMAIN_CREATE_CMD_H__
00009 
00010 #include <string>
00011 #include <vector>
00012 #include <map>
00013 #include <list>
00014 
00015 #include "libepp_nicbr.H"
00016 
00017 #include "Command.H"
00018 #include "CommonData.H" // struct NameServer
00019 #include "RegistrationPeriod.H"
00020 
00021 using std::string;
00022 using std::set;
00023 using std::map;
00024 using std::list;
00025 using std::less;
00026 
00027 LIBEPP_NICBR_NS_BEGIN
00028 
00030 class DomainCreateCmd : public Command
00031 {
00032 public:
00034   DomainCreateCmd(bool reset = true) : Command(false)
00035   {
00036     if (reset) {
00037       this->reset();
00038     }
00039   }
00040 
00042 
00045   void set_name(string name) { _name = name; }
00046 
00048 
00051   string get_name() { return _name; }
00052 
00054 
00058   void set_period(int time, string unit)
00059   {
00060     _period.time = time;
00061     _period.unit = unit;
00062   }
00063 
00065 
00068   RegistrationPeriod get_period() { return _period; }
00069 
00071 
00074   void insert_nameserver(const struct NameServer &nameserver)
00075   {
00076     _nameservers.push_back(nameserver);
00077   }
00078 
00080 
00083   vector<struct NameServer> get_nameservers() { return _nameservers; }
00084 
00086 
00089   void set_registrant(string registrant) { _registrant = registrant; }
00090 
00092 
00095   string get_registrant() { return _registrant; }
00096 
00098 
00102   void insert_contact(string type, string identification)
00103   {
00104     _contacts[type] = identification;
00105   }
00106 
00108 
00111   map< string, string, less<string> > get_contacts() { return _contacts; }
00112 
00114 
00117   void set_authInfo(const AuthInfo &authInfo)
00118   {
00119     _authInfo = authInfo;
00120   }
00121   
00123 
00126   AuthInfo get_authInfo() { return _authInfo; }
00127 
00128   //******************** RFC 4310 BEGIN ********************
00130 
00133   void add_dsInfo(const DSInfo &ds_info)
00134   {
00135     _ds_info.push_back(ds_info);
00136   }
00137   
00139 
00142   list<DSInfo> get_dsInfo() { return _ds_info; }
00143 
00144   //******************** RFC 4310 END ********************
00145 
00147   bool has_extension() {
00148     return has_ds_extension();
00149   }
00150   
00152   bool has_ds_extension() { 
00153     return !_ds_info.empty();
00154   }
00155 
00157   void reset()
00158   {
00159     Command::reset();
00160     _name = "";
00161     _period.time = 0;
00162     _period.unit = "";
00163     _nameservers.clear();
00164     _registrant = "";
00165     _contacts.clear();
00166     _authInfo.reset();
00167     _ds_info.clear(); 
00168   }
00169   
00170 protected:
00172   string _name;
00173 
00175   RegistrationPeriod _period;
00176 
00178   vector<struct NameServer> _nameservers;
00179 
00181   string _registrant;
00182 
00184   map< string, string, less<string> > _contacts;
00185 
00187   AuthInfo _authInfo;
00188 
00190   list<DSInfo> _ds_info;
00191 };
00192 
00193 LIBEPP_NICBR_NS_END
00194 #endif //__DOMAIN_CREATE_CMD_H__

Generated on Tue Mar 17 16:03:07 2009 for libepp_nicbr by  doxygen 1.4.7