This commit is contained in:
Ren RenJuan 2014-01-16 04:42:18 +00:00
parent d129931b4d
commit 8054bef18d
75 changed files with 378 additions and 2280 deletions

214
.cproject Normal file
View File

@ -0,0 +1,214 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.1489137557">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.1489137557" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="git" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.1489137557" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.1489137557.45876174" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.1604623789" name="cdt.managedbuild.toolchain.gnu.base" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1489688336" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder id="cdt.managedbuild.target.gnu.builder.base.1594561920" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1326612781" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.637187500" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1015923900" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1814883119" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1118638960" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.1481582528" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1048700328" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1629920531" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.base.264833315" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.853558430" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="git.null.364140434" name="git"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="libACTK1_0.so" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>libACTK1_0.so</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>tests</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="dirs" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>dirs</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="dclean" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>dclean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="all" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="all" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>tests</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="APIG" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="dirs" path="APIG" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>dirs</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="ausreg_cd" path="APIG" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>ausreg_cd</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="apig-cli" path="APIG" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>apig-cli</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="build/commander.o" path="APIG" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>build/commander.o</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="AusRegEPPTK.so" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="tests" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>tests</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="cliever" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>cliever</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>clean</buildTarget>
<stopOnError>false</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="distclean" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>distclean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="build/ausreg-md" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>build/ausreg-md</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cproject>

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.cproject .settings .project

