include/DomainRenewCmd.H

Go to the documentation of this file.
00001 /* ${copyright}$ */
00002 /* $Id: DomainRenewCmd.H 536 2006-03-03 15:00:29Z cesar $ */
00007 #ifndef __DOMAIN_RENEW_CMD_H__
00008 #define __DOMAIN_RENEW_CMD_H__
00009 
00010 #include <string>
00011 #include <set>
00012 #include <map>
00013 
00014 #include "libepp_nicbr.H"
00015 
00016 #include "Command.H"
00017 
00018 using std::string;
00019 using std::set;
00020 using std::map;
00021 using std::less;
00022 
00023 LIBEPP_NICBR_NS_BEGIN
00024 
00026 class DomainRenewCmd : public Command
00027 {
00028 public:
00029   struct Period {
00030     int time;
00031     string unit;
00032   };
00033 
00035   DomainRenewCmd(bool reset = true) : Command(false)
00036   {
00037     if (reset) {
00038       this->reset();
00039     }
00040   }
00041 
00043 
00046   void set_name(string name) { _name = name; }
00047 
00049 
00052   string get_name() { return _name; }
00053 
00054   // Sets the date of the next renewal
00058   void set_curExpDate(string curExpDate) { _curExpDate = curExpDate; }
00059 
00061 
00064   string get_curExpDate() { return _curExpDate; }
00065 
00067 
00071   void set_period(int time, string unit)
00072   {
00073     _period.time = time;
00074     _period.unit = unit;
00075   }
00076 
00078 
00081   void set_period(Period period)
00082   {
00083     _period.time = period.time;
00084     _period.unit = period.unit;
00085   }
00086 
00088 
00091   Period get_period() { return _period; }
00092 
00093 
00095   void reset()
00096   {
00097     Command::reset();
00098     _name = "";
00099     _curExpDate = "";
00100     _period.time = 0;
00101     _period.unit = "";
00102   }
00103   
00104 protected:
00106   string _name;
00107 
00109   string _curExpDate;
00110 
00112   Period _period;
00113 };
00114 
00115 LIBEPP_NICBR_NS_END
00116 #endif //__DOMAIN_RENEW_CMD_H__

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