DRDE/AusRegEPPTK/se/ArDomainUnrenewCommand.cpp

38 lines
1.2 KiB
C++
Raw Normal View History

2013-12-31 19:36:07 +00:00
#include "se/ArDomainUnrenewCommand.hpp"
#include "se/CommandType.hpp"
#include "se/ArExtension.hpp"
#include "se/ArDomainObjectType.hpp"
#include "se/EPPDateFormatter.hpp"
#include "xml/XMLHelper.hpp"
#include "se/XMLGregorianCalendar.hpp"
namespace {
class ArUnrenewCommand : public CommandType
{
public:
ArUnrenewCommand() : CommandType (getCommandName()) { }
std::string getCommandName() const { return "unrenew"; }
std::string toString() const { return "unrenew"; }
};
Extension& arExtension() {
static Extension* arExt = new ArExtension();
return *arExt;
}
const ArUnrenewCommand unrenewCmdType;
const ArDomainObjectType ardomType;
}; // anonymous namespace
ArDomainUnrenewCommand::ArDomainUnrenewCommand(
const std::string &name,
2014-01-17 01:46:48 +00:00
constXMLGC::XMLGregorianCalendar& exDate) : ProtocolExtensionCommand(
2013-12-31 19:36:07 +00:00
&unrenewCmdType, &ardomType, name, arExtension())
{
std::string exDateStr = EPPDateFormatter::toXSDate(exDate);
XMLHelper::setTextContent
(xmlWriter->appendChild(objElement, "curExpDate"), exDateStr);
}