2013-12-31 19:36:07 +00:00
|
|
|
#include "se/DomainCreateResponse.hpp"
|
|
|
|
#include "se/StandardObjectType.hpp"
|
|
|
|
#include "se/EPPDateFormatter.hpp"
|
|
|
|
#include "common/StringUtils.hpp"
|
|
|
|
|
|
|
|
const std::string DomainCreateResponse::DOM_CR_DATE_EXPR
|
|
|
|
(DomainCreateResponse::exprReplace
|
|
|
|
(CreateResponse::CR_DATE_EXPR()));
|
|
|
|
|
|
|
|
const std::string DomainCreateResponse::DOM_NAME_EXPR
|
|
|
|
(DomainCreateResponse::exprReplace
|
|
|
|
(CreateResponse::CRE_DATA_EXPR()) +
|
|
|
|
"/domain:name/text()");
|
|
|
|
|
|
|
|
const std::string DomainCreateResponse::DOM_EX_DATE_EXPR
|
|
|
|
(DomainCreateResponse::exprReplace
|
|
|
|
(CreateResponse::CRE_DATA_EXPR()) +
|
|
|
|
"/domain:exDate/text()");
|
|
|
|
|
|
|
|
DomainCreateResponse::DomainCreateResponse()
|
|
|
|
: CreateResponse(StandardObjectType::DOMAIN())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DomainCreateResponse::fromXML (XMLDocument *xmlDoc) throw (ParsingException)
|
|
|
|
{
|
|
|
|
CreateResponse::fromXML (xmlDoc);
|
|
|
|
|
|
|
|
if (!(resultArray[0].succeeded())) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
name = xmlDoc->getNodeValue (DOM_NAME_EXPR);
|
|
|
|
std::string exDateStr = xmlDoc->getNodeValue (DOM_EX_DATE_EXPR);
|
2014-01-17 01:46:48 +00:00
|
|
|
exDate = std::auto_ptr<XMLGC::XMLGregorianCalendar>(EPPDateFormatter::fromXSDateTime(exDateStr));
|
2013-12-31 19:36:07 +00:00
|
|
|
}
|
|
|
|
catch (XPathExpressionException& e)
|
|
|
|
{
|
|
|
|
maintLogger->warning(e.getMessage());
|
|
|
|
ParsingException pe;
|
|
|
|
pe.causedBy(e);
|
|
|
|
throw pe;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string DomainCreateResponse::exprReplace (const std::string &expr)
|
|
|
|
{
|
|
|
|
return StringUtils::replaceAll (expr,
|
|
|
|
CreateResponse::OBJ(),
|
|
|
|
StandardObjectType::DOMAIN()->getName());
|
|
|
|
}
|