This commit is contained in:
Ren RenJuan 2014-01-22 20:38:55 +00:00
parent 7798edd690
commit fb651febff
25 changed files with 24 additions and 1345 deletions

View File

@ -55,7 +55,7 @@ INCLUDE_DIR = -I . -I $(XERCES_INC_DIR) -I $(XALAN_INC_DIR) -I ../AusRegCliever/
build_obj_dir = $(BUILD_OBJ_DIR) build_obj_dir = $(BUILD_OBJ_DIR)
src_dirs_cpp = se se/secDNS common OTE session xml src_dirs_cpp = se se/secDNS common se/LPE session xml
src_dirs_c = config src_dirs_c = config
srcs_all = $(foreach dir,$(src_dirs_cpp),$(wildcard $(dir)/*.cpp)) srcs_all = $(foreach dir,$(src_dirs_cpp),$(wildcard $(dir)/*.cpp))
srcs_all += $(foreach dir,$(src_dirs_c),$(wildcard $(dir)/*.c)) srcs_all += $(foreach dir,$(src_dirs_c),$(wildcard $(dir)/*.c))
@ -79,8 +79,8 @@ include $(foreach name,$(srcs_all),$(basename $(name)).d)
vpath %.cpp ./ \ vpath %.cpp ./ \
./se\ ./se\
./OTE \
./xsd2xml \ ./xsd2xml \
./se/LPE \
./se/secDNS\ ./se/secDNS\
./xml\ ./xml\
./common\ ./common\
@ -113,29 +113,28 @@ $(BUILD_OBJ_DIR)/%: $(BUILD_OBJ_DIR)/%.o
.PHONY: doc clean dclean .PHONY: doc clean dclean
# #
# The toolkit raises the c++ "static initialization fiasco" situation. # The toolkit raises the c++ "static initialization fiasco" situation. Use this as needed
# #
ARTKOBJS= build/XMLGregorianCalendar.o build/XMLParser.o build/XMLWriter.o build/ACSession.o build/DomainAddRem.o build/EnumDomainInfoResponse.o build/log.o build/PostalInfoType.o build/SessionManagerPropertiesImpl.o \ #ARTKOBJS= build/XMLGregorianCalendar.o build/XMLParser.o build/XMLWriter.o build/ACSession.o build/DomainAddRem.o build/EnumDomainInfoResponse.o build/log.o build/PostalInfoType.o build/SessionManagerPropertiesImpl.o \
build/RegistrantObjectType.o build/mdLogger.o \ #build/RegistrantObjectType.o build/mdLogger.o \
build/AddRemType.o build/DomainCheckResponse.o build/EnumDomainUpdateCommand.o build/LPECheckResponse.o build/Properties.o build/SessionPoolImpl.o \ #build/AddRemType.o build/DomainCheckResponse.o build/EnumDomainUpdateCommand.o build/LPECheckResponse.o build/Properties.o build/SessionPoolImpl.o \#build/boolean.o build/DomainCreateCommand.o build/EnumType.o build/LPECreateCommand.o build/ProtocolExtensionCommand.o build/SSLException.o \
build/boolean.o build/DomainCreateCommand.o build/EnumType.o build/LPECreateCommand.o build/ProtocolExtensionCommand.o build/SSLException.o \ #build/CertificateUserMismatchException.o build/DomainCreateResponse.o build/EPPDateFormatter.o build/LPECreateResponse.o build/ReceiveSE.o build/StandardCommandType.o \
build/CertificateUserMismatchException.o build/DomainCreateResponse.o build/EPPDateFormatter.o build/LPECreateResponse.o build/ReceiveSE.o build/StandardCommandType.o \ #build/CheckResponse.o build/DomainInfoKVResponseExtension.o build/EPPWriter.o build/NamespaceResolver.o build/StandardObjectType.o \
build/CheckResponse.o build/DomainInfoKVResponseExtension.o build/EPPWriter.o build/NamespaceResolver.o build/StandardObjectType.o \ #build/CLTRID.o build/DomainInfoResponse.o build/ErrorPkg.o build/NAPTR.o build/RegistrantTransferCommandType.o build/StringUtils.o \
build/CLTRID.o build/DomainInfoResponse.o build/ErrorPkg.o build/NAPTR.o build/RegistrantTransferCommandType.o build/StringUtils.o \ #build/CommandCounter.o build/DomainKVCommandExtension.o build/Greeting.o build/NotificationResponse.o build/ResponseExtension.o build/SyncExtension.o \
build/CommandCounter.o build/DomainKVCommandExtension.o build/Greeting.o build/NotificationResponse.o build/ResponseExtension.o build/SyncExtension.o \ #build/Command.o build/DomainNotificationResponse.o build/HostAddRem.o build/ObjectCommand.o build/Response.o build/SystemProperties.o \
build/Command.o build/DomainNotificationResponse.o build/HostAddRem.o build/ObjectCommand.o build/Response.o build/SystemProperties.o \ #build/config.o build/DomainRegistrantTransferCommand.o build/HostCheckResponse.o build/ResultCounter.o build/Timer.o \
build/config.o build/DomainRegistrantTransferCommand.o build/HostCheckResponse.o build/OteDomainInfoResponse.o build/ResultCounter.o build/Timer.o \ #build/Constants.o build/DomainRegistrantTransferResponse.o build/HostCreateCommand.o build/Result.o build/TLSContext.o \
build/Constants.o build/DomainRegistrantTransferResponse.o build/HostCreateCommand.o build/OteDomainModifyRegistrantCommand.o build/Result.o build/TLSContext.o \ #build/ContactCheckResponse.o build/DomainRenewCommand.o build/HostCreateResponse.o build/LPEDomainObjectType.o build/SecDNSChgType.o build/TLSSession.o \
build/ContactCheckResponse.o build/DomainRenewCommand.o build/HostCreateResponse.o build/OteDomainObjectType.o build/SecDNSChgType.o build/TLSSession.o \ #build/ContactCreateCommand.o build/DomainRenewResponse.o build/HostInfoResponse.o build/SecDNSDSData.o build/TLSSocket.o \
build/ContactCreateCommand.o build/DomainRenewResponse.o build/HostInfoResponse.o build/OteDomainTransferRegistrantCommand.o build/SecDNSDSData.o build/TLSSocket.o \ #build/ContactCreateResponse.o build/DomainSecDNSCreateCommandExtension.o build/HostUpdateCommand.o build/SecDNSDSOrKeyType.o build/TransferCommand.o \
build/ContactCreateResponse.o build/DomainSecDNSCreateCommandExtension.o build/HostUpdateCommand.o build/OteDomainTransferRegistrantResponse.o build/SecDNSDSOrKeyType.o build/TransferCommand.o \ #build/ContactInfoResponse.o build/DomainSecDNSInfoResponseExtension.o build/InetAddress.o build/LPEExtension.o build/SecDNSExtension.o build/TransferOp.o \
build/ContactInfoResponse.o build/DomainSecDNSInfoResponseExtension.o build/InetAddress.o build/OteExtension.o build/SecDNSExtension.o build/TransferOp.o \ #build/ContactNotificationResponse.o build/DomainSecDNSUpdateCommandExtension.o build/InfoResponse.o build/LPELPECreateCommand.o build/SecDNSKeyData.o build/TransferResponse.o \
build/ContactNotificationResponse.o build/DomainSecDNSUpdateCommandExtension.o build/InfoResponse.o build/OteLPECreateCommand.o build/SecDNSKeyData.o build/TransferResponse.o \ #build/ContactTransferResponse.o build/DomainTransferResponse.o build/init.o build/Period.o build/SecDNSRemType.o build/UserPassMismatchException.o \
build/ContactTransferResponse.o build/DomainTransferResponse.o build/init.o build/Period.o build/SecDNSRemType.o build/UserPassMismatchException.o \ #build/ContactUpdateCommand.o build/DomainUpdateCommand.o build/IPVersion.o build/PeriodUnit.o build/SendSE.o build/XMLDocument.o \
build/ContactUpdateCommand.o build/DomainUpdateCommand.o build/IPVersion.o build/PeriodUnit.o build/SendSE.o build/XMLDocument.o \ #build/CreateResponse.o build/DomainUpdateSyncCommandExtension.o build/KVExtension.o build/PollOperation.o build/SessionFactory.o \
build/CreateResponse.o build/DomainUpdateSyncCommandExtension.o build/KVExtension.o build/PollOperation.o build/SessionFactory.o \ #build/DataResponse.o build/E164Extension.o build/Logger.o build/PollResponse.o build/SessionManagerFactory.o \
build/DataResponse.o build/E164Extension.o build/Logger.o build/PollResponse.o build/SessionManagerFactory.o \ #build/Disclose.o build/EnumDomainCreateCommand.o build/LoginCommand.o build/PostalInfo.o build/SessionManagerImpl.o
build/Disclose.o build/EnumDomainCreateCommand.o build/LoginCommand.o build/PostalInfo.o build/SessionManagerImpl.o
.PHONY: tests .PHONY: tests
@ -149,7 +148,7 @@ dirs:
libACTK1_0.so: libACTK1_0.so:
$(BUILD_LIB_DIR)/libACTK1_0.so: $(objs) $(BUILD_LIB_DIR)/libACTK1_0.so: $(objs)
$(CXX) $(LDFLAGS) $(PRODORDEV) -shared $(ARTKOBJS) -o $@ $(CXX) $(LDFLAGS) $(PRODORDEV) -shared $(objs) -o $@
xsd2xml: xsd2xml:
$(BUILD_OBJ_DIR)/xsd2xml: build/parser.o $(BUILD_OBJ_DIR)/xsd2xml: build/parser.o

View File

@ -1,37 +0,0 @@
#ifndef __LPEDOMAIN_CHECK_COMMAND_HPP
#define __LPEDOMAIN_CHECK_COMMAND_HPP
#include "se/DomainCheckCommand.hpp"
#include "se/StandardObjectType.hpp"
#include <string>
#include <vector>
/**
* A DomainCheckCommand is used to check the availability of domain objects
* in a Registry. Instances of this class generate RFC3730 and RFC3731
* compliant domain check EPP command service elements via the toXML method.
*
* @see DomainCheckResponse
*/
class LPECheckCommand : public DomainCheckCommand
{
public:
/**
* Check the availability of the single identified domain.
*
* @param name The name of the domain to check the availability of.
*/
LPECheckCommand (const std::string &name)
: DomainCheckCommand ( name) {};
/**
* Check the availability of at least one domain.
*
* @param names The names of the domains to check the availability of.
*/
LPECheckCommand (std::vector<std::string> &names)
: DomainCheckCommand ( names) {};
};
#endif // __LPEDOMAIN_CHECK_COMMAND_HPP

View File

@ -1,31 +0,0 @@
#include "common/init.hpp"
#include "common/Test.hpp"
#include "se/CLTRID.hpp"
#include "session/Timer.hpp"
#include "OTE/LPECheckCommand.hpp"
#include <iostream>
using namespace std;
void doWork()
{
init("./etc/toolkit2.conf");
{
CLTRID::setClID("ACTKUTST");
Timer::setTime("20140101.010101");
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-andvalidate.claimsgafour</name></check></check><clTRID>ACTKUTST.20140101.010101.0</clTRID></command></epp>");
}
}
int main(int argc, char* argv[])
{ int i=0;
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,49 +0,0 @@
#include "common/StringUtils.hpp"
#include "se/StandardObjectType.hpp"
#include "OTE/LPECheckResponse.hpp"
const std::string& LPECheckResponse::DOM_CHKDATA_COUNT_EXPR()
{
static const std::string expr = LPECheckResponse::exprReplace (CheckResponse::CHKDATA_COUNT_EXPR());
return expr;
}
const std::string& LPECheckResponse::DOM_CHKDATA_IND_EXPR()
{
static const std::string expr = LPECheckResponse::exprReplace (CheckResponse::CHKDATA_IND_EXPR());
return expr;
}
const std::string& LPECheckResponse::DOM_CHKDATA_IDENT_EXPR()
{
static const std::string expr = LPECheckResponse::exprReplace (CheckResponse::CHKDATA_IDENT_EXPR());
return expr;
}
const std::string& LPECheckResponse::DOM_CHKDATA_AVAIL_EXPR()
{
static const std::string expr = LPECheckResponse::exprReplace (CheckResponse::CHKDATA_AVAIL_EXPR());
return expr;
}
const std::string& LPECheckResponse::DOM_CHKDATA_REASON_EXPR()
{
static const std::string expr = LPECheckResponse::exprReplace (CheckResponse::CHKDATA_REASON_EXPR());
return expr;
}
LPECheckResponse::LPECheckResponse()
: CheckResponse (StandardObjectType::DOMAIN())
{ }
std::string LPECheckResponse::exprReplace (const std::string &expr)
{
return StringUtils::replaceAll(
StringUtils::replaceAll(
expr,
DataResponse::OBJ(),
StandardObjectType::DOMAIN()->getName()),
"IDENT",
"name");
}

View File

@ -1,36 +0,0 @@
#ifndef __LPE_CHECK_RESPONSE_HPP
#define __LPE_CHECK_RESPONSE_HPP
#include "se/CheckResponse.hpp"
/**
* Use this to access availability data for domains as provided in an EPP
* domain check response compliant with RFCs 3730 and 3731. Such a service
* element is sent by a compliant EPP server in response to a valid domain
* check command, implemented by the DomainCheckCommand class.
*
* @see DomainCheckCommand
*/
class LPECheckResponse : public CheckResponse
{
public:
LPECheckResponse ();
protected:
const std::string& chkDataCountExpr() const { return DOM_CHKDATA_COUNT_EXPR(); };
const std::string& chkDataIndexExpr() const { return DOM_CHKDATA_IND_EXPR(); };
const std::string& chkDataTextExpr() const { return DOM_CHKDATA_IDENT_EXPR(); };
const std::string& chkDataAvailExpr() const { return DOM_CHKDATA_AVAIL_EXPR(); };
const std::string& chkDataReasonExpr() const { return DOM_CHKDATA_REASON_EXPR(); };
static std::string exprReplace (const std::string &expr);
private:
static const std::string& DOM_CHKDATA_COUNT_EXPR();
static const std::string& DOM_CHKDATA_IND_EXPR();
static const std::string& DOM_CHKDATA_IDENT_EXPR();
static const std::string& DOM_CHKDATA_AVAIL_EXPR();
static const std::string& DOM_CHKDATA_REASON_EXPR();
};
#endif // __LPE_CHECK_RESPONSE_HPP

View File

@ -1,37 +0,0 @@
#include "session/TestEnvironment.hpp"
#include "xml/XMLParser.hpp"
#include "xml/XMLDocument.hpp"
#include "common/init.hpp"
#include "common/Test.hpp"
#include "OTE/LPECheckResponse.hpp"
#include <memory>
using namespace std;
void doWork()
{
init("./etc/toolkit2.conf");
const string xml =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><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\"><response><result code=\"1000\"><msg>Command completed successfully</msg></result><resData><domain:chkData xmlns:domain=\"urn:ietf:params:xml:ns:domain-1.0\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd\"><domain:cd><domain:name avail=\"1\">example.com</domain:name></domain:cd><domain:cd><domain:name avail=\"0\">example.net</domain:name><domain:reason>In use</domain:reason></domain:cd><domain:cd><domain:name avail=\"1\">example.org</domain:name></domain:cd></domain:chkData></resData><trID><clTRID>ABC-12345</clTRID><svTRID>54322-XYZ</svTRID></trID></response></epp>";
XMLParser parser;
auto_ptr<XMLDocument> doc(parser.parse(xml));
LPECheckResponse response;
response.fromXML(doc.get());
ASSERT_EQ(response.isAvailable("example.com"), true);
ASSERT_EQ(response.getReason("example.net"), "In use");
ASSERT_EQ("In use", response.getReason(1));
ASSERT_EQ(3, response.getAvailableList().size());
ASSERT_EQ(3, response.getReasonList().size());
ASSERT_EQ(1000, response.getResults()[0].getResultCode());
ASSERT_EQ("ABC-12345", response.getCLTRID());
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,15 +0,0 @@
#include "se/StandardObjectType.hpp"
#include "xml/XMLHelper.hpp"
#include "OTE/OteExtension.hpp"
#include "OTE/LPECreateCommand.hpp"
#include "se/CommandExtension.hpp"
void LPECreateCommand::addToCommand(const Command &command) const
{
XMLWriter* xmlWriter = command.getXmlWriter();
DOMElement* extensionElement = command.getExtensionElement();
DOMElement* createElement = xmlWriter->appendChild(extensionElement,
"create", OteExtension().getURI());
int a = 0;
}

View File

@ -1,38 +0,0 @@
#ifndef __LPECREATECOMMAND_HPP
#define __LPECREATECOMMAND_HPP
#define OTEADT void
#include "se/DomainCreateCommand.hpp"
#include "se/CommandExtension.hpp"
class LPECreateCommand;
/**
* Mapping of EPP urn:ietf:params:xml:ns:domain-1.0 create command specified in
* RFC3731. Command-response extensions to the domain:create command are
* implemented as subclasses of this.
* Use this class to generate a standards-compliant XML document, given simple
* input parameters. The toXML method in Command serialises this object to
* XML.
*/
class LPECreateCommand : public DomainCreateCommand, public CommandExtension
{
public:
/**
* Constructor for a domain:create EPP command. All core EPP domain:create
* attributes may be set using this constructor.
*/
LPECreateCommand (const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts = NULL,
const std::vector<std::string>* nameservers = NULL,
const std::vector<std::string>* adminContacts = NULL,
const std::vector<std::string>* billingContacts = NULL,
const Period* period = NULL) :
DomainCreateCommand(name, pw, registrantID, techContacts, nameservers,
adminContacts, billingContacts, period), CommandExtension(){}
virtual void addToCommand(const Command &command) const;
void setCreateData(OTEADT* createData);
};
#endif // __LPECREATECOMMAND_HPP

View File

@ -1,54 +0,0 @@
#include "se/StandardObjectType.hpp"
#include "se/EPPDateFormatter.hpp"
#include "common/StringUtils.hpp"
#include "OTE/LPECreateResponse.hpp"
const std::string LPECreateResponse::DOM_CR_DATE_EXPR
(LPECreateResponse::exprReplace
(CreateResponse::CR_DATE_EXPR()));
const std::string LPECreateResponse::DOM_NAME_EXPR
(LPECreateResponse::exprReplace
(CreateResponse::CRE_DATA_EXPR()) +
"/domain:name/text()");
const std::string LPECreateResponse::DOM_EX_DATE_EXPR
(LPECreateResponse::exprReplace
(CreateResponse::CRE_DATA_EXPR()) +
"/domain:exDate/text()");
LPECreateResponse::LPECreateResponse()
: CreateResponse(StandardObjectType::DOMAIN())
{
}
void LPECreateResponse::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);
exDate = std::auto_ptr<XMLGregorianCalendar>(EPPDateFormatter::fromXSDateTime(exDateStr));
}
catch (XPathExpressionException& e)
{
maintLogger->warning(e.getMessage());
ParsingException pe;
pe.causedBy(e);
throw pe;
}
}
std::string LPECreateResponse::exprReplace (const std::string &expr)
{
return StringUtils::replaceAll (expr,
CreateResponse::OBJ(),
StandardObjectType::DOMAIN()->getName());
}

View File

@ -1,38 +0,0 @@
#ifndef __LPE_CREATE_RESPONSE_HPP
#define __LPE_CREATE_RESPONSE_HPP
#include "se/CreateResponse.hpp"
#include "se/XMLGregorianCalendar.hpp"
/**
* Use this to access create data for a domain as provided in an EPP domain
* create response compliant with RFCs 3730 and 3731. Such a service element
* is sent by a compliant EPP server in response to a valid domain create
* command, implemented by the DomainCreateCommand.
*
* @see DomainCreateCommand
*/
class LPECreateResponse : public CreateResponse
{
public:
LPECreateResponse();
const std::string & getName() const { return name; };
const XMLGregorianCalendar* getExpiryDate() const { return exDate.get(); };
virtual void fromXML (XMLDocument *xmlDoc) throw (ParsingException);
protected:
const std::string & crDateExpr() const { return DOM_CR_DATE_EXPR; };
static std::string exprReplace (const std::string &expr);
private:
static const std::string DOM_CR_DATE_EXPR,
DOM_NAME_EXPR,
DOM_EX_DATE_EXPR;
std::string name;
std::auto_ptr<XMLGregorianCalendar> exDate;
};
#endif // __DOMAIN_CREATE_RESPONSE_HPP

View File

@ -1,57 +0,0 @@
#include "OTE/OteDomainInfoResponse.hpp"
#include "se/StandardObjectType.hpp"
#include <stdlib.h> // atoi()
using namespace std;
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()");
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;
}
}