38
.project Normal file
View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>git</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<filteredResources>
<filter>
<id>1389807810627</id>
<name></name>
<type>22</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-*.d</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="cdt.managedbuild.toolchain.gnu.base.1489137557" name="Default">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(gcc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
</project>

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.jboss.ide.eclipse.as.core.singledeployable.deployableList=AusRegCliever/include/ausRegTK.h\n

BIN
ACTK1_0/lib/libACTK1_0.so Executable file

Binary file not shown.

View File

@ -1,25 +0,0 @@
#include <string>
#include "ArDomainObjectType.hpp"
const std::string & ArDomainObjectType::getName() const {
static const std::string name = "ardom";
return name;
}
const std::string & ArDomainObjectType::getURI() const {
static const std::string uri = "urn:X-ar:params:xml:ns:ardomain-1.0";
return uri;
}
const std::string & ArDomainObjectType::getSchemaLocation() const {
static const std::string schemaLocation =
"urn:X-ar:params:xml:ns:ardomain-1.0 ardomain-1.0.xsd";
return schemaLocation;
}
const std::string & ArDomainObjectType::getIdentType() const {
static const std::string ident = "name";
return ident;
}

View File

@ -1,17 +0,0 @@
#ifndef ARDOMAIN_OBJECT_TYPE
#define ARDOMAIN_OBJECT_TYPE
#include "ObjectType.hpp"
#include <string>
class ArDomainObjectType : public ObjectType {
public:
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 // ARDOMAIN_OBJECT_TYPE

View File

@ -1,35 +0,0 @@
#include "se/ArDomainPolicyDeleteCommand.hpp"
#include "se/ArExtension.hpp"
#include "se/ArDomainObjectType.hpp"
#include "se/CommandType.hpp"
#include "se/Extension.hpp"
#include "xml/XMLHelper.hpp"
#include <string>
namespace {
class ArDomainPolicyDeleteCommandType : public CommandType
{
public:
ArDomainPolicyDeleteCommandType() : CommandType(getCommandName()) { }
std::string getCommandName() const { return "policyDelete"; }
std::string toString() const { return "policyDelete"; }
};
Extension& arExtension() {
static Extension* arExt = new ArExtension();
return *arExt;
}
const ArDomainPolicyDeleteCommandType polDeleteCmdType;
ArDomainObjectType ardomType;
}; // anonymous namespace
ArDomainPolicyDeleteCommand::ArDomainPolicyDeleteCommand (
const std::string &name, const std::string &reason) : ProtocolExtensionCommand(
&polDeleteCmdType, &ardomType, name, arExtension())
{
XMLHelper::setTextContent(
xmlWriter->appendChild(objElement, "reason"), reason);
}

View File

@ -1,28 +0,0 @@
#ifndef __AR_DOMAIN_POLICY_DELETE_COMMAND_HPP
#define __AR_DOMAIN_POLICY_DELETE_COMMAND_HPP
#include "se/Extension.hpp"
#include "se/ProtocolExtensionCommand.hpp"
/**
* Mapping of EPP urn:ar:params:xml:ns:arext-1.0 policyDelete command specified
* by the AusRegistry EPP extensions document. This should be used to delete
* domains violating relevant policy, rather than at the request of the
* registrant.
* Use this class to generate an AusRegistry-compliant XML document, given
* simple input parameters. The toXML method in Command serialises this object
* to XML.
*/
class ArDomainPolicyDeleteCommand : public ProtocolExtensionCommand
{
public:
ArDomainPolicyDeleteCommand (
const std::string &name,
const std::string &reason);
private:
Extension& getExtension() const;
};
#endif // __AR_DOMAIN_POLICY_DELETE_COMMAND_HPP

View File

@ -1,29 +0,0 @@
#include "se/ArDomainPolicyDeleteCommand.hpp"
#include "se/CLTRID.hpp"
#include "common/init.hpp"
#include "session/Timer.hpp"
#include "common/Test.hpp"
#include <iostream>
using namespace std;
void doWork()
{
init("/home/drde/etc/toolkit2.conf");
{
Timer::setTime("20070101.010101");
CLTRID::setClID("JTKUTEST");
ArDomainPolicyDeleteCommand cmd("jtkutest.com.au", "jtkutest");
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\"><extension><command xmlns=\"urn:X-ar:params:xml:ns:arext-1.0\" xsi:schemaLocation=\"urn:X-ar:params:xml:ns:arext-1.0 arext-1.0.xsd\"><policyDelete><policyDelete xmlns=\"urn:X-ar:params:xml:ns:ardomain-1.0\" xsi:schemaLocation=\"urn:X-ar:params:xml:ns:ardomain-1.0 ardomain-1.0.xsd\"><name>jtkutest.com.au</name><reason>jtkutest</reason></policyDelete></policyDelete><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></extension></epp>");
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,31 +0,0 @@
#include "se/ArDomainPolicyUndeleteCommand.hpp"
#include "se/ArExtension.hpp"
#include "se/ArDomainObjectType.hpp"
#include "se/CommandType.hpp"
#include "xml/XMLHelper.hpp"
#include "xml/XStr.hpp"
namespace {
class ArPolicyUndeleteCommandType : public CommandType
{
public:
ArPolicyUndeleteCommandType() : CommandType(getCommandName()) { }
std::string getCommandName() const { return "policyUndelete"; }
std::string toString() const { return "policyUndelete"; }
};
Extension& arExtension() {
static Extension* arExt = new ArExtension();
return *arExt;
}
const ArPolicyUndeleteCommandType polUndeleteCmdType;
ArDomainObjectType ardomType;
}; // anonymous namespace
ArDomainPolicyUndeleteCommand::ArDomainPolicyUndeleteCommand(
const std::string &name) : ProtocolExtensionCommand(
&polUndeleteCmdType, &ardomType, name, arExtension())
{
}

View File

@ -1,22 +0,0 @@
#ifndef __AR_DOMAIN_POLICY_UNDELETE_COMMAND_HPP
#define __AR_DOMAIN_POLICY_UNDELETE_COMMAND_HPP
#include "se/ProtocolExtensionCommand.hpp"
/**
* Mapping of EPP urn:ar:params:xml:ns:arext-1.0 policy domainUndelete command
* specified by the AusRegistry EPP extensions document. This should only be
* used to request undeletion of domains which have been deleted due to policy
* violation using the policy delete operation.
* Use this class to generate an AusRegistry-compliant XML document, given
* simple input parameters. The toXML method in Command serialises this object
* to XML.
*/
class ArDomainPolicyUndeleteCommand : public ProtocolExtensionCommand
{
public:
ArDomainPolicyUndeleteCommand(const std::string &name);
};
#endif // __AR_DOMAIN_POLICY_UNDELETE_COMMAND_HPP

View File

@ -1,29 +0,0 @@
#include "se/ArDomainPolicyUndeleteCommand.hpp"
#include "se/CLTRID.hpp"
#include "common/init.hpp"
#include "session/Timer.hpp"
#include "common/Test.hpp"
#include <iostream>
using namespace std;
void doWork()
{
init("/home/drde/etc/toolkit2.conf");
{
Timer::setTime("20070101.010101");
CLTRID::setClID("JTKUTEST");
ArDomainPolicyUndeleteCommand cmd("jtkutest.com.au");
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\"><extension><command xmlns=\"urn:X-ar:params:xml:ns:arext-1.0\" xsi:schemaLocation=\"urn:X-ar:params:xml:ns:arext-1.0 arext-1.0.xsd\"><policyUndelete><policyUndelete xmlns=\"urn:X-ar:params:xml:ns:ardomain-1.0\" xsi:schemaLocation=\"urn:X-ar:params:xml:ns:ardomain-1.0 ardomain-1.0.xsd\"><name>jtkutest.com.au</name></policyUndelete></policyUndelete><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></extension></epp>");
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,32 +0,0 @@
#include "se/ArDomainUndeleteCommand.hpp"
#include "se/ArExtension.hpp"
#include "se/ArDomainObjectType.hpp"
#include "se/CommandType.hpp"
#include "xml/XMLHelper.hpp"
#include "xml/XStr.hpp"
namespace {
class ArUndeleteCommandType : public CommandType
{
public:
ArUndeleteCommandType() : CommandType (getCommandName()) {}
std::string getCommandName() const { return "undelete"; }
std::string toString() const { return "undelete"; }
};
Extension& arExtension() {
static Extension* arExt = new ArExtension();
return *arExt;
}
const ArUndeleteCommandType undeleteCmdType;
ArDomainObjectType ardomType;
}; // anonymous namespace
ArDomainUndeleteCommand::ArDomainUndeleteCommand(
const std::string &name) : ProtocolExtensionCommand(
&undeleteCmdType, &ardomType, name, arExtension())
{
}

View File

@ -1,20 +0,0 @@
#ifndef __ARDOMAIN_UNDELETE_COMMAND_HPP
#define __ARDOMAIN_UNDELETE_COMMAND_HPP
#include "se/ProtocolExtensionCommand.hpp"
/**
* Mapping of EPP urn:ar:params:xml:ns:arext-1.0 domainUndelete command
* specified by the AusRegistry EPP extensions document.
* Use this class to generate an AusRegistry-compliant XML document, given
* simple input parameters. The toXML method in Command serialises this object
* to XML.
*/
class ArDomainUndeleteCommand: public ProtocolExtensionCommand
{
public:
ArDomainUndeleteCommand(const std::string &name);
};
#endif // __ARDOMAIN_UNDELETE_COMMAND_HPP

View File

@ -1,28 +0,0 @@
#include "se/ArDomainUndeleteCommand.hpp"
#include "se/CLTRID.hpp"
#include "se/Period.hpp"
#include "session/Timer.hpp"
#include "common/init.hpp"
#include "common/Test.hpp"
#include <iostream>
using namespace std;
void doWork()
{
init("/home/drde/etc/toolkit2.conf");
Timer::setTime("20070101.010101");
CLTRID::setClID("JTKUTEST");
ArDomainUndeleteCommand cmd("jtkutest.com.au");
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\"><extension><command xmlns=\"urn:X-ar:params:xml:ns:arext-1.0\" xsi:schemaLocation=\"urn:X-ar:params:xml:ns:arext-1.0 arext-1.0.xsd\"><undelete><undelete xmlns=\"urn:X-ar:params:xml:ns:ardomain-1.0\" xsi:schemaLocation=\"urn:X-ar:params:xml:ns:ardomain-1.0 ardomain-1.0.xsd\"><name>jtkutest.com.au</name></undelete></undelete><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></extension></epp>");
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,37 +0,0 @@
#include "se/ArDomainUnrenewCommand.hpp"
#include "se/CommandType.hpp"
#include "se/ArExtension.hpp"
#include "se/ArDomainObjectType.hpp"
#include "se/EPPDateFormatter.hpp"
#include "xml/XMLHelper.hpp"
#include "se/XMLGregorianCalendar.hpp"
namespace {
class ArUnrenewCommand : public CommandType
{
public:
ArUnrenewCommand() : CommandType (getCommandName()) { }
std::string getCommandName() const { return "unrenew"; }
std::string toString() const { return "unrenew"; }
};
Extension& arExtension() {
static Extension* arExt = new ArExtension();
return *arExt;
}
const ArUnrenewCommand unrenewCmdType;
ArDomainObjectType ardomType;
}; // anonymous namespace
ArDomainUnrenewCommand::ArDomainUnrenewCommand(
const std::string &name,
const XMLGregorianCalendar& exDate) : ProtocolExtensionCommand(
&unrenewCmdType, &ardomType, name, arExtension())
{
std::string exDateStr = EPPDateFormatter::toXSDate(exDate);
XMLHelper::setTextContent
(xmlWriter->appendChild(objElement, "curExpDate"), exDateStr);
}

View File

@ -1,23 +0,0 @@
#ifndef __AR_DOMAIN_UNRENEW_COMMAND_HPP
#define __AR_DOMAIN_UNRENEW_COMMAND_HPP
#include "se/ProtocolExtensionCommand.hpp"
#include <string>
class XMLGregorianCalendar;
/**
* Mapping of EPP urn:ar:params:xml:ns:arext-1.0 domainUnrenew command
* specified by the AusRegistry EPP extensions document.
* Use this class to generate an AusRegistry-compliant XML document, given
* simple input parameters. The toXML method in Command serialises this object
* to XML.
*/
class ArDomainUnrenewCommand : public ProtocolExtensionCommand
{
public:
ArDomainUnrenewCommand(const std::string & name, const XMLGregorianCalendar& exDate);
};
#endif // __AR_DOMAIN_UNRENEW_COMMAND_HPP

View File

@ -1,30 +0,0 @@
#include "se/ArDomainUnrenewCommand.hpp"
#include "se/CLTRID.hpp"
#include "se/EPPDateFormatter.hpp"
#include "session/Timer.hpp"
#include "common/init.hpp"
#include "common/Test.hpp"
#include <iostream>
using namespace std;
void doWork()
{
init("/home/drde/etc/toolkit2.conf");
Timer::setTime("20070101.010101");
CLTRID::setClID("JTKUTEST");
ArDomainUnrenewCommand cmd(
"jtkutest.com.au", *EPPDateFormatter::fromXSDateTime("2007-01-01T00:00:00.0Z"));
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\"><extension><command xmlns=\"urn:X-ar:params:xml:ns:arext-1.0\" xsi:schemaLocation=\"urn:X-ar:params:xml:ns:arext-1.0 arext-1.0.xsd\"><unrenew><unrenew xmlns=\"urn:X-ar:params:xml:ns:ardomain-1.0\" xsi:schemaLocation=\"urn:X-ar:params:xml:ns:ardomain-1.0 ardomain-1.0.xsd\"><name>jtkutest.com.au</name><curExpDate>2007-01-01</curExpDate></unrenew></unrenew><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></extension></epp>");
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,37 +0,0 @@
#include "se/ArDomainUnrenewResponse.hpp"
#include "se/ArDomainObjectType.hpp"
#include "se/ArUnrenewCommandType.hpp"
#include "se/EPPDateFormatter.hpp"
namespace {
const ArUnrenewCommandType urenType;
ArDomainObjectType ardomType;
} // anonymous namespace
using namespace std;
const string ArDomainUnrenewResponse::ARDOM_NAME_EXPR =
"/e:epp/e:response/e:resData/ardom:urenData/ardom:name/text()";
const string ArDomainUnrenewResponse::ARDOM_EX_DATE_EXPR =
"/e:epp/e:response/e:resData/ardom:urenData/ardom:exDate/text()";
ArDomainUnrenewResponse::ArDomainUnrenewResponse()
: DataResponse(&urenType, &ardomType)
{
}
void ArDomainUnrenewResponse::fromXML(XMLDocument* xmlDoc) throw (ParsingException)
{
DataResponse::fromXML(xmlDoc);
if (!(resultArray[0].succeeded())) {
return;
}
name = xmlDoc->getNodeValue(ARDOM_NAME_EXPR);
std::string exDateStr = xmlDoc->getNodeValue(ARDOM_EX_DATE_EXPR);
exDate = std::auto_ptr<XMLGregorianCalendar>(
EPPDateFormatter::fromXSDateTime(exDateStr));
}

View File

@ -1,33 +0,0 @@
#ifndef __AR_DOMAIN_UNRENEW_RESPONSE
#define __AR_DOMAIN_UNRENEW_RESPONSE
#include "se/DataResponse.hpp"
#include "se/XMLGregorianCalendar.hpp"
/**
* Use this to access unrenew data for a domain as provided in an EPP domain
* unrenew response compliant with AusRegistry Extensions to EPP and the domain
* name mapping for such extensions. Such a service element is sent by a
* compliant EPP server in response to a valid domain unrenew command,
* implemented by the ArDomainUnrenewCommand class.
*
* @see ArDomainUnrenewCommand
*/
class ArDomainUnrenewResponse : public DataResponse
{
public:
ArDomainUnrenewResponse();
const std::string& getName() { return name; }
const XMLGregorianCalendar* getExpiryDate() { return exDate.get(); }
void fromXML(XMLDocument* xmlDoc) throw (ParsingException);
private:
static const std::string ARDOM_NAME_EXPR;
static const std::string ARDOM_EX_DATE_EXPR;
std::string name;
std::auto_ptr<XMLGregorianCalendar> exDate;
};
#endif // __AU_DOMAIN_UNRENEW_RESPONSE

View File

@ -1,54 +0,0 @@
#include "se/ArDomainUnrenewResponse.hpp"
#include "xml/XMLParser.hpp"
#include "session/Timer.hpp"
#include "common/Test.hpp"
#include "common/init.hpp"
#include "se/EPPDateFormatter.hpp"
using namespace std;
void doWork()
{
init("/home/drde/etc/toolkit2.conf");
const string xml1 =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><epp xmlns=\"urn:ietf:params:xml:ns:epp-1.0\"><response><result code=\"1000\"><msg>Command completed successfully</msg></result><resData><urenData xmlns=\"urn:X-ar:params:xml:ns:ardomain-1.0\"><name>example.com</name><exDate>2009-04-03T22:00:00.0Z</exDate></urenData></resData><trID><clTRID>ABC-12345</clTRID><svTRID>54321-XYZ</svTRID></trID></response></epp>";
const string xml2 =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><epp xmlns=\"urn:ietf:params:xml:ns:epp-1.0\"><response><result code=\"1001\"><msg>Command completed successfully; action pending</msg></result><resData><urenData xmlns=\"urn:X-ar:params:xml:ns:ardomain-1.0\"><name>example.com</name></urenData></resData><trID><clTRID>ABC-12345</clTRID><svTRID>54321-XYZ</svTRID></trID></response></epp>";
ArDomainUnrenewResponse response1;
ArDomainUnrenewResponse response2;
XMLParser parser;
auto_ptr<XMLDocument> doc(parser.parse(xml1));
response1.fromXML(doc.get());
{
ASSERT_EQ(response1.getName(), "example.com");
const XMLGregorianCalendar *exDate = response1.getExpiryDate();
string res = EPPDateFormatter::toXSDateTime(*exDate);
ASSERT_EQ(res, "2009-04-03T22:00:00.0Z");
const vector<Result>& results(response1.getResults());
ASSERT_EQ(response1.getCLTRID(), "ABC-12345");
ASSERT_EQ(results[0].getResultCode(), 1000);
ASSERT_EQ(results[0].getResultMessage(),
"Command completed successfully");
}
auto_ptr<XMLDocument> doc2(parser.parse(xml2));
response2.fromXML(doc2.get());
{
ASSERT_EQ(response2.getName(), "example.com");
const XMLGregorianCalendar *exDate = response2.getExpiryDate();
ASSERT_NULL(exDate);
const vector<Result>& results(response2.getResults());
ASSERT_EQ(response2.getCLTRID(), "ABC-12345");
ASSERT_EQ(results[0].getResultCode(), 1001);
ASSERT_EQ(results[0].getResultMessage(),
"Command completed successfully; action pending");
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

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

View File

@ -1,26 +0,0 @@
#ifndef __AREXTENSION_HPP
#define __AREXTENSION_HPP
#include "se/Extension.hpp"
/**
* A bundled set of constants representing the AusRegistry EPP extension
* schema. The namespace URI uniquely identifies the extension.
*/
class ArExtension : public Extension
{
public:
/**
* 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 // __AREXTENSION_HPP

View File

@ -1,4 +0,0 @@
#include "se/ArUnrenewCommandType.hpp"
const std::string ArUnrenewCommandType::cmdName("unrenew");

View File

@ -1,19 +0,0 @@
#ifndef AR_UNRENEW_COMMAND_TYPE
#define AR_UNRENEW_COMMAND_TYPE
#include "se/CommandType.hpp"
#include <string>
class ArUnrenewCommandType : public CommandType
{
public:
ArUnrenewCommandType() : CommandType(getCommandName()) {};
std::string getCommandName() const { return cmdName; };
std::string toString() const { return cmdName; };
private:
static const std::string cmdName;
};
#endif /* AR_UNRENEW_COMMAND_TYPE */

View File

@ -1,131 +0,0 @@
#include "se/AuDomainCreateCommand.hpp"
#include "xml/XMLHelper.hpp"
#include "se/AuExtension.hpp"
#include "common/ErrorPkg.hpp"
namespace {
Extension& auExtension() {
static Extension* auExtension = new AuExtension();
return *auExtension;
}
}; // anonymous namespace
AuDomainCreateCommand::AuDomainCreateCommand (
const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
const std::string &auEligibilityType,
int auPolicyReason,
const std::string &auRegistrantName) : DomainCreateCommand (
name, pw, registrantID, techContacts)
{
setExtension (auEligibilityType, auPolicyReason, auRegistrantName);
}
AuDomainCreateCommand::AuDomainCreateCommand (
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 std::string &auEligibilityType,
int auPolicyReason,
const std::string &auRegistrantName,
const std::string *auRegistrantID,
const std::string *auRegistrantIDType,
const std::string *auEligibilityName,
const std::string *auEligibilityID,
const std::string *auEligibilityIDType) : DomainCreateCommand (
name, pw, registrantID, techContacts, nameservers,
adminContacts, billingContacts, NULL)
{
setExtension (auEligibilityType, auPolicyReason,
auRegistrantName, auRegistrantID, auRegistrantIDType,
auEligibilityName, auEligibilityID, auEligibilityIDType);
}
void AuDomainCreateCommand::setExtension (const std::string& eligibilityType,
int policyReason,
const std::string& registrantName)
{
setExtension (eligibilityType, policyReason, registrantName,
NULL, NULL, NULL, NULL, NULL);
}
void AuDomainCreateCommand::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 AuDomainCreateCommand::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.au.missing_ar"));
}
DOMElement *auextCreate = xmlWriter->appendChild(
xmlWriter->appendChild(
command,
"extension"),
"create",
auExtension().getURI());
XMLHelper::setAttribute(auextCreate,
"xsi:schemaLocation",
auExtension().getSchemaLocation());
DOMElement* auProperties = xmlWriter->appendChild(
auextCreate, "auProperties");
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "registrantName"),
registrantName);
if (registrantID && registrantIDType)
xmlWriter->appendChild (auProperties,
"registrantID", *registrantID,
"type", *registrantIDType);
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "eligibilityType"),
eligibilityType);
if (eligibilityName)
{
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "eligibilityName"),
*eligibilityName);
if (eligibilityID && eligibilityIDType)
xmlWriter->appendChild(auProperties,
"eligibilityID", *eligibilityID,
"type", *eligibilityIDType);
}
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "policyReason"),
policyReason);
}

