DRDE/ACTK1_0/OTE/OteDomainInfoResponse.cpp

58 lines
2.6 KiB
C++
Raw Normal View History

2014-01-15 21:41:16 +00:00
#include "OTE/OteDomainInfoResponse.hpp"
2014-01-15 18:29:15 +00:00
#include "se/StandardObjectType.hpp"
#include <stdlib.h> // atoi()
using namespace std;
2014-01-15 21:41:16 +00:00
const std::string OteDomainInfoResponse::OTEEXT_EXPR(Response::RESPONSE_EXPR() + "/e:extension/oteext:infData");
const std::string OteDomainInfoResponse::OTE_PROPERTIES_EXPR(OteDomainInfoResponse::OTEEXT_EXPR + "/oteext:aeProperties");
const std::string OteDomainInfoResponse::OTE_REGISTRANT_NAME_EXPR(OteDomainInfoResponse::OTE_PROPERTIES_EXPR + "/oteext:registrantName/text()");
const std::string OteDomainInfoResponse::OTE_REGISTRANT_ID_EXPR(OteDomainInfoResponse::OTE_PROPERTIES_EXPR + "/oteext:registrantID/text()");
const std::string OteDomainInfoResponse::OTE_REGISTRANT_ID_TYPE_EXPR(OteDomainInfoResponse::OTE_PROPERTIES_EXPR + "/oteext:registrantID/@type");
const std::string OteDomainInfoResponse::OTE_ELI_TYPE_EXPR(OteDomainInfoResponse::OTE_PROPERTIES_EXPR + "/oteext:eligibilityType/text()");
const std::string OteDomainInfoResponse::OTE_ELI_NAME_EXPR(OteDomainInfoResponse::OTE_PROPERTIES_EXPR + "/oteext:eligibilityName/text()");
const std::string OteDomainInfoResponse::OTE_ELI_ID_EXPR(OteDomainInfoResponse::OTE_PROPERTIES_EXPR + "/oteext:eligibilityID/text()");
const std::string OteDomainInfoResponse::OTE_ELI_ID_TYPE_EXPR(OteDomainInfoResponse::OTE_PROPERTIES_EXPR + "/oteext:eligibilityID/@type");
const std::string OteDomainInfoResponse::OTE_POLICY_REASON_EXPR(OteDomainInfoResponse::OTE_PROPERTIES_EXPR + "/oteext:policyReason/text()");
2014-01-15 18:29:15 +00:00
OteDomainInfoResponse::OteDomainInfoResponse() : DomainInfoResponse()
{
policyReason = 0;
}
void OteDomainInfoResponse::fromXML (XMLDocument *xmlDoc) throw (ParsingException)
{
DomainInfoResponse::fromXML(xmlDoc);
if (!(resultArray[0].succeeded())) {
return;
}
try
{
registrantName = xmlDoc->getNodeValue (OTE_REGISTRANT_NAME_EXPR);
registrantID = xmlDoc->getNodeValue (OTE_REGISTRANT_ID_EXPR);
registrantIDType = xmlDoc->getNodeValue (OTE_REGISTRANT_ID_TYPE_EXPR);
eligibilityType = xmlDoc->getNodeValue (OTE_ELI_TYPE_EXPR);
eligibilityName = xmlDoc->getNodeValue (OTE_ELI_NAME_EXPR);
eligibilityID = xmlDoc->getNodeValue (OTE_ELI_ID_EXPR);
eligibilityIDType = xmlDoc->getNodeValue (OTE_ELI_ID_TYPE_EXPR);
string polReasonStr = xmlDoc->getNodeValue (OTE_POLICY_REASON_EXPR);
if (polReasonStr.length() > 0) {
policyReason = atoi (polReasonStr.c_str());
}
}
catch (XPathExpressionException& e)
{
maintLogger->warning(e.getMessage());
ParsingException pe("Could not parse OteDomainInfoResponse object.");
pe.causedBy(e);
throw pe;
}
}