View File

@ -1,72 +0,0 @@
#ifndef __OTE_DOMAIN_INFO_RESPONSE_HPP
#define __OTE_DOMAIN_INFO_RESPONSE_HPP
#include "common/Deprecated.hpp"
#include "se/DomainInfoResponse.hpp"
#include <string>
/**
* Extension of the domain mapping of the EPP info response, as defined in
* RFC3730 and RFC3731, to .ae domain names, the specification of which is in
* the XML schema definition urn:X-ae:params:xml:ns:aeext-1.0.
* Instances of this class provide an interface to access all of the
* information available through EPP for a .ae domain name.
* This relies on the instance first being initialised by a suitable EPP domain
* info response using the method fromXML. For flexibility, this
* implementation extracts the data from the response using XPath queries, the
* expressions for which are defined statically.
* @deprecated AE eligibility extensions should now be managed through the
* @c <kvlist> extension defined in the
* <tt>urn:X-ar:params:xml:ns:kv-1.0</tt> namespace. This can be done
* through the toolkit by using a @c DomainInfoResponse and
* registering a @c DomainInfoKVResponseExtension object, which
* will contain the AE eligibility extensions.
*
* See
* {@link DomainInfoResponse.registerExtension(ResponseExtension)}
* and
* {@link DomainInfoKVResponseExtension}.
*/
class OteDomainInfoResponse : public DomainInfoResponse
{
public:
DEPRECATED(OteDomainInfoResponse());
const std::string& getRegistrantName() const { return registrantName; };
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; };
const std::string& getEligibilityID() const { return eligibilityID; };
const std::string& getEligibilityIDType() const { return eligibilityIDType; };
int getPolicyReason() const { return policyReason; };
virtual void fromXML (XMLDocument *xmlDoc) throw (ParsingException);
private:
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,
registrantIDType,
eligibilityType,
eligibilityName,
eligibilityID,
eligibilityIDType;
int policyReason;
};
#endif // __OTE_DOMAIN_INFO_RESPONSE_HPP