View File

@ -1,147 +0,0 @@
#ifndef __AUDOMAINCREATECOMMAND_HPP
#define __AUDOMAINCREATECOMMAND_HPP
#include "common/Deprecated.hpp"
#include "se/DomainCreateCommand.hpp"
/**
* Extension of EPP urn:ietf:params:xml:ns:domain-1.0 create command specified
* in RFC3731 to urn:au:params:xml:ns:auext-1.0. .au domains must be
* provisioned using this class rather than {@link
* DomainCreateCommand}, as the au 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 AU 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 AU eligibility extensions.
*
* See
* {@link DomainCreateCommand.appendExtension(CommandExtension)}
* and
* {@link DomainKVCommandExtension}.
*/
class AuDomainCreateCommand : public DomainCreateCommand
{
public:
/**
* Minimal constructor for creating a domain:create + auext:create
* EPP command. These parameters are the least required for a valid
* .au domain create command.
*/
DEPRECATED(
AuDomainCreateCommand (const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
const std::string &auEligibilityType,
int auPolicyReason,
const std::string& auRegistrantName));
/**
* Full data specification constructor for a domain:create + auext:create
* EPP command. Please refer to the urn:au:params:xml:ns:auext-1.1 schema
* for specification of the required fields.
* The mapping of parameter names to au 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 auEligibilityType auext:eligType.
*
* @param auPolicyReason auext:policyReason.
*
* @param auRegistrantName auext:registrantName.
*
* @param auRegistrantID auext:registrantID.
*
* @param auRegistrantIDType auext:registrantID type attribute.
*
* @param auEligibilityName auext:eligibilityName.
*
* @param auEligibilityID auext:eligibilityID.
*
* @param auEligibilityIDType auext:eligibilityID type attribute.
*/
DEPRECATED(
AuDomainCreateCommand (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 std::string &auEligibilityType,
int auPolicyReason,
const std::string& auRegistrantName,
const std::string* auRegistrantID,
const std::string* auRegistrantIDType,
const std::string* auEligibilityName,
const std::string* auEligibilityID,
const std::string* auEligibilityIDType));
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:au:params:xml:ns:auext-1.1" xsi:schemaLocation="urn:au:params:xml:ns:auext-1.1 auext.1.1.xsd"&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 // __AUDOMAINCREATECOMMAND_HPP

View File

@ -1,84 +0,0 @@
#include "se/ContactCheckCommand.hpp"
#include "se/AuDomainCreateCommand.hpp"
#include "se/CLTRID.hpp"
#include "session/Timer.hpp"
#include "common/init.hpp"
#include "common/Test.hpp"
using namespace std;
void doWork()
{
init("/home/drde/etc/toolkit2.conf");
const string registrantName = "AusRegistry";
const string registrantID = "01241326211";
const string registrantIDType = "ACN";
const string eligibilityType = "Company";
const int policyReason = 1;
const string eligibilityName = "Blah";
const string eligibilityID = "1231239523";
const string eligibilityIDType = "OTHER";
/**
* 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("20070101.010101");
CLTRID::setClID("JTKUTEST");
vector<string> techIds;
techIds.push_back("JTKCON2");
string registrant("JTKCON");
AuDomainCreateCommand cmd("jtkutest.com.au", "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>jtkutest.com.au</name><registrant>JTKCON</registrant><contact type=\"tech\">JTKCON2</contact><authInfo><pw>jtkUT3st</pw></authInfo></create></create><extension><create xmlns=\"urn:X-au:params:xml:ns:auext-1.1\" xsi:schemaLocation=\"urn:X-au:params:xml:ns:auext-1.1 auext-1.1.xsd\"><auProperties><registrantName>AusRegistry</registrantName><eligibilityType>Company</eligibilityType><policyReason>1</policyReason></auProperties></create></extension><clTRID>JTKUTEST.20070101.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("20070101.010101");
CLTRID::setClID("JTKUTEST");
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");
AuDomainCreateCommand cmd(
"jtkutest.com.au", "jtkUT3st", &registrant,
&techIds, &adminContacts,
NULL, &nameServers,
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>jtkutest.com.au</name><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-au:params:xml:ns:auext-1.1\" xsi:schemaLocation=\"urn:X-au:params:xml:ns:auext-1.1 auext-1.1.xsd\"><auProperties><registrantName>AusRegistry</registrantName><registrantID type=\"ACN\">01241326211</registrantID><eligibilityType>Company</eligibilityType><eligibilityName>Blah</eligibilityName><eligibilityID type=\"OTHER\">1231239523</eligibilityID><policyReason>1</policyReason></auProperties></create></extension><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></epp>");
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,124 +0,0 @@
#include "se/AuDomainCreateCommandV1.hpp"
#include "xml/XMLHelper.hpp"
#include "se/AuExtensionV1.hpp"
namespace {
Extension& auExtension() {
static Extension* auExtension = new AuExtensionV1();
return *auExtension;
}
}; // anonymous namespace
AuDomainCreateCommandV1::AuDomainCreateCommandV1(
const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
const std::string &auEligibilityType,
int auPolicyReason,
const std::string &auRegistrantName) : DomainCreateCommand (
name, pw, registrantID, techContacts)
{
setExtension(auEligibilityType, auPolicyReason, auRegistrantName);
}
AuDomainCreateCommandV1::AuDomainCreateCommandV1(
const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
std::vector<std::string>* adminContacts,
std::vector<std::string>* billingContacts,
std::vector<std::string>* nameservers,
const std::string &auEligibilityType,
int auPolicyReason,
const std::string &auRegistrantName,
std::string *auRegistrantID,
std::string *auRegistrantIDType,
std::string *auEligibilityName,
std::string *auEligibilityID,
std::string *auEligibilityIDType) : DomainCreateCommand (
name, pw, registrantID, techContacts,
adminContacts, billingContacts, nameservers, NULL)
{
setExtension(auEligibilityType, auPolicyReason,
auRegistrantName, auRegistrantID, auRegistrantIDType,
auEligibilityName, auEligibilityID, auEligibilityIDType);
}
void AuDomainCreateCommandV1::setExtension(
const std::string& eligibilityType,
int policyReason,
const std::string& registrantName)
{
setExtension(eligibilityType, policyReason, registrantName,
NULL, NULL, NULL, NULL, NULL);
}
void AuDomainCreateCommandV1::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 AuDomainCreateCommandV1::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)
{
DOMElement *extensionAU =
xmlWriter->appendChild
(xmlWriter->appendChild
(command,
"extension"),
"extensionAU",
auExtension().getURI());
XMLHelper::setAttribute (extensionAU,
"xsi:schemaLocation",
auExtension().getSchemaLocation());
DOMElement *auextCreate = xmlWriter->appendChild (extensionAU, "create");
XMLHelper::setTextContent
(xmlWriter->appendChild (auextCreate, "registrantName"),
registrantName);
if (registrantID && registrantIDType)
xmlWriter->appendChild (auextCreate,
"registrantID", *registrantID,
"type", *registrantIDType);
XMLHelper::setTextContent
(xmlWriter->appendChild (auextCreate, "eligibilityType"),
eligibilityType);
if (eligibilityName)
{
XMLHelper::setTextContent
(xmlWriter->appendChild (auextCreate, "eligibilityName"),
*eligibilityName);
if (eligibilityID && eligibilityIDType)
xmlWriter->appendChild (auextCreate,
"eligibilityID", *eligibilityID,
"type", *eligibilityIDType);
}
XMLHelper::setTextContent(
xmlWriter->appendChild(auextCreate, "policyReason"),
policyReason);
}

View File

@ -1,85 +0,0 @@
#ifndef __AUDOMAINCREATECOMMANDV1_HPP
#define __AUDOMAINCREATECOMMANDV1_HPP
#include "common/Deprecated.hpp"
#include "se/DomainCreateCommand.hpp"
/**
* Extension of EPP urn:ietf:params:xml:ns:domain-1.0 create command specified
* in RFC3731 to urn:au:params:xml:ns:auext-1.0. .au domains must be
* provisioned using this class rather than {@link
* com.ausregistry.jtoolkit2.se.DomainCreateCommand}, as the au 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
* com.ausregistry.jtoolkit2.se.DomainCreateResponse} object.
*
* @deprecated AU 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 AU eligibility extensions.
*
* See
* {@link DomainCreateCommand.appendExtension(CommandExtension)}
* and
* {@link DomainKVCommandExtension}.
*/
class AuDomainCreateCommandV1 : public DomainCreateCommand
{
public:
AuDomainCreateCommandV1(
const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
const std::string& auEligibilityType,
int auPolicyReason,
const std::string& auRegistrantName);
AuDomainCreateCommandV1(
const std::string& name,
const std::string& pw,
const std::string* registrantID,
const std::vector<std::string>* techContacts,
std::vector<std::string>* adminContacts,
std::vector<std::string>* billingContacts,
std::vector<std::string>* nameservers,
const std::string &auEligibilityType,
int auPolicyReason,
const std::string& auRegistrantName,
std::string* auRegistrantID,
std::string* auRegistrantIDType,
std::string* auEligibilityName,
std::string* auEligibilityID,
std::string* auEligibilityIDType);
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);
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 // __AUDOMAINCREATECOMMANDV1_HPP

View File

@ -1,57 +0,0 @@
#include "se/AuDomainInfoResponse.hpp"
#include "se/StandardObjectType.hpp"
#include <stdlib.h> // atoi()
using namespace std;
const std::string AuDomainInfoResponse::AUEXT_EXPR(Response::RESPONSE_EXPR() + "/e:extension/auext:infData");
const std::string AuDomainInfoResponse::AU_PROPERTIES_EXPR(AuDomainInfoResponse::AUEXT_EXPR + "/auext:auProperties");
const std::string AuDomainInfoResponse::AU_REGISTRANT_NAME_EXPR(AuDomainInfoResponse::AU_PROPERTIES_EXPR + "/auext:registrantName/text()");
const std::string AuDomainInfoResponse::AU_REGISTRANT_ID_EXPR(AuDomainInfoResponse::AU_PROPERTIES_EXPR + "/auext:registrantID/text()");
const std::string AuDomainInfoResponse::AU_REGISTRANT_ID_TYPE_EXPR(AuDomainInfoResponse::AU_PROPERTIES_EXPR + "/auext:registrantID/@type");
const std::string AuDomainInfoResponse::AU_ELI_TYPE_EXPR(AuDomainInfoResponse::AU_PROPERTIES_EXPR + "/auext:eligibilityType/text()");
const std::string AuDomainInfoResponse::AU_ELI_NAME_EXPR(AuDomainInfoResponse::AU_PROPERTIES_EXPR + "/auext:eligibilityName/text()");
const std::string AuDomainInfoResponse::AU_ELI_ID_EXPR(AuDomainInfoResponse::AU_PROPERTIES_EXPR + "/auext:eligibilityID/text()");
const std::string AuDomainInfoResponse::AU_ELI_ID_TYPE_EXPR(AuDomainInfoResponse::AU_PROPERTIES_EXPR + "/auext:eligibilityID/@type");
const std::string AuDomainInfoResponse::AU_POLICY_REASON_EXPR(AuDomainInfoResponse::AU_PROPERTIES_EXPR + "/auext:policyReason/text()");
AuDomainInfoResponse::AuDomainInfoResponse() : DomainInfoResponse()
{
policyReason = 0;
}
void AuDomainInfoResponse::fromXML (XMLDocument *xmlDoc) throw (ParsingException)
{
DomainInfoResponse::fromXML(xmlDoc);
if (!(resultArray[0].succeeded())) {
return;
}
try
{
registrantName = xmlDoc->getNodeValue (AU_REGISTRANT_NAME_EXPR);
registrantID = xmlDoc->getNodeValue (AU_REGISTRANT_ID_EXPR);
registrantIDType = xmlDoc->getNodeValue (AU_REGISTRANT_ID_TYPE_EXPR);
eligibilityType = xmlDoc->getNodeValue (AU_ELI_TYPE_EXPR);
eligibilityName = xmlDoc->getNodeValue (AU_ELI_NAME_EXPR);
eligibilityID = xmlDoc->getNodeValue (AU_ELI_ID_EXPR);
eligibilityIDType = xmlDoc->getNodeValue (AU_ELI_ID_TYPE_EXPR);
string polReasonStr = xmlDoc->getNodeValue (AU_POLICY_REASON_EXPR);
if (polReasonStr.length() > 0) {
policyReason = atoi (polReasonStr.c_str());
}
}
catch (XPathExpressionException& e)
{
maintLogger->warning(e.getMessage());
ParsingException pe("Could not parse AuDomainInfoResponse object.");
pe.causedBy(e);
throw pe;
}
}

View File

@ -1,72 +0,0 @@
#ifndef __AU_DOMAIN_INFO_RESPONSE_HPP
#define __AU_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 .au domain names, the specification of which is in
* the XML schema definition urn:au:params:xml:ns:auext-1.1.
* Instances of this class provide an interface to access all of the
* information available through EPP for a .au 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 AU 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 AU eligibility extensions.
*
* See
* {@link DomainInfoResponse.registerExtension(ResponseExtension)}
* and
* {@link DomainInfoKVResponseExtension}.
*/
class AuDomainInfoResponse : public DomainInfoResponse
{
public:
DEPRECATED(AuDomainInfoResponse());
const std::string& getRegistrantName() const { return registrantName; };
const std::string& getAURegistrantID() 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 AUEXT_EXPR,
AU_PROPERTIES_EXPR,
AU_REGISTRANT_NAME_EXPR,
AU_REGISTRANT_ID_EXPR,
AU_REGISTRANT_ID_TYPE_EXPR,
AU_ELI_TYPE_EXPR,
AU_ELI_NAME_EXPR,
AU_ELI_ID_EXPR,
AU_ELI_ID_TYPE_EXPR,
AU_POLICY_REASON_EXPR;
std::string registrantName,
registrantID,
registrantIDType,
eligibilityType,
eligibilityName,
eligibilityID,
eligibilityIDType;
int policyReason;
};
#endif // __AU_DOMAIN_INFO_RESPONSE_HPP

View File

@ -1,44 +0,0 @@
#include "se/AuDomainInfoResponse.hpp"
#include "xml/XMLParser.hpp"
#include "common/Test.hpp"
#include "common/init.hpp"
#include <memory>
using namespace std;
void doWork()
{
init("/home/drde/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:infData 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:name>example.com.au</domain:name><domain:roid>D0000003-AR</domain:roid><domain:status s=\"ok\" lang=\"en\"/><domain:registrant>EXAMPLE</domain:registrant><domain:contact type=\"tech\">EXAMPLE</domain:contact><domain:ns><domain:hostObj>ns1.example.com.au</domain:hostObj><domain:hostObj>ns2.example.com.au</domain:hostObj></domain:ns><domain:host>ns1.example.com.au</domain:host><domain:host>ns2.exmaple.com.au</domain:host><domain:clID>Registrar</domain:clID><domain:crID>Registrar</domain:crID><domain:crDate>2006-02-09T15:44:58.0Z</domain:crDate><domain:exDate>2008-02-10T00:00:00.0Z</domain:exDate><domain:authInfo><domain:pw>0192pqow</domain:pw></domain:authInfo></domain:infData></resData><extension><auext:infData xmlns:auext=\"urn:X-au:params:xml:ns:auext-1.1\" xsi:schemaLocation=\"urn:X-au:params:xml:ns:auext-1.1 auext-1.1.xsd\"><auext:auProperties><auext:registrantName>RegistrantName Pty. Ltd.</auext:registrantName><auext:registrantID type=\"ACN\">123456789</auext:registrantID><auext:eligibilityType>Other</auext:eligibilityType><auext:eligibilityName>Registrant Eligi</auext:eligibilityName><auext:eligibilityID type=\"ABN\">987654321</auext:eligibilityID><auext:policyReason>2</auext:policyReason></auext:auProperties></auext:infData></extension><trID><clTRID>ABC-12345</clTRID><svTRID>805</svTRID></trID></response></epp>";
AuDomainInfoResponse response;
try
{
auto_ptr<XMLParser> parser(new XMLParser);
auto_ptr<XMLDocument> doc(parser->parse(xml));
response.fromXML(doc.get());
ASSERT_EQ("123456789", response.getAURegistrantID());
ASSERT_EQ("RegistrantName Pty. Ltd.", response.getRegistrantName());
ASSERT_EQ("ACN", response.getRegistrantIDType());
ASSERT_EQ("Other", response.getEligibilityType());
ASSERT_EQ("Registrant Eligi", response.getEligibilityName());
ASSERT_EQ("987654321", response.getEligibilityID());
ASSERT_EQ("ABN", response.getEligibilityIDType());
ASSERT_EQ(2, response.getPolicyReason());
ASSERT_EQ("example.com.au", response.getName());
ASSERT_EQ("D0000003-AR", response.getROID());
ASSERT_EQ("ABC-12345", response.getCLTRID());
}
catch (EPPException& e)
{
FAIL(e.getMessage());
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,60 +0,0 @@
#include "se/AuDomainInfoResponseV1.hpp"
#include "se/StandardObjectType.hpp"
#include <stdlib.h> // atoi()
using namespace std;
const string AuDomainInfoResponseV1::AUEXT_EXPR(
Response::RESPONSE_EXPR() + "/e:extension/auextv1:extensionAU/auextv1:info");
const string AuDomainInfoResponseV1::AU_REGISTRANT_NAME_EXPR(
AUEXT_EXPR + "/auextv1:registrantName/text()");
const string AuDomainInfoResponseV1::AU_REGISTRANT_ID_EXPR(
AUEXT_EXPR + "/auextv1:registrantID/text()");
const string AuDomainInfoResponseV1::AU_REGISTRANT_ID_TYPE_EXPR(
AUEXT_EXPR + "/auextv1:registrantID/@type");
const string AuDomainInfoResponseV1::AU_ELI_TYPE_EXPR(
AUEXT_EXPR + "/auextv1:eligibilityType/text()");
const string AuDomainInfoResponseV1::AU_ELI_NAME_EXPR(
AUEXT_EXPR + "/auextv1:eligibilityName/text()");
const string AuDomainInfoResponseV1::AU_ELI_ID_EXPR(
AUEXT_EXPR + "/auextv1:eligibilityID/text()");
const string AuDomainInfoResponseV1::AU_ELI_ID_TYPE_EXPR(
AUEXT_EXPR + "/auextv1:eligibilityID/@type");
const string AuDomainInfoResponseV1::AU_POLICY_REASON_EXPR(
AUEXT_EXPR + "/auextv1:policyReason/text()");
AuDomainInfoResponseV1::AuDomainInfoResponseV1()
: DomainInfoResponse()
{ }
void AuDomainInfoResponseV1::fromXML(XMLDocument *xmlDoc) throw (ParsingException)
{
DomainInfoResponse::fromXML(xmlDoc);
if (!(resultArray[0].succeeded())) {
return;
}
try
{
registrantName = xmlDoc->getNodeValue(AU_REGISTRANT_NAME_EXPR);
registrantID = xmlDoc->getNodeValue(AU_REGISTRANT_ID_EXPR);
registrantIDType = xmlDoc->getNodeValue(AU_REGISTRANT_ID_TYPE_EXPR);
eligibilityType = xmlDoc->getNodeValue(AU_ELI_TYPE_EXPR);
eligibilityName = xmlDoc->getNodeValue(AU_ELI_NAME_EXPR);
eligibilityID = xmlDoc->getNodeValue(AU_ELI_ID_EXPR);
eligibilityIDType = xmlDoc->getNodeValue(AU_ELI_ID_TYPE_EXPR);
policyReason = atoi (xmlDoc->getNodeValue(AU_POLICY_REASON_EXPR).c_str());
}
catch (XPathExpressionException& e)
{
maintLogger->warning(e.getMessage());
ParsingException pe("Could not parse AuDomainInfoResponse object.");
pe.causedBy(e);
throw pe;
}
}

View File

@ -1,68 +0,0 @@
#ifndef __AU_DOMAIN_INFO_RESPONSEV1_HPP
#define __AU_DOMAIN_INFO_RESPONSEV1_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 .au domain names, the specification of which is in
* the XML schema definition urn:au:params:xml:ns:auext-1.0.
* Instances of this class provide an interface to access all of the
* information available through EPP for a .au 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 AU 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 AU eligibility extensions.
*
* See
* {@link DomainInfoResponse.registerExtension(ResponseExtension)}
* and
* {@link DomainInfoKVResponseExtension}.
*/
class AuDomainInfoResponseV1 : public DomainInfoResponse
{
public:
DEPRECATED(AuDomainInfoResponseV1());
const std::string& getRegistrantName() const { return registrantName; };
const std::string& getAURegistrantID() 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 AUEXT_EXPR,
AU_REGISTRANT_NAME_EXPR,
AU_REGISTRANT_ID_EXPR,
AU_REGISTRANT_ID_TYPE_EXPR,
AU_ELI_TYPE_EXPR,
AU_ELI_NAME_EXPR,
AU_ELI_ID_EXPR,
AU_ELI_ID_TYPE_EXPR,
AU_POLICY_REASON_EXPR;
std::string registrantName,
registrantID,
registrantIDType,
eligibilityType,
eligibilityName,
eligibilityID,
eligibilityIDType;
int policyReason;
};
#endif // __AU_DOMAIN_INFO_RESPONSEV1_HPP

View File

@ -1,42 +0,0 @@
#include "se/AuDomainInfoResponseV1.hpp"
#include "xml/XMLDocument.hpp"
#include "xml/XMLParser.hpp"
#include "se/CLTRID.hpp"
#include "se/EPPDateFormatter.hpp"
#include "session/Timer.hpp"
#include "common/init.hpp"
#include "common/Test.hpp"
#include <iostream>
using namespace std;
void doWork()
{
init("/home/drde/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:infData 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:name>example.com.au</domain:name><domain:roid>D0000003-AR</domain:roid><domain:status s=\"ok\" lang=\"en\"/><domain:registrant>EXAMPLE</domain:registrant><domain:contact type=\"tech\">EXAMPLE</domain:contact><domain:ns><domain:hostObj>ns1.example.com.au</domain:hostObj><domain:hostObj>ns2.example.com.au</domain:hostObj></domain:ns><domain:host>ns1.example.com.au</domain:host><domain:host>ns2.exmaple.com.au</domain:host><domain:clID>Registrar</domain:clID><domain:crID>Registrar</domain:crID><domain:crDate>2006-02-09T15:44:58.0Z</domain:crDate><domain:exDate>2008-02-10T00:00:00.0Z</domain:exDate><domain:authInfo><domain:pw>0192pqow</domain:pw></domain:authInfo></domain:infData></resData><extension><auext:extensionAU xmlns:auext=\"urn:au:params:xml:ns:auext-1.0\" xsi:schemaLocation=\"urn:au:params:xml:ns:auext-1.0 auext-1.0.xsd\"><auext:info><auext:registrantName>RegistrantName Pty. Ltd.</auext:registrantName><auext:registrantID type=\"ACN\">123456789</auext:registrantID><auext:eligibilityType>Other</auext:eligibilityType><auext:eligibilityName>Registrant Eligi</auext:eligibilityName><auext:eligibilityID type=\"ABN\">987654321</auext:eligibilityID><auext:policyReason>2</auext:policyReason></auext:info></auext:extensionAU></extension><trID><clTRID>ABC-12345</clTRID><svTRID>805</svTRID></trID></response></epp>";
AuDomainInfoResponseV1 response;
XMLParser parser;
auto_ptr<XMLDocument> doc(parser.parse(xml));
response.fromXML(doc.get());
ASSERT_EQ("123456789", response.getAURegistrantID());
ASSERT_EQ("RegistrantName Pty. Ltd.", response.getRegistrantName());
ASSERT_EQ("ACN", response.getRegistrantIDType());
ASSERT_EQ("Other", response.getEligibilityType());
ASSERT_EQ("Registrant Eligi", response.getEligibilityName());
ASSERT_EQ("987654321", response.getEligibilityID());
ASSERT_EQ("ABN", response.getEligibilityIDType());
ASSERT_EQ(2, response.getPolicyReason());
ASSERT_EQ("example.com.au", response.getName());
ASSERT_EQ("D0000003-AR", response.getROID());
ASSERT_EQ("ABC-12345", response.getCLTRID());
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,93 +0,0 @@
#include "se/AuDomainModifyRegistrantCommand.hpp"
#include "common/ErrorPkg.hpp"
#include "se/AuExtension.hpp"
#include "xml/XMLHelper.hpp"
namespace {
AuExtension& auExtension() {
static AuExtension* auExtension = new AuExtension();
return *auExtension;
}
}; // anonymous namespace
AuDomainModifyRegistrantCommand::AuDomainModifyRegistrantCommand(
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.au.missing_arg"));
}
DOMElement* auextUpdate = xmlWriter->appendChild(
xmlWriter->appendChild(command, "extension"),
"update",
auExtension().getURI());
auextUpdate->setAttribute(
XStr("xsi:schemaLocation").str(),
XStr(auExtension().getSchemaLocation()).str());
DOMElement* auProperties = xmlWriter->appendChild(auextUpdate,
"auProperties");
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "registrantName"),
registrantName);
if (registrantID != NULL && registrantIDType != NULL)
{
xmlWriter->appendChild(
auProperties,
"registrantID",
*registrantID,
"type",
*registrantIDType);
}
if (eligibilityType != NULL)
{
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "eligibilityType"),
*eligibilityType);
}
if (eligibilityName != NULL)
{
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "eligibilityName"),
*eligibilityName);
}
if (eligibilityID != NULL && eligibilityIDType != NULL)
{
xmlWriter->appendChild(
auProperties,
"eligibilityID",
*eligibilityID,
"type",
*eligibilityIDType);
}
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "policyReason"),
policyReason);
XMLHelper::setTextContent(
xmlWriter->appendChild(auextUpdate, "explanation"),
explanation);
}

