Created
January 31, 2015 16:55
-
-
Save bradylove/a549b17e7a2c3612a117 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Client | |
import "java.net.InetAddress" | |
def create_host(nameserver) | |
addrs = [] | |
addrs << InetAddress.getByName(nameserver.addr_v4) if nameserver.addr_v4 | |
addrs << InetAddress.getByName(nameserver.addr_v6) if nameserver.addr_v6 | |
command = JavaImport::Se::HostCreateCommand.new( | |
nameserver.name.to_java, | |
addrs.to_java(java.net.InetAddress) | |
) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ausregistry.jtoolkit2.se; | |
/** | |
* Use this to request that a host object be provisioned in an EPP Registry. | |
* Instances of this class generate RFC5730 and RFC5732 compliant host create | |
* EPP command service elements via the toXML method. | |
* | |
* @see com.ausregistry.jtoolkit2.se.HostCreateResponse | |
*/ | |
public class HostCreateCommand extends CreateCommand { | |
private static final long serialVersionUID = -3161264324911932444L; | |
/** | |
* Provision a host with the specified details which constitute the | |
* minimum valid parameters according to the EPP specification. This is | |
* the appropriate constructor to use for provisioning external hosts. | |
* | |
* @param name The new host's name. | |
*/ | |
public HostCreateCommand(String name) { | |
this(name, null); | |
} | |
/** | |
* Provision a host with the specified details. This constructor allows | |
* specification of any and all parameters for a host create command. | |
* | |
* @param name The new host's name. | |
* | |
* @param addresses The Internet addresses of the host to be provisioned. | |
* These should only be specified if the parent domain is sponsored by the | |
* client provisioning this host and the parent domain is provisioned in | |
* the domain name registry in which this host is being provisioned. That | |
* is, external hosts must not be assigned Internet addresses. | |
*/ | |
public HostCreateCommand(String name, InetAddress[] addresses) { | |
super(StandardObjectType.HOST, name); | |
if (addresses != null) { | |
for (InetAddress inaddr : addresses) { | |
inaddr.appendToElement(xmlWriter, objElement); | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NameError: no constructorfor arguments (java.lang.String,org.jruby.java.proxies.ArrayJavaProxy) on Java::ComAusregistryJtoolkit2Se::HostCreateCommand