mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 03:06:01 +02:00
Add and wire up the AllocationTokenExtension XML class
The extension itself isn't used for anything yet; allocation tokens can be passed for domain creates and checks but are ignored if present. This will be changed in a subsequent CL that adds AllocationToken entities and related logic. Usage of this extension in any other EPP flow will throw an UnsupportedExtensionException. The relevant spec is https://tools.ietf.org/html/draft-gould-allocation-token-04 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=181343188
This commit is contained in:
parent
f6f43badd4
commit
5f62947691
14 changed files with 177 additions and 3 deletions
|
@ -0,0 +1,38 @@
|
|||
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.model.domain.token;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.eppinput.EppInput.CommandExtension;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlValue;
|
||||
|
||||
/**
|
||||
* An allocation token extension that may be present on EPP domain commands.
|
||||
*
|
||||
* @see <a href="https://tools.ietf.org/html/draft-ietf-regext-allocation-token-04">the IETF
|
||||
* draft</a> for full details.
|
||||
*/
|
||||
@XmlRootElement(name = "allocationToken")
|
||||
public class AllocationTokenExtension extends ImmutableObject implements CommandExtension {
|
||||
|
||||
/** The allocation token for the command. */
|
||||
@XmlValue
|
||||
String allocationToken;
|
||||
|
||||
public String getAllocationToken() {
|
||||
return allocationToken;
|
||||
}
|
||||
}
|
31
java/google/registry/model/domain/token/package-info.java
Normal file
31
java/google/registry/model/domain/token/package-info.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2017 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
@XmlSchema(
|
||||
namespace = "urn:ietf:params:xml:ns:allocationToken-1.0",
|
||||
xmlns =
|
||||
@XmlNs(
|
||||
prefix = "allocationToken",
|
||||
namespaceURI = "urn:ietf:params:xml:ns:allocationToken-1.0"
|
||||
),
|
||||
elementFormDefault = XmlNsForm.QUALIFIED
|
||||
)
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
package google.registry.model.domain.token;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlNs;
|
||||
import javax.xml.bind.annotation.XmlNsForm;
|
||||
import javax.xml.bind.annotation.XmlSchema;
|
|
@ -51,6 +51,7 @@ import google.registry.model.domain.secdns.SecDnsCreateExtension;
|
|||
import google.registry.model.domain.secdns.SecDnsUpdateExtension;
|
||||
import google.registry.model.domain.superuser.DomainDeleteSuperuserExtension;
|
||||
import google.registry.model.domain.superuser.DomainTransferRequestSuperuserExtension;
|
||||
import google.registry.model.domain.token.AllocationTokenExtension;
|
||||
import google.registry.model.eppinput.ResourceCommand.ResourceCheck;
|
||||
import google.registry.model.eppinput.ResourceCommand.SingleResourceCommand;
|
||||
import google.registry.model.host.HostCommand;
|
||||
|
@ -329,6 +330,8 @@ public class EppInput extends ImmutableObject {
|
|||
@XmlElementRefs({
|
||||
// allocate create extension
|
||||
@XmlElementRef(type = AllocateCreateExtension.class),
|
||||
// allocation token extension
|
||||
@XmlElementRef(type = AllocationTokenExtension.class),
|
||||
// fee extension version 0.6
|
||||
@XmlElementRef(type = FeeCheckCommandExtensionV06.class),
|
||||
@XmlElementRef(type = FeeInfoCommandExtensionV06.class),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue