From 7a11d07def83f32d57f836f9df26bc653983b6ca Mon Sep 17 00:00:00 2001 From: Ren RenJuan Date: Wed, 15 Jan 2014 21:41:16 +0000 Subject: [PATCH] * --- ACTK1_0/Makefile | 4 +- ACTK1_0/OTE/LPECheckCommand.hpp | 2 +- ACTK1_0/OTE/LPECheckCommandTest.cpp | 6 +- ACTK1_0/OTE/LPECheckResponse.cpp | 2 +- ACTK1_0/OTE/LPECheckResponse.hpp | 4 +- ACTK1_0/OTE/LPECheckResponseTest.cpp | 2 +- ACTK1_0/OTE/LPECreateCommand.cpp | 54 --------------- ACTK1_0/OTE/LPECreateCommand.hpp | 4 +- ACTK1_0/OTE/LPECreateResponse.cpp | 2 +- ACTK1_0/OTE/LPECreateResponse.hpp | 4 +- ACTK1_0/OTE/OteDomainInfoResponse.cpp | 22 +++--- ACTK1_0/OTE/OteDomainInfoResponse.hpp | 24 +++---- .../OTE/OteDomainModifyRegistrantCommand.cpp | 38 +++++------ .../OTE/OteDomainModifyRegistrantCommand.hpp | 6 +- ACTK1_0/OTE/OteDomainObjectType.cpp | 6 +- ACTK1_0/OTE/OteDomainObjectType.hpp | 12 ++-- .../OteDomainTransferRegistrantCommand.cpp | 32 ++++----- .../OteDomainTransferRegistrantCommand.hpp | 10 +-- .../OteDomainTransferRegistrantResponse.cpp | 12 ++-- .../OteDomainTransferRegistrantResponse.hpp | 14 ++-- ACTK1_0/OTE/OteExtension.cpp | 6 +- ACTK1_0/OTE/OteExtension.hpp | 10 +-- ACTK1_0/OTE/OteLPECreateCommand.cpp | 66 +++++++++--------- ACTK1_0/OTE/OteLPECreateCommand.hpp | 68 +++++++++---------- ACTK1_0/OTE/OteLPECreateCommandTest.cpp | 2 +- 25 files changed, 179 insertions(+), 233 deletions(-) delete mode 100644 ACTK1_0/OTE/LPECreateCommand.cpp diff --git a/ACTK1_0/Makefile b/ACTK1_0/Makefile index 7a2a91b..e6387b1 100644 --- a/ACTK1_0/Makefile +++ b/ACTK1_0/Makefile @@ -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\ diff --git a/ACTK1_0/OTE/LPECheckCommand.hpp b/ACTK1_0/OTE/LPECheckCommand.hpp index 570e447..96335f3 100644 --- a/ACTK1_0/OTE/LPECheckCommand.hpp +++ b/ACTK1_0/OTE/LPECheckCommand.hpp @@ -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 diff --git a/ACTK1_0/OTE/LPECheckCommandTest.cpp b/ACTK1_0/OTE/LPECheckCommandTest.cpp index 1ad653c..e3b21f2 100644 --- a/ACTK1_0/OTE/LPECheckCommandTest.cpp +++ b/ACTK1_0/OTE/LPECheckCommandTest.cpp @@ -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 @@ -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, "test.com.auJTKUTEST.20070101.010101.0"); + ASSERT_EQ(xml, "test-andvalidate.claimsgafourJTKUTEST.20070101.010101.0"); } } diff --git a/ACTK1_0/OTE/LPECheckResponse.cpp b/ACTK1_0/OTE/LPECheckResponse.cpp index 53eae32..2abc357 100644 --- a/ACTK1_0/OTE/LPECheckResponse.cpp +++ b/ACTK1_0/OTE/LPECheckResponse.cpp @@ -1,4 +1,4 @@ -#include "se/LPECheckResponse.hpp" +#include "OTE/LPECheckResponse.hpp" #include "common/StringUtils.hpp" #include "se/StandardObjectType.hpp" diff --git a/ACTK1_0/OTE/LPECheckResponse.hpp b/ACTK1_0/OTE/LPECheckResponse.hpp index 9b5c0e1..fdc8a3d 100644 --- a/ACTK1_0/OTE/LPECheckResponse.hpp +++ b/ACTK1_0/OTE/LPECheckResponse.hpp @@ -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(); }; diff --git a/ACTK1_0/OTE/LPECheckResponseTest.cpp b/ACTK1_0/OTE/LPECheckResponseTest.cpp index 769035a..b70acf3 100644 --- a/ACTK1_0/OTE/LPECheckResponseTest.cpp +++ b/ACTK1_0/OTE/LPECheckResponseTest.cpp @@ -1,4 +1,4 @@ -#include "se/LPECheckResponse.hpp" +#include "OTE/LPECheckResponse.hpp" // #include "session/TestEnvironment.hpp" #include "xml/XMLParser.hpp" #include "xml/XMLDocument.hpp" diff --git a/ACTK1_0/OTE/LPECreateCommand.cpp b/ACTK1_0/OTE/LPECreateCommand.cpp deleted file mode 100644 index 838919a..0000000 --- a/ACTK1_0/OTE/LPECreateCommand.cpp +++ /dev/null @@ -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* techContacts, - const std::vector* nameservers, - const std::vector* adminContacts, - const std::vector* billingContacts, - const Period* period) - : CreateCommand(StandardObjectType::DOMAIN(), name) -{ - std::vector::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); -} diff --git a/ACTK1_0/OTE/LPECreateCommand.hpp b/ACTK1_0/OTE/LPECreateCommand.hpp index 4e7a33e..cbca8f1 100644 --- a/ACTK1_0/OTE/LPECreateCommand.hpp +++ b/ACTK1_0/OTE/LPECreateCommand.hpp @@ -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 diff --git a/ACTK1_0/OTE/LPECreateResponse.cpp b/ACTK1_0/OTE/LPECreateResponse.cpp index 3dc3eb4..7230c2a 100644 --- a/ACTK1_0/OTE/LPECreateResponse.cpp +++ b/ACTK1_0/OTE/LPECreateResponse.cpp @@ -1,4 +1,4 @@ -#include "se/LPECreateResponse.hpp" +#include "OTE/LPECreateResponse.hpp" #include "se/StandardObjectType.hpp" #include "se/EPPDateFormatter.hpp" #include "common/StringUtils.hpp" diff --git a/ACTK1_0/OTE/LPECreateResponse.hpp b/ACTK1_0/OTE/LPECreateResponse.hpp index a498488..5748ad9 100644 --- a/ACTK1_0/OTE/LPECreateResponse.hpp +++ b/ACTK1_0/OTE/LPECreateResponse.hpp @@ -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(); }; diff --git a/ACTK1_0/OTE/OteDomainInfoResponse.cpp b/ACTK1_0/OTE/OteDomainInfoResponse.cpp index b1e972a..e5ed4ef 100644 --- a/ACTK1_0/OTE/OteDomainInfoResponse.cpp +++ b/ACTK1_0/OTE/OteDomainInfoResponse.cpp @@ -1,20 +1,20 @@ -#include "se/OteDomainInfoResponse.hpp" +#include "OTE/OteDomainInfoResponse.hpp" #include "se/StandardObjectType.hpp" #include // 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()"); diff --git a/ACTK1_0/OTE/OteDomainInfoResponse.hpp b/ACTK1_0/OTE/OteDomainInfoResponse.hpp index 3638b3d..36fb4a8 100644 --- a/ACTK1_0/OTE/OteDomainInfoResponse.hpp +++ b/ACTK1_0/OTE/OteDomainInfoResponse.hpp @@ -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 diff --git a/ACTK1_0/OTE/OteDomainModifyRegistrantCommand.cpp b/ACTK1_0/OTE/OteDomainModifyRegistrantCommand.cpp index 911ae0a..aac92f4 100644 --- a/ACTK1_0/OTE/OteDomainModifyRegistrantCommand.cpp +++ b/ACTK1_0/OTE/OteDomainModifyRegistrantCommand.cpp @@ -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); } diff --git a/ACTK1_0/OTE/OteDomainModifyRegistrantCommand.hpp b/ACTK1_0/OTE/OteDomainModifyRegistrantCommand.hpp index 09d113c..90eeb8b 100644 --- a/ACTK1_0/OTE/OteDomainModifyRegistrantCommand.hpp +++ b/ACTK1_0/OTE/OteDomainModifyRegistrantCommand.hpp @@ -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 diff --git a/ACTK1_0/OTE/OteDomainObjectType.cpp b/ACTK1_0/OTE/OteDomainObjectType.cpp index 74f7030..57ff8e6 100644 --- a/ACTK1_0/OTE/OteDomainObjectType.cpp +++ b/ACTK1_0/OTE/OteDomainObjectType.cpp @@ -3,18 +3,18 @@ #include 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; } diff --git a/ACTK1_0/OTE/OteDomainObjectType.hpp b/ACTK1_0/OTE/OteDomainObjectType.hpp index 38485a5..60d0cd6 100644 --- a/ACTK1_0/OTE/OteDomainObjectType.hpp +++ b/ACTK1_0/OTE/OteDomainObjectType.hpp @@ -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 -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 diff --git a/ACTK1_0/OTE/OteDomainTransferRegistrantCommand.cpp b/ACTK1_0/OTE/OteDomainTransferRegistrantCommand.cpp index f9fff1f..ac5230b 100644 --- a/ACTK1_0/OTE/OteDomainTransferRegistrantCommand.cpp +++ b/ACTK1_0/OTE/OteDomainTransferRegistrantCommand.cpp @@ -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( diff --git a/ACTK1_0/OTE/OteDomainTransferRegistrantCommand.hpp b/ACTK1_0/OTE/OteDomainTransferRegistrantCommand.hpp index c85a161..401d216 100644 --- a/ACTK1_0/OTE/OteDomainTransferRegistrantCommand.hpp +++ b/ACTK1_0/OTE/OteDomainTransferRegistrantCommand.hpp @@ -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 diff --git a/ACTK1_0/OTE/OteDomainTransferRegistrantResponse.cpp b/ACTK1_0/OTE/OteDomainTransferRegistrantResponse.cpp index 2bdfb96..1e4a1fd 100644 --- a/ACTK1_0/OTE/OteDomainTransferRegistrantResponse.cpp +++ b/ACTK1_0/OTE/OteDomainTransferRegistrantResponse.cpp @@ -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) { } diff --git a/ACTK1_0/OTE/OteDomainTransferRegistrantResponse.hpp b/ACTK1_0/OTE/OteDomainTransferRegistrantResponse.hpp index 3dd97cc..18b9753 100644 --- a/ACTK1_0/OTE/OteDomainTransferRegistrantResponse.hpp +++ b/ACTK1_0/OTE/OteDomainTransferRegistrantResponse.hpp @@ -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 exDate; }; -#endif // __AE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE +#endif // __OTE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE diff --git a/ACTK1_0/OTE/OteExtension.cpp b/ACTK1_0/OTE/OteExtension.cpp index 28b4557..0e2cc47 100644 --- a/ACTK1_0/OTE/OteExtension.cpp +++ b/ACTK1_0/OTE/OteExtension.cpp @@ -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; } diff --git a/ACTK1_0/OTE/OteExtension.hpp b/ACTK1_0/OTE/OteExtension.hpp index 6c8b529..8103820 100644 --- a/ACTK1_0/OTE/OteExtension.hpp +++ b/ACTK1_0/OTE/OteExtension.hpp @@ -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 diff --git a/ACTK1_0/OTE/OteLPECreateCommand.cpp b/ACTK1_0/OTE/OteLPECreateCommand.cpp index 59b7d80..c7cbc17 100644 --- a/ACTK1_0/OTE/OteLPECreateCommand.cpp +++ b/ACTK1_0/OTE/OteLPECreateCommand.cpp @@ -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* 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* billingContacts, const std::vector* 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); } diff --git a/ACTK1_0/OTE/OteLPECreateCommand.hpp b/ACTK1_0/OTE/OteLPECreateCommand.hpp index efecd96..5a09f4c 100644 --- a/ACTK1_0/OTE/OteLPECreateCommand.hpp +++ b/ACTK1_0/OTE/OteLPECreateCommand.hpp @@ -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* 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* techContacts, @@ -105,14 +105,14 @@ public: const std::vector* billingContacts, const std::vector* 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: /** * <extension> - *  <create xmlns="urn:X-ae:params:xml:ns:aeext-1.0"> + *  <create xmlns="urn:X-ote:params:xml:ns:oteext-1.0"> *   <registrantName>registrantName</registrantName> *   <registrantID type="registrantIDType">registrantID</registrantID> *   <eligibilityType>eligibilityType</eligibilityType> @@ -147,4 +147,4 @@ private: }; -#endif // __AEDOMAINCREATECOMMAND_HPP +#endif // __OTEDOMAINCREATECOMMAND_HPP diff --git a/ACTK1_0/OTE/OteLPECreateCommandTest.cpp b/ACTK1_0/OTE/OteLPECreateCommandTest.cpp index 48c8e85..2bb8a9d 100644 --- a/ACTK1_0/OTE/OteLPECreateCommandTest.cpp +++ b/ACTK1_0/OTE/OteLPECreateCommandTest.cpp @@ -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"