View File

@ -1,46 +0,0 @@
#ifndef __AU_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP
#define __AU_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 .au domain names, the specification of which is in
* the XML schema definition urn:au:params:xml:ns:auext-1.1.
* This class should only be used to correct au extension data for .au 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 AU 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 AU eligibility extensions.
*
* See
* {@link DomainUpdateCommand.appendExtension(CommandExtension)}
* and
* {@link DomainKVCommandExtension}.
*/
class AuDomainModifyRegistrantCommand : public DomainUpdateCommand
{
public:
DEPRECATED(
AuDomainModifyRegistrantCommand(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 // __AU_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP

View File

@ -1,48 +0,0 @@
#include "se/ContactCheckCommand.hpp"
#include "se/AuDomainModifyRegistrantCommand.hpp"
#include "se/CLTRID.hpp"
#include "session/Timer.hpp"
#include "common/init.hpp"
#include "common/Test.hpp"
using namespace std;
void doWork()
{
init("/home/drde/etc/toolkit2.conf");
const string registrantName = "AusRegistry";
const string registrantID = "01241326211";
const string registrantIDType = "ACN";
const string eligibilityType = "Company";
const int policyReason = 1;
const string eligibilityName = "Blah";
const string eligibilityID = "1231239523";
const string eligibilityIDType = "OTHER";
{
Timer::setTime("20070101.010101");
CLTRID::setClID("JTKUTEST");
AuDomainModifyRegistrantCommand cmd(
"jtkutest.com.au",
registrantName,
"testing",
&eligibilityType,
policyReason,
&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><update><update xmlns=\"urn:ietf:params:xml:ns:domain-1.0\" xsi:schemaLocation=\"urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd\"><name>jtkutest.com.au</name></update></update><extension><update xmlns=\"urn:X-au:params:xml:ns:auext-1.1\" xsi:schemaLocation=\"urn:X-au:params:xml:ns:auext-1.1 auext-1.1.xsd\"><auProperties><registrantName>AusRegistry</registrantName><registrantID type=\"ACN\">01241326211</registrantID><eligibilityType>Company</eligibilityType><eligibilityName>Blah</eligibilityName><eligibilityID type=\"OTHER\">1231239523</eligibilityID><policyReason>1</policyReason></auProperties><explanation>testing</explanation></update></extension><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></epp>");
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,25 +0,0 @@
#include "AuDomainObjectType.hpp"
#include <string>
const std::string& AuDomainObjectType::getName() const {
static const std::string name = "audom";
return name;
}
const std::string& AuDomainObjectType::getURI() const {
static const std::string uri = "urn:X-au:params:xml:ns:audomain-1.0";
return uri;
}
const std::string& AuDomainObjectType::getSchemaLocation() const {
static const std::string schemaLocation =
"urn:X-au:params:xml:ns:audomain-1.0 audomain-1.0.xsd";
return schemaLocation;
}
const std::string& AuDomainObjectType::getIdentType() const {
static const std::string ident = "name";
return ident;
}

View File

@ -1,17 +0,0 @@
#ifndef AUDOMAIN_OBJECT_TYPE
#define AUDOMAIN_OBJECT_TYPE
#include "ObjectType.hpp"
#include <string>
class AuDomainObjectType : public ObjectType {
public:
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 // AUDOMAIN_OBJECT_TYPE

View File

@ -1,92 +0,0 @@
#include "se/AuDomainTransferRegistrantCommand.hpp"
#include "se/XMLGregorianCalendar.hpp"
#include "se/AuExtension.hpp"
#include "se/AuDomainObjectType.hpp"
#include "se/RegistrantTransferCommandType.hpp"
#include "se/CommandType.hpp"
#include "se/Period.hpp"
#include "common/ErrorPkg.hpp"
#include "se/EPPDateFormatter.hpp"
#include "xml/XMLHelper.hpp"
namespace {
Extension& auExtension() {
static Extension* auExt = new AuExtension();
return *auExt;
}
const RegistrantTransferCommandType rtrnType;
AuDomainObjectType audomType;
} // anonymous namespace
AuDomainTransferRegistrantCommand::AuDomainTransferRegistrantCommand (
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, &audomType, name, auExtension())
{
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.au.missing_arg"));
}
DOMElement *element;
std::string curExpDateStr = EPPDateFormatter::toXSDate(curExpDate);
XMLHelper::setTextContent(
xmlWriter->appendChild(objElement, "curExpDate"), curExpDateStr);
if (period)
period->appendPeriod(xmlWriter, objElement);
DOMElement *auProperties = xmlWriter->appendChild(objElement, "auProperties");
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "registrantName"), registrantName);
if (registrantID)
{
element = xmlWriter->appendChild(auProperties, "registrantID");
XMLHelper::setTextContent(element, *registrantID);
XMLHelper::setAttribute(element, "type", *registrantIDType);
}
XMLHelper::setTextContent
(xmlWriter->appendChild(auProperties, "eligibilityType"), eligibilityType);
if (eligibilityName)
{
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "eligibilityName"), *eligibilityName);
element = xmlWriter->appendChild(auProperties, "eligibilityID");
XMLHelper::setTextContent(element, *eligibilityID);
XMLHelper::setAttribute(element, "type", *eligibilityIDType);
}
XMLHelper::setTextContent(
xmlWriter->appendChild(auProperties, "policyReason"),
policyReason);
XMLHelper::setTextContent(
xmlWriter->appendChild(objElement, "explanation"),
explanation);
}

View File

@ -1,89 +0,0 @@
#ifndef __AU_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
#define __AU_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
#include "common/Deprecated.hpp"
#include "se/ProtocolExtensionCommand.hpp"
class XMLGregorianCalendar;
class Period;
/**
* In cases where the legal registrant of a .au 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 AU 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 "au" as the kvListName.
*
* See
* {@link DomainRegistrantTransferCommand}
* and
* {@link DomainRegistrantTransferCommand.addItem(std::string, std::string)}
* .
*/
class AuDomainTransferRegistrantCommand : public ProtocolExtensionCommand
{
public:
/**
* Request that the named .au domain name be transferred to the legal
* entity specified by the given au 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(
AuDomainTransferRegistrantCommand (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 // __AU_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP

View File

@ -1,71 +0,0 @@
#include "se/AuDomainTransferRegistrantCommand.hpp"
#include "se/CLTRID.hpp"
#include "se/EPPDateFormatter.hpp"
#include "se/Period.hpp"
#include "session/Timer.hpp"
#include "common/init.hpp"
#include "common/Test.hpp"
#include <iostream>
using namespace std;
void doWork()
{
init("/home/drde/etc/toolkit2.conf");
const int policyReason = 1;
const string registrantName = "AusRegistry";
const string registrantID = "01241326211";
const string registrantIDType = "ACN";
const string eligibilityType = "Company";
const string eligibilityName = "Blah";
const string eligibilityID = "1231239523";
const string eligibilityIDType = "OTHER";
auto_ptr<XMLGregorianCalendar> curExpDate(EPPDateFormatter::fromXSDateTime("2007-01-01T01:01:01.0Z"));
{
Timer::setTime("20070101.010101");
CLTRID::setClID("JTKUTEST");
AuDomainTransferRegistrantCommand cmd(
"jtkutest.com.au", // domain name
*curExpDate, // current expire date
"Other",
policyReason,
registrantName,
"testing");
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\"><extension><command xmlns=\"urn:X-au:params:xml:ns:auext-1.1\" xsi:schemaLocation=\"urn:X-au:params:xml:ns:auext-1.1 auext-1.1.xsd\"><registrantTransfer><registrantTransfer xmlns=\"urn:X-au:params:xml:ns:audomain-1.0\" xsi:schemaLocation=\"urn:X-au:params:xml:ns:audomain-1.0 audomain-1.0.xsd\"><name>jtkutest.com.au</name><curExpDate>2007-01-01</curExpDate><auProperties><registrantName>AusRegistry</registrantName><eligibilityType>Other</eligibilityType><policyReason>1</policyReason></auProperties><explanation>testing</explanation></registrantTransfer></registrantTransfer><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></extension></epp>");
}
{
Timer::setTime("20070101.010101");
CLTRID::setClID("JTKUTEST");
Period p(2, PeriodUnit::YEARS());
AuDomainTransferRegistrantCommand cmd(
"jtkutest.com.au", // name
*curExpDate, // curExpDate
eligibilityType,
policyReason,
registrantName,
"testing",
&registrantID,
&registrantIDType,
&eligibilityName,
&eligibilityID,
&eligibilityIDType,
&p);
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\"><extension><command xmlns=\"urn:X-au:params:xml:ns:auext-1.1\" xsi:schemaLocation=\"urn:X-au:params:xml:ns:auext-1.1 auext-1.1.xsd\"><registrantTransfer><registrantTransfer xmlns=\"urn:X-au:params:xml:ns:audomain-1.0\" xsi:schemaLocation=\"urn:X-au:params:xml:ns:audomain-1.0 audomain-1.0.xsd\"><name>jtkutest.com.au</name><curExpDate>2007-01-01</curExpDate><period unit=\"y\">2</period><auProperties><registrantName>AusRegistry</registrantName><registrantID type=\"ACN\">01241326211</registrantID><eligibilityType>Company</eligibilityType><eligibilityName>Blah</eligibilityName><eligibilityID type=\"OTHER\">1231239523</eligibilityID><policyReason>1</policyReason></auProperties><explanation>testing</explanation></registrantTransfer></registrantTransfer><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></extension></epp>");
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

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

View File

@ -1,43 +0,0 @@
#ifndef __AU_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
#define __AU_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 AU eligibility extensions
* should now be managed through the use of the
* @c DomainRegistrantTransferCommand and
* @c DomainRegistrantTransferResponse
*
* See
* {@link DomainRegistrantTransferCommand}
* and
* {@link DomainRegistrantTransferResponse}.
*/
class AuDomainTransferRegistrantResponse : public DataResponse
{
public:
DEPRECATED(AuDomainTransferRegistrantResponse());
const std::string& getName() const { return name; }
const XMLGregorianCalendar* getExpiryDate() const { return exDate.get(); }
void fromXML(XMLDocument* xmlDoc) throw (ParsingException);
private:
static const std::string AUDOM_NAME_EXPR;
static const std::string AUDOM_EX_DATE_EXPR;
std::string name;
std::auto_ptr<XMLGregorianCalendar> exDate;
};
#endif // __AU_DOMAIN_TRANSFER_REGISTRANT_RESPONSE

View File

@ -1,38 +0,0 @@
#include "se/AuDomainTransferRegistrantResponse.hpp"
#include "xml/XMLParser.hpp"
#include "session/Timer.hpp"
#include "common/Test.hpp"
#include "common/init.hpp"
#include "se/EPPDateFormatter.hpp"
using namespace std;
void doWork()
{
init("/home/drde/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\"><response><result code=\"1000\"><msg>Command completed successfully</msg></result><resData><rtrnData xmlns=\"urn:X-au:params:xml:ns:audomain-1.0\"><name>example.com</name><exDate>2009-04-03T22:00:00.0Z</exDate></rtrnData></resData><trID><clTRID>ABC-12345</clTRID><svTRID>54321-XYZ</svTRID></trID></response></epp>";
AuDomainTransferRegistrantResponse response;
AuDomainTransferRegistrantResponse response2;
XMLParser parser;
auto_ptr<XMLDocument> doc(parser.parse(xml));
response.fromXML(doc.get());
{
ASSERT_EQ(response.getName(), "example.com");
const XMLGregorianCalendar *exDate = response.getExpiryDate();
string res = EPPDateFormatter::toXSDateTime(*exDate);
ASSERT_EQ(res, "2009-04-03T22:00:00.0Z");
const vector<Result>& results(response.getResults());
ASSERT_EQ(response.getCLTRID(), "ABC-12345");
ASSERT_EQ(results[0].getResultCode(), 1000);
ASSERT_EQ(results[0].getResultMessage(),
"Command completed successfully");
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}

View File

@ -1,14 +0,0 @@
#include "se/AuExtension.hpp"
std::string& AuExtension::getURI() const
{
static std::string uri = "urn:X-au:params:xml:ns:auext-1.1";
return uri;
}
std::string& AuExtension::getSchemaLocation() const
{
static std::string loc = "urn:X-au:params:xml:ns:auext-1.1 auext-1.1.xsd";
return loc;
}

View File

@ -1,27 +0,0 @@
#ifndef __AUEXTENSION_HPP
#define __AUEXTENSION_HPP
#include "se/Extension.hpp"
/**
* A bundled set of constants representing the .au EPP extension
* schema. The namespace URI uniquely identifies the extension.
*/
class AuExtension : public Extension
{
public:
/**
* 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 // __AUEXTENSION_HPP

View File

@ -1,13 +0,0 @@
#include "se/AuExtensionV1.hpp"
std::string& AuExtensionV1::getURI() const
{
static std::string uri = "urn:au:params:xml:ns:auext-1.0";
return uri;
}
std::string& AuExtensionV1::getSchemaLocation() const
{
static std::string loc = "urn:au:params:xml:ns:auext-1.0 auext-1.0.xsd";
return loc;
}

View File

@ -1,25 +0,0 @@
#ifndef __AUEXTENSIONV1_HPP
#define __AUEXTENSIONV1_HPP
#include "se/Extension.hpp"
/**
* A bundled set of constants representing the .au EPP extension
* schema. The namespace URI uniquely identifies the extension.
*/
class AuExtensionV1 : public Extension
{
public:
/**
* 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 // __AUEXTENSIONV1_HPP

View File

@ -1,9 +0,0 @@
build/DomainSecDNSCreateCommandExtension.o se/secDNS/DomainSecDNSCreateCommandExtension.d: \
se/secDNS/DomainSecDNSCreateCommandExtension.cpp se/Command.hpp \
se/SendSE.hpp xml/EPPWriter.hpp xml/XMLWriter.hpp common/Logger.hpp \
common/Properties.hpp config/config.h common/EPPException.hpp \
common/ConfigurationError.hpp xml/ParsingException.hpp se/Extension.hpp \
se/CommandExtension.hpp se/secDNS/SecDNSExtension.hpp xml/XMLHelper.hpp \
xml/XStr.hpp se/secDNS/DomainSecDNSCreateCommandExtension.hpp \
se/secDNS/SecDNSDSOrKeyType.hpp se/secDNS/SecDNSMaxSigLifeType.hpp \
se/secDNS/SecDNSKeyData.hpp se/secDNS/SecDNSDSData.hpp

View File

@ -1,14 +0,0 @@
build/DomainSecDNSCreateCommandExtensionTest.o se/secDNS/DomainSecDNSCreateCommandExtensionTest.d: \
se/secDNS/DomainSecDNSCreateCommandExtensionTest.cpp xml/XMLParser.hpp \
xml/ParsingException.hpp common/EPPException.hpp common/init.hpp \
common/Test.hpp session/Timer.hpp common/ParameterSyntaxException.hpp \
se/secDNS/SecDNSDSData.hpp xml/XMLWriter.hpp common/Logger.hpp \
common/Properties.hpp config/config.h common/ConfigurationError.hpp \
se/secDNS/SecDNSKeyData.hpp se/secDNS/SecDNSDSOrKeyType.hpp \
se/secDNS/SecDNSMaxSigLifeType.hpp xml/XMLHelper.hpp xml/XStr.hpp \
se/secDNS/DomainSecDNSCreateCommandExtension.hpp se/CommandExtension.hpp \
se/DomainCreateCommand.hpp se/CreateCommand.hpp se/ObjectCommand.hpp \
se/Command.hpp se/SendSE.hpp xml/EPPWriter.hpp se/Extension.hpp \
se/ObjectType.hpp se/StandardCommandType.hpp se/EnumType.hpp \
se/IllegalArgException.hpp se/CommandType.hpp common/StringUtils.hpp \
se/Period.hpp se/PeriodUnit.hpp se/CLTRID.hpp

View File

@ -1,8 +0,0 @@
build/DomainSecDNSInfoResponseExtension.o se/secDNS/DomainSecDNSInfoResponseExtension.d: \
se/secDNS/DomainSecDNSInfoResponseExtension.cpp \
se/secDNS/SecDNSMaxSigLifeType.hpp xml/XMLWriter.hpp common/Logger.hpp \
common/Properties.hpp config/config.h common/EPPException.hpp \
common/ConfigurationError.hpp xml/XMLHelper.hpp xml/XStr.hpp \
se/secDNS/SecDNSDSData.hpp se/secDNS/SecDNSKeyData.hpp \
se/secDNS/DomainSecDNSInfoResponseExtension.hpp se/ResponseExtension.hpp \
se/ReceiveSE.hpp xml/XMLDocument.hpp se/secDNS/SecDNSDSOrKeyType.hpp

View File

@ -1,14 +0,0 @@
build/DomainSecDNSInfoResponseExtensionTest.o se/secDNS/DomainSecDNSInfoResponseExtensionTest.d: \
se/secDNS/DomainSecDNSInfoResponseExtensionTest.cpp xml/XMLParser.hpp \
xml/ParsingException.hpp common/EPPException.hpp common/init.hpp \
common/Test.hpp se/secDNS/SecDNSDSData.hpp xml/XMLWriter.hpp \
common/Logger.hpp common/Properties.hpp config/config.h \
common/ConfigurationError.hpp se/secDNS/SecDNSKeyData.hpp \
se/secDNS/SecDNSDSOrKeyType.hpp se/secDNS/SecDNSMaxSigLifeType.hpp \
xml/XMLHelper.hpp xml/XStr.hpp \
se/secDNS/DomainSecDNSInfoResponseExtension.hpp se/ResponseExtension.hpp \
se/ReceiveSE.hpp xml/XMLDocument.hpp se/DomainInfoResponse.hpp \
se/InfoResponse.hpp se/DataResponse.hpp se/Response.hpp \
se/XMLGregorianCalendar.hpp common/IllegalStateException.hpp \
se/IllegalArgException.hpp se/Result.hpp se/ObjectType.hpp se/Status.hpp \
common/StringUtils.hpp

View File

@ -1,10 +0,0 @@
build/DomainSecDNSUpdateCommandExtension.o se/secDNS/DomainSecDNSUpdateCommandExtension.d: \
se/secDNS/DomainSecDNSUpdateCommandExtension.cpp se/Command.hpp \
se/SendSE.hpp xml/EPPWriter.hpp xml/XMLWriter.hpp common/Logger.hpp \
common/Properties.hpp config/config.h common/EPPException.hpp \
common/ConfigurationError.hpp xml/ParsingException.hpp se/Extension.hpp \
se/CommandExtension.hpp se/secDNS/SecDNSExtension.hpp xml/XMLHelper.hpp \
xml/XStr.hpp se/secDNS/DomainSecDNSUpdateCommandExtension.hpp \
se/secDNS/SecDNSRemType.hpp se/secDNS/SecDNSKeyData.hpp \
se/secDNS/SecDNSDSData.hpp se/secDNS/SecDNSDSOrKeyType.hpp \
se/secDNS/SecDNSMaxSigLifeType.hpp se/secDNS/SecDNSChgType.hpp

View File

@ -1,15 +0,0 @@
build/DomainSecDNSUpdateCommandExtensionTest.o se/secDNS/DomainSecDNSUpdateCommandExtensionTest.d: \
se/secDNS/DomainSecDNSUpdateCommandExtensionTest.cpp xml/XMLParser.hpp \
xml/ParsingException.hpp common/EPPException.hpp common/init.hpp \
common/Test.hpp session/Timer.hpp common/ParameterSyntaxException.hpp \
se/secDNS/SecDNSDSData.hpp xml/XMLWriter.hpp common/Logger.hpp \
common/Properties.hpp config/config.h common/ConfigurationError.hpp \
se/secDNS/SecDNSKeyData.hpp se/secDNS/SecDNSDSOrKeyType.hpp \
se/secDNS/SecDNSMaxSigLifeType.hpp xml/XMLHelper.hpp xml/XStr.hpp \
se/secDNS/DomainSecDNSUpdateCommandExtension.hpp se/CommandExtension.hpp \
se/secDNS/SecDNSRemType.hpp se/secDNS/SecDNSChgType.hpp \
se/DomainUpdateCommand.hpp se/UpdateCommand.hpp se/ObjectCommand.hpp \
se/Command.hpp se/SendSE.hpp xml/EPPWriter.hpp se/Extension.hpp \
se/ObjectType.hpp se/StandardCommandType.hpp se/EnumType.hpp \
se/IllegalArgException.hpp se/CommandType.hpp common/StringUtils.hpp \
se/CLTRID.hpp

View File

@ -1,5 +0,0 @@
build/SecDNSChgType.o se/secDNS/SecDNSChgType.d: \
se/secDNS/SecDNSChgType.cpp xml/XMLHelper.hpp xml/XStr.hpp \
se/secDNS/SecDNSChgType.hpp xml/XMLWriter.hpp common/Logger.hpp \
common/Properties.hpp config/config.h common/EPPException.hpp \
common/ConfigurationError.hpp se/secDNS/SecDNSMaxSigLifeType.hpp

View File

@ -1,5 +0,0 @@
build/SecDNSDSData.o se/secDNS/SecDNSDSData.d: se/secDNS/SecDNSDSData.cpp \
xml/XMLHelper.hpp xml/XStr.hpp se/secDNS/SecDNSDSData.hpp \
xml/XMLWriter.hpp common/Logger.hpp common/Properties.hpp \
config/config.h common/EPPException.hpp common/ConfigurationError.hpp \
se/secDNS/SecDNSKeyData.hpp

View File

@ -1,6 +0,0 @@
build/SecDNSDSOrKeyType.o se/secDNS/SecDNSDSOrKeyType.d: \
se/secDNS/SecDNSDSOrKeyType.cpp xml/XMLHelper.hpp xml/XStr.hpp \
se/secDNS/SecDNSDSOrKeyType.hpp xml/XMLWriter.hpp common/Logger.hpp \
common/Properties.hpp config/config.h common/EPPException.hpp \
common/ConfigurationError.hpp se/secDNS/SecDNSMaxSigLifeType.hpp \
se/secDNS/SecDNSKeyData.hpp se/secDNS/SecDNSDSData.hpp

View File

@ -1,3 +0,0 @@
build/SecDNSExtension.o se/secDNS/SecDNSExtension.d: \
se/secDNS/SecDNSExtension.cpp se/secDNS/SecDNSExtension.hpp \
se/Extension.hpp

View File

@ -1,5 +0,0 @@
build/SecDNSKeyData.o se/secDNS/SecDNSKeyData.d: \
se/secDNS/SecDNSKeyData.cpp xml/XMLHelper.hpp xml/XStr.hpp \
se/secDNS/SecDNSKeyData.hpp xml/XMLWriter.hpp common/Logger.hpp \
common/Properties.hpp config/config.h common/EPPException.hpp \
common/ConfigurationError.hpp

View File

@ -1,6 +0,0 @@
build/SecDNSRemType.o se/secDNS/SecDNSRemType.d: \
se/secDNS/SecDNSRemType.cpp xml/XMLHelper.hpp xml/XStr.hpp \
se/secDNS/SecDNSRemType.hpp xml/XMLWriter.hpp common/Logger.hpp \
common/Properties.hpp config/config.h common/EPPException.hpp \
common/ConfigurationError.hpp se/secDNS/SecDNSKeyData.hpp \
se/secDNS/SecDNSDSData.hpp

View File

@ -0,0 +1,50 @@
#include "se/Greeting.hpp"
#include "session/SessionManagerImpl.hpp"
#include "session/ACSession.hpp"
#include "session/SessionPoolImpl.hpp"
#include "session/SessionFactory.hpp"
#include "session/Timer.hpp"
#include "se/ResultCode.hpp"
#include "common/EPPException.hpp"
#include "common/AutoMutex.hpp"
#include "session/SessionManagerProperties.hpp"
#include "session/Transaction.hpp"
#include "session/StatsViewer.hpp"
#include "session/StatsManager.hpp"
#include "session/LoginException.hpp"
#include "common/ErrorPkg.hpp"
#include <time.h>
#include <unistd.h>
#include <errno.h>
#include <limits>
#include <typeinfo>
extern int tkScenario;
using namespace std;
ACSession::ACSession(SessionManagerProperties* props)
{
debugLogger = Logger::getLogger(pname + ".debug");
userLogger = Logger::getLogger(pname + ".user");
configure(props);
}
ACSession::~ACSession()
{ }
void ACSession::run() {
SessionManagerImpl::run();
}
void ACSession::shutdown() {
SessionManagerImpl::shutdown();
}

View File

@ -0,0 +1,27 @@
#ifndef __ACSESSION_HPP
#define __ACSESSION_HPP
#include "session/SessionManager.hpp"
#include "session/SessionPool.hpp"
#include "session/SessionManagerImpl.hpp"
#include <memory>
#include <pthread.h>
class ACSession : public SessionManagerImpl
{
public:
ACSession(SessionManagerProperties* props) ;
~ACSession();
void shutdown();
void run();
};
#endif // __ACSESSION_HPP

View File

@ -1,5 +1,8 @@
#include "session/SessionManagerFactory.hpp" #include "session/SessionManagerFactory.hpp"
#include "session/SessionManagerImpl.hpp" #include "session/SessionManagerImpl.hpp"
#include "session/ACSession.hpp"
extern int tkScenario;
using namespace std; using namespace std;
@ -18,5 +21,10 @@ SessionManager*
SessionManagerFactory::newInstance(SessionManagerProperties* properties) SessionManagerFactory::newInstance(SessionManagerProperties* properties)
throw (ConfigurationException) throw (ConfigurationException)
{ {
return new SessionManagerImpl(properties); switch(tkScenario) {
case 0: return new SessionManagerImpl(properties);
break;
case 1: return new ACSession(properties);
break;
}
} }

View File

@ -23,7 +23,8 @@
using namespace std; using namespace std;
string SessionManagerImpl::pname("com.ausregistry.cpptoolkit.session"); //string SessionManagerImpl::pname("com.ausregistry.cpptoolkit.session");
string SessionManagerImpl::pname("biz.meansofproduction.dnseppus.session");
SessionManagerImpl::SessionManagerImpl(SessionManagerProperties* props) SessionManagerImpl::SessionManagerImpl(SessionManagerProperties* props)
throw (ConfigurationException) throw (ConfigurationException)

View File

@ -21,6 +21,7 @@ typedef enum SMState { STOPPED, STARTED, RUNNING };
*/ */
class SessionManagerImpl : public SessionManager class SessionManagerImpl : public SessionManager
{ {
friend class ACSession;
public: public:
SessionManagerImpl() SessionManagerImpl()
: state(STOPPED), sessionPool(NULL), properties(NULL) : state(STOPPED), sessionPool(NULL), properties(NULL)
@ -60,8 +61,8 @@ public:
*/ */
void keepAlive(); void keepAlive();
void shutdown(); virtual void shutdown();
void run(); virtual void run();
void changeMaxPoolSize (int size) void changeMaxPoolSize (int size)
{ {

2
APIG/build/.gdbinit Normal file
View File

@ -0,0 +1,2 @@
set follow-fork-mode child

BIN
APIG/build/drde-cd Executable file

Binary file not shown.

BIN
AusRegCliever/build/ausreg-md Executable file

Binary file not shown.

View File

@ -27,7 +27,7 @@ class ausRegEPPTK {
// See the Toolkit Overview. At this level supposedly it can do everything. // See the Toolkit Overview. At this level supposedly it can do everything.
ausRegEPPTK() { tkScenario = ACTK_OTEA; ausRegEPPTK() { tkScenario = ACTK_OTE8;
daysRunning = 0; daysRunning = 0;
} }
bool didInit(const std::string propertiesFilePath); bool didInit(const std::string propertiesFilePath);

View File

@ -75,7 +75,9 @@ void ausRegEPPTK::doOTEA()
} }
void ausRegEPPTK::doOTEB() void ausRegEPPTK::doOTEB()
{ {
int hours; #define N_OTE_B
int cmd=0;
string op("newInstance"); string op("newInstance");
if (!daysRunning) if (!daysRunning)
@ -91,14 +93,20 @@ void ausRegEPPTK::doOTEA()
manager->run(); manager->run();
sess->open(); sess->open();
for (hours=0;hours < 24;hours++) {
// Spawn the keep alive thread.
theseLogs->logN(1,"Send Test SE at start of OTE Test Hour %d.",hours);
sess->writeXML(TEST_SE);
// sess->read();
sleep(3630);
} theseLogs->logN(1,"OTE Basic Access Tests.");
theseLogs->logN(1,"OTE Basic Access Tests (%d).",cmd++);
sess->writeXML(TEST_SE);
sess->read();
theseLogs->logN(1,"Begin Actual Tests.");
sleep(2);
theseLogs->logN(1,"(%d) Conventional check of thoughtcrime.biz",cmd++);
theseLogs->logN(1,"(%d) LPE Check of test-validate.claimsgasix",cmd++);
theseLogs->logN(1,"(%d) Register <registrar>.ote using OTE Account %d.",cmd++);
theseLogs->logN(1,"(%d) Transfer <register>.ote to OTE Account %d.",cmd++);
theseLogs->logN(1,"(%d) Sunrise create with ICANN SMD test files.",cmd++);
theseLogs->logN(1,"End OTE Basic Access Tests.",cmd++);
sess->close(); sess->close();
manager->shutdown(); manager->shutdown();