zeroth toolkit state
This commit is contained in:
commit
ffd2ba5ebb
|
@ -0,0 +1,120 @@
|
||||||
|
##################################################
|
||||||
|
# Makefile for building lib and main test routine#
|
||||||
|
##################################################
|
||||||
|
# operating system
|
||||||
|
SYSTEM = $(shell uname -s)
|
||||||
|
|
||||||
|
CXX = g++
|
||||||
|
CC = gcc
|
||||||
|
|
||||||
|
#SHARED_CXXFLAGS += -O2
|
||||||
|
SHARED_CXXFLAGS += -g
|
||||||
|
|
||||||
|
CXXFLAGS = $(SHARED_CXXFLAGS) -Wall -Wpointer-arith -Wcast-qual -D_REENTRANT -fPIC
|
||||||
|
CPPFLAGS = -fPIC -D_GNU_SOURCE
|
||||||
|
CXXFLAGS += -D_GNU_SOURCE -O0
|
||||||
|
|
||||||
|
#XERCES_HOME = /usr/local/xerces-c-src_2_7_0
|
||||||
|
#XERCES_LIB_DIR = ${XERCES_HOME}/lib
|
||||||
|
#XERCES_LIB = xerces-c2_7_0
|
||||||
|
|
||||||
|
#XALAN_HOME = /usr/local/xalan-c_1_10_0
|
||||||
|
#XALAN_LIB_DIR = $(XALAN_HOME)/lib
|
||||||
|
|
||||||
|
include xml-deps.mk
|
||||||
|
|
||||||
|
##### Set this to the location of the library to be produced
|
||||||
|
|
||||||
|
BUILD_LIB_DIR = lib
|
||||||
|
BUILD_OBJ_DIR = build
|
||||||
|
|
||||||
|
###### Include Paths
|
||||||
|
|
||||||
|
INCLUDE_DIR = -I . -I $(XERCES_INC_DIR) -I $(XALAN_INC_DIR)
|
||||||
|
|
||||||
|
build_obj_dir = $(BUILD_OBJ_DIR)
|
||||||
|
|
||||||
|
src_dirs_cpp = se se/secDNS common session xml
|
||||||
|
src_dirs_c = config
|
||||||
|
srcs_all = $(foreach dir,$(src_dirs_cpp),$(wildcard $(dir)/*.cpp))
|
||||||
|
srcs_all += $(foreach dir,$(src_dirs_c),$(wildcard $(dir)/*.c))
|
||||||
|
|
||||||
|
srcs = $(filter-out %Test.cpp,$(srcs_all))
|
||||||
|
objs = $(foreach file,$(srcs),$(build_obj_dir)/$(basename $(notdir $(file))).o)
|
||||||
|
test_srcs = $(filter %Test.cpp,$(srcs_all))
|
||||||
|
test_objs = $(foreach file,$(test_srcs),$(build_obj_dir)/$(basename $(notdir $(file))).o)
|
||||||
|
test_execs = $(subst .o,,$(test_objs))
|
||||||
|
|
||||||
|
calc_deps = \
|
||||||
|
$(CC) -MT '$(build_obj_dir)/$(basename $(notdir $@)).o $@' -MF $@ -MM $(CPPFLAGS) $(INCLUDE_DIR) $<
|
||||||
|
|
||||||
|
all: dirs $(objs) $(BUILD_LIB_DIR)/libAusreg_EPP_toolkit.so
|
||||||
|
|
||||||
|
%.d: %.c
|
||||||
|
$(calc_deps)
|
||||||
|
%.d: %.cpp
|
||||||
|
$(calc_deps)
|
||||||
|
include $(foreach name,$(srcs_all),$(basename $(name)).d)
|
||||||
|
|
||||||
|
vpath %.cpp ./ \
|
||||||
|
./se\
|
||||||
|
./se/secDNS\
|
||||||
|
./xml\
|
||||||
|
./common\
|
||||||
|
./session\
|
||||||
|
|
||||||
|
vpath %.c ./config
|
||||||
|
|
||||||
|
vpath %.o ../build
|
||||||
|
|
||||||
|
####### Implicit rules
|
||||||
|
|
||||||
|
.SUFFIXES: .cpp .c
|
||||||
|
|
||||||
|
$(BUILD_OBJ_DIR)/%.o: %.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) -c -o $@ $(INCLUDE_DIR) $<
|
||||||
|
|
||||||
|
$(BUILD_OBJ_DIR)/%.o: %.c
|
||||||
|
$(CC) $(CPPFLAGS) -c -o $@ $(INCLUDE_DIR) $<
|
||||||
|
|
||||||
|
|
||||||
|
LDFLAGS_TESTS = -L$(BUILD_LIB_DIR) -lAusreg_EPP_toolkit \
|
||||||
|
-L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg\
|
||||||
|
-L$(XERCES_LIB_DIR) -lxerces-c \
|
||||||
|
-lssl \
|
||||||
|
-lrt
|
||||||
|
|
||||||
|
$(BUILD_OBJ_DIR)/%: $(BUILD_OBJ_DIR)/%.o
|
||||||
|
$(CXX) $(LDFLAGS_TESTS) -o $@ $<
|
||||||
|
|
||||||
|
.PHONY: doc clean dclean
|
||||||
|
####### Build rules
|
||||||
|
|
||||||
|
#libAusreg_EPP_toolkit.a: $(OBJECTS)
|
||||||
|
# $(LIB_ARCHIVER) $(LIB_FLAGS) $(BUILD_LIB_DIR)/$@ $^
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: tests
|
||||||
|
tests: all $(test_execs)
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: dirs
|
||||||
|
dirs:
|
||||||
|
-mkdir -p $(BUILD_LIB_DIR)
|
||||||
|
-mkdir -p $(BUILD_OBJ_DIR)
|
||||||
|
|
||||||
|
$(BUILD_LIB_DIR)/libAusreg_EPP_toolkit.so: $(objs)
|
||||||
|
$(CXX) $(LDFLAGS) $(SHARED_CXXFLAGS) -shared $^ -o $@
|
||||||
|
|
||||||
|
doc:
|
||||||
|
doxygen etc/Doxyfile
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) $(objs) $(BUILD_LIB_DIR)/libAusreg_EPP_toolkit.so *~
|
||||||
|
$(RM) -r $(BUILD_OBJ_DIR)
|
||||||
|
$(RM) -r $(BUILD_LIB_DIR)
|
||||||
|
|
||||||
|
dclean:
|
||||||
|
$(MAKE) clean
|
||||||
|
$(RM) */*.d
|
||||||
|
|
|
@ -0,0 +1,146 @@
|
||||||
|
A. Software Requirements
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
1. GNU Make 3.80 or later
|
||||||
|
2. GCC 3.4.6 (for gcc and g++)
|
||||||
|
3. Xerces C++ 2.7.0
|
||||||
|
4. Xalan C++ 1.0
|
||||||
|
5. OpenSSL 0.9.7a or later
|
||||||
|
6. Doxygen 1.3.9.1 (required to produce API documentation)
|
||||||
|
|
||||||
|
Notes
|
||||||
|
The software library may build with an earlier GCC release, but has only been
|
||||||
|
verified on GCC 3.4.6. It was developed on 64-bit Redhat Enterprise Linux ES
|
||||||
|
4 using 64-bit supporting libraries (Xerces, Xalan, OpenSSL).
|
||||||
|
|
||||||
|
|
||||||
|
B. Build Instructions
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
1. Set the values of the following environment variables:
|
||||||
|
XALAN_LIB_DIR
|
||||||
|
XALAN_LIB
|
||||||
|
XALAN_INC_DIR
|
||||||
|
XERCES_LIB_DIR
|
||||||
|
XERCES_LIB
|
||||||
|
XERCES_INC_DIR
|
||||||
|
Examples:
|
||||||
|
$ XALAN_LIB_DIR=/usr/local/xalan-c/lib
|
||||||
|
$ XALAN_LIB=xalan-c
|
||||||
|
$ XALAN_INC_DIR=/usr/local/xalan-c/include
|
||||||
|
$ XERCES_LIB_DIR=/usr/lib
|
||||||
|
$ XERCES_LIB=xerces-c
|
||||||
|
$ XERCES_INC_DIR=/usr/include/xercesc
|
||||||
|
$ export XALAN_LIB_DIR XALAN_LIB XALAN_INC_DIR XERCES_LIB_DIR XERCES_LIB XERCES_INC_DIR
|
||||||
|
|
||||||
|
2. Verify version of tools.
|
||||||
|
$ make --version$ make --version
|
||||||
|
GNU Make 3.80
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
This is free software; see the source for copying conditions.
|
||||||
|
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
$ gcc --version
|
||||||
|
gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-8)
|
||||||
|
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||||
|
This is free software; see the source for copying conditions. There is NO
|
||||||
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
$ openssl version
|
||||||
|
OpenSSL 0.9.7a Feb 19 2003
|
||||||
|
|
||||||
|
$ doxygen --version
|
||||||
|
1.3.9.1
|
||||||
|
|
||||||
|
2. Unpack the toolkit source (one of the following):
|
||||||
|
> tar xf cpptk2_release.tar
|
||||||
|
> tar zxf cpptk2_release.tar.gz
|
||||||
|
> tar jxf cpptk2_release.tar.bz2
|
||||||
|
|
||||||
|
3. Build the C++ Toolkit shared library:
|
||||||
|
> make
|
||||||
|
|
||||||
|
4. The previous command will leave object files in the bin directory and, most
|
||||||
|
importantly, the shared object file (libAusreg_EPP_toolkit.so) in the lib
|
||||||
|
directory.
|
||||||
|
|
||||||
|
|
||||||
|
C. Usage Information and Advice
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
1. When using the toolkit, the LD_LIBRARY_PATH should contain the lib
|
||||||
|
directory, or else the libAusreg_EPP_toolkit.so file shold be placed in a
|
||||||
|
system library directory, or the linker should otherwise be made aware of the
|
||||||
|
location of the libAusreg_EPP_toolkit.so file (such as by using ldconfig).
|
||||||
|
Also, the linker will need to find the Xalan and Xerces libraries (by similar
|
||||||
|
means).
|
||||||
|
|
||||||
|
2. A configuration file (see toolkit2.conf for a sample file) must be available
|
||||||
|
to the toolkit at startup. It is recommended that this file be named
|
||||||
|
absolutely. This file directs the library to the location of other resources
|
||||||
|
required for correct operation. The user should ensure that each resource
|
||||||
|
named in the configuration file resolves to an available file on the system
|
||||||
|
(such as .xsd files). The sample configuration file is in the 'etc' directory.
|
||||||
|
|
||||||
|
4. XML schema definition files are in the 'resources' directory. They may be
|
||||||
|
copied to another location as appropriate to the client's environment, but such
|
||||||
|
a location must be defined as described in step C.2.
|
||||||
|
|
||||||
|
|
||||||
|
D. Running Bundled Tests
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
There are a set of unit tests provided with the source release of the C++
|
||||||
|
toolkit. Follow the steps below to run these tests. In the examples, phrases
|
||||||
|
delimited by < and > should be replaced by suitable values, such as:
|
||||||
|
ORG=<organisation-name>
|
||||||
|
to be replaced with:
|
||||||
|
ORG="AusRegistry Pty Ltd"
|
||||||
|
|
||||||
|
1. Ensure the system requirements are met.
|
||||||
|
|
||||||
|
2. Obtain the latest C++ toolkit source release.
|
||||||
|
|
||||||
|
3. Obtain a valid username/password combination from the Registry server.
|
||||||
|
|
||||||
|
4. Generate a private key and corresponding public certificate signing request,
|
||||||
|
as documented in the Registrar Help Centre (www.ausregistry.net.au). Define
|
||||||
|
the location of the private key and the certificate file returned by Registry
|
||||||
|
support staff in the toolkit configuration file. You will also receive a
|
||||||
|
CAfile from the Registry operator. The location of this must be specified by
|
||||||
|
the ssl.ca.location configuration parameter. The other parameters are
|
||||||
|
ssl.cert.location, ssl.privatekey.location and ssl.privatekey.pass for the
|
||||||
|
location of the public certificate and private key files and the passphrase of
|
||||||
|
the private key, respectively.
|
||||||
|
|
||||||
|
5. Copy or modify the site.properties file from the 'etc' directory of the
|
||||||
|
Toolkit source release, and modify the parameters to suit your requirements.
|
||||||
|
The username and password are as obtained in (3) above. Registry support
|
||||||
|
should provide the location (hostname and port) of a suitable EPP server for
|
||||||
|
testing.
|
||||||
|
Note: the environment variable EPP_SITE_PROPERTIES defines the location of the
|
||||||
|
modified site.properties file and should be stated as an absolute filename.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
export EPP_SITE_PROPERTIES=/home/eppclient/etc/site-test.properties
|
||||||
|
|
||||||
|
6. Run the supplied tests (will build the Toolkit library if not already built).
|
||||||
|
$ make tests
|
||||||
|
|
||||||
|
9. Verify the results of the test run. If the test run is successful, then
|
||||||
|
there will be no output, otherwise each failed test will be reported to the
|
||||||
|
screen. Failure details are available in the target/test_reports directory.
|
||||||
|
Log messages are written by default to a file name 'log' in the working
|
||||||
|
directory. Only the messages from the last test class are available after the
|
||||||
|
test run completes.
|
||||||
|
|
||||||
|
If the tests passed, congratulations! You have successfully configured the
|
||||||
|
dependencies of the toolkit. The next step is to consult the user manual,
|
||||||
|
which is available from the Registry Portal. Keep track of the resources
|
||||||
|
created during this procedure, especially the private key and public
|
||||||
|
certificate, as these will be required by the toolkit when integrated into your
|
||||||
|
application.
|
||||||
|
|
||||||
|
|
||||||
|
--- End of README.txt ---
|
|
@ -0,0 +1,20 @@
|
||||||
|
AusRegistry's EPP Client Library for the C++ Programming Language.
|
||||||
|
|
||||||
|
Changes in version 1.3.2
|
||||||
|
* Change API on TLSSocket. writeInt(int i) now throws SSLException.
|
||||||
|
* Blocked SIGPIPE signal as work around fix for OpenSSL bug in version (openssl-0.9.8e-22.el5).
|
||||||
|
* Fixed exception handling mismatches in TLSSession class.
|
||||||
|
|
||||||
|
Changes in version 1.3.1
|
||||||
|
* Corrected sample hostname value in toolkit2.conf.
|
||||||
|
|
||||||
|
Changes in version 1.3
|
||||||
|
* Added classes to support DNSSEC through SecDNS-1.1 schema
|
||||||
|
|
||||||
|
Changes in version 1.2
|
||||||
|
* Added classes to support Key Value extensions (DomainInfoKVResponseExtension, DomainKVCommandExtension, KVExtension)
|
||||||
|
* Added classes to support generic Domain Registrant Transfer command (DomainRegistrantTransfer)
|
||||||
|
|
||||||
|
Changes in version 1.1
|
||||||
|
* Added classes to support Domain Expiry Synchronisation (DomainUpdateSyncCommandExtension)
|
||||||
|
* Fixed memory leaks
|
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef __AUTO_MUTEX_HPP
|
||||||
|
#define __AUTO_MUTEX_HPP
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper to ensure mutex lock/unlock matching in the presence of exceptions.
|
||||||
|
*/
|
||||||
|
class AutoMutex
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AutoMutex(pthread_mutex_t* mutex)
|
||||||
|
: mtx(mutex)
|
||||||
|
{
|
||||||
|
// XXX errors
|
||||||
|
pthread_mutex_lock(mtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
~AutoMutex()
|
||||||
|
{
|
||||||
|
// XXX errors
|
||||||
|
pthread_mutex_unlock(mtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
pthread_mutex_t* mtx;
|
||||||
|
};
|
||||||
|
#endif // __AUTO_MUTEX_HPP
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#ifndef __CONFIGURATION_ERROR_HPP
|
||||||
|
#define __CONFIGURATION_ERROR_HPP
|
||||||
|
|
||||||
|
#include "common/EPPException.hpp"
|
||||||
|
|
||||||
|
class ConfigurationError : public EPPException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ConfigurationError (const std::string &msg)
|
||||||
|
: EPPException (msg) {};
|
||||||
|
|
||||||
|
ConfigurationError (const EPPException &other)
|
||||||
|
: EPPException (other.getMessage()) {};
|
||||||
|
EPP_EXCEPTION(ConfigurationError);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __CONFIGURATION_ERROR_HPP
|
|
@ -0,0 +1,7 @@
|
||||||
|
#include "common/Constants.hpp"
|
||||||
|
|
||||||
|
bool Constants::useObjectPrefixes(true);
|
||||||
|
bool Constants::useRealTime(false);
|
||||||
|
bool Constants::isValidating(true);
|
||||||
|
const std::string Constants::DEFAULT_LANG("en");
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#ifndef __CONSTANTS_HPP
|
||||||
|
#define __CONSTANTS_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class Constants
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static bool useObjectPrefixes, useRealTime, isValidating;
|
||||||
|
static const std::string DEFAULT_LANG;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __CONSTANTS_HPP
|
|
@ -0,0 +1,22 @@
|
||||||
|
#ifndef DEPRECATED_HPP_
|
||||||
|
#define DEPRECATED_HPP_
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Platform independent way of deprecating methods, as referenced from
|
||||||
|
* http://stackoverflow.com/questions/295120/c-mark-as-deprecated.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
/* Deprecating classes and constructors by using this attribute may have some
|
||||||
|
* issues in versions older than 4.5.0, as reported in this gcc bug
|
||||||
|
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43797
|
||||||
|
*/
|
||||||
|
#define DEPRECATED(func) func __attribute__ ((deprecated))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define DEPRECATED(func) __declspec(deprecated) func
|
||||||
|
#else
|
||||||
|
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
|
||||||
|
#define DEPRECATED(func) func
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* DEPRECATED_HPP_ */
|
|
@ -0,0 +1,54 @@
|
||||||
|
#ifndef __EPP_EXCEPTION_H
|
||||||
|
#define __EPP_EXCEPTION_H
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#define EPP_EXCEPTION(className) virtual EPPException* clone() const { return new className (*this); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Root exception class for exception reporting within the EPP toolkit.
|
||||||
|
*/
|
||||||
|
class EPPException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// constructor.
|
||||||
|
EPPException(const std::string& message)
|
||||||
|
: msg(message), cause(NULL)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
// copy constructor.
|
||||||
|
EPPException(const EPPException& other)
|
||||||
|
: msg(other.msg)
|
||||||
|
{
|
||||||
|
if (other.cause) cause = other.cause->clone();
|
||||||
|
else cause = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~EPPException() { if (cause) delete cause; }
|
||||||
|
|
||||||
|
const std::string getMessage() const
|
||||||
|
{
|
||||||
|
return msg + (cause != NULL ? "\nCaused by\n" + cause->getMessage() : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Indicate that this exception was caused by another exception.
|
||||||
|
virtual void causedBy(const EPPException& ex)
|
||||||
|
{
|
||||||
|
cause = ex.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
EPPException* getCause() const { return cause; }
|
||||||
|
EPP_EXCEPTION(EPPException);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
std::string msg;
|
||||||
|
EPPException* cause;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //__EPP_EXCEPTION_H
|
|
@ -0,0 +1,14 @@
|
||||||
|
#include "common/EPPException.hpp"
|
||||||
|
#include "common/Test.hpp"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
EPPException a("whoops");
|
||||||
|
EPPException b("there was a problem");
|
||||||
|
a.causedBy(b);
|
||||||
|
ASSERT_EQ(a.getMessage(), "whoops\nCaused by\nthere was a problem");
|
||||||
|
}
|
|
@ -0,0 +1,104 @@
|
||||||
|
#include "common/ErrorPkg.hpp"
|
||||||
|
#include "common/Logger.hpp"
|
||||||
|
#include "common/StringUtils.hpp"
|
||||||
|
#include "common/SystemProperties.hpp"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
Properties ErrorPkg::properties;
|
||||||
|
static std::string pname;
|
||||||
|
|
||||||
|
|
||||||
|
void ErrorPkg::init() throw (PropertyConfigException)
|
||||||
|
{
|
||||||
|
pname = "com.ausregistry.cpptoolkit";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string msgsFile = SystemProperties::getProperty("epp.client.messages.file");
|
||||||
|
Logger::getLogger(pname + ".debug")->fine("Using message file: " + msgsFile);
|
||||||
|
|
||||||
|
Logger::getLogger(pname + ".debug")->fine("Loading messages file: " + msgsFile);
|
||||||
|
properties.load(msgsFile);
|
||||||
|
}
|
||||||
|
catch (PropertyNotFoundException& e)
|
||||||
|
{
|
||||||
|
PropertyConfigException pc("ErrPkg::init failed.");
|
||||||
|
pc.causedBy(e);
|
||||||
|
throw pc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string ErrorPkg::getMessage (const string &key)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return properties.getProperty(key);
|
||||||
|
}
|
||||||
|
catch (PropertyNotFoundException)
|
||||||
|
{
|
||||||
|
Logger::getLogger(pname+".support")->warning
|
||||||
|
("Message definition not found for name: " + key);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string ErrorPkg::getMessage (const string &name,
|
||||||
|
const string &arg,
|
||||||
|
const string &val)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string msg = getMessage(name);
|
||||||
|
|
||||||
|
Logger::getLogger(pname+".debug")->finer
|
||||||
|
(name + ": " + arg + "= " + val);
|
||||||
|
|
||||||
|
return StringUtils::replaceAll(msg, arg, val);
|
||||||
|
}
|
||||||
|
catch (ConfigurationError)
|
||||||
|
{
|
||||||
|
Logger::getLogger(pname+".support")->warning
|
||||||
|
("Message definition not found for name: " + name);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string ErrorPkg::getMessage(const string &name,
|
||||||
|
const vector<string> &args,
|
||||||
|
const vector<string> &vals)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string msg = getMessage (name);
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < args.size() && i < vals.size(); i++)
|
||||||
|
{
|
||||||
|
Logger::getLogger(pname+".debug")->fine("replace: " + args[i]);
|
||||||
|
Logger::getLogger(pname+".debug")->fine("with: " + vals[i]);
|
||||||
|
msg = StringUtils::replaceAll (msg, args[i], vals[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
catch (ConfigurationError)
|
||||||
|
{
|
||||||
|
Logger::getLogger(pname+".support")->warning
|
||||||
|
("Message definition not found for name: " + name);
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string ErrorPkg::findMessageFile()
|
||||||
|
{
|
||||||
|
string msgsFile = SystemProperties::getProperty("epp.client.messages.file");
|
||||||
|
Logger::getLogger(pname+".debug")->config("Using message file: " + msgsFile);
|
||||||
|
return msgsFile;
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
#ifndef __ERROR_PKG_HPP
|
||||||
|
#define __ERROR_PKG_HPP
|
||||||
|
|
||||||
|
#include "common/Properties.hpp"
|
||||||
|
#include "common/ConfigurationError.hpp"
|
||||||
|
#include "common/Logger.hpp"
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class ErrorPkg
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static std::string getMessage(const std::string& msg);
|
||||||
|
|
||||||
|
static std::string getMessage(const std::string& msg,
|
||||||
|
const std::string& arg,
|
||||||
|
const std::string& val);
|
||||||
|
|
||||||
|
static std::string getMessage(const std::string& msg,
|
||||||
|
const std::vector<std::string>& args,
|
||||||
|
const std::vector<std::string>& vals);
|
||||||
|
static void init() throw (PropertyConfigException);
|
||||||
|
private:
|
||||||
|
|
||||||
|
static std::string getMessageInternal(const std::string& msg);
|
||||||
|
|
||||||
|
static Properties properties;
|
||||||
|
|
||||||
|
static std::string findMessageFile();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __ERROR_PKG_HPP
|
|
@ -0,0 +1,15 @@
|
||||||
|
#ifndef __ILLEGAL_STATE_EXCEPTION_HPP
|
||||||
|
#define __ILLEGAL_STATE_EXCEPTION_HPP
|
||||||
|
|
||||||
|
#include "common/EPPException.hpp"
|
||||||
|
|
||||||
|
class IllegalStateException : public EPPException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IllegalStateException(const std::string &msg)
|
||||||
|
: EPPException (msg)
|
||||||
|
{ }
|
||||||
|
EPP_EXCEPTION(IllegalStateException);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __ILLEGAL_ARGUMENT_EXCEPTION_HPP
|
|
@ -0,0 +1,237 @@
|
||||||
|
#include "SystemProperties.hpp"
|
||||||
|
#include "common/Logger.hpp"
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include "common/AutoMutex.hpp"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
// s_loggerMap and s_loggerProperties are protected by s_logPoolLock
|
||||||
|
class LoggerMap
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// This is primarily a thin wrapper around std::map to release the heap
|
||||||
|
// allocated Logger objects. (Bring on map<string, tr1::shared_ptr > ... ).
|
||||||
|
~LoggerMap()
|
||||||
|
{
|
||||||
|
for (Map::iterator i = loggerMap.begin(); i != loggerMap.end(); ++i)
|
||||||
|
{
|
||||||
|
delete i->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
typedef map<string, Logger *> Map;
|
||||||
|
typedef Map::const_iterator const_iterator;
|
||||||
|
|
||||||
|
Map::const_iterator find(const string& name) const
|
||||||
|
{
|
||||||
|
return loggerMap.find(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map::const_iterator end() const { return loggerMap.end(); }
|
||||||
|
|
||||||
|
void addLog(const string& name, Logger::LoggerLevel lvl, const string& fname)
|
||||||
|
{
|
||||||
|
loggerMap.insert(make_pair(name, new Logger(name, lvl, fname)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Map loggerMap;
|
||||||
|
};
|
||||||
|
static LoggerMap s_loggerMap;
|
||||||
|
static auto_ptr<Properties> s_loggerProperties;
|
||||||
|
|
||||||
|
pthread_mutex_t s_logPoolLock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
const char * LoggerLevelStringReps[Logger::__INVALID_LEVEL + 1] =
|
||||||
|
{
|
||||||
|
"OFF",
|
||||||
|
"FINEST",
|
||||||
|
"FINER",
|
||||||
|
"FINE",
|
||||||
|
"CONFIG",
|
||||||
|
"INFO",
|
||||||
|
"WARNING",
|
||||||
|
"SEVERE",
|
||||||
|
"__INVALID_LEVEL"
|
||||||
|
};
|
||||||
|
|
||||||
|
string findKey(const string& parent, const string& key, const string& def)
|
||||||
|
{
|
||||||
|
const string delim(".");
|
||||||
|
string::size_type i;
|
||||||
|
for (i = parent.size(); i != string::npos; i = parent.rfind(delim, i))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return s_loggerProperties->getProperty(parent.substr(0, i) + delim + key);
|
||||||
|
}
|
||||||
|
catch (PropertyNotFoundException& e)
|
||||||
|
{ }
|
||||||
|
if (i == 0) break;
|
||||||
|
i -= delim.size();
|
||||||
|
}
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
|
||||||
|
string getFileNameForLogger(const string& logName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return findKey(logName, "file", "");
|
||||||
|
}
|
||||||
|
catch (EPPException& e)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger::LoggerLevel getLevelForLogger(
|
||||||
|
const string& logName,
|
||||||
|
const Logger::LoggerLevel defaultLevel)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
const string lvl(findKey(logName, "level", "WARNING"));
|
||||||
|
for (int i = 0; i < Logger::__INVALID_LEVEL; i++)
|
||||||
|
{
|
||||||
|
if (lvl == LoggerLevelStringReps[i])
|
||||||
|
{
|
||||||
|
return (Logger::LoggerLevel)i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return defaultLevel;
|
||||||
|
}
|
||||||
|
catch (EPPException& e)
|
||||||
|
{
|
||||||
|
return defaultLevel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add a time string to str.
|
||||||
|
ostream& logTime(ostream& str)
|
||||||
|
{
|
||||||
|
struct timeval tv;
|
||||||
|
struct tm tm;
|
||||||
|
const char BUFSZ=32;
|
||||||
|
char tmpbuf[BUFSZ];
|
||||||
|
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
|
gmtime_r(&(tv.tv_sec), &tm);
|
||||||
|
|
||||||
|
strftime(tmpbuf, BUFSZ, "%Y%m%d %H:%M:%S", &tm);
|
||||||
|
str << tmpbuf;
|
||||||
|
snprintf(tmpbuf, BUFSZ, ".%03ld", tv.tv_usec / 1000);
|
||||||
|
str << tmpbuf;
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // anonymous namespace
|
||||||
|
|
||||||
|
|
||||||
|
Logger::Logger(const string& name, const LoggerLevel ll, const string& fileName)
|
||||||
|
: myName(name), level(ll), stream(NULL)
|
||||||
|
{
|
||||||
|
pthread_mutex_init(&mtx, NULL);
|
||||||
|
if (fileName.size() > 0)
|
||||||
|
{
|
||||||
|
stream = new ofstream(fileName.c_str(), ios_base::app);
|
||||||
|
if (!stream->good())
|
||||||
|
{
|
||||||
|
cerr << "Logger: failed open file '" << fileName
|
||||||
|
<< "' for logger '" << name << "'." << endl;
|
||||||
|
|
||||||
|
// Note if the new worked, but the stream is 'invalid', the object
|
||||||
|
// still exists but is of no use. Let's delete it and treat it as
|
||||||
|
// for the default logging case.
|
||||||
|
delete stream;
|
||||||
|
stream = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger::~Logger()
|
||||||
|
{
|
||||||
|
pthread_mutex_destroy(&mtx);
|
||||||
|
if (stream) delete stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Logger::init() throw (PropertyConfigException)
|
||||||
|
{
|
||||||
|
s_loggerMap = LoggerMap();
|
||||||
|
s_loggerProperties = auto_ptr<Properties>(new Properties);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
s_loggerProperties->load(SystemProperties::getProperty("logging.config.file"));
|
||||||
|
}
|
||||||
|
catch (PropertyConfigException& e)
|
||||||
|
{
|
||||||
|
// We explicitly send this to cerr as the logging system itself is not working!
|
||||||
|
cerr << "Logger::init failed to load config: "
|
||||||
|
<< e.getMessage() << endl;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
catch (PropertyNotFoundException& e)
|
||||||
|
{
|
||||||
|
PropertyConfigException pce("Could not initialise the logging system.");
|
||||||
|
pce.causedBy(e);
|
||||||
|
|
||||||
|
// We explicitly send this to cerr as the logging system itself is not
|
||||||
|
// working!
|
||||||
|
cerr << e.getMessage() << endl;
|
||||||
|
throw pce;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger* Logger::getLogger(const string &name)
|
||||||
|
{
|
||||||
|
AutoMutex lock(&s_logPoolLock);
|
||||||
|
|
||||||
|
LoggerMap::const_iterator p = s_loggerMap.find(name);
|
||||||
|
if (p != s_loggerMap.end()) return p->second;
|
||||||
|
|
||||||
|
const string fname = getFileNameForLogger(name);
|
||||||
|
const LoggerLevel ll = getLevelForLogger(name, WARNING);
|
||||||
|
s_loggerMap.addLog(name, ll, fname);
|
||||||
|
|
||||||
|
// Redundant find, but this only happens once per log name.
|
||||||
|
return s_loggerMap.find(name)->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Logger::log(LoggerLevel lvl,
|
||||||
|
const string& msg,
|
||||||
|
const string& unit,
|
||||||
|
int line)
|
||||||
|
{
|
||||||
|
if (lvl >= this->level)
|
||||||
|
{
|
||||||
|
ostringstream str;
|
||||||
|
logTime(str) << " | " << myName << " | ";
|
||||||
|
if (unit != "")
|
||||||
|
{
|
||||||
|
str << unit;
|
||||||
|
if (line > 0) str << "[" << line << "]";
|
||||||
|
str << " | ";
|
||||||
|
}
|
||||||
|
str << LoggerLevelStringReps[lvl] << ": " << msg << "\n";
|
||||||
|
|
||||||
|
AutoMutex lock(&mtx);
|
||||||
|
if (stream)
|
||||||
|
{
|
||||||
|
*stream << str.str();
|
||||||
|
stream->flush();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clog << str.str();
|
||||||
|
clog.flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,92 @@
|
||||||
|
#ifndef __LOGGER_HPP
|
||||||
|
#define __LOGGER_HPP
|
||||||
|
|
||||||
|
#include "common/Properties.hpp"
|
||||||
|
#include "common/ConfigurationError.hpp"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <ostream>
|
||||||
|
|
||||||
|
#define LOG_FINEST(msg) log(Logger::FINEST, msg, __FILE__, __LINE__)
|
||||||
|
#define LOG_FINER(msg) log(Logger::FINER, msg, __FILE__, __LINE__)
|
||||||
|
#define LOG_FINE(msg) log(Logger::FINE, msg, __FILE__, __LINE__)
|
||||||
|
#define LOG_CONFIG(msg) log(Logger::CONFIG, msg, __FILE__, __LINE__)
|
||||||
|
#define LOG_INFO(msg) log(Logger::INFO, msg, __FILE__, __LINE__)
|
||||||
|
#define LOG_WARNING(msg) log(Logger::WARNING, msg, __FILE__, __LINE__)
|
||||||
|
#define LOG_SEVERE(msg) log(Logger::SEVERE, msg, __FILE__, __LINE__)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An interface that support logging at various severity levels and
|
||||||
|
* to various logging sinks. The toolkit uses a number of well known
|
||||||
|
* logging sinks as defined in the shipped 'logging.conf' property
|
||||||
|
* file. The Logging interface needs to be initialised before any
|
||||||
|
* toolkit application objects are constructed to ensure the settings
|
||||||
|
* present in the configuration have an effect.
|
||||||
|
* Note: SystemProperties::init() must have been run before using this
|
||||||
|
* interface. Logger::init() must be called first.
|
||||||
|
* The SystemProperty 'logging.config.file' must refer to a file contain
|
||||||
|
* the logging configuration.
|
||||||
|
*/
|
||||||
|
class Logger
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum LoggerLevel
|
||||||
|
{
|
||||||
|
OFF,
|
||||||
|
FINEST,
|
||||||
|
FINER,
|
||||||
|
FINE,
|
||||||
|
CONFIG,
|
||||||
|
INFO,
|
||||||
|
WARNING,
|
||||||
|
SEVERE,
|
||||||
|
__INVALID_LEVEL
|
||||||
|
};
|
||||||
|
|
||||||
|
/// @note Use the getLogger function exclusively to create loggers.
|
||||||
|
~Logger();
|
||||||
|
Logger(const std::string& name, const LoggerLevel ll, const std::string& fileName);
|
||||||
|
|
||||||
|
|
||||||
|
static void init() throw (PropertyConfigException);
|
||||||
|
|
||||||
|
// Return the logger object from the configuration.
|
||||||
|
// @param name The logger identity.
|
||||||
|
static Logger* getLogger(const std::string &name);
|
||||||
|
|
||||||
|
void severe(const std::string &str) { log(SEVERE,str); }
|
||||||
|
void warning(const std::string &str){ log(WARNING, str); }
|
||||||
|
void finest(const std::string &str) { log(FINEST, str); }
|
||||||
|
void finer(const std::string &str) { log(FINER, str); }
|
||||||
|
void fine(const std::string &str) { log(FINE, str); }
|
||||||
|
void info(const std::string &str) { log(INFO, str); }
|
||||||
|
void config(const std::string &str) { log(CONFIG, str); }
|
||||||
|
|
||||||
|
/// Return true if a log message of the given level will be recorded
|
||||||
|
// by this logger.
|
||||||
|
// This may be useful in cases where it is considered comparatively
|
||||||
|
// expensive to construct a specific diagnostic--constuction can be
|
||||||
|
// predicated on whether or not the message will in fact be logged.
|
||||||
|
// @param lvl The log level importance level to test.
|
||||||
|
bool enabled(const LoggerLevel& lvl) { return lvl >= level; }
|
||||||
|
|
||||||
|
void log(LoggerLevel lvl,
|
||||||
|
const std::string &str,
|
||||||
|
const std::string &unit = "",
|
||||||
|
int line = 0);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Logger(const Logger&);
|
||||||
|
Logger& operator=(Logger&);
|
||||||
|
|
||||||
|
pthread_mutex_t mtx;
|
||||||
|
|
||||||
|
std::string myName;
|
||||||
|
LoggerLevel level;
|
||||||
|
std::ostream* stream;
|
||||||
|
|
||||||
|
void logMessage(const std::string& msg, LoggerLevel lvl);
|
||||||
|
};
|
||||||
|
#endif // __LOGGER_HPP
|
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef __PARAMETER_SYNTAX_EXCEPTION_HPP
|
||||||
|
#define __PARAMETER_SYNTAX_EXCEPTION_HPP
|
||||||
|
|
||||||
|
#include "common/EPPException.hpp"
|
||||||
|
|
||||||
|
class ParameterSyntaxException : public EPPException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ParameterSyntaxException (const std::string &msg)
|
||||||
|
: EPPException (msg) {};
|
||||||
|
EPP_EXCEPTION(ParameterSyntaxException);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __PARAMETER_SYNTAX_EXCEPTION_HPP
|
|
@ -0,0 +1,212 @@
|
||||||
|
#include "common/Properties.hpp"
|
||||||
|
#include "config/boolean.h"
|
||||||
|
#include <sstream>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
Properties::Properties(const string &filename)
|
||||||
|
throw (PropertyConfigException)
|
||||||
|
: theConfig(NULL), _initFailed(false)
|
||||||
|
{
|
||||||
|
load(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
Properties::~Properties()
|
||||||
|
{
|
||||||
|
if (theConfig)
|
||||||
|
{
|
||||||
|
config_destroy(theConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Properties::load(const string& filename)
|
||||||
|
throw (PropertyConfigException)
|
||||||
|
{
|
||||||
|
if (theConfig)
|
||||||
|
{
|
||||||
|
config_destroy(theConfig);
|
||||||
|
theConfig = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((theConfig = config_open(filename.c_str())) == NULL)
|
||||||
|
{
|
||||||
|
_initFailed = true;
|
||||||
|
throw PropertyConfigException("Properties::load: failed to open '" + filename + "'.");
|
||||||
|
}
|
||||||
|
_initFailed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Properties::store(const string &filename) const
|
||||||
|
throw (PropertyConfigException, PropertyIoException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
|
||||||
|
if (config_save(theConfig, filename.c_str()) == FALSE)
|
||||||
|
throw PropertyIoException("Could not write properties to file '" + filename + "'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
string Properties::getProperty(const string &prop) const
|
||||||
|
throw (PropertyNotFoundException, PropertyConfigException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
|
||||||
|
char *value = config_get_str(theConfig, prop.c_str());
|
||||||
|
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
string str_value (value);
|
||||||
|
free(value);
|
||||||
|
return str_value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
throw PropertyNotFoundException(prop);
|
||||||
|
}
|
||||||
|
|
||||||
|
string Properties::getProperty(const string &prop, const string &def) const
|
||||||
|
throw (PropertyConfigException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return getProperty(prop);
|
||||||
|
}
|
||||||
|
catch (PropertyNotFoundException&)
|
||||||
|
{
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<pair<string,string> >
|
||||||
|
Properties::getProperties(const string &prop_prefix) const
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
vector<pair<string,string> > result;
|
||||||
|
config_iter_t *i = config_iter_create(theConfig,prop_prefix.c_str());
|
||||||
|
while(i->key!=NULL)
|
||||||
|
{
|
||||||
|
result.push_back(make_pair(i->key,i->value));
|
||||||
|
config_iter_next(i);
|
||||||
|
}
|
||||||
|
config_iter_destroy(i);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Properties::setProperty(const string &prop,
|
||||||
|
const string &value)
|
||||||
|
throw (PropertyConfigException, PropertyIoException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
if (config_put_str (theConfig, prop.c_str(), value.c_str()) == NULL)
|
||||||
|
throw PropertyIoException("Could not set property '" + prop + "' to value '" + value + "'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Properties::getBooleanProperty(const string &prop) const
|
||||||
|
throw (PropertyConfigException, PropertyNotFoundException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
int value;
|
||||||
|
if (config_get_bool (theConfig, prop.c_str(), &value) == FALSE)
|
||||||
|
throw PropertyNotFoundException(prop);
|
||||||
|
|
||||||
|
return (value == TRUE ? true : false);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Properties::getBooleanProperty (const string &prop,
|
||||||
|
bool defaultValue) const
|
||||||
|
throw (PropertyConfigException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return getBooleanProperty(prop);
|
||||||
|
}
|
||||||
|
catch (PropertyNotFoundException)
|
||||||
|
{
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Properties::getIntProperty (const string &prop) const
|
||||||
|
throw (PropertyNotFoundException, PropertyConfigException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
int value;
|
||||||
|
if (config_get_int(theConfig, prop.c_str(), &value) == FALSE)
|
||||||
|
throw PropertyNotFoundException(prop);
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Properties::getIntProperty(const string &prop,
|
||||||
|
int defaultValue) const
|
||||||
|
throw (PropertyConfigException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return getIntProperty(prop);
|
||||||
|
}
|
||||||
|
catch (PropertyNotFoundException)
|
||||||
|
{
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
long Properties::getLongProperty (const string &prop) const
|
||||||
|
throw (PropertyConfigException, PropertyNotFoundException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
long value;
|
||||||
|
if (config_get_long (theConfig, prop.c_str(), &value) == FALSE)
|
||||||
|
throw PropertyNotFoundException(prop);
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
long Properties::getLongProperty (const string &prop,
|
||||||
|
long defaultValue) const
|
||||||
|
throw (PropertyConfigException)
|
||||||
|
{
|
||||||
|
if (theConfig == NULL)
|
||||||
|
throw PropertyConfigException("Properties are not loaded.");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return getLongProperty (prop);
|
||||||
|
}
|
||||||
|
catch (PropertyNotFoundException)
|
||||||
|
{
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
void Properties::splitString (const string &in,
|
||||||
|
char delim,
|
||||||
|
vector<string> &out)
|
||||||
|
{
|
||||||
|
out.clear();
|
||||||
|
|
||||||
|
istringstream iss(in);
|
||||||
|
string token;
|
||||||
|
while (getline (iss, token, delim))
|
||||||
|
out.push_back (token);
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -0,0 +1,110 @@
|
||||||
|
#ifndef __PROPERTIES_HPP
|
||||||
|
#define __PROPERTIES_HPP
|
||||||
|
|
||||||
|
#include "config/config.h"
|
||||||
|
#include "common/EPPException.hpp"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
/// This is throw when a Properties instance can not be loaded or saved
|
||||||
|
// or when a property is accessed prior to the instance being initialised.
|
||||||
|
class PropertyConfigException : public EPPException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PropertyConfigException()
|
||||||
|
: EPPException("Property configuration error.")
|
||||||
|
{ }
|
||||||
|
PropertyConfigException(const std::string &msg)
|
||||||
|
: EPPException(msg) { }
|
||||||
|
EPP_EXCEPTION(PropertyConfigException);
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Indicates that the request property name can not be found.
|
||||||
|
class PropertyNotFoundException : public EPPException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PropertyNotFoundException(const std::string &property)
|
||||||
|
: EPPException("Property not found: " + property) { }
|
||||||
|
EPP_EXCEPTION(PropertyNotFoundException);
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Thrown when a Properties file encounters an error when writing changes
|
||||||
|
// to the underlying property file.
|
||||||
|
class PropertyIoException : public EPPException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PropertyIoException(const std::string &msg)
|
||||||
|
: EPPException(msg) { }
|
||||||
|
EPP_EXCEPTION(PropertyIoException);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instances of these class manage a file containing 'name=value' lines.
|
||||||
|
* A number of function are available with can allow the value to be
|
||||||
|
* transformed into a specific type, or for a default value to be returned
|
||||||
|
* if the 'name' can not be found (or of the value is malformed).
|
||||||
|
*/
|
||||||
|
class Properties
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
Properties() : theConfig(NULL), _initFailed(false) { };
|
||||||
|
Properties(const std::string &filename) throw (PropertyConfigException);
|
||||||
|
~Properties();
|
||||||
|
|
||||||
|
bool isInitialised() const { return (theConfig != NULL); }
|
||||||
|
bool initFailed() const { return _initFailed; }
|
||||||
|
|
||||||
|
/// This must be called prior to accessing, setting or storing properties.
|
||||||
|
void load(const std::string &filename) throw (PropertyConfigException);
|
||||||
|
|
||||||
|
void store(const std::string &filename) const
|
||||||
|
throw (PropertyConfigException, PropertyIoException);
|
||||||
|
|
||||||
|
std::string getProperty(const std::string &prop) const
|
||||||
|
throw (PropertyNotFoundException, PropertyConfigException);
|
||||||
|
|
||||||
|
std::string getProperty(const std::string &prop, const std::string& def) const
|
||||||
|
throw (PropertyConfigException);
|
||||||
|
|
||||||
|
std::vector<std::pair<std::string, std::string> >
|
||||||
|
getProperties(const std::string& prop_prefix) const;
|
||||||
|
|
||||||
|
bool getBooleanProperty(const std::string &prop) const
|
||||||
|
throw (PropertyConfigException, PropertyNotFoundException);
|
||||||
|
|
||||||
|
bool getBooleanProperty(const std::string &prop,
|
||||||
|
bool defaultValue) const
|
||||||
|
throw (PropertyConfigException);
|
||||||
|
|
||||||
|
int getIntProperty(const std::string &prop) const
|
||||||
|
throw (PropertyConfigException, PropertyNotFoundException);
|
||||||
|
|
||||||
|
int getIntProperty(const std::string &prop,
|
||||||
|
int defaultValue) const
|
||||||
|
throw (PropertyConfigException);
|
||||||
|
|
||||||
|
long getLongProperty(const std::string &prop) const
|
||||||
|
throw (PropertyNotFoundException, PropertyConfigException);
|
||||||
|
|
||||||
|
long getLongProperty(const std::string &prop,
|
||||||
|
long defaultValue) const
|
||||||
|
throw (PropertyConfigException);
|
||||||
|
|
||||||
|
void setProperty(const std::string &prop,
|
||||||
|
const std::string &value)
|
||||||
|
throw (PropertyIoException, PropertyConfigException);
|
||||||
|
|
||||||
|
private:
|
||||||
|
config_t *theConfig;
|
||||||
|
bool _initFailed;
|
||||||
|
|
||||||
|
static void splitString(const std::string &in,
|
||||||
|
char delim,
|
||||||
|
std::vector<std::string> & out);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __PROPERTIES_HPP
|
|
@ -0,0 +1,73 @@
|
||||||
|
#include "common/StringUtils.hpp"
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
string StringUtils::replaceAll (const string &theString,
|
||||||
|
const string &orig,
|
||||||
|
const string &repl)
|
||||||
|
{
|
||||||
|
string retval (theString);
|
||||||
|
|
||||||
|
int replLen = repl.length(), origLen = orig.length();
|
||||||
|
|
||||||
|
string::size_type idx = 0;
|
||||||
|
while ((idx = retval.find (orig, idx)) != string::npos)
|
||||||
|
retval.replace (idx, origLen, repl, 0, replLen);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
string StringUtils::replaceFirst (const string &theString,
|
||||||
|
const string &orig,
|
||||||
|
const string &repl)
|
||||||
|
{
|
||||||
|
string retval (theString);
|
||||||
|
|
||||||
|
string::size_type idx = retval.find (orig, 0);
|
||||||
|
if (idx != string::npos)
|
||||||
|
retval.replace (idx, orig.length(), repl, 0, repl.length());
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create a hash code for the string.
|
||||||
|
* Uses the java string.hashCode() algorithm:
|
||||||
|
*
|
||||||
|
* s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
|
||||||
|
*/
|
||||||
|
StringUtils::HashType StringUtils::hashCode (const string &str)
|
||||||
|
{
|
||||||
|
unsigned int n = str.length();
|
||||||
|
HashType hash = 0L;
|
||||||
|
|
||||||
|
long double term;
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < n; i++)
|
||||||
|
{
|
||||||
|
term = pow ((long double)31, (int)(n-(i+1)));
|
||||||
|
hash += str[i] * (HashType)term;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
string StringUtils::makeString (int num)
|
||||||
|
{
|
||||||
|
ostringstream intstr;
|
||||||
|
intstr << num;
|
||||||
|
return intstr.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
string StringUtils::makeString (bool tf)
|
||||||
|
{
|
||||||
|
return tf ? "true" : "false";
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef __STRING_UTILS_HPP
|
||||||
|
#define __STRING_UTILS_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class StringUtils
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef long long HashType;
|
||||||
|
|
||||||
|
static std::string replaceAll (const std::string &theString,
|
||||||
|
const std::string &orig,
|
||||||
|
const std::string &repl);
|
||||||
|
|
||||||
|
static std::string replaceFirst (const std::string &theString,
|
||||||
|
const std::string &orig,
|
||||||
|
const std::string &repl);
|
||||||
|
|
||||||
|
static HashType hashCode (const std::string &str);
|
||||||
|
|
||||||
|
static std::string makeString (int num);
|
||||||
|
static std::string makeString (bool tf);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __STRING_UTILS_HPP
|
|
@ -0,0 +1,36 @@
|
||||||
|
#include "common/SystemProperties.hpp"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
Properties properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SystemProperties::init(const string& file)
|
||||||
|
{
|
||||||
|
//static string name = "com.ausregistry.cpptoolkit";
|
||||||
|
properties.load(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
string SystemProperties::getProperty(const string &prop)
|
||||||
|
{
|
||||||
|
return properties.getProperty(prop);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string SystemProperties::getProperty(const string& prop, const string& def)
|
||||||
|
{
|
||||||
|
return properties.getProperty(prop, def);
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<pair<string,string> > SystemProperties::getProperties(const string& prefix)
|
||||||
|
{
|
||||||
|
return properties.getProperties(prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SystemProperties::getBooleanProperty(const string& prop, bool def)
|
||||||
|
{
|
||||||
|
return properties.getBooleanProperty(prop, def);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
#ifndef __SYSTEM_PROPERTIES_HPP
|
||||||
|
#define __SYSTEM_PROPERTIES_HPP
|
||||||
|
|
||||||
|
#include "common/Properties.hpp"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides a simple interface to a system properties file.
|
||||||
|
*/
|
||||||
|
class SystemProperties
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/// Initialise the SystemProperties from the the given configuration file.
|
||||||
|
/// @param configFile The path to the configuration file.
|
||||||
|
static void init(const std::string& configFile);
|
||||||
|
|
||||||
|
/// Get a single property value with the given name.
|
||||||
|
/// @param prop The property to retrieve.
|
||||||
|
static std::string getProperty(const std::string& prop);
|
||||||
|
|
||||||
|
/// Get a single property value with the given name.
|
||||||
|
/// @param prop The property to retrieve.
|
||||||
|
static std::string getProperty(const std::string& prop, const std::string& def);
|
||||||
|
|
||||||
|
|
||||||
|
/// Get a set of proerties based upon a key prefix.
|
||||||
|
/// @param prop The property prefix.
|
||||||
|
/// @returns The matching property key and value pairs, or an empty array
|
||||||
|
/// if no key matched.
|
||||||
|
static std::vector<std::pair<std::string,std::string> >
|
||||||
|
getProperties(const std::string& prefix);
|
||||||
|
|
||||||
|
|
||||||
|
/// Get a boolean property. i.e. One that has a value of either "TRUE" or "FALSE"
|
||||||
|
/// @param prop The property.
|
||||||
|
/// @return The sense of the property.
|
||||||
|
static bool getBooleanProperty(const std::string& prop, bool def);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Must not be instantiated.
|
||||||
|
SystemProperties();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __SYSTEM_PROPERTIES_HPP
|
|
@ -0,0 +1,65 @@
|
||||||
|
#ifndef __TEST_HPP
|
||||||
|
#define __TEST_HPP
|
||||||
|
|
||||||
|
#include "common/EPPException.hpp"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
static int g_numErrors = 0;
|
||||||
|
int TEST_errorCount() { return g_numErrors; }
|
||||||
|
|
||||||
|
#define ASSERT_STR_EQ(got, expect) ASSERT_EQ(std::string(got), std::string(expect))
|
||||||
|
|
||||||
|
#define ASSERT(expr) \
|
||||||
|
if (!(expr)) { \
|
||||||
|
g_numErrors++; \
|
||||||
|
std::cerr << __FILE__ << ":" << __LINE__ << ":" << #expr << std::endl;}
|
||||||
|
|
||||||
|
#define ASSERT_EQ(got, expect) \
|
||||||
|
if ((got) != (expect)) \
|
||||||
|
{ g_numErrors++; \
|
||||||
|
std::cerr << __FILE__ << ":" << __LINE__ << ": (" \
|
||||||
|
<< got << " != " << expect \
|
||||||
|
<< ") for (" << #got" == "#expect")" << std::endl; }
|
||||||
|
|
||||||
|
#define ASSERT_NULL(got) \
|
||||||
|
if ((got) != NULL) \
|
||||||
|
{ g_numErrors++; \
|
||||||
|
std::cerr << __FILE__ << ":" << __LINE__ << ": (" \
|
||||||
|
<< got << " != null" \
|
||||||
|
<< ") for (" << #got" == null)" << std::endl; }
|
||||||
|
|
||||||
|
#define ASSERT_NEQ(got, expect) \
|
||||||
|
if ((got) == (expect)) \
|
||||||
|
{ g_numErrors++; \
|
||||||
|
std::cerr << __FILE__ << ":" << __LINE__ << ": (" \
|
||||||
|
<< got << " == " << expect \
|
||||||
|
<< ") for (" << #got" != "#expect")" << std::endl; }
|
||||||
|
|
||||||
|
#define FAIL(msg) std::cerr << __FILE__ << ":" << __LINE__ << ": " << msg << std::endl
|
||||||
|
|
||||||
|
int TEST_run(void (*test)())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
(*test)();
|
||||||
|
}
|
||||||
|
catch (EPPException& e)
|
||||||
|
{
|
||||||
|
std::cerr << "Unexpected EPPException: " << e.getMessage() << std::endl;
|
||||||
|
g_numErrors++;
|
||||||
|
}
|
||||||
|
catch (std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << "Unexpected std::exception: " << e.what() << std::endl;
|
||||||
|
g_numErrors++;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
std::cerr << "Unexpected unknown." << std::endl;
|
||||||
|
g_numErrors++;
|
||||||
|
}
|
||||||
|
return g_numErrors;
|
||||||
|
}
|
||||||
|
#endif // __TEST_HPP
|
|
@ -0,0 +1,86 @@
|
||||||
|
#include "common/SystemProperties.hpp"
|
||||||
|
#include "common/Logger.hpp"
|
||||||
|
#include "common/ErrorPkg.hpp"
|
||||||
|
#include "se/SendSE.hpp"
|
||||||
|
#include "se/ReceiveSE.hpp"
|
||||||
|
#include "se/IPVersion.hpp"
|
||||||
|
#include "se/PostalInfoType.hpp"
|
||||||
|
#include "se/StandardCommandType.hpp"
|
||||||
|
#include "se/AddRemType.hpp"
|
||||||
|
#include "se/StandardObjectType.hpp"
|
||||||
|
#include "se/PeriodUnit.hpp"
|
||||||
|
#include "se/PollOperation.hpp"
|
||||||
|
#include "se/TransferOp.hpp"
|
||||||
|
#include "xml/XMLParser.hpp"
|
||||||
|
#include "xml/XMLInit.hpp"
|
||||||
|
#include <xercesc/util/PlatformUtils.hpp>
|
||||||
|
#include <xalanc/XalanTransformer/XalanTransformer.hpp>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
void initEnumTypes()
|
||||||
|
{
|
||||||
|
// These classes are decendants of EnumType and so have static storage
|
||||||
|
// listing valid values. The init() method must be called to establish
|
||||||
|
// these values.
|
||||||
|
IPVersion::init();
|
||||||
|
PostalInfoType::init();
|
||||||
|
StandardCommandType::init();
|
||||||
|
AddRemType::init();
|
||||||
|
StandardObjectType::init();
|
||||||
|
PeriodUnit::init();
|
||||||
|
PollOperation::init();
|
||||||
|
TransferOp::init();
|
||||||
|
}
|
||||||
|
|
||||||
|
class Init
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Init(const std::string& system_props_file)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// SystemProperties, Logger and ErrorPkg must be initialised in
|
||||||
|
// this order.
|
||||||
|
sigset_t new_set, old_set;
|
||||||
|
sigemptyset(&new_set);
|
||||||
|
sigaddset(&new_set,SIGPIPE);
|
||||||
|
sigprocmask(SIG_BLOCK,&new_set,&old_set);
|
||||||
|
|
||||||
|
SystemProperties::init(system_props_file);
|
||||||
|
Logger::init();
|
||||||
|
ErrorPkg::init();
|
||||||
|
|
||||||
|
|
||||||
|
XMLInit::init();
|
||||||
|
XMLParser::init();
|
||||||
|
XMLWriter::init();
|
||||||
|
ReceiveSE::init();
|
||||||
|
SendSE::init();
|
||||||
|
|
||||||
|
initEnumTypes();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (EPPException& e)
|
||||||
|
{
|
||||||
|
std::cerr << "Toolkit initialisation exception: " << e.getMessage() << std::endl;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
catch (std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << "Toolkit initialisation exception: " << e.what() << std::endl;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // anonymous namepsace
|
||||||
|
|
||||||
|
|
||||||
|
void init(const std::string& system_props_file)
|
||||||
|
{
|
||||||
|
static const Init doInit(system_props_file);
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
#ifndef __INIT_HPP
|
||||||
|
#define __INIT_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
void init(const std::string& system_props_file);
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,28 @@
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
|
||||||
|
CUNIT_INCLUDE = ~/CUnit-2.1-0/include/
|
||||||
|
|
||||||
|
INCLUDE_DIR = -I ${CUNIT_INCLUDE}
|
||||||
|
|
||||||
|
LIBOBJS = boolean.o \
|
||||||
|
config.o \
|
||||||
|
log.o
|
||||||
|
|
||||||
|
OBJS = $(LIBOBJS) test_config.o
|
||||||
|
|
||||||
|
|
||||||
|
LIBS = ~/CUnit-2.1-0/lib/libcunit.a
|
||||||
|
|
||||||
|
DEPS = boolean.h config.h log.h
|
||||||
|
|
||||||
|
%.o: %.c $(DEPS)
|
||||||
|
$(CC) -c $< $(CFLAGS) $(INCLUDE_DIR)
|
||||||
|
|
||||||
|
libConfig.so: $(LIBOBJS)
|
||||||
|
$(CC) -o $@ $^ -shared
|
||||||
|
|
||||||
|
test: $(OBJS)
|
||||||
|
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "boolean.h"
|
||||||
|
|
||||||
|
const char* const bool_str_g[]={
|
||||||
|
"FALSE",
|
||||||
|
"TRUE",
|
||||||
|
NULL
|
||||||
|
};
|
|
@ -0,0 +1,13 @@
|
||||||
|
#ifndef __BOOLEAN_H
|
||||||
|
#define __BOOLEAN_H
|
||||||
|
|
||||||
|
#ifndef TRUE
|
||||||
|
#define TRUE 1
|
||||||
|
#endif /* defined(TRUE) */
|
||||||
|
#ifndef FALSE
|
||||||
|
#define FALSE 0
|
||||||
|
#endif /* defined(FALSE) */
|
||||||
|
extern const char *const bool_str_g[];
|
||||||
|
#define BOOL_STR(x) bool_str_g[x]
|
||||||
|
|
||||||
|
#endif //__BOOLEAN_H
|
|
@ -0,0 +1,512 @@
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "log.h"
|
||||||
|
#include "boolean.h"
|
||||||
|
#include "string.h"
|
||||||
|
#include "mem_debug.h"
|
||||||
|
|
||||||
|
|
||||||
|
static const int KEYS_PER_BLOCK=64;
|
||||||
|
|
||||||
|
|
||||||
|
static char **config_find_entry(config_t *cfg, const char *key);
|
||||||
|
static int config_rebuild_index (config_t *cfg);
|
||||||
|
static int config_iter_seek(config_iter_t *iter);
|
||||||
|
static void config_reset_content(config_t *cfg);
|
||||||
|
|
||||||
|
/* TODO add parsing state info/offsets for better error messages? */
|
||||||
|
/* TODO iff this is an ACTUAL performance problem, could qsort cfg->keys at
|
||||||
|
* completion then bsearch on lookup */
|
||||||
|
static int config_build_index(config_t *cfg)
|
||||||
|
{
|
||||||
|
/* we modify cfg->content, NULL-terminating keys and values */
|
||||||
|
char *c = cfg->content;
|
||||||
|
int pair_num=0;
|
||||||
|
|
||||||
|
/* scan through looking for comments and "key=value\n" strings. */
|
||||||
|
/* blank lines may contain whitespace, which is ignored (and line may be indented) */
|
||||||
|
while (*c!='\0')
|
||||||
|
{
|
||||||
|
if (*c=='\n')
|
||||||
|
{
|
||||||
|
c++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (*c=='#')
|
||||||
|
{
|
||||||
|
if((c=strchr(c, '\n'))==NULL)
|
||||||
|
{
|
||||||
|
real_log("config_build_index: un-terminated comment.\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
c++; /* move past the '\n' */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (isalpha(*c))
|
||||||
|
{
|
||||||
|
/* if we have crossed a multiple of KEY_BLOCK_SIZE keys, grow by another 64. */
|
||||||
|
if (pair_num && pair_num%KEYS_PER_BLOCK==0)
|
||||||
|
{
|
||||||
|
size_t new_size = (pair_num+KEYS_PER_BLOCK)*sizeof(char *);
|
||||||
|
cfg->keys=(char **)realloc_d(cfg->keys,new_size,"config_build_index: cfg->keys"); /* XXX errors */
|
||||||
|
cfg->values=(char **)realloc_d(cfg->values,new_size,"config_build_index: cfg_values");
|
||||||
|
}
|
||||||
|
cfg->keys[pair_num] = c;
|
||||||
|
if((c=strchr(c,'='))==NULL)
|
||||||
|
{
|
||||||
|
real_log("config_build_index: value without '=' found.\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
*c='\0';
|
||||||
|
c++;
|
||||||
|
cfg->values[pair_num] = c;
|
||||||
|
if((c=strchr(c, '\n'))==NULL)
|
||||||
|
{
|
||||||
|
real_log("config_build_index: a value was found that was not terminated by new-line.\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
*c='\0';
|
||||||
|
c++;
|
||||||
|
pair_num++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(isspace(*c))
|
||||||
|
{
|
||||||
|
while(isspace(*c)) c++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
real_log("config_build_index: unexpected char '%c' at offset %d\n", *c, c-cfg->content);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
cfg->num_keys=pair_num;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
config_t *config_open_inmem(
|
||||||
|
const char *data
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int success=FALSE;
|
||||||
|
config_t *cfg=NULL;
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
if ((cfg=(config_t *)malloc_d(sizeof(config_t),"config_open_inmem: config_t"))==NULL
|
||||||
|
|| !memset(cfg,0,sizeof(config_t))
|
||||||
|
|| (cfg->content=strdup_d(data, "config_open_inmem: cfg->content")) == NULL
|
||||||
|
|| (cfg->keys=malloc_d(KEYS_PER_BLOCK*sizeof(char *), "config_open_inmem: cfg->keys"))==NULL
|
||||||
|
|| (cfg->values=malloc_d(KEYS_PER_BLOCK*sizeof(char *), "config_open_inmem: cfg->values"))==NULL)
|
||||||
|
{
|
||||||
|
real_log("config_open_inmem: memory allocation failed for config_t\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!config_build_index(cfg))
|
||||||
|
{
|
||||||
|
real_log("config_open_inmem: failed to build config index\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
cfg->content_bufsz = strlen(data) + 1;
|
||||||
|
success=TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!success)
|
||||||
|
{
|
||||||
|
if (cfg) config_destroy(cfg);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return cfg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
config_t *config_open(
|
||||||
|
const char *file_name
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int sz, success=FALSE;
|
||||||
|
config_t *cfg=NULL;
|
||||||
|
struct stat stats;
|
||||||
|
FILE *file=NULL;
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
if (stat(file_name,&stats)==-1)
|
||||||
|
{
|
||||||
|
real_log("config_open: could not get information for '%s': %s\n", file_name, LOG_ERR_STR(errno));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ((file=fopen(file_name,"r"))==NULL)
|
||||||
|
{
|
||||||
|
real_log("config_open: could not open '%s': %s\n", file_name, LOG_ERR_STR(errno));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ((cfg=(config_t *)malloc_d(sizeof(config_t),"config_open: config_t"))==NULL
|
||||||
|
|| !memset(cfg,0,sizeof(config_t))
|
||||||
|
|| (cfg->content=malloc_d(stats.st_size+1,"config_open: cfg->content"))==NULL
|
||||||
|
|| (cfg->keys=malloc_d(KEYS_PER_BLOCK*sizeof(char *), "config_open: cfg->keys"))==NULL
|
||||||
|
|| (cfg->values=malloc_d(KEYS_PER_BLOCK*sizeof(char *), "config_open: cfg->values"))==NULL)
|
||||||
|
{
|
||||||
|
real_log("config_open: memory allocation failed for config_t\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ((sz=fread(cfg->content,sizeof(char),stats.st_size,file))!=stats.st_size)
|
||||||
|
{
|
||||||
|
real_log("config_open: fread return unexpected length (got %d, expected %d)\n", sz, stats.st_size);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
(cfg->content)[stats.st_size]='\0'; /* terminate file with NULL */
|
||||||
|
cfg->content_bufsz = stats.st_size + 1;
|
||||||
|
if (!config_build_index(cfg))
|
||||||
|
{
|
||||||
|
real_log("config_open: failed to build config index\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
success=TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(file) fclose(file);
|
||||||
|
if(!success)
|
||||||
|
{
|
||||||
|
if (cfg) config_destroy(cfg);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return cfg;
|
||||||
|
}
|
||||||
|
|
||||||
|
void config_destroy(
|
||||||
|
config_t *cfg
|
||||||
|
)
|
||||||
|
{
|
||||||
|
free_d(cfg->keys,"config_destroy: cfg->keys");
|
||||||
|
free_d(cfg->values,"config_destroy: cfg->values");
|
||||||
|
free_d(cfg->content,"config_destroy: cfg->content");
|
||||||
|
free(cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
config_iter_t *config_iter_create(
|
||||||
|
config_t *cfg,
|
||||||
|
const char* prefix
|
||||||
|
)
|
||||||
|
{
|
||||||
|
config_iter_t *iter;
|
||||||
|
iter=(config_iter_t *)malloc_d(sizeof(config_iter_t),"config_iter_create: iter");
|
||||||
|
memset(iter,0,sizeof(config_iter_t));
|
||||||
|
iter->cfg=cfg;
|
||||||
|
if(prefix) iter->prefix=strdup_d(prefix,"config_iter_create: pattern");
|
||||||
|
config_iter_seek(iter);
|
||||||
|
return iter;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int config_iter_next(
|
||||||
|
config_iter_t *iter
|
||||||
|
)
|
||||||
|
{
|
||||||
|
/* if iterator currently valid, increment */
|
||||||
|
if(iter->key!=NULL)
|
||||||
|
{
|
||||||
|
iter->idx++;
|
||||||
|
if (config_iter_seek(iter))
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
/* indicate iter now at end */
|
||||||
|
(iter->key)=(iter->value)=NULL;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void config_iter_destroy(
|
||||||
|
config_iter_t *cfg_iter
|
||||||
|
)
|
||||||
|
{
|
||||||
|
free_d(cfg_iter->prefix,"config_iter_destroy: pattern");
|
||||||
|
free_d(cfg_iter,"config_iter_destroy: cfg_iter");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* returns NULL if string not found, or if key is NULL */
|
||||||
|
char *config_get_str(
|
||||||
|
config_t *cfg,
|
||||||
|
const char *key)
|
||||||
|
{
|
||||||
|
char **entry = config_find_entry(cfg, key);
|
||||||
|
|
||||||
|
if (entry)
|
||||||
|
return strdup_d (*entry, "config_get_str: cfg->values[i]");
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* reallocates space for the config's content buffer, adjusting the
|
||||||
|
* existing size by delta.
|
||||||
|
*/
|
||||||
|
static void config_realloc_content (config_t *cfg, int delta)
|
||||||
|
{
|
||||||
|
cfg->content = realloc_d (cfg->content,
|
||||||
|
cfg->content_bufsz + delta,
|
||||||
|
"config_realloc_content: cfg->content");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Slides the block of memory from 'block' to the end of the content buffer
|
||||||
|
* by dist bytes (may be negative).
|
||||||
|
*/
|
||||||
|
static void config_slide_content (config_t *cfg, char* block, int dist)
|
||||||
|
{
|
||||||
|
size_t block_size = cfg->content_bufsz - (block - cfg->content);
|
||||||
|
|
||||||
|
memmove (block + dist,
|
||||||
|
block,
|
||||||
|
block_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Replaces the entry string with the new_entry string within the
|
||||||
|
* config's content buffer, adjusting the buffer size accordingly.
|
||||||
|
*/
|
||||||
|
void config_replace_entry(config_t *cfg, char *entry, const char *new_entry)
|
||||||
|
{
|
||||||
|
size_t old_length = strlen(entry), new_length = strlen(new_entry);
|
||||||
|
int delta_size = new_length - old_length;
|
||||||
|
|
||||||
|
/* point into the data directly after to the current entry value. */
|
||||||
|
char *next_block = entry + old_length + 1;
|
||||||
|
|
||||||
|
/* We need integer offsets into the buffer, so we can re-find
|
||||||
|
* the right position after realloc() is called.
|
||||||
|
*/
|
||||||
|
size_t next_block_offset = next_block - cfg->content;
|
||||||
|
size_t entry_offset = entry - cfg->content;
|
||||||
|
|
||||||
|
/* The order we do this in depends on whether we're growing
|
||||||
|
* or shrinking the existing key's value. */
|
||||||
|
if (delta_size > 0)
|
||||||
|
{
|
||||||
|
config_realloc_content (cfg, delta_size);
|
||||||
|
|
||||||
|
/* Buffer will have (possibly) moved - point at the (possibly different)
|
||||||
|
* new location */
|
||||||
|
next_block = cfg->content + next_block_offset;
|
||||||
|
|
||||||
|
config_slide_content (cfg, next_block, delta_size);
|
||||||
|
}
|
||||||
|
else if (delta_size < 0)
|
||||||
|
{
|
||||||
|
config_slide_content (cfg, next_block, delta_size);
|
||||||
|
config_realloc_content (cfg, delta_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
cfg->content_bufsz += delta_size;
|
||||||
|
|
||||||
|
entry = cfg->content + entry_offset;
|
||||||
|
memcpy(entry, new_entry, new_length+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* changes the value of an existing key, returning the new value or NULL
|
||||||
|
* if the key doesn't exist.
|
||||||
|
*/
|
||||||
|
char *config_put_str (config_t *cfg,
|
||||||
|
const char *key,
|
||||||
|
const char *new_value)
|
||||||
|
{
|
||||||
|
char **entry = config_find_entry(cfg, key);
|
||||||
|
char *res = NULL;
|
||||||
|
|
||||||
|
if (entry)
|
||||||
|
{
|
||||||
|
config_replace_entry (cfg, *entry, new_value);
|
||||||
|
if (config_rebuild_index (cfg))
|
||||||
|
res = strdup_d (*entry, "config_put_str: value");
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int config_get_enum(
|
||||||
|
config_t *cfg,
|
||||||
|
const char *key,
|
||||||
|
const char* const allowed[],
|
||||||
|
int *val
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int i, success=FALSE;
|
||||||
|
char *str_val;
|
||||||
|
if ((str_val=config_get_str(cfg,key))==NULL) return FALSE;
|
||||||
|
for(i=0;allowed[i]!=NULL;i++)
|
||||||
|
{
|
||||||
|
if(strcmp(str_val,allowed[i])==0)
|
||||||
|
{
|
||||||
|
*val=i;
|
||||||
|
success=TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!success) real_log("config_get_enum: key '%s' has out-of-range enum value '%s'\n", key, str_val);
|
||||||
|
free_d(str_val,"config_get_enum: val");
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* same as config_get_enum, with 'allowed' == {"FALSE", "TRUE", NULL} */
|
||||||
|
int config_get_bool(
|
||||||
|
config_t *cfg,
|
||||||
|
const char *key,
|
||||||
|
int *val)
|
||||||
|
{
|
||||||
|
return config_get_enum(cfg, key, bool_str_g, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return value associated with 'key' through 'val'. returns TRUE if
|
||||||
|
value found and int-like, or FALSE otherwise. */
|
||||||
|
int config_get_int(
|
||||||
|
config_t *cfg,
|
||||||
|
const char *key,
|
||||||
|
int *val)
|
||||||
|
{
|
||||||
|
int res;
|
||||||
|
int success=TRUE;
|
||||||
|
char *str_val;
|
||||||
|
if ((str_val=config_get_str(cfg, key))==NULL)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
/* we expect a single integer term to match */
|
||||||
|
if (sscanf(str_val,"%d",&res)!=1)
|
||||||
|
{
|
||||||
|
real_log("config_get_int: key: '%s' not an integer, instead '%s'\n",key,str_val);
|
||||||
|
success=FALSE;
|
||||||
|
}
|
||||||
|
else *val=res;
|
||||||
|
free_d(str_val, "config_get_int: str_val");
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
int config_get_long (config_t *cfg, const char *key, long *val)
|
||||||
|
{
|
||||||
|
long res;
|
||||||
|
int success=TRUE;
|
||||||
|
char *str_val;
|
||||||
|
if ((str_val=config_get_str(cfg, key))==NULL)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
/* we expect a single integer term to match */
|
||||||
|
if (sscanf(str_val,"%ld",&res)!=1)
|
||||||
|
{
|
||||||
|
real_log("config_get_long: key: '%s' not a long, instead '%s'\n",key,str_val);
|
||||||
|
success=FALSE;
|
||||||
|
}
|
||||||
|
else *val=res;
|
||||||
|
free_d(str_val, "config_get_long: str_val");
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* JR */
|
||||||
|
|
||||||
|
/* Clones a config_t object */
|
||||||
|
config_t *config_clone (const config_t * const other_cfg)
|
||||||
|
{
|
||||||
|
config_t *cfg;
|
||||||
|
|
||||||
|
if ((cfg=(config_t *)malloc_d(sizeof(config_t),"config_clone: config_t"))==NULL
|
||||||
|
|| !memset(cfg,0,sizeof(config_t))
|
||||||
|
|| (cfg->content=malloc_d(other_cfg->content_bufsz,"config_clone: cfg->content"))==NULL
|
||||||
|
|| (cfg->keys=malloc_d(KEYS_PER_BLOCK*sizeof(char *), "config_clone: cfg->keys"))==NULL
|
||||||
|
|| (cfg->values=malloc_d(KEYS_PER_BLOCK*sizeof(char *), "config_clone: cfg->values"))==NULL)
|
||||||
|
{
|
||||||
|
real_log("config_open: memory allocation failed for config_t\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy (cfg->content, other_cfg->content, other_cfg->content_bufsz);
|
||||||
|
if (config_rebuild_index (cfg))
|
||||||
|
{
|
||||||
|
return cfg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
config_destroy (cfg);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int config_save (config_t *cfg,
|
||||||
|
const char *file_name)
|
||||||
|
{
|
||||||
|
int success = FALSE;
|
||||||
|
|
||||||
|
FILE *file = fopen (file_name, "w");
|
||||||
|
|
||||||
|
if (file)
|
||||||
|
{
|
||||||
|
config_reset_content(cfg);
|
||||||
|
|
||||||
|
fputs (cfg->content, file);
|
||||||
|
|
||||||
|
fclose (file);
|
||||||
|
|
||||||
|
config_build_index (cfg);
|
||||||
|
|
||||||
|
success = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* replaces all the '=' and '\n' characters in the content buffer */
|
||||||
|
static void config_reset_content(config_t *cfg)
|
||||||
|
{
|
||||||
|
int i, keyOrValue = 0;
|
||||||
|
char *c = cfg->content;
|
||||||
|
|
||||||
|
for (i = 0; i < cfg->content_bufsz - 1; i++)
|
||||||
|
if (cfg->content[i] == '\0')
|
||||||
|
cfg->content[i] = (keyOrValue = !keyOrValue) ? '=' : '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
static int config_rebuild_index (config_t *cfg)
|
||||||
|
{
|
||||||
|
config_reset_content (cfg);
|
||||||
|
return config_build_index (cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char **config_find_entry(config_t *cfg, const char *key)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (key == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (i = 0; i < cfg->num_keys; i++)
|
||||||
|
if (strcmp (cfg->keys[i], key) == 0)
|
||||||
|
return &(cfg->values[i]);
|
||||||
|
|
||||||
|
real_log ("config_find_entry: key not found '%s'\n", key);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int config_iter_seek(config_iter_t *iter)
|
||||||
|
{
|
||||||
|
config_t *cfg=iter->cfg;
|
||||||
|
int prefix_len=(iter->prefix?strlen(iter->prefix):0);
|
||||||
|
|
||||||
|
while(iter->idx<cfg->num_keys)
|
||||||
|
{
|
||||||
|
if(iter->prefix==NULL
|
||||||
|
||strncmp(cfg->keys[iter->idx],iter->prefix,prefix_len)==0)
|
||||||
|
{
|
||||||
|
iter->key=cfg->keys[iter->idx];
|
||||||
|
iter->value=cfg->values[iter->idx];
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
iter->idx++;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
#ifndef _CONFIG_H
|
||||||
|
#define _CONFIG_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct config_t
|
||||||
|
{
|
||||||
|
int content_bufsz;
|
||||||
|
char *content;
|
||||||
|
char **keys;
|
||||||
|
char **values;
|
||||||
|
int num_keys;
|
||||||
|
} config_t;
|
||||||
|
|
||||||
|
config_t *config_open(const char *file_name);
|
||||||
|
config_t *config_open_inmem(const char *data);
|
||||||
|
void config_destroy(config_t *);
|
||||||
|
|
||||||
|
int config_save(config_t *cfg, const char *file_name);
|
||||||
|
config_t *config_clone(const config_t * const other_cfg);
|
||||||
|
|
||||||
|
/* return value associated with 'key', or NULL if key not found. caller
|
||||||
|
must free returned string */
|
||||||
|
char *config_get_str(config_t *,const char *key);
|
||||||
|
|
||||||
|
/* write a new value to the key and return the value string. */
|
||||||
|
char *config_put_str(config_t *cfg, const char *key, const char *value);
|
||||||
|
|
||||||
|
/* return through 'val' the integer value associated with 'key'. if found and
|
||||||
|
* int-like, return TRUE, else FALSE */
|
||||||
|
int config_get_int(config_t *cfg,const char *key,int* val);
|
||||||
|
int config_get_long(config_t *cfg,const char *key,long* val);
|
||||||
|
|
||||||
|
/* return through 'val' the offset within the list of possible values given by
|
||||||
|
* 'allowed' for the config key 'key'. 'allowed' is NULL terminated. Return TRUE
|
||||||
|
* if key found and value within range, else FALSE. */
|
||||||
|
int config_get_enum(config_t *cfg,const char *key,const char* const allowed[],int *val);
|
||||||
|
|
||||||
|
/* same as config_get_enum, with 'allowed' == {"FALSE", "TRUE", NULL} */
|
||||||
|
int config_get_bool(config_t *cfg,const char *key,int *val);
|
||||||
|
|
||||||
|
typedef struct config_iter_t
|
||||||
|
{
|
||||||
|
char *key;
|
||||||
|
char *value;
|
||||||
|
char *prefix;
|
||||||
|
config_t *cfg;
|
||||||
|
int idx;
|
||||||
|
} config_iter_t;
|
||||||
|
|
||||||
|
config_iter_t *config_iter_create(config_t *,const char* pattern);
|
||||||
|
void config_iter_destroy(config_iter_t *);
|
||||||
|
int config_iter_next(config_iter_t *);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _CONFIG_H */
|
|
@ -0,0 +1,84 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "log.h"
|
||||||
|
#include "boolean.h"
|
||||||
|
|
||||||
|
#define LOG_BUFFER_SIZE 6000
|
||||||
|
static void real_log_again(
|
||||||
|
const char *format,
|
||||||
|
va_list ap
|
||||||
|
);
|
||||||
|
|
||||||
|
/* need a debug flag for this ... */
|
||||||
|
static int g_mylog_enabled = FALSE;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const char *LOG_ERR_STR(int errnum)
|
||||||
|
{
|
||||||
|
/* uses the GNU specific strerror_r which requires a buffer which it
|
||||||
|
* 'might' use. provide one, but make is zero length */
|
||||||
|
char dummy;
|
||||||
|
return strerror_r(errnum, &dummy, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO this is a workaround for proper logging for now
|
||||||
|
// NB: Adds a '\n' to message.
|
||||||
|
void mylog(
|
||||||
|
const char *const format,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (!g_mylog_enabled) return;
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap,format);
|
||||||
|
vfprintf(stderr,format,ap);
|
||||||
|
fprintf(stderr,"\n");
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void real_log(
|
||||||
|
const char *const format,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (!g_mylog_enabled) return;
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap,format);
|
||||||
|
real_log_again(format,ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void real_log_again(
|
||||||
|
const char *format,
|
||||||
|
va_list ap
|
||||||
|
)
|
||||||
|
{
|
||||||
|
char buffer[LOG_BUFFER_SIZE+1];
|
||||||
|
struct timeval tv;
|
||||||
|
struct tm tm;
|
||||||
|
|
||||||
|
gettimeofday(&tv,NULL);
|
||||||
|
gmtime_r(&(tv.tv_sec),&tm);
|
||||||
|
snprintf(buffer,LOG_BUFFER_SIZE,"%d%02d%02d %02d:%02d:%02d.%03lu %s",1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec,tv.tv_usec/1000,format);
|
||||||
|
vfprintf(stderr,buffer,ap);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
#ifndef __LOG_H
|
||||||
|
#define __LOG_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const char *LOG_ERR_STR(int errnum);
|
||||||
|
|
||||||
|
void mylog(
|
||||||
|
const char *const format,
|
||||||
|
...
|
||||||
|
);
|
||||||
|
|
||||||
|
void real_log(
|
||||||
|
const char *const format,
|
||||||
|
...
|
||||||
|
);
|
||||||
|
|
||||||
|
//critical loggin needs to be handled by the thread itself otherwsie we risk exiting before the log is written out
|
||||||
|
//XXX think about making an on exit to flush and close log files otherwise messages might get lost
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif //__LOG_H
|
|
@ -0,0 +1,4 @@
|
||||||
|
#define realloc_d(x,y,z) realloc(x,y)
|
||||||
|
#define malloc_d(x,y) malloc(x)
|
||||||
|
#define free_d(x,y) free(x)
|
||||||
|
#define strdup_d(x,y) strdup(x)
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,17 @@
|
||||||
|
com.ausregistry.cpptoolkit.file=log
|
||||||
|
|
||||||
|
com.ausregistry.cpptoolkit.debug.level=FINEST
|
||||||
|
|
||||||
|
com.ausregistry.cpptoolkit.support.level=FINEST
|
||||||
|
|
||||||
|
com.ausregistry.cpptoolkit.se.maint.level=FINEST
|
||||||
|
com.ausregistry.cpptoolkit.se.support.level=FINEST
|
||||||
|
com.ausregistry.cpptoolkit.se.user.level=FINEST
|
||||||
|
com.ausregistry.cpptoolkit.se.debug.level=FINEST
|
||||||
|
|
||||||
|
com.ausregistry.cpptoolkit.session.debug.level=FINEST
|
||||||
|
com.ausregistry.cpptoolkit.session.user.level=FINEST
|
||||||
|
com.ausregistry.cpptoolkit.session.support.level=FINEST
|
||||||
|
|
||||||
|
com.ausregistry.cpptoolkit.xml.debug.level=FINEST
|
||||||
|
com.ausregistry.cpptoolkit.xml.user.level=FINEST
|
|
@ -0,0 +1,17 @@
|
||||||
|
# These are site-specific properties used by the test suites.
|
||||||
|
# The environment variable EPP_SITE_PROPERTIES can be set to the path of a localised
|
||||||
|
# file for the following variables. The TestEnvironment class will use this env var
|
||||||
|
# to find the specialised site properties.
|
||||||
|
#
|
||||||
|
epp.client.clID=<<client id>>
|
||||||
|
epp.client.password=<<password>>
|
||||||
|
|
||||||
|
epp.server.hostname=<<ip address of EPP server>>
|
||||||
|
epp.server.port=<<port number for EPP server>>
|
||||||
|
|
||||||
|
# Relative paths will be interpreted relative to the cwd of the process using
|
||||||
|
# the TestEnvironment instance.
|
||||||
|
ssl.privatekey.location=<<this client's PEM format private key>>
|
||||||
|
ssl.privatekey.pass=<<password protecting the private key>>
|
||||||
|
ssl.cert.location=<<certificate for the private key>>
|
||||||
|
ssl.ca.location=<<certifying auth public key(s)>>
|
|
@ -0,0 +1,107 @@
|
||||||
|
# This may be either exactly "TRUE" or "FALSE". Setting this to TRUE will
|
||||||
|
# enable strict inbound and outbound schema validations. TRUE is the
|
||||||
|
# recommended setting.
|
||||||
|
xml.validation.enable=TRUE
|
||||||
|
|
||||||
|
# This file contains the text for the majority of the error and information
|
||||||
|
# messages used by the toolkit.
|
||||||
|
#
|
||||||
|
epp.client.messages.file=resources/messages.properties
|
||||||
|
|
||||||
|
# Path to the definition of the logging 'sinks' and their respective
|
||||||
|
# sensitivity. See the shipped version of this file for more details and
|
||||||
|
# comments.
|
||||||
|
#
|
||||||
|
logging.config.file=etc/logging.conf
|
||||||
|
|
||||||
|
# Each URN and entity pair must be separated by a single space character. All
|
||||||
|
# keys that have the prefix "xml.schema.location." will be considered as a
|
||||||
|
# schema location hints.
|
||||||
|
#
|
||||||
|
xml.schema.location=urn:ietf:params:xml:ns:eppcom-1.0 resources/eppcom-1.0.xsd
|
||||||
|
xml.schema.location=urn:ietf:params:xml:ns:epp-1.0 resources/epp-1.0.xsd
|
||||||
|
xml.schema.location=urn:ietf:params:xml:ns:host-1.0 resources/host-1.0.xsd
|
||||||
|
xml.schema.location=urn:ietf:params:xml:ns:contact-1.0 resources/contact-1.0.xsd
|
||||||
|
xml.schema.location=urn:ietf:params:xml:ns:domain-1.0 resources/domain-1.0.xsd
|
||||||
|
xml.schema.location=urn:ietf:params:xml:ns:e164epp-1.0 resources/e164epp-1.0.xsd
|
||||||
|
xml.schema.location=urn:ietf:params:xml:ns:secDNS-1.1 resources/secDNS-1.1.xsd
|
||||||
|
xml.schema.location=urn:au:params:xml:ns:auext-1.0 resources/auext-1.0.xsd
|
||||||
|
xml.schema.location=urn:X-au:params:xml:ns:auext-1.1 resources/auext-1.1.xsd
|
||||||
|
xml.schema.location=urn:X-au:params:xml:ns:audomain-1.0 resources/audomain-1.0.xsd
|
||||||
|
#xml.schema.location=urn:X-ae:params:xml:ns:aeext-1.0 resources/aeext-1.0.xsd
|
||||||
|
#xml.schema.location=urn:X-ae:params:xml:ns:aedomain-1.0 resources/aedomain-1.0.xsd
|
||||||
|
xml.schema.location=urn:X-ar:params:xml:ns:arext-1.0 resources/arext-1.0.xsd
|
||||||
|
xml.schema.location=urn:X-ar:params:xml:ns:ardomain-1.0 resources/ardomain-1.0.xsd
|
||||||
|
xml.schema.location=urn:X-ar:params:xml:ns:sync-1.0 resources/sync-1.0.xsd
|
||||||
|
xml.schema.location=urn:X-ar:params:xml:ns:kv-1.0 resources/kv-1.0.xsd
|
||||||
|
xml.schema.location=urn:X-ar:params:xml:ns:registrant-1.0 resources/registrant-1.0.xsd
|
||||||
|
|
||||||
|
# Server hostname or IP address (textual representation).
|
||||||
|
epp.server.hostname=HOSTNAME
|
||||||
|
|
||||||
|
# EPP login data.
|
||||||
|
epp.client.clID=MYUSER
|
||||||
|
epp.client.password=MYPASS
|
||||||
|
epp.client.options.lang=en
|
||||||
|
|
||||||
|
# The maximum number of sessions which the session pool will allow to open.
|
||||||
|
epp.client.session.count.max=3
|
||||||
|
|
||||||
|
# TLS resources.
|
||||||
|
ssl.privatekey.location=<<absolute filename of private key>>
|
||||||
|
ssl.cert.location=<<absolute filename of X509 certificate containing public key>>
|
||||||
|
ssl.ca.location=<<absolute filename of Certificate Authority file>>
|
||||||
|
ssl.privatekey.pass=<<private key password/passphrase>>
|
||||||
|
|
||||||
|
# Parameters fixed for a given EPP specification.
|
||||||
|
epp.server.port=700
|
||||||
|
epp.client.options.version=1.0
|
||||||
|
ssl.protocol=TLSv1
|
||||||
|
|
||||||
|
# Request management of these objects at login
|
||||||
|
xml.uri.obj.host=urn:ietf:params:xml:ns:host-1.0
|
||||||
|
xml.uri.obj.contact=urn:ietf:params:xml:ns:contact-1.0
|
||||||
|
xml.uri.obj.domain=urn:ietf:params:xml:ns:domain-1.0
|
||||||
|
|
||||||
|
# Request use of these extensions at login
|
||||||
|
xml.uri.ext.e164epp=urn:ietf:params:xml:ns:e164epp-1.0
|
||||||
|
#xml.uri.ext.auext1=urn:X-au:params:xml:ns:auext-1.0
|
||||||
|
xml.uri.ext.auext=urn:X-au:params:xml:ns:auext-1.1
|
||||||
|
xml.uri.ext.audomain=urn:X-au:params:xml:ns:audomain-1.0
|
||||||
|
xml.uri.ext.arext=urn:X-ar:params:xml:ns:arext-1.0
|
||||||
|
xml.uri.ext.ardomain=urn:X-ar:params:xml:ns:ardomain-1.0
|
||||||
|
xml.uri.ext.sync=urn:X-ar:params:xml:ns:sync-1.0
|
||||||
|
xml.uri.ext.kv=urn:X-ar:params:xml:ns:kv-1.0
|
||||||
|
xml.uri.ext.registrant=urn:X-ar:params:xml:ns:registrant-1.0
|
||||||
|
xml.uri.ext.secDNS=urn:ietf:params:xml:ns:secDNS-1.1
|
||||||
|
|
||||||
|
# Command Rate Limits
|
||||||
|
# Match these to the server's published values for optimal performance.
|
||||||
|
epp.server.command.limit.check=100
|
||||||
|
epp.server.command.limit.info=100
|
||||||
|
epp.server.command.limit.transfer=100
|
||||||
|
epp.server.command.limit.create=100
|
||||||
|
epp.server.command.limit.delete=100
|
||||||
|
epp.server.command.limit.update=100
|
||||||
|
epp.server.command.limit.renew=100
|
||||||
|
epp.server.command.limit.unrenew=100
|
||||||
|
epp.server.command.limit.undelete=100
|
||||||
|
epp.server.command.limit.policyDelete=100
|
||||||
|
epp.server.command.limit.policyUndelete=100
|
||||||
|
epp.server.command.limit.registrantTransfer=100
|
||||||
|
|
||||||
|
# The maximum time spent waiting for notification that a session has been
|
||||||
|
# returned to the pool (in milliseconds). There shouldn't be any reason to
|
||||||
|
# change this value.
|
||||||
|
thread.wait.timeout=120000
|
||||||
|
|
||||||
|
# The session idle time after which the server will disconnect a client (in
|
||||||
|
# milliseconds). This value should be the same as that published by the
|
||||||
|
# server.
|
||||||
|
net.server.timeout=600000
|
||||||
|
|
||||||
|
# The effective session idle time after which the toolkit should consider a
|
||||||
|
# session inactive and close it (in milliseconds). This only makes a
|
||||||
|
# difference if a keep-alive thread is running.
|
||||||
|
net.client.timeout=12000000
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<schema targetNamespace="urn:X-ae:params:xml:ns:aedomain-1.0"
|
||||||
|
xmlns:aeDomain="urn:X-ae:params:xml:ns:aedomain-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
|
||||||
|
xmlns:aeext="urn:X-ae:params:xml:ns:aeext-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:domain-1.0"
|
||||||
|
schemaLocation="domain-1.0.xsd"/>
|
||||||
|
<import namespace="urn:X-ae:params:xml:ns:aeext-1.0" schemaLocation="aeext-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
.ae Domain Extensions to the Extensible
|
||||||
|
Provisioning Protocol v1.0. schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework command elements.
|
||||||
|
-->
|
||||||
|
<element name="registrantTransfer"
|
||||||
|
type="aeDomain:registrantTransferType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework response elements.
|
||||||
|
-->
|
||||||
|
<element name="rtrnData" type="aeDomain:rtrnDataType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Type definitions.
|
||||||
|
-->
|
||||||
|
<complexType name="registrantTransferType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
<element name="curExpDate" type="date" minOccurs="1"/>
|
||||||
|
<element name="period" type="domain:periodType" minOccurs="0"/>
|
||||||
|
<element name="aeProperties" type="aeDomain:aePropertiesType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
<element name="explanation" type="aeext:explanationType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
the .ae extension domain properties
|
||||||
|
-->
|
||||||
|
<complexType name="aePropertiesType">
|
||||||
|
<sequence>
|
||||||
|
<element name="registrantName" type="eppcom:labelType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
<element name="registrantID" type="aeext:registrantIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="eligibilityType" type="aeext:eligType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
<element name="eligibilityName" type="eppcom:labelType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="eligibilityID" type="aeext:eligibilityIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="policyReason" type="aeext:policyNumType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="rtrnDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
<element name="exDate" type="dateTime" minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
||||||
|
|
|
@ -0,0 +1,196 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:X-ae:params:xml:ns:aeext-1.0"
|
||||||
|
xmlns:aeext="urn:X-ae:params:xml:ns:aeext-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="epp-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
.ae Extensions to the
|
||||||
|
Extensible Provisioning Protocol v1.0 schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework elements.
|
||||||
|
-->
|
||||||
|
<element name="command" type="aeext:commandType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension type definitions.
|
||||||
|
-->
|
||||||
|
<complexType name="commandType">
|
||||||
|
<sequence>
|
||||||
|
<choice>
|
||||||
|
<element name="registrantTransfer" type="epp:readWriteType"/>
|
||||||
|
</choice>
|
||||||
|
<element name="clTRID" type="epp:trIDStringType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Command-response framework extension elements.
|
||||||
|
-->
|
||||||
|
<element name="create" type="aeext:createType"/>
|
||||||
|
<element name="update" type="aeext:updateType"/>
|
||||||
|
<element name="infData" type="aeext:infDataType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
.ae update command extension
|
||||||
|
-->
|
||||||
|
<complexType name="updateType">
|
||||||
|
<sequence>
|
||||||
|
<element name="aeProperties" type="aeext:aePropertiesType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
<element name="explanation" type="aeext:explanationType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
.ae create command extension
|
||||||
|
-->
|
||||||
|
<complexType name="createType">
|
||||||
|
<sequence>
|
||||||
|
<element name="aeProperties" type="aeext:aePropertiesType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
.ae info response extension
|
||||||
|
-->
|
||||||
|
<complexType name="infDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="aeProperties" type="aeext:aePropertiesType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
the .ae extension domain properties
|
||||||
|
-->
|
||||||
|
<complexType name="aePropertiesType">
|
||||||
|
<sequence>
|
||||||
|
<element name="registrantName" type="eppcom:labelType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
<element name="registrantID" type="aeext:registrantIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="eligibilityType" type="aeext:eligType"
|
||||||
|
minOccurs="1"/>
|
||||||
|
<element name="eligibilityName" type="eppcom:labelType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="eligibilityID" type="aeext:eligibilityIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="policyReason" type="aeext:policyNumType" minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
the explanation type
|
||||||
|
-->
|
||||||
|
<simpleType name="explanationType">
|
||||||
|
<restriction base="normalizedString">
|
||||||
|
<maxLength value="1000"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
registrant id type is used for registrantID
|
||||||
|
-->
|
||||||
|
<complexType name="registrantIDType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute name="type" type="aeext:registrantAEIdType"
|
||||||
|
use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
eligibility id type is used for eligibilityID
|
||||||
|
-->
|
||||||
|
<complexType name="eligibilityIDType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute name="type" type="aeext:eligibilityAEIdType"
|
||||||
|
use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
enumeration of valid registrant ID types for the .ae namespace
|
||||||
|
-->
|
||||||
|
<simpleType name="registrantAEIdType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="Trade License"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
enumeration of valid eligibility ID types for the .ae namespace
|
||||||
|
-->
|
||||||
|
<simpleType name="eligibilityAEIdType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="Trademark"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
enumeration of valid Eligibility Types for the .ae namespace
|
||||||
|
-->
|
||||||
|
<simpleType name="eligType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="Trade License"/>
|
||||||
|
<enumeration value="Freezone Trade License"/>
|
||||||
|
<enumeration value="Trademark"/>
|
||||||
|
<enumeration value="Freezone Trademark"/>
|
||||||
|
<enumeration value="Trade License (IT)"/>
|
||||||
|
<enumeration value="Freezone Trade License (IT)"/>
|
||||||
|
<enumeration value="Trademark (IT)"/>
|
||||||
|
<enumeration value="Freezone Trademark (IT)"/>
|
||||||
|
<enumeration value="Legacy"/>
|
||||||
|
<enumeration value="Legacy - Approved"/>
|
||||||
|
<enumeration value="Citizen"/>
|
||||||
|
<enumeration value="Permanent Resident"/>
|
||||||
|
<enumeration value="Sporting Organisation"/>
|
||||||
|
<enumeration value="Charitable Organisation"/>
|
||||||
|
<enumeration value="Religious Organisation"/>
|
||||||
|
<enumeration value="University"/>
|
||||||
|
<enumeration value="Technical College"/>
|
||||||
|
<enumeration value="School"/>
|
||||||
|
<enumeration value="Academy"/>
|
||||||
|
<enumeration value="Government Approved"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Policy reason numbers are left unassigned to a meaning to promote
|
||||||
|
flexibility of policy application. The range is also left more
|
||||||
|
open than is strictly known at the time of writing in order to
|
||||||
|
reduce the need for redistribution of an updated version of this
|
||||||
|
schema should the supported policy numbers change at some time in
|
||||||
|
the future.
|
||||||
|
-->
|
||||||
|
<simpleType name="policyNumType">
|
||||||
|
<restriction base="integer">
|
||||||
|
<minInclusive value="1"/>
|
||||||
|
<maxInclusive value="99"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:X-ar:params:xml:ns:ardomain-1.0"
|
||||||
|
xmlns:arDomain="urn:X-ar:params:xml:ns:ardomain-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
AusRegistry Domain Extensions to the Extensible
|
||||||
|
Provisioning Protocol v1.0. schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework command elements.
|
||||||
|
-->
|
||||||
|
<element name="unrenew" type="arDomain:unrenewType"/>
|
||||||
|
<element name="undelete" type="arDomain:undeleteType"/>
|
||||||
|
<element name="policyDelete" type="arDomain:policyDeleteType"/>
|
||||||
|
<element name="policyUndelete" type="arDomain:policyUndeleteType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework response elements.
|
||||||
|
-->
|
||||||
|
<element name="urenData" type="arDomain:urenDataType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Type definitions.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<complexType name="unrenewType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="curExpDate" type="date"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="undeleteType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="policyDeleteType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="reason" type="arDomain:reasonType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="reasonType">
|
||||||
|
<restriction base="normalizedString">
|
||||||
|
<maxLength value="1000"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<complexType name="policyUndeleteType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="urenDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
<element name="exDate" type="dateTime" minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:X-ar:params:xml:ns:arext-1.0"
|
||||||
|
xmlns:arext="urn:X-ar:params:xml:ns:arext-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
schemaLocation="epp-1.0.xsd"/>
|
||||||
|
|
||||||
|
<element name="command" type="arext:commandType"/>
|
||||||
|
|
||||||
|
<complexType name="commandType">
|
||||||
|
<sequence>
|
||||||
|
<choice>
|
||||||
|
<element name="unrenew" type="epp:readWriteType"/>
|
||||||
|
<element name="undelete" type="epp:readWriteType"/>
|
||||||
|
<element name="policyDelete" type="epp:readWriteType"/>
|
||||||
|
<element name="policyUndelete" type="epp:readWriteType"/>
|
||||||
|
</choice>
|
||||||
|
<element name="clTRID" type="epp:trIDStringType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
</schema>
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:X-au:params:xml:ns:audomain-1.0"
|
||||||
|
xmlns:auDomain="urn:X-au:params:xml:ns:audomain-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
|
||||||
|
xmlns:auext="urn:X-au:params:xml:ns:auext-1.1"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:domain-1.0" schemaLocation="domain-1.0.xsd"/>
|
||||||
|
<import namespace="urn:X-au:params:xml:ns:auext-1.1" schemaLocation="auext-1.1.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
.au Domain Extensions to the Extensible
|
||||||
|
Provisioning Protocol v1.0. schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework command elements.
|
||||||
|
-->
|
||||||
|
<element name="registrantTransfer" type="auDomain:registrantTransferType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework response elements.
|
||||||
|
-->
|
||||||
|
<element name="rtrnData" type="auDomain:rtrnDataType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Type definitions.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<complexType name="registrantTransferType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
<element name="curExpDate" type="date" minOccurs="1"/>
|
||||||
|
<element name="period" type="domain:periodType" minOccurs="0"/>
|
||||||
|
<element name="auProperties" type="auDomain:auPropertiesType" minOccurs="1"/>
|
||||||
|
<element name="explanation" type="auext:explanationType" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
the .au extension domain properties
|
||||||
|
-->
|
||||||
|
<complexType name="auPropertiesType">
|
||||||
|
<sequence>
|
||||||
|
<element name="registrantName" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
<element name="registrantID" type="auext:registrantIDType" minOccurs="0"/>
|
||||||
|
<element name="eligibilityType" type="auext:eligType" minOccurs="1"/>
|
||||||
|
<element name="eligibilityName" type="eppcom:labelType" minOccurs="0"/>
|
||||||
|
<element name="eligibilityID" type="auext:eligibilityIDType" minOccurs="0"/>
|
||||||
|
<element name="policyReason" type="auext:policyNumType" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="rtrnDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
<element name="exDate" type="dateTime" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,176 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:au:params:xml:ns:auext-1.0"
|
||||||
|
xmlns:auext="urn:au:params:xml:ns:auext-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
.au Extensions to the Extensible Provisioning Protocol v1.0.
|
||||||
|
schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
au element for use in the extensions tag
|
||||||
|
-->
|
||||||
|
<element name="extensionAU" type="auext:extensionAU_type"/>
|
||||||
|
<complexType name="extensionAU_type">
|
||||||
|
<choice>
|
||||||
|
<element name="update" type="auext:extensionAUUpdate_type"/>
|
||||||
|
<element name="create" type="auext:extensionAUCreate_type"/>
|
||||||
|
<element name="info" type="auext:extensionAUInfo_type"/>
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
.au update command extension
|
||||||
|
-->
|
||||||
|
<complexType name="extensionAUUpdate_type">
|
||||||
|
<sequence>
|
||||||
|
<element name="registrantName" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
.au create command extension
|
||||||
|
-->
|
||||||
|
<complexType name="extensionAUCreate_type">
|
||||||
|
<sequence>
|
||||||
|
<element name="registrantName" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
<element name="registrantID" type="auext:registrantIDType" minOccurs="0"/>
|
||||||
|
<element name="eligibilityType" type="auext:eligType" minOccurs="1"/>
|
||||||
|
<element name="eligibilityName" type="eppcom:labelType" minOccurs="0"/>
|
||||||
|
<element
|
||||||
|
name="eligibilityID" type="auext:eligibilityIDType" minOccurs="0"/>
|
||||||
|
<element name="policyReason" type="auext:policyNumType" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
.au info response extension
|
||||||
|
-->
|
||||||
|
<complexType name="extensionAUInfo_type">
|
||||||
|
<sequence>
|
||||||
|
<element name="registrantName" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
<element name="registrantID" type="auext:registrantIDType" minOccurs="0"/>
|
||||||
|
<element name="eligibilityType" type="auext:eligType" minOccurs="1"/>
|
||||||
|
<element name="eligibilityName" type="eppcom:labelType" minOccurs="0"/>
|
||||||
|
<element
|
||||||
|
name="eligibilityID" type="auext:eligibilityIDType" minOccurs="0"/>
|
||||||
|
<element name="policyReason" type="auext:policyNumType" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
registrant id type is used for registrantID
|
||||||
|
-->
|
||||||
|
<complexType name="registrantIDType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute
|
||||||
|
name="type" type="auext:registrant_au_idType" use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
eligibility id type is used for eligibilityID
|
||||||
|
-->
|
||||||
|
<complexType name="eligibilityIDType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute
|
||||||
|
name="type" type="auext:eligibility_au_idType" use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
enumeration of valid registrant ID types for the .au namespace
|
||||||
|
-->
|
||||||
|
<simpleType name="registrant_au_idType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="ACN"/>
|
||||||
|
<enumeration value="ABN"/>
|
||||||
|
<enumeration value="OTHER"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
enumeration of valid eligibility ID types for the .au namespace
|
||||||
|
-->
|
||||||
|
<simpleType name="eligibility_au_idType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="ACN"/>
|
||||||
|
<enumeration value="ABN"/>
|
||||||
|
<enumeration value="VIC BN"/>
|
||||||
|
<enumeration value="NSW BN"/>
|
||||||
|
<enumeration value="SA BN"/>
|
||||||
|
<enumeration value="NT BN"/>
|
||||||
|
<enumeration value="WA BN"/>
|
||||||
|
<enumeration value="TAS BN"/>
|
||||||
|
<enumeration value="ACT BN"/>
|
||||||
|
<enumeration value="QLD BN"/>
|
||||||
|
<enumeration value="TM"/>
|
||||||
|
<enumeration value="OTHER"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
enumeration of valid Eligibility Types for the .au namespace
|
||||||
|
-->
|
||||||
|
<simpleType name="eligType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="Charity"/>
|
||||||
|
<enumeration value="Child Care Centre"/>
|
||||||
|
<enumeration value="Citizen/Resident"/>
|
||||||
|
<enumeration value="Club"/>
|
||||||
|
<enumeration value="Commercial Statutory Body"/>
|
||||||
|
<enumeration value="Company"/>
|
||||||
|
<enumeration value="Government School"/>
|
||||||
|
<enumeration value="Higher Education Institution"/>
|
||||||
|
<enumeration value="Incorporated Association"/>
|
||||||
|
<enumeration value="Industry Body"/>
|
||||||
|
<enumeration value="National Body"/>
|
||||||
|
<enumeration value="Non-Government School"/>
|
||||||
|
<enumeration value="Non-profit Organisation"/>
|
||||||
|
<enumeration value="Other"/>
|
||||||
|
<enumeration value="Partnership"/>
|
||||||
|
<enumeration value="Pending TM Owner"/>
|
||||||
|
<enumeration value="Political Party"/>
|
||||||
|
<enumeration value="Pre-school"/>
|
||||||
|
<enumeration value="Registered Business"/>
|
||||||
|
<enumeration value="Religious/Church Group"/>
|
||||||
|
<enumeration value="Research Organisation"/>
|
||||||
|
<enumeration value="Sole Trader"/>
|
||||||
|
<enumeration value="Trade Union"/>
|
||||||
|
<enumeration value="Trademark Owner"/>
|
||||||
|
<enumeration value="Training Organisation"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
policy numbers can be allocated up to 106. Less than the max number
|
||||||
|
of policy values may be valed in the .au registry. This will be handled
|
||||||
|
by registry command validation. (this is done so that a new schema does
|
||||||
|
not have to be released each time the policy reasons are modified)
|
||||||
|
-->
|
||||||
|
<simpleType name="policyNumType">
|
||||||
|
<restriction base="integer">
|
||||||
|
<minInclusive value="1"/>
|
||||||
|
<maxInclusive value="106"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,201 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:X-au:params:xml:ns:auext-1.1"
|
||||||
|
xmlns:auext="urn:X-au:params:xml:ns:auext-1.1"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="epp-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
.au Extensions to the
|
||||||
|
Extensible Provisioning
|
||||||
|
Protocol v1.1 schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework elements.
|
||||||
|
-->
|
||||||
|
<element name="command" type="auext:commandType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension type definitions.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<complexType name="commandType">
|
||||||
|
<sequence>
|
||||||
|
<choice>
|
||||||
|
<element name="registrantTransfer" type="epp:readWriteType"/>
|
||||||
|
</choice>
|
||||||
|
<element name="clTRID" type="epp:trIDStringType" minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Command-response framework extension elements.
|
||||||
|
-->
|
||||||
|
<element name="create" type="auext:createType"/>
|
||||||
|
<element name="update" type="auext:updateType"/>
|
||||||
|
<element name="infData" type="auext:infDataType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
.au update command extension
|
||||||
|
-->
|
||||||
|
<complexType name="updateType">
|
||||||
|
<sequence>
|
||||||
|
<element name="auProperties" type="auext:auPropertiesType" minOccurs="1"/>
|
||||||
|
<element name="explanation" type="auext:explanationType" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
.au create command extension
|
||||||
|
-->
|
||||||
|
<complexType name="createType">
|
||||||
|
<sequence>
|
||||||
|
<element name="auProperties" type="auext:auPropertiesType" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
.au info response extension
|
||||||
|
-->
|
||||||
|
<complexType name="infDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="auProperties" type="auext:auPropertiesType" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
the .au extension domain properties
|
||||||
|
-->
|
||||||
|
<complexType name="auPropertiesType">
|
||||||
|
<sequence>
|
||||||
|
<element name="registrantName" type="eppcom:labelType" minOccurs="1"/>
|
||||||
|
<element name="registrantID" type="auext:registrantIDType" minOccurs="0"/>
|
||||||
|
<element name="eligibilityType" type="auext:eligType" minOccurs="1"/>
|
||||||
|
<element name="eligibilityName" type="eppcom:labelType" minOccurs="0"/>
|
||||||
|
<element name="eligibilityID" type="auext:eligibilityIDType" minOccurs="0"/>
|
||||||
|
<element name="policyReason" type="auext:policyNumType" minOccurs="1"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
the explanation type
|
||||||
|
-->
|
||||||
|
<simpleType name="explanationType">
|
||||||
|
<restriction base="normalizedString">
|
||||||
|
<maxLength value="1000"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
registrant id type is used for registrantID
|
||||||
|
-->
|
||||||
|
<complexType name="registrantIDType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute name="type" type="auext:registrantAUIdType" use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
eligibility id type is used for eligibilityID
|
||||||
|
-->
|
||||||
|
<complexType name="eligibilityIDType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute name="type" type="auext:eligibilityAUIdType" use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
enumeration of valid registrant ID types for the .au namespace
|
||||||
|
-->
|
||||||
|
<simpleType name="registrantAUIdType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="ACN"/>
|
||||||
|
<enumeration value="ABN"/>
|
||||||
|
<enumeration value="OTHER"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
enumeration of valid eligibility ID types for the .au namespace
|
||||||
|
-->
|
||||||
|
<simpleType name="eligibilityAUIdType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="ACN"/>
|
||||||
|
<enumeration value="ABN"/>
|
||||||
|
<enumeration value="VIC BN"/>
|
||||||
|
<enumeration value="NSW BN"/>
|
||||||
|
<enumeration value="SA BN"/>
|
||||||
|
<enumeration value="NT BN"/>
|
||||||
|
<enumeration value="WA BN"/>
|
||||||
|
<enumeration value="TAS BN"/>
|
||||||
|
<enumeration value="ACT BN"/>
|
||||||
|
<enumeration value="QLD BN"/>
|
||||||
|
<enumeration value="TM"/>
|
||||||
|
<enumeration value="OTHER"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
enumeration of valid Eligibility Types for the .au namespace
|
||||||
|
-->
|
||||||
|
<simpleType name="eligType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="Charity"/>
|
||||||
|
<enumeration value="Child Care Centre"/>
|
||||||
|
<enumeration value="Citizen/Resident"/>
|
||||||
|
<enumeration value="Club"/>
|
||||||
|
<enumeration value="Commercial Statutory Body"/>
|
||||||
|
<enumeration value="Company"/>
|
||||||
|
<enumeration value="Government School"/>
|
||||||
|
<enumeration value="Higher Education Institution"/>
|
||||||
|
<enumeration value="Incorporated Association"/>
|
||||||
|
<enumeration value="Industry Body"/>
|
||||||
|
<enumeration value="National Body"/>
|
||||||
|
<enumeration value="Non-Government School"/>
|
||||||
|
<enumeration value="Non-profit Organisation"/>
|
||||||
|
<enumeration value="Other"/>
|
||||||
|
<enumeration value="Partnership"/>
|
||||||
|
<enumeration value="Pending TM Owner"/>
|
||||||
|
<enumeration value="Political Party"/>
|
||||||
|
<enumeration value="Pre-school"/>
|
||||||
|
<enumeration value="Registered Business"/>
|
||||||
|
<enumeration value="Religious/Church Group"/>
|
||||||
|
<enumeration value="Research Organisation"/>
|
||||||
|
<enumeration value="Sole Trader"/>
|
||||||
|
<enumeration value="Trade Union"/>
|
||||||
|
<enumeration value="Trademark Owner"/>
|
||||||
|
<enumeration value="Training Organisation"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
policy numbers can be allocated up to 106. Less than the max number
|
||||||
|
of policy values may be valed in the .au registry. This will be handled
|
||||||
|
by registry command validation. (this is done so that a new schema does
|
||||||
|
not have to be released each time the policy reasons are modified)
|
||||||
|
-->
|
||||||
|
<simpleType name="policyNumType">
|
||||||
|
<restriction base="integer">
|
||||||
|
<minInclusive value="1"/>
|
||||||
|
<maxInclusive value="106"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,388 @@
|
||||||
|
<schema targetNamespace="urn:ietf:params:xml:ns:contact-1.0"
|
||||||
|
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
|
||||||
|
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
schemaLocation="epp-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Extensible Provisioning Protocol v1.0
|
||||||
|
contact provisioning schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements found in EPP commands.
|
||||||
|
-->
|
||||||
|
<element name="check" type="contact:mIDType"/>
|
||||||
|
<element name="create" type="contact:createType"/>
|
||||||
|
<element name="delete" type="contact:sIDType"/>
|
||||||
|
<element name="info" type="contact:authIDType"/>
|
||||||
|
<element name="transfer" type="contact:authIDType"/>
|
||||||
|
<element name="update" type="contact:updateType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Utility types.
|
||||||
|
-->
|
||||||
|
<simpleType name="ccType">
|
||||||
|
<restriction base="token">
|
||||||
|
<length value="2"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<complexType name="e164Type">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="contact:e164StringType">
|
||||||
|
<attribute name="x" type="token"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="e164StringType">
|
||||||
|
<restriction base="token">
|
||||||
|
<pattern value="(\+[0-9]{1,3}\.[0-9]{1,14})?"/>
|
||||||
|
<maxLength value="17"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<simpleType name="pcType">
|
||||||
|
<restriction base="token">
|
||||||
|
<maxLength value="16"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<simpleType name="postalLineType">
|
||||||
|
<restriction base="normalizedString">
|
||||||
|
<minLength value="1"/>
|
||||||
|
<maxLength value="255"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<simpleType name="optPostalLineType">
|
||||||
|
<restriction base="normalizedString">
|
||||||
|
<maxLength value="255"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <create> command.
|
||||||
|
-->
|
||||||
|
<complexType name="createType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="eppcom:clIDType"/>
|
||||||
|
<element name="postalInfo" type="contact:postalInfoType"
|
||||||
|
maxOccurs="2"/>
|
||||||
|
<element name="voice" type="contact:e164Type"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="fax" type="contact:e164Type"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="email" type="eppcom:minTokenType"/>
|
||||||
|
<element name="authInfo" type="contact:authInfoType"/>
|
||||||
|
<element name="disclose" type="contact:discloseType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="postalInfoType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="contact:postalLineType"/>
|
||||||
|
<element name="org" type="contact:optPostalLineType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="addr" type="contact:addrType"/>
|
||||||
|
</sequence>
|
||||||
|
<attribute name="type" type="contact:postalInfoEnumType"
|
||||||
|
use="required"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="postalInfoEnumType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="loc"/>
|
||||||
|
<enumeration value="int"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<complexType name="addrType">
|
||||||
|
<sequence>
|
||||||
|
<element name="street" type="contact:optPostalLineType"
|
||||||
|
minOccurs="0" maxOccurs="3"/>
|
||||||
|
<element name="city" type="contact:postalLineType"/>
|
||||||
|
<element name="sp" type="contact:optPostalLineType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="pc" type="contact:pcType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="cc" type="contact:ccType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="authInfoType">
|
||||||
|
<choice>
|
||||||
|
<element name="pw" type="eppcom:pwAuthInfoType"/>
|
||||||
|
<element name="ext" type="eppcom:extAuthInfoType"/>
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="discloseType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="contact:intLocType"
|
||||||
|
minOccurs="0" maxOccurs="2"/>
|
||||||
|
<element name="org" type="contact:intLocType"
|
||||||
|
minOccurs="0" maxOccurs="2"/>
|
||||||
|
<element name="addr" type="contact:intLocType"
|
||||||
|
minOccurs="0" maxOccurs="2"/>
|
||||||
|
<element name="voice" minOccurs="0"/>
|
||||||
|
<element name="fax" minOccurs="0"/>
|
||||||
|
<element name="email" minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
<attribute name="flag" type="boolean" use="required"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="intLocType">
|
||||||
|
<attribute name="type" type="contact:postalInfoEnumType"
|
||||||
|
use="required"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child element of commands that require only an identifier.
|
||||||
|
-->
|
||||||
|
<complexType name="sIDType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="eppcom:clIDType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child element of commands that accept multiple identifiers.
|
||||||
|
-->
|
||||||
|
<complexType name="mIDType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="eppcom:clIDType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <info> and <transfer> commands.
|
||||||
|
-->
|
||||||
|
<complexType name="authIDType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="eppcom:clIDType"/>
|
||||||
|
<element name="authInfo" type="contact:authInfoType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <update> command.
|
||||||
|
-->
|
||||||
|
<complexType name="updateType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="eppcom:clIDType"/>
|
||||||
|
<element name="add" type="contact:addRemType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="rem" type="contact:addRemType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="chg" type="contact:chgType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Data elements that can be added or removed.
|
||||||
|
-->
|
||||||
|
<complexType name="addRemType">
|
||||||
|
<sequence>
|
||||||
|
<element name="status" type="contact:statusType"
|
||||||
|
maxOccurs="7"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Data elements that can be changed.
|
||||||
|
-->
|
||||||
|
<complexType name="chgType">
|
||||||
|
<sequence>
|
||||||
|
<element name="postalInfo" type="contact:chgPostalInfoType"
|
||||||
|
minOccurs="0" maxOccurs="2"/>
|
||||||
|
<element name="voice" type="contact:e164Type"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="fax" type="contact:e164Type"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="email" type="eppcom:minTokenType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="authInfo" type="contact:authInfoType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="disclose" type="contact:discloseType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="chgPostalInfoType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="contact:postalLineType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="org" type="contact:optPostalLineType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="addr" type="contact:addrType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
<attribute name="type" type="contact:postalInfoEnumType"
|
||||||
|
use="required"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child response elements.
|
||||||
|
-->
|
||||||
|
<element name="chkData" type="contact:chkDataType"/>
|
||||||
|
<element name="creData" type="contact:creDataType"/>
|
||||||
|
<element name="infData" type="contact:infDataType"/>
|
||||||
|
<element name="panData" type="contact:panDataType"/>
|
||||||
|
<element name="trnData" type="contact:trnDataType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<check> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="chkDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="cd" type="contact:checkType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="checkType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="contact:checkIDType"/>
|
||||||
|
<element name="reason" type="eppcom:reasonType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="checkIDType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:clIDType">
|
||||||
|
<attribute name="avail" type="boolean"
|
||||||
|
use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<create> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="creDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="eppcom:clIDType"/>
|
||||||
|
<element name="crDate" type="dateTime"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<info> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="infDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="eppcom:clIDType"/>
|
||||||
|
<element name="roid" type="eppcom:roidType"/>
|
||||||
|
<element name="status" type="contact:statusType"
|
||||||
|
maxOccurs="7"/>
|
||||||
|
<element name="postalInfo" type="contact:postalInfoType"
|
||||||
|
maxOccurs="2"/>
|
||||||
|
<element name="voice" type="contact:e164Type"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="fax" type="contact:e164Type"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="email" type="eppcom:minTokenType"/>
|
||||||
|
<element name="clID" type="eppcom:clIDType"/>
|
||||||
|
<element name="crID" type="eppcom:clIDType"/>
|
||||||
|
<element name="crDate" type="dateTime"/>
|
||||||
|
<element name="upID" type="eppcom:clIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="upDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="trDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="authInfo" type="contact:authInfoType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="disclose" type="contact:discloseType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Status is a combination of attributes and an optional human-readable
|
||||||
|
message that may be expressed in languages other than English.
|
||||||
|
-->
|
||||||
|
<complexType name="statusType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="normalizedString">
|
||||||
|
<attribute name="s" type="contact:statusValueType"
|
||||||
|
use="required"/>
|
||||||
|
<attribute name="lang" type="language"
|
||||||
|
default="en"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="statusValueType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="clientDeleteProhibited"/>
|
||||||
|
<enumeration value="clientTransferProhibited"/>
|
||||||
|
<enumeration value="clientUpdateProhibited"/>
|
||||||
|
<enumeration value="linked"/>
|
||||||
|
<enumeration value="ok"/>
|
||||||
|
<enumeration value="pendingCreate"/>
|
||||||
|
<enumeration value="pendingDelete"/>
|
||||||
|
<enumeration value="pendingTransfer"/>
|
||||||
|
<enumeration value="pendingUpdate"/>
|
||||||
|
<enumeration value="serverDeleteProhibited"/>
|
||||||
|
<enumeration value="serverTransferProhibited"/>
|
||||||
|
<enumeration value="serverUpdateProhibited"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Pending action notification response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="panDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="contact:paCLIDType"/>
|
||||||
|
<element name="paTRID" type="epp:trIDType"/>
|
||||||
|
<element name="paDate" type="dateTime"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="paCLIDType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:clIDType">
|
||||||
|
<attribute name="paResult" type="boolean"
|
||||||
|
use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<transfer> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="trnDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="id" type="eppcom:clIDType"/>
|
||||||
|
<element name="trStatus" type="eppcom:trStatusType"/>
|
||||||
|
<element name="reID" type="eppcom:clIDType"/>
|
||||||
|
<element name="reDate" type="dateTime"/>
|
||||||
|
<element name="acID" type="eppcom:clIDType"/>
|
||||||
|
<element name="acDate" type="dateTime"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,432 @@
|
||||||
|
<schema targetNamespace="urn:ietf:params:xml:ns:domain-1.0"
|
||||||
|
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
|
||||||
|
xmlns:host="urn:ietf:params:xml:ns:host-1.0"
|
||||||
|
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
schemaLocation="epp-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:host-1.0"
|
||||||
|
schemaLocation="host-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Extensible Provisioning Protocol v1.0
|
||||||
|
domain provisioning schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements found in EPP commands.
|
||||||
|
-->
|
||||||
|
<element name="check" type="domain:mNameType"/>
|
||||||
|
<element name="create" type="domain:createType"/>
|
||||||
|
<element name="delete" type="domain:sNameType"/>
|
||||||
|
<element name="info" type="domain:infoType"/>
|
||||||
|
<element name="renew" type="domain:renewType"/>
|
||||||
|
<element name="transfer" type="domain:transferType"/>
|
||||||
|
<element name="update" type="domain:updateType"/>
|
||||||
|
<!--
|
||||||
|
Child elements of the <create> command.
|
||||||
|
-->
|
||||||
|
<complexType name="createType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="period" type="domain:periodType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="ns" type="domain:nsType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="registrant" type="eppcom:clIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="contact" type="domain:contactType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<element name="authInfo" type="domain:authInfoType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="periodType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="domain:pLimitType">
|
||||||
|
<attribute name="unit" type="domain:pUnitType"
|
||||||
|
use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="pLimitType">
|
||||||
|
<restriction base="unsignedShort">
|
||||||
|
<minInclusive value="1"/>
|
||||||
|
<maxInclusive value="99"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<simpleType name="pUnitType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="y"/>
|
||||||
|
<enumeration value="m"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<complexType name="nsType">
|
||||||
|
<choice>
|
||||||
|
<element name="hostObj" type="eppcom:labelType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
<element name="hostAttr" type="domain:hostAttrType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
<!--
|
||||||
|
Name servers are either host objects or attributes.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<complexType name="hostAttrType">
|
||||||
|
<sequence>
|
||||||
|
<element name="hostName" type="eppcom:labelType"/>
|
||||||
|
<element name="hostAddr" type="host:addrType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
<!--
|
||||||
|
If attributes, addresses are optional and follow the
|
||||||
|
structure defined in the host mapping.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<complexType name="contactType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:clIDType">
|
||||||
|
<attribute name="type" type="domain:contactAttrType"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="contactAttrType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="admin"/>
|
||||||
|
<enumeration value="billing"/>
|
||||||
|
<enumeration value="tech"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<complexType name="authInfoType">
|
||||||
|
<choice>
|
||||||
|
<element name="pw" type="eppcom:pwAuthInfoType"/>
|
||||||
|
<element name="ext" type="eppcom:extAuthInfoType"/>
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child element of commands that require a single name.
|
||||||
|
-->
|
||||||
|
<complexType name="sNameType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
<!--
|
||||||
|
Child element of commands that accept multiple names.
|
||||||
|
-->
|
||||||
|
<complexType name="mNameType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <info> command.
|
||||||
|
-->
|
||||||
|
<complexType name="infoType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="domain:infoNameType"/>
|
||||||
|
<element name="authInfo" type="domain:authInfoType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="infoNameType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base = "eppcom:labelType">
|
||||||
|
<attribute name="hosts" type="domain:hostsType"
|
||||||
|
default="all"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="hostsType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="all"/>
|
||||||
|
<enumeration value="del"/>
|
||||||
|
<enumeration value="none"/>
|
||||||
|
<enumeration value="sub"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <renew> command.
|
||||||
|
-->
|
||||||
|
<complexType name="renewType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="curExpDate" type="date"/>
|
||||||
|
<element name="period" type="domain:periodType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <transfer> command.
|
||||||
|
-->
|
||||||
|
<complexType name="transferType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="period" type="domain:periodType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="authInfo" type="domain:authInfoType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <update> command.
|
||||||
|
-->
|
||||||
|
<complexType name="updateType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="add" type="domain:addRemType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="rem" type="domain:addRemType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="chg" type="domain:chgType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Data elements that can be added or removed.
|
||||||
|
-->
|
||||||
|
<complexType name="addRemType">
|
||||||
|
<sequence>
|
||||||
|
<element name="ns" type="domain:nsType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="contact" type="domain:contactType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<element name="status" type="domain:statusType"
|
||||||
|
minOccurs="0" maxOccurs="11"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Data elements that can be changed.
|
||||||
|
-->
|
||||||
|
<complexType name="chgType">
|
||||||
|
<sequence>
|
||||||
|
<element name="registrant" type="domain:clIDChgType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="authInfo" type="domain:authInfoChgType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Allow the registrant value to be nullified by changing the
|
||||||
|
minLength restriction to "0".
|
||||||
|
-->
|
||||||
|
<simpleType name="clIDChgType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="0"/>
|
||||||
|
<maxLength value="16"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Allow the authInfo value to be nullified by including an
|
||||||
|
empty element within the choice.
|
||||||
|
-->
|
||||||
|
<complexType name="authInfoChgType">
|
||||||
|
<choice>
|
||||||
|
<element name="pw" type="eppcom:pwAuthInfoType"/>
|
||||||
|
<element name="ext" type="eppcom:extAuthInfoType"/>
|
||||||
|
<element name="null"/>
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child response elements.
|
||||||
|
-->
|
||||||
|
<element name="chkData" type="domain:chkDataType"/>
|
||||||
|
<element name="creData" type="domain:creDataType"/>
|
||||||
|
<element name="infData" type="domain:infDataType"/>
|
||||||
|
<element name="panData" type="domain:panDataType"/>
|
||||||
|
<element name="renData" type="domain:renDataType"/>
|
||||||
|
<element name="trnData" type="domain:trnDataType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<check> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="chkDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="cd" type="domain:checkType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="checkType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="domain:checkNameType"/>
|
||||||
|
<element name="reason" type="eppcom:reasonType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="checkNameType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute name="avail" type="boolean"
|
||||||
|
use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<create> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="creDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="crDate" type="dateTime"/>
|
||||||
|
<element name="exDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<info> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="infDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="roid" type="eppcom:roidType"/>
|
||||||
|
<element name="status" type="domain:statusType"
|
||||||
|
minOccurs="0" maxOccurs="11"/>
|
||||||
|
<element name="registrant" type="eppcom:clIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="contact" type="domain:contactType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<element name="ns" type="domain:nsType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="host" type="eppcom:labelType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<element name="clID" type="eppcom:clIDType"/>
|
||||||
|
<element name="crID" type="eppcom:clIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="crDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="upID" type="eppcom:clIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="upDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="exDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="trDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="authInfo" type="domain:authInfoType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Status is a combination of attributes and an optional
|
||||||
|
human-readable message that may be expressed in languages other
|
||||||
|
than English.
|
||||||
|
-->
|
||||||
|
<complexType name="statusType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="normalizedString">
|
||||||
|
<attribute name="s" type="domain:statusValueType"
|
||||||
|
use="required"/>
|
||||||
|
<attribute name="lang" type="language"
|
||||||
|
default="en"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="statusValueType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="clientDeleteProhibited"/>
|
||||||
|
<enumeration value="clientHold"/>
|
||||||
|
<enumeration value="clientRenewProhibited"/>
|
||||||
|
<enumeration value="clientTransferProhibited"/>
|
||||||
|
<enumeration value="clientUpdateProhibited"/>
|
||||||
|
<enumeration value="inactive"/>
|
||||||
|
<enumeration value="ok"/>
|
||||||
|
<enumeration value="pendingCreate"/>
|
||||||
|
<enumeration value="pendingDelete"/>
|
||||||
|
<enumeration value="pendingRenew"/>
|
||||||
|
<enumeration value="pendingTransfer"/>
|
||||||
|
<enumeration value="pendingUpdate"/>
|
||||||
|
<enumeration value="serverDeleteProhibited"/>
|
||||||
|
<enumeration value="serverHold"/>
|
||||||
|
<enumeration value="serverRenewProhibited"/>
|
||||||
|
<enumeration value="serverTransferProhibited"/>
|
||||||
|
<enumeration value="serverUpdateProhibited"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Pending action notification response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="panDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="domain:paNameType"/>
|
||||||
|
<element name="paTRID" type="epp:trIDType"/>
|
||||||
|
<element name="paDate" type="dateTime"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="paNameType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute name="paResult" type="boolean"
|
||||||
|
use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<renew> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="renDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="exDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<transfer> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="trnDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="trStatus" type="eppcom:trStatusType"/>
|
||||||
|
<element name="reID" type="eppcom:clIDType"/>
|
||||||
|
<element name="reDate" type="dateTime"/>
|
||||||
|
<element name="acID" type="eppcom:clIDType"/>
|
||||||
|
<element name="acDate" type="dateTime"/>
|
||||||
|
<element name="exDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,111 @@
|
||||||
|
<schema targetNamespace="urn:ietf:params:xml:ns:e164epp-1.0"
|
||||||
|
xmlns:e164="urn:ietf:params:xml:ns:e164epp-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Extensible Provisioning Protocol v1.0
|
||||||
|
domain name extension schema for E.164 number provisioning.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements found in EPP commands.
|
||||||
|
-->
|
||||||
|
<element name="create" type="e164:createType"/>
|
||||||
|
<element name="update" type="e164:updateType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Global elements.
|
||||||
|
-->
|
||||||
|
<element name="naptr" type="e164:naptrType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <create> command.
|
||||||
|
-->
|
||||||
|
<complexType name="createType">
|
||||||
|
<sequence>
|
||||||
|
<element ref="e164:naptr" maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="naptrType">
|
||||||
|
<sequence>
|
||||||
|
<element name="order" type="unsignedShort"/>
|
||||||
|
<element name="pref" type="unsignedShort"/>
|
||||||
|
<element name="flags" type="e164:flagsType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="svc" type="e164:svcType"/>
|
||||||
|
<element name="regex" type="e164:regexType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="repl" type="e164:replType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="flagsType">
|
||||||
|
<restriction base="token">
|
||||||
|
<pattern value="[A-Z]|[a-z]|[0-9]"/>
|
||||||
|
<length value="1"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<simpleType name="svcType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="1"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<simpleType name="regexType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="1"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<simpleType name="replType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="1"/>
|
||||||
|
<maxLength value="255"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <update> command.
|
||||||
|
-->
|
||||||
|
<complexType name="updateType">
|
||||||
|
<sequence>
|
||||||
|
<element name="add" type="e164:addRemType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="rem" type="e164:addRemType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Data elements that can be added or removed.
|
||||||
|
-->
|
||||||
|
<complexType name="addRemType">
|
||||||
|
<sequence>
|
||||||
|
<element ref="e164:naptr" maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child response elements.
|
||||||
|
-->
|
||||||
|
<element name="infData" type="e164:infDataType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<info> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="infDataType">
|
||||||
|
<sequence>
|
||||||
|
<element ref="e164:naptr" maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,441 @@
|
||||||
|
<schema targetNamespace="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Extensible Provisioning Protocol v1.0 schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Every EPP XML instance must begin with this element.
|
||||||
|
-->
|
||||||
|
<element name="epp" type="epp:eppType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
An EPP XML instance must contain a greeting, hello, command,
|
||||||
|
response, or extension.
|
||||||
|
-->
|
||||||
|
<complexType name="eppType">
|
||||||
|
<choice>
|
||||||
|
<element name="greeting" type="epp:greetingType"/>
|
||||||
|
<element name="hello"/>
|
||||||
|
<element name="command" type="epp:commandType"/>
|
||||||
|
<element name="response" type="epp:responseType"/>
|
||||||
|
<element name="extension" type="epp:extAnyType"/>
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
A greeting is sent by a server in response to a client connection
|
||||||
|
or <hello>.
|
||||||
|
-->
|
||||||
|
<complexType name="greetingType">
|
||||||
|
<sequence>
|
||||||
|
<element name="svID" type="epp:sIDType"/>
|
||||||
|
<element name="svDate" type="dateTime"/>
|
||||||
|
<element name="svcMenu" type="epp:svcMenuType"/>
|
||||||
|
<element name="dcp" type="epp:dcpType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Server IDs are strings with minimum and maximum length
|
||||||
|
restrictions.
|
||||||
|
-->
|
||||||
|
<simpleType name="sIDType">
|
||||||
|
<restriction base="normalizedString">
|
||||||
|
<minLength value="3"/>
|
||||||
|
<maxLength value="64"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
A server greeting identifies available object services.
|
||||||
|
-->
|
||||||
|
<complexType name="svcMenuType">
|
||||||
|
<sequence>
|
||||||
|
<element name="version" type="epp:versionType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
<element name="lang" type="language"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
<element name="objURI" type="anyURI"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
<element name="svcExtension" type="epp:extURIType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Data Collection Policy types.
|
||||||
|
-->
|
||||||
|
<complexType name="dcpType">
|
||||||
|
<sequence>
|
||||||
|
<element name="access" type="epp:dcpAccessType"/>
|
||||||
|
<element name="statement" type="epp:dcpStatementType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
<element name="expiry" type="epp:dcpExpiryType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="dcpAccessType">
|
||||||
|
<choice>
|
||||||
|
<element name="all"/>
|
||||||
|
<element name="none"/>
|
||||||
|
<element name="null"/>
|
||||||
|
<element name="other"/>
|
||||||
|
<element name="personal"/>
|
||||||
|
<element name="personalAndOther"/>
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="dcpStatementType">
|
||||||
|
<sequence>
|
||||||
|
<element name="purpose" type="epp:dcpPurposeType"/>
|
||||||
|
<element name="recipient" type="epp:dcpRecipientType"/>
|
||||||
|
<element name="retention" type="epp:dcpRetentionType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="dcpPurposeType">
|
||||||
|
<sequence>
|
||||||
|
<element name="admin"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="contact"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="other"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="prov"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="dcpRecipientType">
|
||||||
|
<sequence>
|
||||||
|
<element name="other"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="ours" type="epp:dcpOursType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<element name="public"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="same"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="unrelated"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="dcpOursType">
|
||||||
|
<sequence>
|
||||||
|
<element name="recDesc" type="epp:dcpRecDescType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="dcpRecDescType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="1"/>
|
||||||
|
<maxLength value="255"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<complexType name="dcpRetentionType">
|
||||||
|
<choice>
|
||||||
|
<element name="business"/>
|
||||||
|
<element name="indefinite"/>
|
||||||
|
<element name="legal"/>
|
||||||
|
<element name="none"/>
|
||||||
|
<element name="stated"/>
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="dcpExpiryType">
|
||||||
|
<choice>
|
||||||
|
<element name="absolute" type="dateTime"/>
|
||||||
|
<element name="relative" type="duration"/>
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Extension framework types.
|
||||||
|
-->
|
||||||
|
<complexType name="extAnyType">
|
||||||
|
<sequence>
|
||||||
|
<any namespace="##other"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="extURIType">
|
||||||
|
<sequence>
|
||||||
|
<element name="extURI" type="anyURI"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
An EPP version number is a dotted pair of decimal numbers.
|
||||||
|
-->
|
||||||
|
<simpleType name="versionType">
|
||||||
|
<restriction base="token">
|
||||||
|
<pattern value="[1-9]+\.[0-9]+"/>
|
||||||
|
<enumeration value="1.0"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Command types.
|
||||||
|
-->
|
||||||
|
<complexType name="commandType">
|
||||||
|
<sequence>
|
||||||
|
<choice>
|
||||||
|
<element name="check" type="epp:readWriteType"/>
|
||||||
|
<element name="create" type="epp:readWriteType"/>
|
||||||
|
<element name="delete" type="epp:readWriteType"/>
|
||||||
|
<element name="info" type="epp:readWriteType"/>
|
||||||
|
<element name="login" type="epp:loginType"/>
|
||||||
|
<element name="logout"/>
|
||||||
|
<element name="poll" type="epp:pollType"/>
|
||||||
|
<element name="renew" type="epp:readWriteType"/>
|
||||||
|
<element name="transfer" type="epp:transferType"/>
|
||||||
|
<element name="update" type="epp:readWriteType"/>
|
||||||
|
</choice>
|
||||||
|
<element name="extension" type="epp:extAnyType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="clTRID" type="epp:trIDStringType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The <login> command.
|
||||||
|
-->
|
||||||
|
<complexType name="loginType">
|
||||||
|
<sequence>
|
||||||
|
<element name="clID" type="eppcom:clIDType"/>
|
||||||
|
<element name="pw" type="epp:pwType"/>
|
||||||
|
<element name="newPW" type="epp:pwType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="options" type="epp:credsOptionsType"/>
|
||||||
|
<element name="svcs" type="epp:loginSvcType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="credsOptionsType">
|
||||||
|
<sequence>
|
||||||
|
<element name="version" type="epp:versionType"/>
|
||||||
|
<element name="lang" type="language"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="pwType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="6"/>
|
||||||
|
<maxLength value="16"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<complexType name="loginSvcType">
|
||||||
|
<sequence>
|
||||||
|
<element name="objURI" type="anyURI"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
<element name="svcExtension" type="epp:extURIType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The <poll> command.
|
||||||
|
-->
|
||||||
|
<complexType name="pollType">
|
||||||
|
<attribute name="op" type="epp:pollOpType"
|
||||||
|
use="required"/>
|
||||||
|
<attribute name="msgID" type="token"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="pollOpType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="ack"/>
|
||||||
|
<enumeration value="req"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
<!--
|
||||||
|
The <transfer> command. This is object-specific, and uses attributes
|
||||||
|
to identify the requested operation.
|
||||||
|
-->
|
||||||
|
<complexType name="transferType">
|
||||||
|
<sequence>
|
||||||
|
<any namespace="##other"/>
|
||||||
|
</sequence>
|
||||||
|
<attribute name="op" type="epp:transferOpType"
|
||||||
|
use="required"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="transferOpType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="approve"/>
|
||||||
|
<enumeration value="cancel"/>
|
||||||
|
<enumeration value="query"/>
|
||||||
|
<enumeration value="reject"/>
|
||||||
|
<enumeration value="request"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
All other object-centric commands. EPP doesn't specify the syntax or
|
||||||
|
semantics of object-centric command elements. The elements MUST be
|
||||||
|
described in detail in another schema specific to the object.
|
||||||
|
-->
|
||||||
|
<complexType name="readWriteType">
|
||||||
|
<sequence>
|
||||||
|
<any namespace="##other"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="trIDType">
|
||||||
|
<sequence>
|
||||||
|
<element name="clTRID" type="epp:trIDStringType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="svTRID" type="epp:trIDStringType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="trIDStringType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="3"/>
|
||||||
|
<maxLength value="64"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
<!--
|
||||||
|
Response types.
|
||||||
|
-->
|
||||||
|
<complexType name="responseType">
|
||||||
|
<sequence>
|
||||||
|
<element name="result" type="epp:resultType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
<element name="msgQ" type="epp:msgQType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="resData" type="epp:extAnyType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="extension" type="epp:extAnyType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="trID" type="epp:trIDType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="resultType">
|
||||||
|
<sequence>
|
||||||
|
<element name="msg" type="epp:msgType"/>
|
||||||
|
<choice minOccurs="0" maxOccurs="unbounded">
|
||||||
|
<element name="value" type="epp:errValueType"/>
|
||||||
|
<element name="extValue" type="epp:extErrValueType"/>
|
||||||
|
</choice>
|
||||||
|
</sequence>
|
||||||
|
<attribute name="code" type="epp:resultCodeType"
|
||||||
|
use="required"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="errValueType" mixed="true">
|
||||||
|
<sequence>
|
||||||
|
<any namespace="##any" processContents="skip"/>
|
||||||
|
</sequence>
|
||||||
|
<anyAttribute namespace="##any" processContents="skip"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="extErrValueType">
|
||||||
|
<sequence>
|
||||||
|
<element name="value" type="epp:errValueType"/>
|
||||||
|
<element name="reason" type="epp:msgType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="msgQType">
|
||||||
|
<sequence>
|
||||||
|
<element name="qDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="msg" type="epp:mixedMsgType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
<attribute name="count" type="unsignedLong"
|
||||||
|
use="required"/>
|
||||||
|
<attribute name="id" type="eppcom:minTokenType"
|
||||||
|
use="required"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="mixedMsgType" mixed="true">
|
||||||
|
<sequence>
|
||||||
|
<any processContents="skip"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
<attribute name="lang" type="language"
|
||||||
|
default="en"/>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Human-readable text may be expressed in languages other than English.
|
||||||
|
-->
|
||||||
|
<complexType name="msgType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="normalizedString">
|
||||||
|
<attribute name="lang" type="language"
|
||||||
|
default="en"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
EPP result codes.
|
||||||
|
-->
|
||||||
|
<simpleType name="resultCodeType">
|
||||||
|
<restriction base="unsignedShort">
|
||||||
|
<enumeration value="1000"/>
|
||||||
|
<enumeration value="1001"/>
|
||||||
|
<enumeration value="1300"/>
|
||||||
|
<enumeration value="1301"/>
|
||||||
|
<enumeration value="1500"/>
|
||||||
|
<enumeration value="2000"/>
|
||||||
|
<enumeration value="2001"/>
|
||||||
|
<enumeration value="2002"/>
|
||||||
|
<enumeration value="2003"/>
|
||||||
|
<enumeration value="2004"/>
|
||||||
|
<enumeration value="2005"/>
|
||||||
|
<enumeration value="2100"/>
|
||||||
|
<enumeration value="2101"/>
|
||||||
|
<enumeration value="2102"/>
|
||||||
|
<enumeration value="2103"/>
|
||||||
|
<enumeration value="2104"/>
|
||||||
|
<enumeration value="2105"/>
|
||||||
|
<enumeration value="2106"/>
|
||||||
|
<enumeration value="2200"/>
|
||||||
|
<enumeration value="2201"/>
|
||||||
|
<enumeration value="2202"/>
|
||||||
|
<enumeration value="2300"/>
|
||||||
|
<enumeration value="2301"/>
|
||||||
|
<enumeration value="2302"/>
|
||||||
|
<enumeration value="2303"/>
|
||||||
|
<enumeration value="2304"/>
|
||||||
|
<enumeration value="2305"/>
|
||||||
|
<enumeration value="2306"/>
|
||||||
|
<enumeration value="2307"/>
|
||||||
|
<enumeration value="2308"/>
|
||||||
|
<enumeration value="2400"/>
|
||||||
|
<enumeration value="2500"/>
|
||||||
|
<enumeration value="2501"/>
|
||||||
|
<enumeration value="2502"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,103 @@
|
||||||
|
<schema targetNamespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Extensible Provisioning Protocol v1.0
|
||||||
|
shared structures schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Object authorization information types.
|
||||||
|
-->
|
||||||
|
<complexType name="pwAuthInfoType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="normalizedString">
|
||||||
|
<attribute name="roid" type="eppcom:roidType"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="extAuthInfoType">
|
||||||
|
<sequence>
|
||||||
|
<any namespace="##other"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<check> response types.
|
||||||
|
-->
|
||||||
|
<complexType name="reasonType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:reasonBaseType">
|
||||||
|
<attribute name="lang" type="language"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="reasonBaseType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="1"/>
|
||||||
|
<maxLength value="32"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Abstract client and object identifier type.
|
||||||
|
-->
|
||||||
|
<simpleType name="clIDType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="3"/>
|
||||||
|
<maxLength value="16"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
DNS label type.
|
||||||
|
-->
|
||||||
|
<simpleType name="labelType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="1"/>
|
||||||
|
<maxLength value="255"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Non-empty token type.
|
||||||
|
-->
|
||||||
|
<simpleType name="minTokenType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="1"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Repository Object IDentifier type.
|
||||||
|
-->
|
||||||
|
<simpleType name="roidType">
|
||||||
|
<restriction base="token">
|
||||||
|
<pattern value="(\w|_){1,80}-\w{1,8}"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Transfer status identifiers.
|
||||||
|
-->
|
||||||
|
<simpleType name="trStatusType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="clientApproved"/>
|
||||||
|
<enumeration value="clientCancelled"/>
|
||||||
|
<enumeration value="clientRejected"/>
|
||||||
|
<enumeration value="pending"/>
|
||||||
|
<enumeration value="serverApproved"/>
|
||||||
|
<enumeration value="serverCancelled"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,241 @@
|
||||||
|
<schema targetNamespace="urn:ietf:params:xml:ns:host-1.0"
|
||||||
|
xmlns:host="urn:ietf:params:xml:ns:host-1.0"
|
||||||
|
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
schemaLocation="epp-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Extensible Provisioning Protocol v1.0
|
||||||
|
host provisioning schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements found in EPP commands.
|
||||||
|
-->
|
||||||
|
<element name="check" type="host:mNameType"/>
|
||||||
|
<element name="create" type="host:createType"/>
|
||||||
|
<element name="delete" type="host:sNameType"/>
|
||||||
|
<element name="info" type="host:sNameType"/>
|
||||||
|
<element name="update" type="host:updateType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <create> command.
|
||||||
|
-->
|
||||||
|
<complexType name="createType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="addr" type="host:addrType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="addrType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="host:addrStringType">
|
||||||
|
<attribute name="ip" type="host:ipType"
|
||||||
|
default="v4"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="addrStringType">
|
||||||
|
<restriction base="token">
|
||||||
|
<minLength value="3"/>
|
||||||
|
<maxLength value="45"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<simpleType name="ipType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="v4"/>
|
||||||
|
<enumeration value="v6"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <delete> and <info> commands.
|
||||||
|
-->
|
||||||
|
<complexType name="sNameType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child element of commands that accept multiple names.
|
||||||
|
-->
|
||||||
|
<complexType name="mNameType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
<!--
|
||||||
|
Child elements of the <update> command.
|
||||||
|
-->
|
||||||
|
<complexType name="updateType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="add" type="host:addRemType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="rem" type="host:addRemType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="chg" type="host:chgType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Data elements that can be added or removed.
|
||||||
|
-->
|
||||||
|
<complexType name="addRemType">
|
||||||
|
<sequence>
|
||||||
|
<element name="addr" type="host:addrType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<element name="status" type="host:statusType"
|
||||||
|
minOccurs="0" maxOccurs="7"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Data elements that can be changed.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<complexType name="chgType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child response elements.
|
||||||
|
-->
|
||||||
|
<element name="chkData" type="host:chkDataType"/>
|
||||||
|
<element name="creData" type="host:creDataType"/>
|
||||||
|
<element name="infData" type="host:infDataType"/>
|
||||||
|
<element name="panData" type="host:panDataType"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<check> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="chkDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="cd" type="host:checkType"
|
||||||
|
maxOccurs="unbounded"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="checkType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="host:checkNameType"/>
|
||||||
|
<element name="reason" type="eppcom:reasonType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="checkNameType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute name="avail" type="boolean"
|
||||||
|
use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<create> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="creDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="crDate" type="dateTime"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<info> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="infDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType"/>
|
||||||
|
<element name="roid" type="eppcom:roidType"/>
|
||||||
|
<element name="status" type="host:statusType"
|
||||||
|
maxOccurs="7"/>
|
||||||
|
<element name="addr" type="host:addrType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<element name="clID" type="eppcom:clIDType"/>
|
||||||
|
<element name="crID" type="eppcom:clIDType"/>
|
||||||
|
<element name="crDate" type="dateTime"/>
|
||||||
|
<element name="upID" type="eppcom:clIDType"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="upDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
<element name="trDate" type="dateTime"
|
||||||
|
minOccurs="0"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Status is a combination of attributes and an optional human-readable
|
||||||
|
message that may be expressed in languages other than English.
|
||||||
|
-->
|
||||||
|
<complexType name="statusType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="normalizedString">
|
||||||
|
<attribute name="s" type="host:statusValueType"
|
||||||
|
use="required"/>
|
||||||
|
<attribute name="lang" type="language"
|
||||||
|
default="en"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="statusValueType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="clientDeleteProhibited"/>
|
||||||
|
<enumeration value="clientUpdateProhibited"/>
|
||||||
|
<enumeration value="linked"/>
|
||||||
|
<enumeration value="ok"/>
|
||||||
|
<enumeration value="pendingCreate"/>
|
||||||
|
<enumeration value="pendingDelete"/>
|
||||||
|
<enumeration value="pendingTransfer"/>
|
||||||
|
<enumeration value="pendingUpdate"/>
|
||||||
|
<enumeration value="serverDeleteProhibited"/>
|
||||||
|
<enumeration value="serverUpdateProhibited"/>
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Pending action notification response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="panDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="host:paNameType"/>
|
||||||
|
<element name="paTRID" type="epp:trIDType"/>
|
||||||
|
<element name="paDate" type="dateTime"/>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
<complexType name="paNameType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute name="paResult" type="boolean"
|
||||||
|
use="required"/>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,174 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:X-ar:params:xml:ns:idnadomain-1.0"
|
||||||
|
xmlns:idnadomain="urn:X-ar:params:xml:ns:idnadomain-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
schemaLocation="eppcom-1.0.xsd" />
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Internationalised Domain Name Extensions to the Extensible
|
||||||
|
Provisioning Protocol v1.1 schema. Domain-specific types and
|
||||||
|
attributes.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<group name="namePair">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
User and DNS presentation forms of a domain
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
<sequence>
|
||||||
|
<element name="userForm" type="eppcom:labelType">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
This should be of type internationalisedLabelType
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
</element>
|
||||||
|
<element name="dnsForm" type="eppcom:labelType" />
|
||||||
|
</sequence>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements found in EPP commands.
|
||||||
|
-->
|
||||||
|
<element name="check" type="idnadomain:mNameType" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <check> command.
|
||||||
|
-->
|
||||||
|
<complexType name="mNameType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="idnadomain:internationalisedLabelType"
|
||||||
|
maxOccurs="unbounded" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="internationalisedLabelType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="eppcom:labelType">
|
||||||
|
<attribute name="language" type="language">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Registration of language with IANA requires the definition
|
||||||
|
of a Script or Language Designator
|
||||||
|
(http://www.iana.org/procedures/idn-repository.html).
|
||||||
|
|
||||||
|
The linked document above notes that Language Designators
|
||||||
|
are defined in BCP 47
|
||||||
|
(http://www.rfc-editor.org/rfc/bcp/bcp47.txt), which
|
||||||
|
satisfies the requirements of the language datatype and
|
||||||
|
RFC3066 (BCP 47, Section 2.2.8).
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child response elements.
|
||||||
|
-->
|
||||||
|
<element name="chkData" type="idnadomain:chkDataType" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<check> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="chkDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="cd" type="idnadomain:checkType"
|
||||||
|
maxOccurs="unbounded" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="checkType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="idnadomain:checkNameType" />
|
||||||
|
<element name="reason" type="eppcom:reasonType" minOccurs="0" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="checkNameType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="idnadomain:internationalisedLabelType">
|
||||||
|
<attribute name="avail" type="boolean" use="required" />
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Custom extensions
|
||||||
|
-->
|
||||||
|
<element name="create" type="idnadomain:createType" />
|
||||||
|
<element name="info" type="idnadomain:infoType" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <create> command extension.
|
||||||
|
-->
|
||||||
|
<complexType name="createType">
|
||||||
|
<attribute name="language" use="required" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <info> command extension.
|
||||||
|
-->
|
||||||
|
<complexType name="infoType">
|
||||||
|
<attribute name="variants" type="idnadomain:variantsInfoType"
|
||||||
|
default="all" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<simpleType name="variantsInfoType">
|
||||||
|
<restriction base="token">
|
||||||
|
<enumeration value="all" />
|
||||||
|
<enumeration value="none" />
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Custom response
|
||||||
|
-->
|
||||||
|
<element name="infData" type="idnadomain:resDataType" />
|
||||||
|
<element name="creData" type="idnadomain:resDataType" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Response extension elements.
|
||||||
|
-->
|
||||||
|
<complexType name="resDataType">
|
||||||
|
<sequence>
|
||||||
|
<!-- primary is the name in domain create -->
|
||||||
|
<element name="primary" type="idnadomain:primaryType"
|
||||||
|
minOccurs="1" />
|
||||||
|
<element name="variant" type="idnadomain:variantType"
|
||||||
|
minOccurs="0" maxOccurs="unbounded" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="primaryType">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Should this be moved directly into the resDataType? - assumes
|
||||||
|
that userForm of namePair is of type internationalisedLabelType
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
<group ref="idnadomain:namePair" />
|
||||||
|
<attribute name="language" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="variantType">
|
||||||
|
<group ref="idnadomain:namePair" />
|
||||||
|
<attribute name="language" />
|
||||||
|
<attribute name="provisioned" type="boolean" default="false" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,55 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:X-ar:params:xml:ns:idnahost-1.0"
|
||||||
|
xmlns:idnahost="urn:X-ar:params:xml:ns:idnahost-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
schemaLocation="eppcom-1.0.xsd" />
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Internationalised Domain Name Extensions to the Extensible
|
||||||
|
Provisioning Protocol v1.1 schema. Host-specific types and
|
||||||
|
attributes.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<group name="labelGroup">
|
||||||
|
<annotation>
|
||||||
|
<documentation>Label and optional U-label</documentation>
|
||||||
|
</annotation>
|
||||||
|
<sequence>
|
||||||
|
<element name="userForm" type="eppcom:labelType" />
|
||||||
|
<element name="dnsForm" type="eppcom:labelType" />
|
||||||
|
</sequence>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child response elements.
|
||||||
|
-->
|
||||||
|
<element name="creData" type="idnahost:creDataType" />
|
||||||
|
<element name="infData" type="idnahost:infDataType" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<create> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="creDataType">
|
||||||
|
<group ref="idnahost:labelGroup" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<info> response elements.
|
||||||
|
-->
|
||||||
|
<complexType name="infDataType">
|
||||||
|
<group ref="idnahost:labelGroup" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:X-ar:params:xml:ns:kv-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:kv="urn:X-ar:params:xml:ns:kv-1.0"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Definition of kvlist to be reused in other DTDs
|
||||||
|
-->
|
||||||
|
<group name="kvlist">
|
||||||
|
<sequence>
|
||||||
|
<element name="kvlist" type="kv:listType" />
|
||||||
|
</sequence>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Command extension elements
|
||||||
|
-->
|
||||||
|
<element name="create" type="kv:createType" />
|
||||||
|
<element name="update" type="kv:updateType" />
|
||||||
|
|
||||||
|
<complexType name="createType">
|
||||||
|
<group ref="kv:kvlist" maxOccurs="unbounded" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="updateType">
|
||||||
|
<group ref="kv:kvlist" maxOccurs="unbounded" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="listType">
|
||||||
|
<sequence maxOccurs="unbounded">
|
||||||
|
<element name="item" type="kv:itemType" />
|
||||||
|
</sequence>
|
||||||
|
<attribute name="name" type="token" use="required" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<complexType name="itemType">
|
||||||
|
<simpleContent>
|
||||||
|
<extension base="token">
|
||||||
|
<attribute name="key" type="token" use="required" />
|
||||||
|
</extension>
|
||||||
|
</simpleContent>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Response extension types
|
||||||
|
-->
|
||||||
|
<element name="infData" type="kv:infDataType" />
|
||||||
|
|
||||||
|
<complexType name="infDataType">
|
||||||
|
<group ref="kv:kvlist" maxOccurs="unbounded" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
</schema>
|
|
@ -0,0 +1,91 @@
|
||||||
|
test.msg.1=This is a test message; do not change
|
||||||
|
UnimplementedMethodError=The method <<method>> is deprecated.
|
||||||
|
EPPDateFormatter.readDate.0=Invalid date string specified in call to fromDateTimeString; see previous message for details.
|
||||||
|
Timer.setTime.0=Failed to set the Timer for testing; see previous message for details.
|
||||||
|
Response.fromXML.0=Failed to extract element values from EPP response; see previous message for details.
|
||||||
|
Greeting.fromXML.0=Invalid greeting received, see previous message for details.
|
||||||
|
ARSessionManager.configureSessions.0=Session initialisation failed for <<count>> sessions.
|
||||||
|
ARSessionManager.startup.0=The session manager failed to open <<count>> session(s).
|
||||||
|
ARSessionManager.startup.1=The session manager successfully opened <<count>> sessions.
|
||||||
|
reconfigure.open=Failed to open a session during Session Manager reconfiguration; see previous message for details.
|
||||||
|
reconfigure.pw.change.init=Attempting to change EPP client password from <<old>> to <<new>>.
|
||||||
|
reconfigure.pw.change.complete=Changed EPP client password.
|
||||||
|
reconfigure.pw.change.fail=Failed to establish a session for changing the EPP client password; see previous message for details.
|
||||||
|
reconfigure.pw.change.reinit.fail=Failed to re-initialise a Session Pool after successfully changing the EPP client password; see previous message for details.
|
||||||
|
epp.session.open.fatalerr=A request for a session was unable to be serviced. This condition is expected to be persistent and require intervention; see the previous message for details.
|
||||||
|
epp.session.open.fail=The Session Manager failed to open a session; see the previous message for details.
|
||||||
|
epp.session.open.fail.limit_exceeded=The maximum number of EPP sessions allowable by the server was exceeded while trying to open <<total>> sessions. Only <<cutoff>> sessions were successfully opened.
|
||||||
|
epp.session.poll.open.fail=The Session Manager was unable to poll the Registry system after repeated attempts due to failures in opening a Session; see the previous message for details. The keep-alive thread will now terminate.
|
||||||
|
epp.session.poll.cfg.fail=The Session Manager was unable to poll the Registry system due to client configuration errors; see the previous message for details. The keep-alive thread will now terminate.
|
||||||
|
epp.server.failure.retry=Login failed due to an internal server condition not related to EPP (<<count>> times). Transaction will be retried. See the previous message for details.
|
||||||
|
epp.server.cmdfail=EPP command failed due to an internal server error.
|
||||||
|
epp.keepalive.cmdfail=Attempt to poll the Registry system for session keep-alive failed due to an internal server condition not related to EPP (<<count>> times). Keep-alive will retry.
|
||||||
|
epp.login.fail.auth.pw=Incorrect password (<<pw>>) specified for user <<clID>>.
|
||||||
|
epp.login.fail.auth.match=client ID (<<clID>>) does not match certificate common name (<<cn>>).
|
||||||
|
epp.login.fail.loggedin=Attempted to login a session which was already logged in. The session remains logged in.
|
||||||
|
net.event.socket_closed=Failed to write to socket; already closed.
|
||||||
|
net.socket.uninitialised=Attempt to use an uninitialised Session failed; invoke Session.open() before Session.write().
|
||||||
|
net.socket.open.fail=Failed to receive a Greeting from an EPP server on port <<port>> of host <<host>>.
|
||||||
|
TLSContext.createSocket.0=Fatal error: unknown_ca. The most common cause of this error is that the system trust keystore does not contain the issuer's CA certificate. If this is the case then import the appropriate CA certificate into <<java.home>>/lib/security/cacerts.
|
||||||
|
ssl.cert.validity.expired=SSL Certificate has expired. Contact Registrar Support immediately for instructions on how to renew your certificate. The previous log message contains further details.
|
||||||
|
ssl.cert.validity.notyet=SSL Certificate is not yet valid. Verify that the system clock is accurate, then contact Registrar Support for further instructions, citing this message and the log message preceding this.
|
||||||
|
ssl.keystore.npe=Unexpected and unhandled failure in loading a KeyStore from the filesystem.
|
||||||
|
ssl.keystore.unrecoverable_key=The key could not be recovered from the keystore, possibly due to an incorrect passphrase being supplied for the keystore; see the previous message for further details.
|
||||||
|
ssl.keystore.initfail=The key manager factory initialisation process failed unexpectedly; see the previous message for further details.
|
||||||
|
ssl.context.getInstance.fail=Unexpected failure of SSLContext.getInstance(TLSv1). The required system libraries may not be available. See the previous message for further details.
|
||||||
|
ssl.context.init.fail=A key manager factory was loaded successfully, but initialisation of the SSL context using the key manager factory failed unexpectedly. See the previous message for details.
|
||||||
|
ssl.context.nsae=The installed security provider seems to be missing support for Transport Layer Security version 1. See the previous message for further details.
|
||||||
|
ssl.context.kme=The SSL context failed to initialise due to a key management exception. See the previous message for details.
|
||||||
|
|
||||||
|
xml.validation.resolve.begin=Resolving URI <<href>> using filename <<filename>>.
|
||||||
|
xml.validation.resolve.end=Resolved URI <<href>> to file <<file>> using relative named <<filename>>.
|
||||||
|
xml.validation.error=XML parsing/validation error at line <<line>>, column <<column>>. <<message>>
|
||||||
|
xml.validation.schemaload.success=Loaded XML schema document <<schema>>.
|
||||||
|
xml.validation.schemaload.notfound=Unable to locate XML schema document file <<schema>>.
|
||||||
|
xml.validation.schemaload.ioerr=Failed to read XML schema from file <<schema>>; see previous message for details.
|
||||||
|
xml.validation.schemaload.saxerr=Failed to load XML schemas; see previous message for details.
|
||||||
|
xml.validation.source.nx=Unable to load an XML Schema Source from the specified resource; the file <<filename>> was not found in the search space.
|
||||||
|
xml.validation.schemaload.transform.disabled=Failed to locate a local resource for schema validation; schema validation will be disabled.
|
||||||
|
xml.validation.schemaload.saxerr.disabled=A source used to build a required Schema was invalid; schema validation will be disabled.
|
||||||
|
xml.datatype.config.fail.msg=Failed to load the default DatatypeFactory. Verify that the classpath includes core system libraries and that security settings permit access to the JAXP implementation libraries.
|
||||||
|
xml.dateTime.null=Attempted to parse an empty dateTime string.
|
||||||
|
|
||||||
|
xml.writer.config.fail.msg=Failed to create an XMLWriter. Verify that the sjsxp.jar and jsr173_api.jar are in the classpath or that your Java version is >= 1.6.0. If either of these conditions are met, contact Registrar Support, citing this message and the message preceding this (logged by the maint handler).
|
||||||
|
xml.writer.process.fail.msg=An error occurred while generating the textual representation of an XML document using an XMLStreamWriter. Please send this message and the previous message (logged by the maint handler) to Registrar Support to investigate the cause.
|
||||||
|
EPPWriter.init.0=Failed to create a DocumentBuilder for building EPP documents; see previous message for details.
|
||||||
|
|
||||||
|
xml.parser.operation.unsupported=The XML parsing implementation chosen does not support validation of XML documents using XML schemas set via DocumentBuilderFactory.setSchema; see previous message for details.
|
||||||
|
xml.parser.feature.unsupported=The XML parsing implementation chosen does not support the secure processing feature; see the previous message for details.
|
||||||
|
|
||||||
|
file.notfound=File <<filename>> not found.
|
||||||
|
param.notnull.curExpDate=The curExpDate parameter may not be null.
|
||||||
|
thread.sleep.interrupted.ignorable=Thread interrupted while in sleep().
|
||||||
|
thread.wakeup.info=A waiting thread awoke.
|
||||||
|
startup.interruped=Thread interruped while trying to start SessionManager.
|
||||||
|
se.object.missing_arg=Object type and object identifier(s) must be specified.
|
||||||
|
se.login.missing_arg=Username, password and EPP version must all be specified in a login command.
|
||||||
|
se.info.missing_arg=ROID and password must both be specified.
|
||||||
|
se.domain.create.missing_arg=Domain name and authorisation information are required parameters.
|
||||||
|
se.domain.create.au.missing_arg=Eligibility type and registrant name are required .au extension parameters.
|
||||||
|
se.domain.modify.au.missing_arg=Eligibility type and registrant name are required .au extension parameters.
|
||||||
|
se.domain.registrantTransfer.au.missing_arg=Eligibility type, registrant name and current expiry date are all required .au extension parameters.
|
||||||
|
se.domain.create.ae.missing_arg=Eligibility type and registrant name are required .ae extension parameters.
|
||||||
|
se.domain.modify.ae.missing_arg=Eligibility type and registrant name are required .ae extension parameters.
|
||||||
|
se.domain.registrantTransfer.ae.missing_arg=Eligibility type, registrant name and current expiry date are all required .ae extension parameters.
|
||||||
|
se.domain.renew.curExpDate.missing=The current expiry date is a required parameter.
|
||||||
|
se.domain.renew.curExpDate.missing=The current expiry date is a required parameter.
|
||||||
|
se.domain.update.name.missing=Domain name is a required parameter to identify the domain to update.
|
||||||
|
se.domain.update.sync.exDate.missing=The expiry date is a required parameter for domain expiry synchronisation.
|
||||||
|
se.command.type.missing=Command type parameter is required.
|
||||||
|
se.contact.create.missing_arg=Contact identifier, authorisation information, postal information and email address are all required contact parameters.
|
||||||
|
se.contact.update.id.missing=Contact identifier is a required parameter to identify the contact to update.
|
||||||
|
se.poll.ack.msgID.missing=The msgID is a required attribute of a message acknowledgement.
|
||||||
|
se.poll.op.missing=The op attribue is required.
|
||||||
|
se.transfer.operation.missing=The transfer operation type is required.
|
||||||
|
se.transfer.period.missing=The period to extend validity of the object by is required in this usage.
|
||||||
|
se.transfer.pw_roid.missing=An associated object's ROID and the authorisation information of that object are required.
|
||||||
|
se.transfer.pw.missing=The authorisation information of the identified object is required.
|
||||||
|
se.ar.policyDelete.missing_arg=Both name and reason must both be provided.
|
||||||
|
se.ar.domainUndelete.name.missing=Domain name must be provided.
|
||||||
|
se.ar.domainUnrenew.missing_arg=Both domain name and current expiry date must be provided.
|
||||||
|
common.exception.illegal.arg.enum=The enumeration value <<val>> is out of range.
|
|
@ -0,0 +1,71 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:X-ar:params:xml:ns:registrant-1.0"
|
||||||
|
xmlns:registrant="urn:X-ar:params:xml:ns:registrant-1.0"
|
||||||
|
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
||||||
|
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
||||||
|
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
|
||||||
|
xmlns:kv="urn:X-ar:params:xml:ns:kv-1.0"
|
||||||
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Import common element types.
|
||||||
|
-->
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="eppcom-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="epp-1.0.xsd"/>
|
||||||
|
<import namespace="urn:ietf:params:xml:ns:domain-1.0" schemaLocation="domain-1.0.xsd"/>
|
||||||
|
<import namespace="urn:X-ar:params:xml:ns:kv-1.0" schemaLocation="kv-1.0.xsd"/>
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
.au Domain Extensions to the Extensible
|
||||||
|
Provisioning
|
||||||
|
Protocol v1.0. schema.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework elements.
|
||||||
|
-->
|
||||||
|
<element name="command" type="registrant:commandType" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension type definitions.
|
||||||
|
-->
|
||||||
|
<complexType name="commandType">
|
||||||
|
<sequence>
|
||||||
|
<element name="registrantTransfer"
|
||||||
|
type="registrant:registrantTransferType"/>
|
||||||
|
<element name="clTRID" type="epp:trIDStringType" minOccurs="0" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Type definitions.
|
||||||
|
-->
|
||||||
|
<complexType name="registrantTransferType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType" />
|
||||||
|
<element name="curExpDate" type="date" />
|
||||||
|
<element name="period" type="domain:periodType" minOccurs="0" />
|
||||||
|
<group ref="kv:kvlist" />
|
||||||
|
<element name="explanation" type="normalizedString" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Protocol extension framework response elements.
|
||||||
|
-->
|
||||||
|
<element name="rtrnData" type="registrant:rtrnDataType" />
|
||||||
|
|
||||||
|
<complexType name="rtrnDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="name" type="eppcom:labelType" />
|
||||||
|
<element name="exDate" type="dateTime" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
|
@ -0,0 +1,117 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema targetNamespace="urn:ietf:params:xml:ns:secDNS-1.1"
|
||||||
|
xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Extensible Provisioning Protocol v1.0
|
||||||
|
domain name
|
||||||
|
extension schema
|
||||||
|
for provisioning DNS security (DNSSEC) extensions.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements found in EPP commands.
|
||||||
|
-->
|
||||||
|
<element name="create" type="secDNS:dsOrKeyType" />
|
||||||
|
<element name="update" type="secDNS:updateType" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements supporting either the dsData or the keyData interface.
|
||||||
|
-->
|
||||||
|
<complexType name="dsOrKeyType">
|
||||||
|
<sequence>
|
||||||
|
<element name="maxSigLife" type="secDNS:maxSigLifeType"
|
||||||
|
minOccurs="0" />
|
||||||
|
<choice>
|
||||||
|
<element name="dsData" type="secDNS:dsDataType" maxOccurs="unbounded" />
|
||||||
|
<element name="keyData" type="secDNS:keyDataType" maxOccurs="unbounded" />
|
||||||
|
</choice>
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Definition for the maximum signature lifetime (maxSigLife)
|
||||||
|
-->
|
||||||
|
<simpleType name="maxSigLifeType">
|
||||||
|
<restriction base="int">
|
||||||
|
<minInclusive value="1" />
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of dsData used for dsData interface
|
||||||
|
-->
|
||||||
|
<complexType name="dsDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="keyTag" type="unsignedShort" />
|
||||||
|
<element name="alg" type="unsignedByte" />
|
||||||
|
<element name="digestType" type="unsignedByte" />
|
||||||
|
<element name="digest" type="hexBinary" />
|
||||||
|
<element name="keyData" type="secDNS:keyDataType" minOccurs="0" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of keyData used for keyData interface and optionally
|
||||||
|
with dsData interface
|
||||||
|
-->
|
||||||
|
<complexType name="keyDataType">
|
||||||
|
<sequence>
|
||||||
|
<element name="flags" type="unsignedShort" />
|
||||||
|
<element name="protocol" type="unsignedByte" />
|
||||||
|
<element name="alg" type="unsignedByte" />
|
||||||
|
<element name="pubKey" type="secDNS:keyType" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Definition for the public key
|
||||||
|
-->
|
||||||
|
<simpleType name="keyType">
|
||||||
|
<restriction base="base64Binary">
|
||||||
|
<minLength value="1" />
|
||||||
|
</restriction>
|
||||||
|
</simpleType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <update> element.
|
||||||
|
-->
|
||||||
|
<complexType name="updateType">
|
||||||
|
<sequence>
|
||||||
|
<element name="rem" type="secDNS:remType" minOccurs="0" />
|
||||||
|
<element name="add" type="secDNS:dsOrKeyType" minOccurs="0" />
|
||||||
|
<element name="chg" type="secDNS:chgType" minOccurs="0" />
|
||||||
|
</sequence>
|
||||||
|
<attribute name="urgent" type="boolean" default="false" />
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <rem> command.
|
||||||
|
-->
|
||||||
|
<complexType name="remType">
|
||||||
|
<choice>
|
||||||
|
<element name="all" type="boolean" />
|
||||||
|
<element name="dsData" type="secDNS:dsDataType" maxOccurs="unbounded" />
|
||||||
|
<element name="keyData" type="secDNS:keyDataType" maxOccurs="unbounded" />
|
||||||
|
</choice>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements supporting the <chg> element.
|
||||||
|
-->
|
||||||
|
<complexType name="chgType">
|
||||||
|
<sequence>
|
||||||
|
<element name="maxSigLife" type="secDNS:maxSigLifeType"
|
||||||
|
minOccurs="0" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child response elements.
|
||||||
|
-->
|
||||||
|
<element name="infData" type="secDNS:dsOrKeyType" />
|
||||||
|
|
||||||
|
</schema>
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<schema xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:sync="urn:X-ar:params:xml:ns:sync-1.0"
|
||||||
|
targetNamespace="urn:X-ar:params:xml:ns:sync-1.0"
|
||||||
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Extensible Provisioning Protocol v1.0 domain name
|
||||||
|
extension schema for expiration date synchronisation.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements found in EPP commands.
|
||||||
|
-->
|
||||||
|
<element name="update" type="sync:updateType" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Child elements of the <update> command.
|
||||||
|
-->
|
||||||
|
<complexType name="updateType">
|
||||||
|
<sequence>
|
||||||
|
<element name="exDate" type="dateTime" />
|
||||||
|
</sequence>
|
||||||
|
</complexType>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
End of schema.
|
||||||
|
-->
|
||||||
|
</schema>
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
#include "se/AddRemType.hpp"
|
||||||
|
|
||||||
|
// Static member initialisation.
|
||||||
|
std::vector<const EnumType *> AddRemType::values;
|
||||||
|
|
||||||
|
const AddRemType* AddRemType::ADD()
|
||||||
|
{
|
||||||
|
static const AddRemType arm("add");
|
||||||
|
return value("add");
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddRemType* AddRemType::REM()
|
||||||
|
{
|
||||||
|
static const AddRemType arm("rem");
|
||||||
|
return value("rem");
|
||||||
|
}
|
||||||
|
|
||||||
|
AddRemType::AddRemType(const std::string& typeVal)
|
||||||
|
: EnumType (values, typeVal)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
const AddRemType* AddRemType::value(const std::string &name)
|
||||||
|
{
|
||||||
|
return (const AddRemType *)EnumType::value (name, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddRemType::init()
|
||||||
|
{
|
||||||
|
ADD();
|
||||||
|
REM();
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
#ifndef __ADDREMTYPE_HPP
|
||||||
|
#define __ADDREMTYPE_HPP
|
||||||
|
|
||||||
|
#include "se/EnumType.hpp"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents add or remove in EPP domain update commands. This is used
|
||||||
|
* internally by the DomainAdd and DomainRem classes to control the behaviour
|
||||||
|
* of their superclass DomainAddRem.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class AddRemType : public EnumType
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
AddRemType(const std::string &typeVal);
|
||||||
|
|
||||||
|
static const AddRemType* ADD();
|
||||||
|
static const AddRemType* REM();
|
||||||
|
|
||||||
|
static const AddRemType* value(const std::string &name);
|
||||||
|
|
||||||
|
static void init();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::vector<const EnumType *> values;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __ADDREMTYPE_HPP
|
|
@ -0,0 +1,132 @@
|
||||||
|
#include "se/AeDomainCreateCommand.hpp"
|
||||||
|
#include "xml/XMLHelper.hpp"
|
||||||
|
#include "se/AeExtension.hpp"
|
||||||
|
#include "common/ErrorPkg.hpp"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
Extension& aeExtension() {
|
||||||
|
static Extension* aeExtension = new AeExtension();
|
||||||
|
return *aeExtension;
|
||||||
|
}
|
||||||
|
}; // anonymous namespace
|
||||||
|
|
||||||
|
AeDomainCreateCommand::AeDomainCreateCommand (
|
||||||
|
const std::string& name,
|
||||||
|
const std::string& pw,
|
||||||
|
const std::string* registrantID,
|
||||||
|
const std::vector<std::string>* techContacts,
|
||||||
|
const std::string &aeEligibilityType,
|
||||||
|
int aePolicyReason,
|
||||||
|
const std::string &aeRegistrantName) : DomainCreateCommand (
|
||||||
|
name, pw, registrantID, techContacts)
|
||||||
|
{
|
||||||
|
setExtension (aeEligibilityType, aePolicyReason, aeRegistrantName);
|
||||||
|
}
|
||||||
|
|
||||||
|
AeDomainCreateCommand::AeDomainCreateCommand (
|
||||||
|
const std::string& name,
|
||||||
|
const std::string& pw,
|
||||||
|
const std::string* registrantID,
|
||||||
|
const std::vector<std::string>* techContacts,
|
||||||
|
const std::vector<std::string>* adminContacts,
|
||||||
|
const std::vector<std::string>* billingContacts,
|
||||||
|
const std::vector<std::string>* nameservers,
|
||||||
|
const Period* period,
|
||||||
|
const std::string &aeEligibilityType,
|
||||||
|
int aePolicyReason,
|
||||||
|
const std::string &aeRegistrantName,
|
||||||
|
const std::string *aeRegistrantID,
|
||||||
|
const std::string *aeRegistrantIDType,
|
||||||
|
const std::string *aeEligibilityName,
|
||||||
|
const std::string *aeEligibilityID,
|
||||||
|
const std::string *aeEligibilityIDType) : DomainCreateCommand (
|
||||||
|
name, pw, registrantID, techContacts, nameservers,
|
||||||
|
adminContacts, billingContacts, period)
|
||||||
|
{
|
||||||
|
setExtension (aeEligibilityType, aePolicyReason,
|
||||||
|
aeRegistrantName, aeRegistrantID, aeRegistrantIDType,
|
||||||
|
aeEligibilityName, aeEligibilityID, aeEligibilityIDType);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AeDomainCreateCommand::setExtension (const std::string& eligibilityType,
|
||||||
|
int policyReason,
|
||||||
|
const std::string& registrantName)
|
||||||
|
{
|
||||||
|
setExtension (eligibilityType, policyReason, registrantName,
|
||||||
|
NULL, NULL, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AeDomainCreateCommand::setExtension (
|
||||||
|
const std::string& eligibilityType,
|
||||||
|
int policyReason,
|
||||||
|
const std::string ®istrantName,
|
||||||
|
const std::string* registrantID,
|
||||||
|
const std::string ®istrantIDType)
|
||||||
|
{
|
||||||
|
setExtension (eligibilityType, policyReason, registrantName,
|
||||||
|
registrantID, ®istrantIDType, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AeDomainCreateCommand::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.ae.missing_ar"));
|
||||||
|
}
|
||||||
|
|
||||||
|
DOMElement *aeextCreate = xmlWriter->appendChild(
|
||||||
|
xmlWriter->appendChild(
|
||||||
|
command,
|
||||||
|
"extension"),
|
||||||
|
"create",
|
||||||
|
aeExtension().getURI());
|
||||||
|
|
||||||
|
XMLHelper::setAttribute(aeextCreate,
|
||||||
|
"xsi:schemaLocation",
|
||||||
|
aeExtension().getSchemaLocation());
|
||||||
|
|
||||||
|
DOMElement* aeProperties = xmlWriter->appendChild(
|
||||||
|
aeextCreate, "aeProperties");
|
||||||
|
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "registrantName"),
|
||||||
|
registrantName);
|
||||||
|
|
||||||
|
if (registrantID && registrantIDType)
|
||||||
|
xmlWriter->appendChild (aeProperties,
|
||||||
|
"registrantID", *registrantID,
|
||||||
|
"type", *registrantIDType);
|
||||||
|
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "eligibilityType"),
|
||||||
|
eligibilityType);
|
||||||
|
|
||||||
|
if (eligibilityName)
|
||||||
|
{
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "eligibilityName"),
|
||||||
|
*eligibilityName);
|
||||||
|
|
||||||
|
if (eligibilityID && eligibilityIDType)
|
||||||
|
xmlWriter->appendChild(aeProperties,
|
||||||
|
"eligibilityID", *eligibilityID,
|
||||||
|
"type", *eligibilityIDType);
|
||||||
|
}
|
||||||
|
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "policyReason"),
|
||||||
|
policyReason);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,150 @@
|
||||||
|
#ifndef __AEDOMAINCREATECOMMAND_HPP
|
||||||
|
#define __AEDOMAINCREATECOMMAND_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:X-ae:params:xml:ns:aeext-1.0. .ae domains must be
|
||||||
|
* provisioned using this class rather than {@link DomainCreateCommand}, as the
|
||||||
|
* ae extension data is mandatory.
|
||||||
|
* Use this class to generate a standards-compliant XML document, given simple
|
||||||
|
* input parameters. The toXML method in Command serialises this object to
|
||||||
|
* XML.
|
||||||
|
* The response expected from a server should be handled by a {@link
|
||||||
|
* DomainCreateResponse} object.
|
||||||
|
*
|
||||||
|
* @deprecated AE eligibility extensions should now be managed through the
|
||||||
|
* @c <kvlist> extension defined in the
|
||||||
|
* <tt>urn:X-ar:params:xml:ns:kv-1.0</tt> namespace. This can be done
|
||||||
|
* through the toolkit by using a @c DomainCreateCommand and
|
||||||
|
* appending a @c DomainKVCommandExtension object containing
|
||||||
|
* the AE eligibility extensions.
|
||||||
|
*
|
||||||
|
* See
|
||||||
|
* {@link DomainCreateCommand.appendExtension(CommandExtension)}
|
||||||
|
* and
|
||||||
|
* {@link DomainKVCommandExtension}.
|
||||||
|
*/
|
||||||
|
class AeDomainCreateCommand : public DomainCreateCommand
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Minimal constructor for creating a domain:create + aeext:create
|
||||||
|
* EPP command. These parameters are the least required for a valid
|
||||||
|
* .ae domain create command.
|
||||||
|
*/
|
||||||
|
DEPRECATED(
|
||||||
|
AeDomainCreateCommand (const std::string& name,
|
||||||
|
const std::string& pw,
|
||||||
|
const std::string* registrantID,
|
||||||
|
const std::vector<std::string>* techContacts,
|
||||||
|
const std::string &aeEligibilityType,
|
||||||
|
int aePolicyReason,
|
||||||
|
const std::string& aeRegistrantName));
|
||||||
|
/**
|
||||||
|
* Full data specification constructor for a domain:create + aeext:create
|
||||||
|
* EPP command. Please refer to the urn:X-ae:params:xml:ns:aeext-1.0 schema
|
||||||
|
* for specification of the required fields.
|
||||||
|
* The mapping of parameter names to ae extension fields is given in the
|
||||||
|
* parameter documentation.
|
||||||
|
*
|
||||||
|
* @param name The name of the new domain.
|
||||||
|
*
|
||||||
|
* @param pw The password to assign to the domain (also known as authInfo
|
||||||
|
* or authorisation information).
|
||||||
|
*
|
||||||
|
* @param registrantID The identifier of an existing contact to assign as
|
||||||
|
* the registrant contact for this domain. Failure to ensure the contact
|
||||||
|
* exists prior to using them in this way will result in an EPP result of
|
||||||
|
* '2303 "Object does not exist"'.
|
||||||
|
*
|
||||||
|
* @param techContacts The identifiers of existing contacts to assign as
|
||||||
|
* technical contacts for this domain. Failure to ensure the contacts
|
||||||
|
* exist prior to using them in this way will result in an EPP result of
|
||||||
|
* '2303 "Object does not exist"'.
|
||||||
|
*
|
||||||
|
* @param adminContacts See techContacts (substitute administrative for
|
||||||
|
* technical).
|
||||||
|
*
|
||||||
|
* @param billingContacts See techContacts (substitute billing for
|
||||||
|
* technical).
|
||||||
|
*
|
||||||
|
* @param nameservers The names of existing hosts to delegate the domain
|
||||||
|
* being created to. Failure to ensure the hosts exist prior to using them
|
||||||
|
* in this way will result in an EPP result of '2303 "Object does not
|
||||||
|
* exist"'.
|
||||||
|
*
|
||||||
|
* @param period The initial registration period of the domain object. A
|
||||||
|
* server may define a default initial registration period if not specified
|
||||||
|
* by the client.
|
||||||
|
*
|
||||||
|
* @param aeEligibilityType aeext:eligType.
|
||||||
|
*
|
||||||
|
* @param aePolicyReason aeext:policyReason.
|
||||||
|
*
|
||||||
|
* @param aeRegistrantName aeext:registrantName.
|
||||||
|
*
|
||||||
|
* @param aeRegistrantID aeext:registrantID.
|
||||||
|
*
|
||||||
|
* @param aeRegistrantIDType aeext:registrantID type attribute.
|
||||||
|
*
|
||||||
|
* @param aeEligibilityName aeext:eligibilityName.
|
||||||
|
*
|
||||||
|
* @param aeEligibilityID aeext:eligibilityID.
|
||||||
|
*
|
||||||
|
* @param aeEligibilityIDType aeext:eligibilityID type attribute.
|
||||||
|
*/
|
||||||
|
DEPRECATED(
|
||||||
|
AeDomainCreateCommand (const std::string& name,
|
||||||
|
const std::string& pw,
|
||||||
|
const std::string* registrantID,
|
||||||
|
const std::vector<std::string>* techContacts,
|
||||||
|
const std::vector<std::string>* adminContacts,
|
||||||
|
const std::vector<std::string>* billingContacts,
|
||||||
|
const std::vector<std::string>* nameservers,
|
||||||
|
const Period *period,
|
||||||
|
const std::string &aeEligibilityType,
|
||||||
|
int aePolicyReason,
|
||||||
|
const std::string& aeRegistrantName,
|
||||||
|
const std::string* aeRegistrantID,
|
||||||
|
const std::string* aeRegistrantIDType,
|
||||||
|
const std::string* aeEligibilityName,
|
||||||
|
const std::string* aeEligibilityID,
|
||||||
|
const std::string* aeEligibilityIDType));
|
||||||
|
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);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <extension>
|
||||||
|
* <create xmlns="urn:X-ae:params:xml:ns:aeext-1.0">
|
||||||
|
* <registrantName>registrantName</registrantName>
|
||||||
|
* <registrantID type="registrantIDType">registrantID</registrantID>
|
||||||
|
* <eligibilityType>eligibilityType</eligibilityType>
|
||||||
|
* <eligibilityName>eligibilityName</eligibilityName>
|
||||||
|
* <eligibilityID type="eligibilityIDType">eligibilityID</eligibilityID>
|
||||||
|
* <policyReason>policyReason</policyReason>
|
||||||
|
* </create>
|
||||||
|
* </extension>
|
||||||
|
*/
|
||||||
|
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 // __AEDOMAINCREATECOMMAND_HPP
|
|
@ -0,0 +1,86 @@
|
||||||
|
#include "se/ContactCheckCommand.hpp"
|
||||||
|
#include "se/AeDomainCreateCommand.hpp"
|
||||||
|
#include "se/CLTRID.hpp"
|
||||||
|
#include "session/Timer.hpp"
|
||||||
|
#include "common/init.hpp"
|
||||||
|
#include "common/Test.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
void doWork()
|
||||||
|
{
|
||||||
|
init("etc/toolkit2.conf");
|
||||||
|
|
||||||
|
const string registrantName = "AusRegistry";
|
||||||
|
const string registrantID = "01241326211";
|
||||||
|
const string registrantIDType = "Trade License";
|
||||||
|
const string eligibilityType = "Trade License (IT)";
|
||||||
|
const int policyReason = 1;
|
||||||
|
const string eligibilityName = "Blah";
|
||||||
|
const string eligibilityID = "1231239523";
|
||||||
|
const string eligibilityIDType = "Trademark";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that the XML string generated for a minimal create domain command
|
||||||
|
* matches the expected XML for an EPP create domain command with those
|
||||||
|
* parameters.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
Timer::setTime("20070101.010101");
|
||||||
|
CLTRID::setClID("JTKUTEST");
|
||||||
|
|
||||||
|
vector<string> techIds;
|
||||||
|
techIds.push_back("JTKCON2");
|
||||||
|
string registrant("JTKCON");
|
||||||
|
AeDomainCreateCommand cmd("jtkutest.co.ae", "jtkUT3st", ®istrant, &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.co.ae</name><registrant>JTKCON</registrant><contact type=\"tech\">JTKCON2</contact><authInfo><pw>jtkUT3st</pw></authInfo></create></create><extension><create xmlns=\"urn:X-ae:params:xml:ns:aeext-1.0\" xsi:schemaLocation=\"urn:X-ae:params:xml:ns:aeext-1.0 aeext-1.0.xsd\"><aeProperties><registrantName>AusRegistry</registrantName><eligibilityType>Trade License (IT)</eligibilityType><policyReason>1</policyReason></aeProperties></create></extension><clTRID>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");
|
||||||
|
|
||||||
|
Period period(48, PeriodUnit::MONTHS());
|
||||||
|
|
||||||
|
AeDomainCreateCommand cmd(
|
||||||
|
"jtkutest.co.ae", "jtkUT3st", ®istrant,
|
||||||
|
&techIds, &adminContacts,
|
||||||
|
NULL, &nameServers, &period,
|
||||||
|
eligibilityType, policyReason,
|
||||||
|
registrantName, ®istrantID,
|
||||||
|
®istrantIDType, &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.co.ae</name><period unit=\"m\">48</period><ns><hostObj>ns1.ausregistry.net</hostObj><hostObj>ns2.ausregistry.net</hostObj></ns><registrant>JTKCON</registrant><contact type=\"admin\">JTKCON</contact><contact type=\"admin\">JTKCON2</contact><contact type=\"tech\">JTKCON2</contact><authInfo><pw>jtkUT3st</pw></authInfo></create></create><extension><create xmlns=\"urn:X-ae:params:xml:ns:aeext-1.0\" xsi:schemaLocation=\"urn:X-ae:params:xml:ns:aeext-1.0 aeext-1.0.xsd\"><aeProperties><registrantName>AusRegistry</registrantName><registrantID type=\"Trade License\">01241326211</registrantID><eligibilityType>Trade License (IT)</eligibilityType><eligibilityName>Blah</eligibilityName><eligibilityID type=\"Trademark\">1231239523</eligibilityID><policyReason>1</policyReason></aeProperties></create></extension><clTRID>JTKUTEST.20070101.010101.0</clTRID></command></epp>");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
TEST_run(doWork);
|
||||||
|
return TEST_errorCount();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
#include "se/AeDomainInfoResponse.hpp"
|
||||||
|
#include "se/StandardObjectType.hpp"
|
||||||
|
|
||||||
|
#include <stdlib.h> // atoi()
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
const std::string AeDomainInfoResponse::AEEXT_EXPR(Response::RESPONSE_EXPR() + "/e:extension/aeext:infData");
|
||||||
|
const std::string AeDomainInfoResponse::AE_PROPERTIES_EXPR(AeDomainInfoResponse::AEEXT_EXPR + "/aeext:aeProperties");
|
||||||
|
const std::string AeDomainInfoResponse::AE_REGISTRANT_NAME_EXPR(AeDomainInfoResponse::AE_PROPERTIES_EXPR + "/aeext:registrantName/text()");
|
||||||
|
const std::string AeDomainInfoResponse::AE_REGISTRANT_ID_EXPR(AeDomainInfoResponse::AE_PROPERTIES_EXPR + "/aeext:registrantID/text()");
|
||||||
|
const std::string AeDomainInfoResponse::AE_REGISTRANT_ID_TYPE_EXPR(AeDomainInfoResponse::AE_PROPERTIES_EXPR + "/aeext:registrantID/@type");
|
||||||
|
const std::string AeDomainInfoResponse::AE_ELI_TYPE_EXPR(AeDomainInfoResponse::AE_PROPERTIES_EXPR + "/aeext:eligibilityType/text()");
|
||||||
|
const std::string AeDomainInfoResponse::AE_ELI_NAME_EXPR(AeDomainInfoResponse::AE_PROPERTIES_EXPR + "/aeext:eligibilityName/text()");
|
||||||
|
const std::string AeDomainInfoResponse::AE_ELI_ID_EXPR(AeDomainInfoResponse::AE_PROPERTIES_EXPR + "/aeext:eligibilityID/text()");
|
||||||
|
const std::string AeDomainInfoResponse::AE_ELI_ID_TYPE_EXPR(AeDomainInfoResponse::AE_PROPERTIES_EXPR + "/aeext:eligibilityID/@type");
|
||||||
|
const std::string AeDomainInfoResponse::AE_POLICY_REASON_EXPR(AeDomainInfoResponse::AE_PROPERTIES_EXPR + "/aeext:policyReason/text()");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
AeDomainInfoResponse::AeDomainInfoResponse() : DomainInfoResponse()
|
||||||
|
{
|
||||||
|
policyReason = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AeDomainInfoResponse::fromXML (XMLDocument *xmlDoc) throw (ParsingException)
|
||||||
|
{
|
||||||
|
DomainInfoResponse::fromXML(xmlDoc);
|
||||||
|
|
||||||
|
if (!(resultArray[0].succeeded())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
registrantName = xmlDoc->getNodeValue (AE_REGISTRANT_NAME_EXPR);
|
||||||
|
registrantID = xmlDoc->getNodeValue (AE_REGISTRANT_ID_EXPR);
|
||||||
|
registrantIDType = xmlDoc->getNodeValue (AE_REGISTRANT_ID_TYPE_EXPR);
|
||||||
|
eligibilityType = xmlDoc->getNodeValue (AE_ELI_TYPE_EXPR);
|
||||||
|
eligibilityName = xmlDoc->getNodeValue (AE_ELI_NAME_EXPR);
|
||||||
|
eligibilityID = xmlDoc->getNodeValue (AE_ELI_ID_EXPR);
|
||||||
|
eligibilityIDType = xmlDoc->getNodeValue (AE_ELI_ID_TYPE_EXPR);
|
||||||
|
|
||||||
|
string polReasonStr = xmlDoc->getNodeValue (AE_POLICY_REASON_EXPR);
|
||||||
|
if (polReasonStr.length() > 0) {
|
||||||
|
policyReason = atoi (polReasonStr.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (XPathExpressionException& e)
|
||||||
|
{
|
||||||
|
maintLogger->warning(e.getMessage());
|
||||||
|
ParsingException pe("Could not parse AeDomainInfoResponse object.");
|
||||||
|
pe.causedBy(e);
|
||||||
|
throw pe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
#ifndef __AE_DOMAIN_INFO_RESPONSE_HPP
|
||||||
|
#define __AE_DOMAIN_INFO_RESPONSE_HPP
|
||||||
|
|
||||||
|
#include "common/Deprecated.hpp"
|
||||||
|
#include "se/DomainInfoResponse.hpp"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extension of the domain mapping of the EPP info response, as defined in
|
||||||
|
* RFC3730 and RFC3731, to .ae domain names, the specification of which is in
|
||||||
|
* the XML schema definition urn:X-ae:params:xml:ns:aeext-1.0.
|
||||||
|
* Instances of this class provide an interface to access all of the
|
||||||
|
* information available through EPP for a .ae domain name.
|
||||||
|
* This relies on the instance first being initialised by a suitable EPP domain
|
||||||
|
* info response using the method fromXML. For flexibility, this
|
||||||
|
* implementation extracts the data from the response using XPath queries, the
|
||||||
|
* expressions for which are defined statically.
|
||||||
|
|
||||||
|
* @deprecated AE eligibility extensions should now be managed through the
|
||||||
|
* @c <kvlist> extension defined in the
|
||||||
|
* <tt>urn:X-ar:params:xml:ns:kv-1.0</tt> namespace. This can be done
|
||||||
|
* through the toolkit by using a @c DomainInfoResponse and
|
||||||
|
* registering a @c DomainInfoKVResponseExtension object, which
|
||||||
|
* will contain the AE eligibility extensions.
|
||||||
|
*
|
||||||
|
* See
|
||||||
|
* {@link DomainInfoResponse.registerExtension(ResponseExtension)}
|
||||||
|
* and
|
||||||
|
* {@link DomainInfoKVResponseExtension}.
|
||||||
|
*/
|
||||||
|
class AeDomainInfoResponse : public DomainInfoResponse
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DEPRECATED(AeDomainInfoResponse());
|
||||||
|
|
||||||
|
const std::string& getRegistrantName() const { return registrantName; };
|
||||||
|
const std::string& getAERegistrantID() 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 AEEXT_EXPR,
|
||||||
|
AE_PROPERTIES_EXPR,
|
||||||
|
AE_REGISTRANT_NAME_EXPR,
|
||||||
|
AE_REGISTRANT_ID_EXPR,
|
||||||
|
AE_REGISTRANT_ID_TYPE_EXPR,
|
||||||
|
AE_ELI_TYPE_EXPR,
|
||||||
|
AE_ELI_NAME_EXPR,
|
||||||
|
AE_ELI_ID_EXPR,
|
||||||
|
AE_ELI_ID_TYPE_EXPR,
|
||||||
|
AE_POLICY_REASON_EXPR;
|
||||||
|
|
||||||
|
std::string registrantName,
|
||||||
|
registrantID,
|
||||||
|
registrantIDType,
|
||||||
|
eligibilityType,
|
||||||
|
eligibilityName,
|
||||||
|
eligibilityID,
|
||||||
|
eligibilityIDType;
|
||||||
|
|
||||||
|
int policyReason;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __AE_DOMAIN_INFO_RESPONSE_HPP
|
||||||
|
|
|
@ -0,0 +1,93 @@
|
||||||
|
#include "se/AeDomainModifyRegistrantCommand.hpp"
|
||||||
|
#include "common/ErrorPkg.hpp"
|
||||||
|
#include "se/AeExtension.hpp"
|
||||||
|
#include "xml/XMLHelper.hpp"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
AeExtension& aeExtension() {
|
||||||
|
static AeExtension* aeExtension = new AeExtension();
|
||||||
|
return *aeExtension;
|
||||||
|
}
|
||||||
|
}; // anonymous namespace
|
||||||
|
|
||||||
|
AeDomainModifyRegistrantCommand::AeDomainModifyRegistrantCommand(
|
||||||
|
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.ae.missing_arg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
DOMElement* aeextUpdate = xmlWriter->appendChild(
|
||||||
|
xmlWriter->appendChild(command, "extension"),
|
||||||
|
"update",
|
||||||
|
aeExtension().getURI());
|
||||||
|
|
||||||
|
aeextUpdate->setAttribute(
|
||||||
|
XStr("xsi:schemaLocation").str(),
|
||||||
|
XStr(aeExtension().getSchemaLocation()).str());
|
||||||
|
|
||||||
|
DOMElement* aeProperties = xmlWriter->appendChild(aeextUpdate,
|
||||||
|
"aeProperties");
|
||||||
|
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "registrantName"),
|
||||||
|
registrantName);
|
||||||
|
|
||||||
|
if (registrantID != NULL && registrantIDType != NULL)
|
||||||
|
{
|
||||||
|
xmlWriter->appendChild(
|
||||||
|
aeProperties,
|
||||||
|
"registrantID",
|
||||||
|
*registrantID,
|
||||||
|
"type",
|
||||||
|
*registrantIDType);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eligibilityType != NULL)
|
||||||
|
{
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "eligibilityType"),
|
||||||
|
*eligibilityType);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eligibilityName != NULL)
|
||||||
|
{
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "eligibilityName"),
|
||||||
|
*eligibilityName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eligibilityID != NULL && eligibilityIDType != NULL)
|
||||||
|
{
|
||||||
|
xmlWriter->appendChild(
|
||||||
|
aeProperties,
|
||||||
|
"eligibilityID",
|
||||||
|
*eligibilityID,
|
||||||
|
"type",
|
||||||
|
*eligibilityIDType);
|
||||||
|
}
|
||||||
|
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "policyReason"),
|
||||||
|
policyReason);
|
||||||
|
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeextUpdate, "explanation"),
|
||||||
|
explanation);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
#ifndef __AE_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP
|
||||||
|
#define __AE_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP
|
||||||
|
|
||||||
|
#include "common/Deprecated.hpp"
|
||||||
|
#include "se/DomainUpdateCommand.hpp"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An extension of the domain mapping of the EPP update command, as defined in
|
||||||
|
* RFC3730 and RFC3731, to .ae domain names, the specification of which is in
|
||||||
|
* the XML schema definition urn:X-ae:params:xml:ns:aeext-1.0.
|
||||||
|
* This class should only be used to correct ae extension data for .ae domain
|
||||||
|
* names, and only where the legal registrant has not changed.
|
||||||
|
* Use this class to generate a standards-compliant XML document, given simple
|
||||||
|
* input parameters. The toXML method in Command serialises this object to
|
||||||
|
* XML.
|
||||||
|
*
|
||||||
|
* @deprecated AE eligibility extensions should now be managed through the
|
||||||
|
* @c <kvlist> extension defined in the
|
||||||
|
* <tt>urn:X-ar:params:xml:ns:kv-1.0</tt> namespace. This can be done
|
||||||
|
* through the toolkit by using a @c DomainUpdateCommand and
|
||||||
|
* appending a @c DomainKVCommandExtension object containing
|
||||||
|
* the AE eligibility extensions.
|
||||||
|
*
|
||||||
|
* See
|
||||||
|
* {@link DomainUpdateCommand.appendExtension(CommandExtension)}
|
||||||
|
* and
|
||||||
|
* {@link DomainKVCommandExtension}.
|
||||||
|
*/
|
||||||
|
class AeDomainModifyRegistrantCommand : public DomainUpdateCommand
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DEPRECATED(
|
||||||
|
AeDomainModifyRegistrantCommand(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 // __AE_DOMAIN_MODIFY_REGISTRANT_COMMAND_HPP
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
#include "AeDomainObjectType.hpp"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
const std::string& AeDomainObjectType::getName() const {
|
||||||
|
static const std::string name = "aedom";
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& AeDomainObjectType::getURI() const {
|
||||||
|
static const std::string uri = "urn:X-ae:params:xml:ns:aedomain-1.0";
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& AeDomainObjectType::getSchemaLocation() const {
|
||||||
|
static const std::string schemaLocation =
|
||||||
|
"urn:X-ae:params:xml:ns:aedomain-1.0 aedomain-1.0.xsd";
|
||||||
|
return schemaLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& AeDomainObjectType::getIdentType() const {
|
||||||
|
static const std::string ident = "name";
|
||||||
|
return ident;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#ifndef AEDOMAIN_OBJECT_TYPE
|
||||||
|
#define AEDOMAIN_OBJECT_TYPE
|
||||||
|
|
||||||
|
#include "ObjectType.hpp"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class AeDomainObjectType : public ObjectType {
|
||||||
|
public:
|
||||||
|
virtual ~AeDomainObjectType(void) { }
|
||||||
|
|
||||||
|
virtual const std::string& getName() const;
|
||||||
|
virtual const std::string& getURI() const;
|
||||||
|
virtual const std::string& getSchemaLocation() const;
|
||||||
|
virtual const std::string& getIdentType() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // AEDOMAIN_OBJECT_TYPE
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
#include "se/AeDomainTransferRegistrantCommand.hpp"
|
||||||
|
#include "se/XMLGregorianCalendar.hpp"
|
||||||
|
|
||||||
|
#include "se/AeExtension.hpp"
|
||||||
|
#include "se/AeDomainObjectType.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& aeExtension() {
|
||||||
|
static Extension* aeExt = new AeExtension();
|
||||||
|
return *aeExt;
|
||||||
|
}
|
||||||
|
|
||||||
|
const RegistrantTransferCommandType rtrnType;
|
||||||
|
const AeDomainObjectType aedomType;
|
||||||
|
} // anonymous namespace
|
||||||
|
|
||||||
|
AeDomainTransferRegistrantCommand::AeDomainTransferRegistrantCommand (
|
||||||
|
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, &aedomType, name, aeExtension())
|
||||||
|
{
|
||||||
|
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.ae.missing_arg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
DOMElement *element;
|
||||||
|
|
||||||
|
std::string curExpDateStr = EPPDateFormatter::toXSDate(curExpDate);
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(objElement, "curExpDate"), curExpDateStr);
|
||||||
|
|
||||||
|
if (period)
|
||||||
|
period->appendPeriod(xmlWriter, objElement);
|
||||||
|
|
||||||
|
DOMElement *aeProperties = xmlWriter->appendChild(objElement, "aeProperties");
|
||||||
|
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "registrantName"), registrantName);
|
||||||
|
|
||||||
|
if (registrantID)
|
||||||
|
{
|
||||||
|
element = xmlWriter->appendChild(aeProperties, "registrantID");
|
||||||
|
XMLHelper::setTextContent(element, *registrantID);
|
||||||
|
XMLHelper::setAttribute(element, "type", *registrantIDType);
|
||||||
|
}
|
||||||
|
XMLHelper::setTextContent
|
||||||
|
(xmlWriter->appendChild(aeProperties, "eligibilityType"), eligibilityType);
|
||||||
|
|
||||||
|
if (eligibilityName)
|
||||||
|
{
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "eligibilityName"), *eligibilityName);
|
||||||
|
|
||||||
|
element = xmlWriter->appendChild(aeProperties, "eligibilityID");
|
||||||
|
XMLHelper::setTextContent(element, *eligibilityID);
|
||||||
|
XMLHelper::setAttribute(element, "type", *eligibilityIDType);
|
||||||
|
}
|
||||||
|
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(aeProperties, "policyReason"),
|
||||||
|
policyReason);
|
||||||
|
|
||||||
|
XMLHelper::setTextContent(
|
||||||
|
xmlWriter->appendChild(objElement, "explanation"),
|
||||||
|
explanation);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
#ifndef __AE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
|
||||||
|
#define __AE_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 .ae domain name has changed, this
|
||||||
|
* class should be used to request a transfer of registrant. This is a
|
||||||
|
* different action to correcting extension data which was originally specified
|
||||||
|
* incorrectly, and should only be used in the situation described. This
|
||||||
|
* command will result in the validity period of the domain name being updated
|
||||||
|
* and the requesting client being charged the usual create fee upon success of
|
||||||
|
* this operation.
|
||||||
|
* Use this class to generate a standards-compliant XML document, given simple
|
||||||
|
* input parameters. The toXML method in Command serialises this object to
|
||||||
|
* XML.
|
||||||
|
|
||||||
|
* @deprecated AE eligibility extensions should now be managed through the
|
||||||
|
* @c <kvlist> extension defined in the
|
||||||
|
* <tt>urn:X-ar:params:xml:ns:kv-1.0</tt> namespace. The Registrant
|
||||||
|
* Transfer command that utilises this extension is defined in the
|
||||||
|
* <tt>urn:X-ar:params:xml:ns:registrant-1.0</tt> namespace. This can
|
||||||
|
* be done through the toolkit by using a
|
||||||
|
* @c DomainRegistrantTransferCommand and specifying
|
||||||
|
* @c "ae" as the kvListName.
|
||||||
|
*
|
||||||
|
* See
|
||||||
|
* {@link DomainRegistrantTransferCommand}
|
||||||
|
* and
|
||||||
|
* {@link DomainRegistrantTransferCommand.addItem(std::string, std::string)}
|
||||||
|
*/
|
||||||
|
class AeDomainTransferRegistrantCommand : public ProtocolExtensionCommand
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request that the named .ae domain name be transferred to the legal
|
||||||
|
* entity specified by the given ae extension data.
|
||||||
|
*
|
||||||
|
* @param name The domain name to transfer.
|
||||||
|
*
|
||||||
|
* @param curExpDate The current expiry of the identified domain name.
|
||||||
|
* This is required in order to prevent repeated transfer of the name due
|
||||||
|
* to protocol transmission failures.
|
||||||
|
*
|
||||||
|
* @param eligibilityType
|
||||||
|
*
|
||||||
|
* @param policyReason
|
||||||
|
*
|
||||||
|
* @param registrantName
|
||||||
|
*
|
||||||
|
* @param explanation An explanation of how the transfer was effected.
|
||||||
|
*
|
||||||
|
* @param registrantID
|
||||||
|
*
|
||||||
|
* @param registrantIDType
|
||||||
|
*
|
||||||
|
* @param eligibilityName
|
||||||
|
*
|
||||||
|
* @param eligibilityID
|
||||||
|
*
|
||||||
|
* @param eligibilityIDType
|
||||||
|
*
|
||||||
|
* @param period The desired new validity period, starting from the time
|
||||||
|
* the transfer completes successfully.
|
||||||
|
*
|
||||||
|
* @param explanation An explanation of how the transfer was effected.
|
||||||
|
*/
|
||||||
|
DEPRECATED(
|
||||||
|
AeDomainTransferRegistrantCommand (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 // __AE_DOMAIN_TRANSFER_REGISTRANT_COMMAND_HPP
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
#include "se/AeDomainTransferRegistrantResponse.hpp"
|
||||||
|
#include "se/AeDomainObjectType.hpp"
|
||||||
|
#include "se/RegistrantTransferCommandType.hpp"
|
||||||
|
#include "se/EPPDateFormatter.hpp"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
const RegistrantTransferCommandType rtrnType;
|
||||||
|
const AeDomainObjectType aedomType;
|
||||||
|
} // anonymous namespace
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
const string AeDomainTransferRegistrantResponse::AEDOM_NAME_EXPR =
|
||||||
|
"/e:epp/e:response/e:resData/aedom:rtrnData/aedom:name/text()";
|
||||||
|
|
||||||
|
const string AeDomainTransferRegistrantResponse::AEDOM_EX_DATE_EXPR =
|
||||||
|
"/e:epp/e:response/e:resData/aedom:rtrnData/aedom:exDate/text()";
|
||||||
|
|
||||||
|
AeDomainTransferRegistrantResponse::AeDomainTransferRegistrantResponse()
|
||||||
|
: DataResponse(&rtrnType, &aedomType)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void AeDomainTransferRegistrantResponse::fromXML(XMLDocument* xmlDoc) throw (ParsingException)
|
||||||
|
{
|
||||||
|
DataResponse::fromXML(xmlDoc);
|
||||||
|
|
||||||
|
if (!(resultArray[0].succeeded())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
name = xmlDoc->getNodeValue(AEDOM_NAME_EXPR);
|
||||||
|
std::string exDateStr = xmlDoc->getNodeValue(AEDOM_EX_DATE_EXPR);
|
||||||
|
exDate = std::auto_ptr<XMLGregorianCalendar>(
|
||||||
|
EPPDateFormatter::fromXSDateTime(exDateStr));
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
#ifndef __AE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
|
||||||
|
#define __AE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
|
||||||
|
|
||||||
|
#include "common/Deprecated.hpp"
|
||||||
|
#include "se/DataResponse.hpp"
|
||||||
|
#include "se/XMLGregorianCalendar.hpp"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this to access create data for a domain as provided in an EPP domain
|
||||||
|
* create response compliant with RFCs 3730 and 3731. Such a service element
|
||||||
|
* is sent by a compliant EPP server in response to a valid domain create
|
||||||
|
* command, implemented by the DomainCreateCommand.
|
||||||
|
*
|
||||||
|
* @see DomainCreateCommand
|
||||||
|
|
||||||
|
* @deprecated Performing a registrant transfer with AE eligibility extensions
|
||||||
|
* should now be managed through the use of the
|
||||||
|
* @c DomainRegistrantTransferCommand and
|
||||||
|
* @c DomainRegistrantTransferResponse
|
||||||
|
*
|
||||||
|
* See
|
||||||
|
* {@link DomainRegistrantTransferCommand}
|
||||||
|
* and
|
||||||
|
* {@link DomainRegistrantTransferResponse}.
|
||||||
|
*/
|
||||||
|
class AeDomainTransferRegistrantResponse : public DataResponse
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DEPRECATED(AeDomainTransferRegistrantResponse());
|
||||||
|
|
||||||
|
const std::string& getName() { return name; }
|
||||||
|
const XMLGregorianCalendar* getExpiryDate() { return exDate.get(); }
|
||||||
|
void fromXML(XMLDocument* xmlDoc) throw (ParsingException);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const std::string AEDOM_NAME_EXPR;
|
||||||
|
static const std::string AEDOM_EX_DATE_EXPR;
|
||||||
|
|
||||||
|
std::string name;
|
||||||
|
std::auto_ptr<XMLGregorianCalendar> exDate;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __AE_DOMAIN_TRANSFER_REGISTRANT_RESPONSE
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
#include "se/AeExtension.hpp"
|
||||||
|
|
||||||
|
std::string& AeExtension::getURI() const
|
||||||
|
{
|
||||||
|
static std::string uri = "urn:X-ae:params:xml:ns:aeext-1.0";
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string& AeExtension::getSchemaLocation() const
|
||||||
|
{
|
||||||
|
static std::string loc = "urn:X-ae:params:xml:ns:aeext-1.0 aeext-1.0.xsd";
|
||||||
|
return loc;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef __AEEXTENSION_HPP
|
||||||
|
#define __AEEXTENSION_HPP
|
||||||
|
|
||||||
|
#include "se/Extension.hpp"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A bundled set of constants representing the .ae EPP extension
|
||||||
|
* schema. The namespace URI uniquely identifies the extension.
|
||||||
|
*/
|
||||||
|
class AeExtension : public Extension
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual ~AeExtension(void) { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the globally unique namespace URI which identifies this extension.
|
||||||
|
*/
|
||||||
|
virtual std::string& getURI() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the location hint for the XML schema used to validate EPP service
|
||||||
|
* element instances using this extension.
|
||||||
|
*/
|
||||||
|
virtual std::string& getSchemaLocation() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __AEEXTENSION_HPP
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#ifndef __APPENDABLE_HPP
|
||||||
|
#define __APPENDABLE_HPP
|
||||||
|
|
||||||
|
#include <xercesc/dom/DOMElement.hpp>
|
||||||
|
class XMLWriter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementors of this interface provide a mechanism for building the part of
|
||||||
|
* the service element DOM tree that they represent. This should only be
|
||||||
|
* implemented by developers wishing to extend the command / response framework
|
||||||
|
* of EPP.
|
||||||
|
*/
|
||||||
|
class Appendable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~Appendable(void) { }
|
||||||
|
/**
|
||||||
|
* Used internally for building a DOM representation of a service element.
|
||||||
|
* This really should not be exposed to the end user, but Java has no
|
||||||
|
* package-visible interface type.
|
||||||
|
*/
|
||||||
|
virtual xercesc::DOMElement* appendToElement(
|
||||||
|
XMLWriter* xmlWriter,
|
||||||
|
xercesc::DOMElement* parent) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // __APPENDABLE_HPP
|
|
@ -0,0 +1,25 @@
|
||||||
|
#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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#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
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
#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;
|
||||||
|
const 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);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
#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
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
#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("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();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
#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;
|
||||||
|
const ArDomainObjectType ardomType;
|
||||||
|
}; // anonymous namespace
|
||||||
|
|
||||||
|
ArDomainPolicyUndeleteCommand::ArDomainPolicyUndeleteCommand(
|
||||||
|
const std::string &name) : ProtocolExtensionCommand(
|
||||||
|
&polUndeleteCmdType, &ardomType, name, arExtension())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#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
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
#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("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();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
#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;
|
||||||
|
const ArDomainObjectType ardomType;
|
||||||
|
}; // anonymous namespace
|
||||||
|
|
||||||
|
ArDomainUndeleteCommand::ArDomainUndeleteCommand(
|
||||||
|
const std::string &name) : ProtocolExtensionCommand(
|
||||||
|
&undeleteCmdType, &ardomType, name, arExtension())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
#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
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
#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("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();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
#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;
|
||||||
|
const 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);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#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
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
#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("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();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
#include "se/ArDomainUnrenewResponse.hpp"
|
||||||
|
#include "se/ArDomainObjectType.hpp"
|
||||||
|
#include "se/ArUnrenewCommandType.hpp"
|
||||||
|
#include "se/EPPDateFormatter.hpp"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
const ArUnrenewCommandType urenType;
|
||||||
|
const 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));
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#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
|
|
@ -0,0 +1,54 @@
|
||||||
|
#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("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();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
#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;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
#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
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
#include "se/ArUnrenewCommandType.hpp"
|
||||||
|
|
||||||
|
const std::string ArUnrenewCommandType::cmdName("unrenew");
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#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 */
|
||||||
|
|
|
@ -0,0 +1,131 @@
|
||||||
|
#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 ®istrantName,
|
||||||
|
const std::string* registrantID,
|
||||||
|
const std::string ®istrantIDType)
|
||||||
|
{
|
||||||
|
setExtension (eligibilityType, policyReason, registrantName,
|
||||||
|
registrantID, ®istrantIDType, 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);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,147 @@
|
||||||
|
#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);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <extension>
|
||||||
|
* <create xmlns="urn:au:params:xml:ns:auext-1.1" xsi:schemaLocation="urn:au:params:xml:ns:auext-1.1 auext.1.1.xsd">
|
||||||
|
* <registrantName>registrantName</registrantName>
|
||||||
|
* <registrantID type="registrantIDType">registrantID</registrantID>
|
||||||
|
* <eligibilityType>eligibilityType</eligibilityType>
|
||||||
|
* <eligibilityName>eligibilityName</eligibilityName>
|
||||||
|
* <eligibilityID type="eligibilityIDType">eligibilityID</eligibilityID>
|
||||||
|
* <policyReason>policyReason</policyReason>
|
||||||
|
* </create>
|
||||||
|
* </extension>
|
||||||
|
*/
|
||||||
|
|
||||||
|
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
|
|
@ -0,0 +1,84 @@
|
||||||
|
#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("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", ®istrant, &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", ®istrant,
|
||||||
|
&techIds, &adminContacts,
|
||||||
|
NULL, &nameServers,
|
||||||
|
eligibilityType, policyReason,
|
||||||
|
registrantName, ®istrantID,
|
||||||
|
®istrantIDType, &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();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,124 @@
|
||||||
|
#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 ®istrantName,
|
||||||
|
const std::string* registrantID,
|
||||||
|
const std::string ®istrantIDType)
|
||||||
|
{
|
||||||
|
setExtension(eligibilityType, policyReason, registrantName,
|
||||||
|
registrantID, ®istrantIDType, 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);
|
||||||
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue