This commit is contained in:
Ren RenJuan 2014-01-15 21:41:16 +00:00
parent d9ec3a171b
commit 7a11d07def
25 changed files with 179 additions and 233 deletions

View File

@ -55,7 +55,7 @@ INCLUDE_DIR = -I . -I $(XERCES_INC_DIR) -I $(XALAN_INC_DIR)
build_obj_dir = $(BUILD_OBJ_DIR)
src_dirs_cpp = se se/secDNS common session xml
src_dirs_cpp = se se/secDNS common OTE session xml
src_dirs_c = config
srcs_all = $(foreach dir,$(src_dirs_cpp),$(wildcard $(dir)/*.cpp))
srcs_all += $(foreach dir,$(src_dirs_c),$(wildcard $(dir)/*.c))
@ -79,7 +79,7 @@ include $(foreach name,$(srcs_all),$(basename $(name)).d)
vpath %.cpp ./ \
./se\
.OTE \
./OTE \
./se/secDNS\
./xml\
./common\

View File

@ -1,7 +1,7 @@
#ifndef __LPE_CHECK_COMMAND_HPP
#define __LPE_CHECK_COMMAND_HPP
#include "se/CheckCommand.hpp"
#include "OTE/LPECheckCommand.hpp"
#include "se/StandardObjectType.hpp"
#include <string>

View File

@ -1,7 +1,7 @@
#include "common/init.hpp"
#include "common/Test.hpp"
#include "se/CLTRID.hpp"
#include "se/LPECheckCommand.hpp"
#include "OTE/LPECheckCommand.hpp"
#include "session/Timer.hpp"
#include <iostream>
@ -15,12 +15,12 @@ void doWork()
CLTRID::setClID("JTKUTEST");
Timer::setTime("20070101.010101");
LPECheckCommand cmd("test.com.au");
LPECheckCommand cmd("test-andvalidate.claimsgafour");
const string xml(cmd.toXML());
ASSERT_EQ(cmd.getCommandType()->getCommandName(), "check");
ASSERT_EQ(cmd.getObjectType()->getName(), "domain");
ASSERT_EQ(xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?><epp xmlns=\"urn:ietf:params:xml:ns:epp-1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd\"><command><check><check xmlns=\"urn:ietf:params:xml:ns:domain-1.0\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd\"><name>test.com.au</name></check></check><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></epp>");
ASSERT_EQ(xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?><epp xmlns=\"urn:ietf:params:xml:ns:epp-1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd\"><command><check><check xmlns=\"urn:ietf:params:xml:ns:domain-1.0\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd\"><name>test-andvalidate.claimsgafour</name></check></check><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></epp>");
}
}

View File

@ -1,4 +1,4 @@
#include "se/LPECheckResponse.hpp"
#include "OTE/LPECheckResponse.hpp"
#include "common/StringUtils.hpp"
#include "se/StandardObjectType.hpp"

View File

@ -11,10 +11,10 @@
*
* @see DomainCheckCommand
*/
class DomainCheckResponse : public CheckResponse
class LPECheckResponse : public CheckResponse
{
public:
DomainCheckResponse ();
LPECheckResponse ();
protected:
const std::string& chkDataCountExpr() const { return DOM_CHKDATA_COUNT_EXPR(); };

View File

@ -1,4 +1,4 @@
#include "se/LPECheckResponse.hpp"
#include "OTE/LPECheckResponse.hpp"
// #include "session/TestEnvironment.hpp"
#include "xml/XMLParser.hpp"
#include "xml/XMLDocument.hpp"

View File

@ -1,54 +0,0 @@
#include "se/LPECreateCommand.hpp"
#include "se/StandardObjectType.hpp"
#include "xml/XMLHelper.hpp"
LPECreateCommand::LPECreateCommand (const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
const std::vector<std::string>* nameservers,
const std::vector<std::string>* adminContacts,
const std::vector<std::string>* billingContacts,
const Period* period)
: CreateCommand(StandardObjectType::DOMAIN(), name)
{
std::vector<std::string>::const_iterator p;
if (period)
period->appendPeriod (xmlWriter, objElement);
if (nameservers)
{
DOMElement *ns = xmlWriter->appendChild (objElement, "ns");
for (p = nameservers->begin(); p != nameservers->end(); p++)
XMLHelper::setTextContent
(xmlWriter->appendChild (ns, "hostObj"), *p);
}
if (registrantID)
{
XMLHelper::setTextContent
(xmlWriter->appendChild(objElement, "registrant"), *registrantID);
}
if (adminContacts)
for (p = adminContacts->begin(); p != adminContacts->end(); p++)
xmlWriter->appendChild(objElement, "contact", *p, "type", "admin");
if (techContacts)
for (p = techContacts->begin(); p != techContacts->end(); p++)
xmlWriter->appendChild(objElement, "contact", *p, "type", "tech");
if (billingContacts)
for (p = billingContacts->begin(); p != billingContacts->end(); p++)
xmlWriter->appendChild(objElement, "contact", *p, "type", "billing");
XMLHelper::setTextContent
(xmlWriter->appendChild
(xmlWriter->appendChild
(objElement,
"authInfo"),
"pw"),
pw);
}

View File

@ -12,7 +12,7 @@
* input parameters. The toXML method in Command serialises this object to
* XML.
*/
class DomainCreateCommand : public CreateCommand
class LPECreateCommand : public CreateCommand
{
public:
/**
@ -29,4 +29,4 @@ public:
const Period* period = NULL);
};
#endif // __DOMAINCREATECOMMAND_HPP
#endif // __LPECREATECOMMAND_HPP

View File

@ -1,4 +1,4 @@
#include "se/LPECreateResponse.hpp"
#include "OTE/LPECreateResponse.hpp"
#include "se/StandardObjectType.hpp"
#include "se/EPPDateFormatter.hpp"
#include "common/StringUtils.hpp"

View File

@ -12,10 +12,10 @@
*
* @see DomainCreateCommand
*/
class DomainCreateResponse : public CreateResponse
class LPECreateResponse : public CreateResponse
{
public:
DomainCreateResponse();
LPECreateResponse();
const std::string & getName() const { return name; };
const XMLGregorianCalendar* getExpiryDate() const { return exDate.get(); };

View File

@ -1,20 +1,20 @@
#include "se/OteDomainInfoResponse.hpp"
#include "OTE/OteDomainInfoResponse.hpp"
#include "se/StandardObjectType.hpp"
#include <stdlib.h> // atoi()
using namespace std;
*oteext:infData");
*oteProperties");
*oteext:registrantName/text()");
*oteext:registrantID/text()");
*oteext:registrantID/@type");
*oteext:eligibilityType/text()");
*oteext:eligibilityName/text()");
*oteext:eligibilityID/text()");
*oteext:eligibilityID/@type");
*oteext:policyReason/text()");
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()");

View File

@ -35,7 +35,7 @@ public:
DEPRECATED(OteDomainInfoResponse());
const std::string& getRegistrantName() const { return registrantName; };
const std::string& getAERegistrantID() const { return registrantID; };
const std::string& getOTERegistrantID() const { return registrantID; };
const std::string& getRegistrantIDType() const { return registrantIDType; };
const std::string& getEligibilityType() const { return eligibilityType; };
const std::string& getEligibilityName() const { return eligibilityName; };
@ -46,16 +46,16 @@ public:
virtual void fromXML (XMLDocument *xmlDoc) throw (ParsingException);
private:
static const std::string AEEXT_EXPR,
AE_PROPERTIES_EXPR,
AE_REGISTRANT_NAME_EXPR,
AE_REGISTRANT_ID_EXPR,
AE_REGISTRANT_ID_TYPE_EXPR,
AE_ELI_TYPE_EXPR,
AE_ELI_NAME_EXPR,
AE_ELI_ID_EXPR,
AE_ELI_ID_TYPE_EXPR,
AE_POLICY_REASON_EXPR;
static const std::string OTEEXT_EXPR,
OTE_PROPERTIES_EXPR,
OTE_REGISTRANT_NAME_EXPR,
OTE_REGISTRANT_ID_EXPR,
OTE_REGISTRANT_ID_TYPE_EXPR,
OTE_ELI_TYPE_EXPR,
OTE_ELI_NAME_EXPR,
OTE_ELI_ID_EXPR,
OTE_ELI_ID_TYPE_EXPR,
OTE_POLICY_REASON_EXPR;
std::string registrantName,
registrantID,
@ -68,5 +68,5 @@ private:
int policyReason;
};
#endif // __AE_DOMAIN_INFO_RESPONSE_HPP
#endif // __OTE_DOMAIN_INFO_RESPONSE_HPP

View File

@ -1,12 +1,12 @@
#include "se/OteDomainModifyRegistrantCommand.hpp"
#include "OTE/OteDomainModifyRegistrantCommand.hpp"
#include "common/ErrorPkg.hpp"
#include "se/OteExtension.hpp"
#include "OTE/OteExtension.hpp"
#include "xml/XMLHelper.hpp"
namespace {
*oteExtension() {
*oteExtension = new OteExtension();
*oteExtension;
OteExtension& oteExtension() {
static OteExtension* oteExtension = new OteExtension();
return *oteExtension;
}
}; // anonymous namespace
@ -29,29 +29,29 @@ OteDomainModifyRegistrantCommand::OteDomainModifyRegistrantCommand(
|| (eligibilityID != NULL && eligibilityIDType == NULL))
{
throw IllegalArgException(
*ote.missing_arg"));
ErrorPkg::getMessage("se.domain.modify.ote.missing_arg"));
}
*oteextUpdate = xmlWriter->appendChild(
DOMElement* oteextUpdate = xmlWriter->appendChild(
xmlWriter->appendChild(command, "extension"),
"update",
*oteExtension().getURI());
oteExtension().getURI());
*oteextUpdate->setAttribute(
oteextUpdate->setAttribute(
XStr("xsi:schemaLocation").str(),
*oteExtension().getSchemaLocation()).str());
XStr(oteExtension().getSchemaLocation()).str());
*oteextUpdate,
*oteProperties");
DOMElement* oteProperties = xmlWriter->appendChild(oteextUpdate,
"oteProperties");
XMLHelper::setTextContent(
*oteProperties, "registrantName"),
xmlWriter->appendChild(oteProperties, "registrantName"),
registrantName);
if (registrantID != NULL && registrantIDType != NULL)
{
xmlWriter->appendChild(
*oteProperties,
oteProperties,
"registrantID",
*registrantID,
"type",
@ -61,21 +61,21 @@ OteDomainModifyRegistrantCommand::OteDomainModifyRegistrantCommand(
if (eligibilityType != NULL)
{
XMLHelper::setTextContent(
*oteProperties, "eligibilityType"),
xmlWriter->appendChild(oteProperties, "eligibilityType"),
*eligibilityType);
}
if (eligibilityName != NULL)
{
XMLHelper::setTextContent(
*oteProperties, "eligibilityName"),
xmlWriter->appendChild(oteProperties, "eligibilityName"),
*eligibilityName);
}
if (eligibilityID != NULL && eligibilityIDType != NULL)
{
xmlWriter->appendChild(
*oteProperties,
oteProperties,
"eligibilityID",
*eligibilityID,
"type",
@ -83,11 +83,11 @@ OteDomainModifyRegistrantCommand::OteDomainModifyRegistrantCommand(
}
XMLHelper::setTextContent(
*oteProperties, "policyReason"),
xmlWriter->appendChild(oteProperties, "policyReason"),
policyReason);
XMLHelper::setTextContent(
*oteextUpdate, "explanation"),
xmlWriter->appendChild(oteextUpdate, "explanation"),
explanation);
}

View File

@ -26,11 +26,11 @@
* and
* {@link DomainKVCommandExtension}.
*/
class AeDomainModifyRegistrantCommand : public DomainUpdateCommand
class OteDomainModifyRegistrantCommand : public DomainUpdateCommand
{
public:
DEPRECATED(
AeDomainModifyRegistrantCommand(const std::string& name,
OteDomainModifyRegistrantCommand(const std::string& name,
const std::string& registrantName,
const std::string& explanation,
const std::string* eligibilityType = NULL,
@ -42,5 +42,5 @@ public:
const std::string* eligibilityIDType = NULL));
};
#endif // __AE_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP
#endif // __OTE_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP

View File

@ -3,18 +3,18 @@
#include <string>
const std::string& OteDomainObjectType::getName() const {
*otedom";
static const std::string name = "otedom";
return name;
}
const std::string& OteDomainObjectType::getURI() const {
*otedomain-1.0";
static const std::string uri = "urn:X-ote:params:xml:ns:otedomain-1.0";
return uri;
}
const std::string& OteDomainObjectType::getSchemaLocation() const {
static const std::string schemaLocation =
*otedomain-1.0.xsd";
"urn:X-ote:params:xml:ns:otedomain-1.0 otedomain-1.0.xsd";
return schemaLocation;
}

View File

@ -1,13 +1,13 @@
#ifndef AEDOMAIN_OBJECT_TYPE
#define AEDOMAIN_OBJECT_TYPE
#ifndef OTEDOMAIN_OBJECT_TYPE
#define OTEDOMAIN_OBJECT_TYPE
#include "ObjectType.hpp"
#include "se/ObjectType.hpp"
#include <string>
class AeDomainObjectType : public ObjectType {
class OteDomainObjectType : public ObjectType {
public:
virtual ~AeDomainObjectType(void) { }
virtual ~OteDomainObjectType(void) { }
virtual const std::string& getName() const;
virtual const std::string& getURI() const;
@ -15,5 +15,5 @@ public:
virtual const std::string& getIdentType() const;
};
#endif // AEDOMAIN_OBJECT_TYPE
#endif // OTEDOMAIN_OBJECT_TYPE

View File

@ -1,8 +1,8 @@
#include "se/OteDomainTransferRegistrantCommand.hpp"
#include "OTE/OteDomainTransferRegistrantCommand.hpp"
#include "se/XMLGregorianCalendar.hpp"
#include "se/OteExtension.hpp"
#include "se/OteDomainObjectType.hpp"
#include "OTE/OteExtension.hpp"
#include "OTE/OteDomainObjectType.hpp"
#include "se/RegistrantTransferCommandType.hpp"
#include "se/CommandType.hpp"
#include "se/Period.hpp"
@ -13,13 +13,13 @@
#include "xml/XMLHelper.hpp"
namespace {
*oteExtension() {
*oteExt = new OteExtension();
*oteExt;
Extension& oteExtension() {
static Extension* oteExt = new OteExtension();
return *oteExt;
}
const RegistrantTransferCommandType rtrnType;
*otedomType;
OteDomainObjectType otedomType;
} // anonymous namespace
OteDomainTransferRegistrantCommand::OteDomainTransferRegistrantCommand (
@ -35,7 +35,7 @@ OteDomainTransferRegistrantCommand::OteDomainTransferRegistrantCommand (
const std::string* eligibilityID,
const std::string* eligibilityIDType,
const Period* period) : ProtocolExtensionCommand(
*oteExtension())
&rtrnType, &otedomType, name, oteExtension())
{
if ((registrantID && registrantIDType == NULL)
|| (registrantIDType == NULL && registrantIDType)
@ -45,7 +45,7 @@ OteDomainTransferRegistrantCommand::OteDomainTransferRegistrantCommand (
// If provided, a registrantID must have a type.
// If provided, an eligibilityName must have both an eligibilityID and type.
throw IllegalArgException(
*ote.missing_arg"));
ErrorPkg::getMessage("se.domain.registrantTransfer.ote.missing_arg"));
}
DOMElement *element;
@ -57,32 +57,32 @@ OteDomainTransferRegistrantCommand::OteDomainTransferRegistrantCommand (
if (period)
period->appendPeriod(xmlWriter, objElement);
*oteProperties");
DOMElement *oteProperties = xmlWriter->appendChild(objElement, "oteProperties");
XMLHelper::setTextContent(
*oteProperties, "registrantName"), registrantName);
xmlWriter->appendChild(oteProperties, "registrantName"), registrantName);
if (registrantID)
{
*oteProperties, "registrantID");
element = xmlWriter->appendChild(oteProperties, "registrantID");
XMLHelper::setTextContent(element, *registrantID);
XMLHelper::setAttribute(element, "type", *registrantIDType);
}
XMLHelper::setTextContent
*oteProperties, "eligibilityType"), eligibilityType);
(xmlWriter->appendChild(oteProperties, "eligibilityType"), eligibilityType);
if (eligibilityName)
{
XMLHelper::setTextContent(
*oteProperties, "eligibilityName"), *eligibilityName);
xmlWriter->appendChild(oteProperties, "eligibilityName"), *eligibilityName);
*oteProperties, "eligibilityID");
element = xmlWriter->appendChild(oteProperties, "eligibilityID");
XMLHelper::setTextContent(element, *eligibilityID);
XMLHelper::setAttribute(element, "type", *eligibilityIDType);
}
XMLHelper::setTextContent(
*oteProperties, "policyReason"),
xmlWriter->appendChild(oteProperties, "policyReason"),
policyReason);
XMLHelper::setTextContent(

View File

@ -1,5 +1,5 @@
#ifndef __AE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
#define __AE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
#ifndef __OTE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
#define __OTE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
#include "common/Deprecated.hpp"
#include "se/ProtocolExtensionCommand.hpp"
@ -32,7 +32,7 @@ class Period;
* and
* {@link DomainRegistrantTransferCommand.addItem(std::string, std::string)}
*/
class AeDomainTransferRegistrantCommand : public ProtocolExtensionCommand
class OteDomainTransferRegistrantCommand : public ProtocolExtensionCommand
{
public:
@ -70,7 +70,7 @@ public:
* @param explanation An explanation of how the transfer was effected.
*/
DEPRECATED(
AeDomainTransferRegistrantCommand (const std::string& name,
OteDomainTransferRegistrantCommand (const std::string& name,
const XMLGregorianCalendar& curExpDate,
const std::string& eligibilityType,
int policyReason,
@ -84,5 +84,5 @@ public:
const Period* period = NULL));
};
#endif // __AE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
#endif // __OTE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP

View File

@ -1,23 +1,23 @@
#include "se/OteDomainTransferRegistrantResponse.hpp"
#include "se/OteDomainObjectType.hpp"
#include "OTE/OteDomainTransferRegistrantResponse.hpp"
#include "OTE/OteDomainObjectType.hpp"
#include "se/RegistrantTransferCommandType.hpp"
#include "se/EPPDateFormatter.hpp"
namespace {
const RegistrantTransferCommandType rtrnType;
*otedomType;
OteDomainObjectType otedomType;
} // anonymous namespace
using namespace std;
const string OteDomainTransferRegistrantResponse::OTEDOM_NAME_EXPR =
*otedom:name/text()";
"/e:epp/e:response/e:resData/otedom:rtrnData/otedom:name/text()";
const string OteDomainTransferRegistrantResponse::OTEDOM_EX_DATE_EXPR =
*otedom:exDate/text()";
"/e:epp/e:response/e:resData/otedom:rtrnData/otedom:exDate/text()";
OteDomainTransferRegistrantResponse::OteDomainTransferRegistrantResponse()
*otedomType)
: DataResponse(&rtrnType, &otedomType)
{
}

View File

@ -1,5 +1,5 @@
#ifndef __AE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
#define __AE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
#ifndef __OTE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
#define __OTE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
#include "common/Deprecated.hpp"
#include "se/DataResponse.hpp"
@ -23,22 +23,22 @@
* and
* {@link DomainRegistrantTransferResponse}.
*/
class AeDomainTransferRegistrantResponse : public DataResponse
class OteDomainTransferRegistrantResponse : public DataResponse
{
public:
DEPRECATED(AeDomainTransferRegistrantResponse());
DEPRECATED(OteDomainTransferRegistrantResponse());
const std::string& getName() { return name; }
const XMLGregorianCalendar* getExpiryDate() { return exDate.get(); }
void fromXML(XMLDocument* xmlDoc) throw (ParsingException);
private:
static const std::string AEDOM_NAME_EXPR;
static const std::string AEDOM_EX_DATE_EXPR;
static const std::string OTEDOM_NAME_EXPR;
static const std::string OTEDOM_EX_DATE_EXPR;
std::string name;
std::auto_ptr<XMLGregorianCalendar> exDate;
};
#endif // __AE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
#endif // __OTE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE

View File

@ -1,14 +1,14 @@
#include "se/OteExtension.hpp"
#include "OTE/OteExtension.hpp"
std::string& OteExtension::getURI() const
{
*oteext-1.0";
static std::string uri = "urn:X-ote:params:xml:ns:oteext-1.0";
return uri;
}
std::string& OteExtension::getSchemaLocation() const
{
*oteext-1.0.xsd";
static std::string loc = "urn:X-ote:params:xml:ns:oteext-1.0 oteext-1.0.xsd";
return loc;
}

View File

@ -1,5 +1,5 @@
#ifndef __AEEXTENSION_HPP
#define __AEEXTENSION_HPP
#ifndef __OTEEXTENSION_HPP
#define __OTEEXTENSION_HPP
#include "se/Extension.hpp"
@ -7,11 +7,11 @@
* A bundled set of constants representing the .ae EPP extension
* schema. The namespace URI uniquely identifies the extension.
*/
class AeExtension : public Extension
class OteExtension : public Extension
{
public:
virtual ~AeExtension(void) { }
virtual ~OteExtension(void) { }
/**
* Get the globally unique namespace URI which identifies this extension.
@ -25,5 +25,5 @@ public:
virtual std::string& getSchemaLocation() const;
};
#endif // __AEEXTENSION_HPP
#endif // __OTEXTENSION_HPP

View File

@ -1,12 +1,12 @@
#include "se/OteLPECreateCommand.hpp"
#include "OTE/OteLPECreateCommand.hpp"
#include "xml/XMLHelper.hpp"
#include "se/OteExtension.hpp"
#include "OTE/OteExtension.hpp"
#include "common/ErrorPkg.hpp"
namespace {
*oteExtension() {
*oteExtension = new OteExtension();
*oteExtension;
Extension& oteExtension() {
static Extension* oteExtension = new OteExtension();
return *oteExtension;
}
}; // anonymous namespace
@ -15,12 +15,12 @@ OteLPECreateCommand::OteLPECreateCommand (
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
*oteEligibilityType,
*otePolicyReason,
*oteRegistrantName) : LPECreateCommand (
const std::string &oteEligibilityType,
int otePolicyReason,
const std::string &oteRegistrantName) : LPECreateCommand (
name, pw, registrantID, techContacts)
{
*oteRegistrantName);
setExtension (oteEligibilityType, otePolicyReason, oteRegistrantName);
}
OteLPECreateCommand::OteLPECreateCommand (
@ -32,20 +32,20 @@ OteLPECreateCommand::OteLPECreateCommand (
const std::vector<std::string>* billingContacts,
const std::vector<std::string>* nameservers,
const Period* period,
*oteEligibilityType,
*otePolicyReason,
*oteRegistrantName,
*oteRegistrantID,
*oteRegistrantIDType,
*oteEligibilityName,
*oteEligibilityID,
*oteEligibilityIDType) : LPECreateCommand (
const std::string &oteEligibilityType,
int otePolicyReason,
const std::string &oteRegistrantName,
const std::string *oteRegistrantID,
const std::string *oteRegistrantIDType,
const std::string *oteEligibilityName,
const std::string *oteEligibilityID,
const std::string *oteEligibilityIDType) : LPECreateCommand (
name, pw, registrantID, techContacts, nameservers,
adminContacts, billingContacts, period)
{
*otePolicyReason,
*oteRegistrantIDType,
*oteEligibilityIDType);
setExtension (oteEligibilityType, otePolicyReason,
oteRegistrantName, oteRegistrantID, oteRegistrantIDType,
oteEligibilityName, oteEligibilityID, oteEligibilityIDType);
}
void OteLPECreateCommand::setExtension (const std::string& eligibilityType,
@ -83,50 +83,50 @@ void OteLPECreateCommand::setExtension (
|| (eligibilityID == NULL && eligibilityIDType))
{
throw IllegalArgException(ErrorPkg::getMessage(
*ote.missing_ar"));
"se.domaincreate.ote.missing_ar"));
}
*oteextCreate = xmlWriter->appendChild(
DOMElement *oteextCreate = xmlWriter->appendChild(
xmlWriter->appendChild(
command,
"extension"),
"create",
*oteExtension().getURI());
oteExtension().getURI());
*oteextCreate,
XMLHelper::setAttribute(oteextCreate,
"xsi:schemaLocation",
*oteExtension().getSchemaLocation());
oteExtension().getSchemaLocation());
*oteProperties = xmlWriter->appendChild(
*oteProperties");
DOMElement* oteProperties = xmlWriter->appendChild(
oteextCreate, "oteProperties");
XMLHelper::setTextContent(
*oteProperties, "registrantName"),
xmlWriter->appendChild(oteProperties, "registrantName"),
registrantName);
if (registrantID && registrantIDType)
*oteProperties,
xmlWriter->appendChild (oteProperties,
"registrantID", *registrantID,
"type", *registrantIDType);
XMLHelper::setTextContent(
*oteProperties, "eligibilityType"),
xmlWriter->appendChild(oteProperties, "eligibilityType"),
eligibilityType);
if (eligibilityName)
{
XMLHelper::setTextContent(
*oteProperties, "eligibilityName"),
xmlWriter->appendChild(oteProperties, "eligibilityName"),
*eligibilityName);
if (eligibilityID && eligibilityIDType)
*oteProperties,
xmlWriter->appendChild(oteProperties,
"eligibilityID", *eligibilityID,
"type", *eligibilityIDType);
}
XMLHelper::setTextContent(
*oteProperties, "policyReason"),
xmlWriter->appendChild(oteProperties, "policyReason"),
policyReason);
}

View File

@ -1,14 +1,14 @@
#ifndef __AEDOMAINCREATECOMMAND_HPP
#define __AEDOMAINCREATECOMMAND_HPP
#ifndef __OTEDOMAINCREATECOMMAND_HPP
#define __OTEDOMAINCREATECOMMAND_HPP
#include "common/Deprecated.hpp"
#include "se/DomainCreateCommand.hpp"
#include "OTE/LPECreateCommand.hpp"
/**
* Extension of EPP urn:ietf:params:xml:ns:domain-1.0 create command specified
* in RFC3731 to urn:X-ae:params:xml:ns:aeext-1.0. .ae domains must be
* in RFC3731 to urn:X-ote:params:xml:ns:oteext-1.0. .ote domains must be
* provisioned using this class rather than {@link DomainCreateCommand}, as the
* ae extension data is mandatory.
* ote extension data is mandatory.
* Use this class to generate a standards-compliant XML document, given simple
* input parameters. The toXML method in Command serialises this object to
* XML.
@ -27,27 +27,27 @@
* and
* {@link DomainKVCommandExtension}.
*/
class AeDomainCreateCommand : public DomainCreateCommand
class OteLPECreateCommand : public LPECreateCommand
{
public:
/**
* Minimal constructor for creating a domain:create + aeext:create
* Minimal constructor for creating a domain:create + oteext:create
* EPP command. These parameters are the least required for a valid
* .ae domain create command.
* .ote domain create command.
*/
DEPRECATED(
AeDomainCreateCommand (const std::string& name,
OteLPECreateCommand (const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
const std::string &aeEligibilityType,
int aePolicyReason,
const std::string& aeRegistrantName));
const std::string &oteEligibilityType,
int otePolicyReason,
const std::string& oteRegistrantName));
/**
* Full data specification constructor for a domain:create + aeext:create
* EPP command. Please refer to the urn:X-ae:params:xml:ns:aeext-1.0 schema
* Full data specification constructor for a domain:create + oteext:create
* EPP command. Please refer to the urn:X-ote:params:xml:ns:oteext-1.0 schema
* for specification of the required fields.
* The mapping of parameter names to ae extension fields is given in the
* The mapping of parameter names to ote extension fields is given in the
* parameter documentation.
*
* @param name The name of the new domain.
@ -80,24 +80,24 @@ public:
* server may define a default initial registration period if not specified
* by the client.
*
* @param aeEligibilityType aeext:eligType.
* @param oteEligibilityType oteext:eligType.
*
* @param aePolicyReason aeext:policyReason.
* @param otePolicyReason oteext:policyReason.
*
* @param aeRegistrantName aeext:registrantName.
* @param oteRegistrantName oteext:registrantName.
*
* @param aeRegistrantID aeext:registrantID.
* @param oteRegistrantID oteext:registrantID.
*
* @param aeRegistrantIDType aeext:registrantID type attribute.
* @param oteRegistrantIDType oteext:registrantID type attribute.
*
* @param aeEligibilityName aeext:eligibilityName.
* @param oteEligibilityName oteext:eligibilityName.
*
* @param aeEligibilityID aeext:eligibilityID.
* @param oteEligibilityID oteext:eligibilityID.
*
* @param aeEligibilityIDType aeext:eligibilityID type attribute.
* @param oteEligibilityIDType oteext:eligibilityID type attribute.
*/
DEPRECATED(
AeDomainCreateCommand (const std::string& name,
OteLPECreateCommand (const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
@ -105,14 +105,14 @@ public:
const std::vector<std::string>* billingContacts,
const std::vector<std::string>* nameservers,
const Period *period,
const std::string &aeEligibilityType,
int aePolicyReason,
const std::string& aeRegistrantName,
const std::string* aeRegistrantID,
const std::string* aeRegistrantIDType,
const std::string* aeEligibilityName,
const std::string* aeEligibilityID,
const std::string* aeEligibilityIDType));
const std::string &oteEligibilityType,
int otePolicyReason,
const std::string& oteRegistrantName,
const std::string* oteRegistrantID,
const std::string* oteRegistrantIDType,
const std::string* oteEligibilityName,
const std::string* oteEligibilityID,
const std::string* oteEligibilityIDType));
private:
void setExtension (const std::string& eligibilityType,
int PolicyReason,
@ -126,7 +126,7 @@ private:
/**
* &lt;extension&gt;
* &nbsp;&lt;create xmlns="urn:X-ae:params:xml:ns:aeext-1.0"&gt;
* &nbsp;&lt;create xmlns="urn:X-ote:params:xml:ns:oteext-1.0"&gt;
* &nbsp;&nbsp;&lt;registrantName&gt;registrantName&lt;/registrantName&gt;
* &nbsp;&nbsp;&lt;registrantID type="registrantIDType"&gt;registrantID&lt;/registrantID&gt;
* &nbsp;&nbsp;&lt;eligibilityType&gt;eligibilityType&lt;/eligibilityType&gt;
@ -147,4 +147,4 @@ private:
};
#endif // __AEDOMAINCREATECOMMAND_HPP
#endif // __OTEDOMAINCREATECOMMAND_HPP

View File

@ -1,5 +1,5 @@
#include "se/ContactCheckCommand.hpp"
#include "se/OteLPECreateCommand.hpp"
#include "OTE/OteLPECreateCommand.hpp"
#include "se/CLTRID.hpp"
#include "session/Timer.hpp"
#include "common/init.hpp"