View File

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

View File

@ -1,46 +0,0 @@
#ifndef __OTE_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP
#define __OTE_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP
#include "common/Deprecated.hpp"
#include "se/DomainUpdateCommand.hpp"
/**
* An extension of the domain mapping of the EPP update command, as defined in
* RFC3730 and RFC3731, to .ae domain names, the specification of which is in
* the XML schema definition urn:X-ae:params:xml:ns:aeext-1.0.
* This class should only be used to correct ae extension data for .ae domain
* names, and only where the legal registrant has not changed.
* Use this class to generate a standards-compliant XML document, given simple
* input parameters. The toXML method in Command serialises this object to
* XML.
*
* @deprecated AE eligibility extensions should now be managed through the
* @c <kvlist> extension defined in the
* <tt>urn:X-ar:params:xml:ns:kv-1.0</tt> namespace. This can be done
* through the toolkit by using a @c DomainUpdateCommand and
* appending a @c DomainKVCommandExtension object containing
* the AE eligibility extensions.
*
* See
* {@link DomainUpdateCommand.appendExtension(CommandExtension)}
* and
* {@link DomainKVCommandExtension}.
*/
class OteDomainModifyRegistrantCommand : public DomainUpdateCommand
{
public:
DEPRECATED(
OteDomainModifyRegistrantCommand(const std::string& name,
const std::string& registrantName,
const std::string& explanation,
const std::string* eligibilityType = NULL,
int policyReason = 0,
const std::string* registrantID = NULL,
const std::string* registrantIDType = NULL,
const std::string* eligibilityName = NULL,
const std::string* eligibilityID = NULL,
const std::string* eligibilityIDType = NULL));
};
#endif // __OTE_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP

View File

@ -1,25 +0,0 @@
#include "OteDomainObjectType.hpp"
#include <string>
const std::string& OteDomainObjectType::getName() const {
static const std::string name = "otedom";
return name;
}
const std::string& OteDomainObjectType::getURI() const {
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 =
"urn:X-ote:params:xml:ns:otedomain-1.0 otedomain-1.0.xsd";
return schemaLocation;
}
const std::string& OteDomainObjectType::getIdentType() const {
static const std::string ident = "name";
return ident;
}

View File

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

View File

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

View File

@ -1,88 +0,0 @@
#ifndef __OTE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
#define __OTE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
#include <iostream>
#include "common/Deprecated.hpp"
#include "se/ProtocolExtensionCommand.hpp"
class XMLGregorianCalendar;
class Period;
/**
* In cases where the legal registrant of a .ae domain name has changed, this
* class should be used to request a transfer of registrant. This is a
* different action to correcting extension data which was originally specified
* incorrectly, and should only be used in the situation described. This
* command will result in the validity period of the domain name being updated
* and the requesting client being charged the usual create fee upon success of
* this operation.
* Use this class to generate a standards-compliant XML document, given simple
* input parameters. The toXML method in Command serialises this object to
* XML.
* @deprecated AE eligibility extensions should now be managed through the
* @c <kvlist> extension defined in the
* <tt>urn:X-ar:params:xml:ns:kv-1.0</tt> namespace. The Registrant
* Transfer command that utilises this extension is defined in the
* <tt>urn:X-ar:params:xml:ns:registrant-1.0</tt> namespace. This can
* be done through the toolkit by using a
* @c DomainRegistrantTransferCommand and specifying
* @c "ae" as the kvListName.
*
* See
* {@link DomainRegistrantTransferCommand}
* and
* {@link DomainRegistrantTransferCommand.addItem(std::string, std::string)}
*/
class OteDomainTransferRegistrantCommand : public ProtocolExtensionCommand
{
public:
/**
* Request that the named .ae domain name be transferred to the legal
* entity specified by the given ae extension data.
*
* @param name The domain name to transfer.
*
* @param curExpDate The current expiry of the identified domain name.
* This is required in order to prevent repeated transfer of the name due
* to protocol transmission failures.
*
* @param eligibilityType
*
* @param policyReason
*
* @param registrantName
*
* @param explanation An explanation of how the transfer was effected.
*
* @param registrantID
*
* @param registrantIDType
*
* @param eligibilityName
*
* @param eligibilityID
*
* @param eligibilityIDType
*
* @param period The desired new validity period, starting from the time
* the transfer completes successfully.
*
* @param explanation An explanation of how the transfer was effected.
*/
DEPRECATED(
OteDomainTransferRegistrantCommand (const std::string& name,
const XMLGregorianCalendar& curExpDate,
const std::string& eligibilityType,
int policyReason,
const std::string& registrantName,
const std::string& explanation,
const std::string* registrantID = NULL,
const std::string* registrantIDType = NULL,
const std::string* eligibilityName = NULL,
const std::string* eligibilityID = NULL,
const std::string* eligibilityIDType = NULL,
const Period* period = NULL));
};
#endif // __OTE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP

View File

@ -1,37 +0,0 @@
#include "se/RegistrantTransferCommandType.hpp"
#include "se/EPPDateFormatter.hpp"
#include "OTE/OteDomainObjectType.hpp"
#include "OTE/OteDomainTransferRegistrantResponse.hpp"
namespace {
const RegistrantTransferCommandType rtrnType;
OteDomainObjectType otedomType;
} // anonymous namespace
using namespace std;
const string OteDomainTransferRegistrantResponse::OTEDOM_NAME_EXPR =
"/e:epp/e:response/e:resData/otedom:rtrnData/otedom:name/text()";
const string OteDomainTransferRegistrantResponse::OTEDOM_EX_DATE_EXPR =
"/e:epp/e:response/e:resData/otedom:rtrnData/otedom:exDate/text()";
OteDomainTransferRegistrantResponse::OteDomainTransferRegistrantResponse()
: DataResponse(&rtrnType, &otedomType)
{
}
void OteDomainTransferRegistrantResponse::fromXML(XMLDocument* xmlDoc) throw (ParsingException)
{
DataResponse::fromXML(xmlDoc);
if (!(resultArray[0].succeeded())) {
return;
}
name = xmlDoc->getNodeValue(OTEDOM_NAME_EXPR);
std::string exDateStr = xmlDoc->getNodeValue(OTEDOM_EX_DATE_EXPR);
exDate = std::auto_ptr<XMLGregorianCalendar>(
EPPDateFormatter::fromXSDateTime(exDateStr));
}

View File

@ -1,44 +0,0 @@
#ifndef __OTE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
#define __OTE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
#include "common/Deprecated.hpp"
#include "se/DataResponse.hpp"
#include "se/XMLGregorianCalendar.hpp"
/**
* Use this to access create data for a domain as provided in an EPP domain
* create response compliant with RFCs 3730 and 3731. Such a service element
* is sent by a compliant EPP server in response to a valid domain create
* command, implemented by the DomainCreateCommand.
*
* @see DomainCreateCommand
* @deprecated Performing a registrant transfer with AE eligibility extensions
* should now be managed through the use of the
* @c DomainRegistrantTransferCommand and
* @c DomainRegistrantTransferResponse
*
* See
* {@link DomainRegistrantTransferCommand}
* and
* {@link DomainRegistrantTransferResponse}.
*/
class OteDomainTransferRegistrantResponse : public DataResponse
{
public:
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 OTEDOM_NAME_EXPR;
static const std::string OTEDOM_EX_DATE_EXPR;
std::string name;
std::auto_ptr<XMLGregorianCalendar> exDate;
};
#endif // __OTE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE

View File

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

View File

@ -1,29 +0,0 @@
#ifndef __OTEEXTENSION_HPP
#define __OTEEXTENSION_HPP
#include "se/Extension.hpp"
/**
* A bundled set of constants representing the .ae EPP extension
* schema. The namespace URI uniquely identifies the extension.
*/
class OteExtension : public Extension
{
public:
virtual ~OteExtension(void) { }
/**
* Get the globally unique namespace URI which identifies this extension.
*/
virtual std::string& getURI() const;
/**
* Get the location hint for the XML schema used to validate EPP service
* element instances using this extension.
*/
virtual std::string& getSchemaLocation() const;
};
#endif // __OTEXTENSION_HPP

View File

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

View File

@ -1,150 +0,0 @@
#ifndef __OTEDOMAINCREATECOMMAND_HPP
#define __OTEDOMAINCREATECOMMAND_HPP
#include "common/Deprecated.hpp"
#include "OTE/LPECreateCommand.hpp"
/**
* Extension of EPP urn:ietf:params:xml:ns:domain-1.0 create command specified
* 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
* 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.
* The response expected from a server should be handled by a {@link
* DomainCreateResponse} object.
*
* @deprecated AE eligibility extensions should now be managed through the
* @c <kvlist> extension defined in the
* <tt>urn:X-ar:params:xml:ns:kv-1.0</tt> namespace. This can be done
* through the toolkit by using a @c DomainCreateCommand and
* appending a @c DomainKVCommandExtension object containing
* the AE eligibility extensions.
*
* See
* {@link DomainCreateCommand.appendExtension(CommandExtension)}
* and
* {@link DomainKVCommandExtension}.
*/
class OteLPECreateCommand : public LPECreateCommand
{
public:
/**
* Minimal constructor for creating a domain:create + oteext:create
* EPP command. These parameters are the least required for a valid
* .ote domain create command.
*/
DEPRECATED(
OteLPECreateCommand (const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
const std::string &oteEligibilityType,
int otePolicyReason,
const std::string& oteRegistrantName));
/**
* 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 ote extension fields is given in the
* parameter documentation.
*
* @param name The name of the new domain.
*
* @param pw The password to assign to the domain (also known as authInfo
* or authorisation information).
*
* @param registrantID The identifier of an existing contact to assign as
* the registrant contact for this domain. Failure to ensure the contact
* exists prior to using them in this way will result in an EPP result of
* '2303 "Object does not exist"'.
*
* @param techContacts The identifiers of existing contacts to assign as
* technical contacts for this domain. Failure to ensure the contacts
* exist prior to using them in this way will result in an EPP result of
* '2303 "Object does not exist"'.
*
* @param adminContacts See techContacts (substitute administrative for
* technical).
*
* @param billingContacts See techContacts (substitute billing for
* technical).
*
* @param nameservers The names of existing hosts to delegate the domain
* being created to. Failure to ensure the hosts exist prior to using them
* in this way will result in an EPP result of '2303 "Object does not
* exist"'.
*
* @param period The initial registration period of the domain object. A
* server may define a default initial registration period if not specified
* by the client.
*
* @param oteEligibilityType oteext:eligType.
*
* @param otePolicyReason oteext:policyReason.
*
* @param oteRegistrantName oteext:registrantName.
*
* @param oteRegistrantID oteext:registrantID.
*
* @param oteRegistrantIDType oteext:registrantID type attribute.
*
* @param oteEligibilityName oteext:eligibilityName.
*
* @param oteEligibilityID oteext:eligibilityID.
*
* @param oteEligibilityIDType oteext:eligibilityID type attribute.
*/
DEPRECATED(
OteLPECreateCommand (const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
const std::vector<std::string>* adminContacts,
const std::vector<std::string>* billingContacts,
const std::vector<std::string>* nameservers,
const Period *period,
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,
const std::string& registrantName);
void setExtension (const std::string& eligibilityType,
int PolicyReason,
const std::string& registrantName,
const std::string* registrantID,
const std::string& registrantIDType);
/**
* &lt;extension&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;
* &nbsp;&nbsp;&lt;eligibilityName&gt;eligibilityName&lt;/eligibilityName&gt;
* &nbsp;&nbsp;&lt;eligibilityID type="eligibilityIDType"&gt;eligibilityID&lt;/eligibilityID&gt;
* &nbsp;&nbsp;&lt;policyReason&gt;policyReason&lt;/policyReason&gt;
* &nbsp;&lt;/create&gt;
* &lt;/extension&gt;
*/
void setExtension (const std::string& eligibilityType,
int policyReason,
const std::string& registrantName,
const std::string* registrantID,
const std::string* registrantIDType,
const std::string* eligibilityName,
const std::string* eligibilityID,
const std::string* eligibilityIDType);
};
#endif // __OTEDOMAINCREATECOMMAND_HPP

View File

@ -1,86 +0,0 @@
#include "common/init.hpp"
#include "common/Test.hpp"
#include "session/Timer.hpp"
#include "se/CLTRID.hpp"
#include "se/ContactCheckCommand.hpp"
#include "OTE/OteLPECreateCommand.hpp"
using namespace std;
void doWork()
{
init("./etc/toolkit2.conf");
const string registrantName = "AusRegistry";
const string registrantID = "01241326211";
const string registrantIDType = "Trade License";
const string eligibilityType = "Trade License (IT)";
const int policyReason = 1;
const string eligibilityName = "Blah";
const string eligibilityID = "1231239523";
const string eligibilityIDType = "Trademark";
/**
* Test that the XML string generated for a minimal create domain command
* matches the expected XML for an EPP create domain command with those
* parameters.
*/
{
Timer::setTime("20140101.010101");
CLTRID::setClID("ACTKUTST");
vector<string> techIds;
techIds.push_back("JTKCON2");
string registrant("JTKCON");
OteLPECreateCommand cmd("ACTKUTST.co.ae", "jtkUT3st", &registrant, &techIds,
eligibilityType, policyReason, registrantName);
const string xml(cmd.toXML());
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><create><create xmlns=\"urn:ietf:params:xml:ns:domain-1.0\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd\"><name>ACTKUTST.co.ae</name><registrant>JTKCON</registrant><contact type=\"tech\">JTKCON2</contact><authInfo><pw>jtkUT3st</pw></authInfo></create></create><extension><create xmlns=\"urn:X-ae:params:xml:ns:aeext-1.0\" xsi:schemaLocation=\"urn:X-ae:params:xml:ns:aeext-1.0 aeext-1.0.xsd\"><aeProperties><registrantName>AusRegistry</registrantName><eligibilityType>Trade License (IT)</eligibilityType><policyReason>1</policyReason></aeProperties></create></extension><clTRID>ACTKUTST.20140101.010101.0</clTRID></command></epp>");
}
/**
* Test that the XML string generated for a sample create domain command
* specified with all available parameters matches the expected XML for
* an EPP create domain command with those parameters.
*
*/
{
Timer::setTime("20140101.010101");
CLTRID::setClID("ACTKUTST");
vector<string> techIds;
techIds.push_back("JTKCON2");
vector<string> adminContacts;
adminContacts.push_back("JTKCON");
adminContacts.push_back("JTKCON2");
string registrant("JTKCON");
vector<string> nameServers;
nameServers.push_back("ns1.ausregistry.net");
nameServers.push_back("ns2.ausregistry.net");
Period period(48, PeriodUnit::MONTHS());
OteLPECreateCommand cmd(
"ACTKUTST.co.ae", "jtkUT3st", &registrant,
&techIds, &adminContacts,
NULL, &nameServers, &period,
eligibilityType, policyReason,
registrantName, &registrantID,
&registrantIDType, &eligibilityName,
&eligibilityID, &eligibilityIDType);
const string xml(cmd.toXML());
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><create><create xmlns=\"urn:ietf:params:xml:ns:domain-1.0\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd\"><name>ACTKUTST.co.ae</name><period unit=\"m\">48</period><ns><hostObj>ns1.ausregistry.net</hostObj><hostObj>ns2.ausregistry.net</hostObj></ns><registrant>JTKCON</registrant><contact type=\"admin\">JTKCON</contact><contact type=\"admin\">JTKCON2</contact><contact type=\"tech\">JTKCON2</contact><authInfo><pw>jtkUT3st</pw></authInfo></create></create><extension><create xmlns=\"urn:X-ae:params:xml:ns:aeext-1.0\" xsi:schemaLocation=\"urn:X-ae:params:xml:ns:aeext-1.0 aeext-1.0.xsd\"><aeProperties><registrantName>AusRegistry</registrantName><registrantID type=\"Trade License\">01241326211</registrantID><eligibilityType>Trade License (IT)</eligibilityType><eligibilityName>Blah</eligibilityName><eligibilityID type=\"Trademark\">1231239523</eligibilityID><policyReason>1</policyReason></aeProperties></create></extension><clTRID>ACTKUTST.20140101.010101.0</clTRID></command></epp>");
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}