diff --git a/java/google/registry/flows/CheckApiAction.java b/java/google/registry/flows/CheckApiAction.java index ed91b4b76..007e5e609 100644 --- a/java/google/registry/flows/CheckApiAction.java +++ b/java/google/registry/flows/CheckApiAction.java @@ -20,6 +20,7 @@ import static com.google.common.io.Resources.getResource; import static com.google.common.net.HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN; import static google.registry.model.domain.fee.Fee.FEE_EXTENSION_URIS; import static google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension.FEE_0_11; +import static google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension.FEE_0_12; import static google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension.FEE_0_6; import static google.registry.model.registry.Registries.findTldForNameOrThrow; import static google.registry.util.DomainNameUtils.canonicalizeDomainName; @@ -120,6 +121,7 @@ public class CheckApiAction implements Runnable { if (available) { FeeCheckResponseExtension feeCheckResponseExtension = (FeeCheckResponseExtension) response.getFirstExtensionOfType( + FEE_0_12.getResponseExtensionClass(), FEE_0_11.getResponseExtensionClass(), FEE_0_6.getResponseExtensionClass()); if (feeCheckResponseExtension != null) { diff --git a/java/google/registry/flows/EppXmlTransformer.java b/java/google/registry/flows/EppXmlTransformer.java index e34a36ff8..8209cf32a 100644 --- a/java/google/registry/flows/EppXmlTransformer.java +++ b/java/google/registry/flows/EppXmlTransformer.java @@ -57,6 +57,7 @@ public class EppXmlTransformer { "secdns.xsd", "fee06.xsd", "fee11.xsd", + "fee12.xsd", "metadata.xsd", "mark.xsd", "dsig.xsd", @@ -173,4 +174,3 @@ public class EppXmlTransformer { } } } - diff --git a/java/google/registry/flows/LoggedInFlow.java b/java/google/registry/flows/LoggedInFlow.java index 5acc1c526..94032a568 100644 --- a/java/google/registry/flows/LoggedInFlow.java +++ b/java/google/registry/flows/LoggedInFlow.java @@ -17,6 +17,7 @@ package google.registry.flows; import static com.google.common.base.Verify.verifyNotNull; import static com.google.common.collect.Sets.difference; import static com.google.common.collect.Sets.intersection; +import static google.registry.model.domain.fee.Fee.FEE_EXTENSION_URIS; import static google.registry.model.registry.Registries.getTlds; import static google.registry.util.CollectionUtils.nullToEmpty; @@ -28,7 +29,6 @@ import google.registry.flows.EppException.CommandUseErrorException; import google.registry.flows.EppException.SyntaxErrorException; import google.registry.flows.EppException.UnimplementedExtensionException; import google.registry.model.eppcommon.ProtocolDefinition; -import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension; import google.registry.model.eppinput.EppInput.CommandExtension; import google.registry.model.registrar.Registrar; import google.registry.util.FormattingLogger; @@ -43,10 +43,7 @@ public abstract class LoggedInFlow extends Flow { * A blacklist of service extension URIs that will cause an error if they are used without being * declared on login. */ - private static final ImmutableSet UNDECLARED_URIS_BLACKLIST = - ImmutableSet.of( - ServiceExtension.FEE_0_6.getUri(), - ServiceExtension.FEE_0_11.getUri()); + private static final ImmutableSet UNDECLARED_URIS_BLACKLIST = FEE_EXTENSION_URIS; /** * The TLDs on which the logged-in registrar is allowed access domains. diff --git a/java/google/registry/flows/domain/DomainDeleteFlow.java b/java/google/registry/flows/domain/DomainDeleteFlow.java index 0d46f1b19..10e88385b 100644 --- a/java/google/registry/flows/domain/DomainDeleteFlow.java +++ b/java/google/registry/flows/domain/DomainDeleteFlow.java @@ -40,6 +40,7 @@ import google.registry.model.domain.fee.Credit; import google.registry.model.domain.fee.FeeTransformResponseExtension; import google.registry.model.domain.fee06.FeeDeleteResponseExtensionV06; import google.registry.model.domain.fee11.FeeDeleteResponseExtensionV11; +import google.registry.model.domain.fee12.FeeDeleteResponseExtensionV12; import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.secdns.SecDnsUpdateExtension; import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension; @@ -176,6 +177,9 @@ public class DomainDeleteFlow extends ResourceSyncDeleteFlow uris = nullToEmpty(sessionMetadata.getServiceExtensionUris()); + if (uris.contains(ServiceExtension.FEE_0_12.getUri())) { + return new FeeDeleteResponseExtensionV12.Builder(); + } if (uris.contains(ServiceExtension.FEE_0_11.getUri())) { return new FeeDeleteResponseExtensionV11.Builder(); } diff --git a/java/google/registry/model/BUILD b/java/google/registry/model/BUILD index aea4ecef2..0228ab733 100644 --- a/java/google/registry/model/BUILD +++ b/java/google/registry/model/BUILD @@ -15,6 +15,7 @@ FIELD_EXPOSERS = [ "domain/fee/FieldExposer.java", "domain/fee06/FieldExposer.java", "domain/fee11/FieldExposer.java", + "domain/fee12/FieldExposer.java", "domain/launch/FieldExposer.java", "domain/rgp/FieldExposer.java", "domain/secdns/FieldExposer.java", diff --git a/java/google/registry/model/domain/fee/Fee.java b/java/google/registry/model/domain/fee/Fee.java index 18d02e06d..d90cf2748 100644 --- a/java/google/registry/model/domain/fee/Fee.java +++ b/java/google/registry/model/domain/fee/Fee.java @@ -28,6 +28,11 @@ import google.registry.model.domain.fee11.FeeCreateCommandExtensionV11; import google.registry.model.domain.fee11.FeeRenewCommandExtensionV11; import google.registry.model.domain.fee11.FeeTransferCommandExtensionV11; import google.registry.model.domain.fee11.FeeUpdateCommandExtensionV11; +import google.registry.model.domain.fee12.FeeCheckCommandExtensionV12; +import google.registry.model.domain.fee12.FeeCreateCommandExtensionV12; +import google.registry.model.domain.fee12.FeeRenewCommandExtensionV12; +import google.registry.model.domain.fee12.FeeTransferCommandExtensionV12; +import google.registry.model.domain.fee12.FeeUpdateCommandExtensionV12; import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension; import java.math.BigDecimal; @@ -48,36 +53,42 @@ public class Fee extends BaseFee { Class>>>of( + FeeCheckCommandExtensionV12.class, FeeCheckCommandExtensionV11.class, FeeCheckCommandExtensionV06.class); public static final ImmutableList> FEE_CREATE_COMMAND_EXTENSIONS_IN_PREFERENCE_ORDER = ImmutableList.>of( + FeeCreateCommandExtensionV12.class, FeeCreateCommandExtensionV11.class, FeeCreateCommandExtensionV06.class); public static final ImmutableList> FEE_RENEW_COMMAND_EXTENSIONS_IN_PREFERENCE_ORDER = ImmutableList.>of( + FeeRenewCommandExtensionV12.class, FeeRenewCommandExtensionV11.class, FeeRenewCommandExtensionV06.class); public static final ImmutableList> FEE_TRANSFER_COMMAND_EXTENSIONS_IN_PREFERENCE_ORDER = ImmutableList.>of( + FeeTransferCommandExtensionV12.class, FeeTransferCommandExtensionV11.class, FeeTransferCommandExtensionV06.class); public static final ImmutableList> FEE_UPDATE_COMMAND_EXTENSIONS_IN_PREFERENCE_ORDER = ImmutableList.>of( + FeeUpdateCommandExtensionV12.class, FeeUpdateCommandExtensionV11.class, FeeUpdateCommandExtensionV06.class); public static final ImmutableSet FEE_EXTENSION_URIS = ImmutableSet.of( + ServiceExtension.FEE_0_12.getUri(), ServiceExtension.FEE_0_11.getUri(), ServiceExtension.FEE_0_6.getUri()); } diff --git a/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionItemV12.java b/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionItemV12.java new file mode 100644 index 000000000..78782efbe --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionItemV12.java @@ -0,0 +1,126 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import com.google.common.base.Ascii; +import com.google.common.base.CharMatcher; +import com.google.common.base.Optional; +import google.registry.model.ImmutableObject; +import google.registry.model.domain.Period; +import google.registry.model.domain.fee.FeeCheckCommandExtensionItem; +import google.registry.model.domain.fee.FeeCheckResponseExtensionItem; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.joda.money.CurrencyUnit; +import org.joda.time.DateTime; + +/** + * An individual price check item in version 0.12 of the fee extension on domain check commands. + * Items look like: + * + * + * 1 + * premium + * 2017-05-17T13:22:21.0Z + * + * + * In a change from previous versions of the extension, items do not contain domain names; instead, + * the names from the non-extension check element are used. + */ +@XmlType(propOrder = {"period", "feeClass", "feeDate"}) +public class FeeCheckCommandExtensionItemV12 + extends ImmutableObject implements FeeCheckCommandExtensionItem { + + /** The default validity period (if not specified) is 1 year for all operations. */ + static final Period DEFAULT_PERIOD = Period.create(1, Period.Unit.YEARS); + + @XmlAttribute(name = "name") + String commandName; + + @XmlAttribute + String phase; + + @XmlAttribute + String subphase; + + @XmlElement + Period period; + + @XmlElement(name = "class") + String feeClass; + + @XmlElement(name = "date") + DateTime feeDate; + + /** Version .12 does not support domain name or currency in fee extension items. */ + @Override + public boolean isDomainNameSupported() { + return false; + } + + @Override + public String getDomainName() { + throw new UnsupportedOperationException("Domain not supported"); + } + + @Override + public boolean isCurrencySupported() { + return false; + } + + @Override + public CurrencyUnit getCurrency() { + throw new UnsupportedOperationException("Currency not supported"); + } + + @Override + public String getUnparsedCommandName() { + return commandName; + } + + @Override + public CommandName getCommandName() { + // Require the xml string to be lowercase. + if (commandName != null && CharMatcher.javaLowerCase().matchesAllOf(commandName)) { + try { + return CommandName.valueOf(Ascii.toUpperCase(commandName)); + } catch (IllegalArgumentException e) { + // Swallow this and return UNKNOWN below because there's no matching CommandName. + } + } + return CommandName.UNKNOWN; + } + + @Override + public String getPhase() { + return phase; + } + + @Override + public String getSubphase() { + return subphase; + } + + @Override + public Period getPeriod() { + return Optional.fromNullable(period).or(DEFAULT_PERIOD); + } + + @Override + public FeeCheckResponseExtensionItem.Builder createResponseBuilder() { + return new FeeCheckResponseExtensionItemV12.Builder(); + } +} diff --git a/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionV12.java b/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionV12.java new file mode 100644 index 000000000..309d86239 --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeCheckCommandExtensionV12.java @@ -0,0 +1,69 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import google.registry.model.ImmutableObject; +import google.registry.model.domain.fee.FeeCheckCommandExtension; +import google.registry.model.domain.fee.FeeCheckResponseExtensionItem; +import java.util.Set; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.joda.money.CurrencyUnit; + +/** Version 0.12 of the fee extension that may be present on domain check commands. */ +@XmlRootElement(name = "check") +@XmlType(propOrder = {"currency", "items"}) +public class FeeCheckCommandExtensionV12 extends ImmutableObject + implements FeeCheckCommandExtension< + FeeCheckCommandExtensionItemV12, + FeeCheckResponseExtensionV12> { + + CurrencyUnit currency; + + @Override + public boolean isCurrencySupported() { + return true; + } + + @Override + public CurrencyUnit getCurrency() { + return currency; + } + + @XmlElement(name = "command") + Set items; + + @Override + public ImmutableSet getItems() { + return nullToEmptyImmutableCopy(items); + } + + @Override + public FeeCheckResponseExtensionV12 createResponse( + ImmutableList items) { + ImmutableList.Builder builder = new ImmutableList.Builder<>(); + for (FeeCheckResponseExtensionItem item : items) { + if (item instanceof FeeCheckResponseExtensionItemV12) { + builder.add((FeeCheckResponseExtensionItemV12) item); + } + } + return FeeCheckResponseExtensionV12.create(currency, builder.build()); + } +} diff --git a/java/google/registry/model/domain/fee12/FeeCheckResponseExtensionItemCommandV12.java b/java/google/registry/model/domain/fee12/FeeCheckResponseExtensionItemCommandV12.java new file mode 100644 index 000000000..66d45cf1a --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeCheckResponseExtensionItemCommandV12.java @@ -0,0 +1,105 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import static google.registry.util.CollectionUtils.forceEmptyToNull; + +import com.google.common.base.Ascii; +import com.google.common.collect.ImmutableList; +import google.registry.model.Buildable.GenericBuilder; +import google.registry.model.ImmutableObject; +import google.registry.model.domain.Period; +import google.registry.model.domain.fee.Fee; +import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName; +import java.util.List; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + * The version 0.12 response command entity for a domain check on a single resource. + */ +@XmlType(propOrder = {"period", "fee", "feeClass"}) +public class FeeCheckResponseExtensionItemCommandV12 extends ImmutableObject { + + /** The command that was checked. */ + @XmlAttribute(name = "name") + String commandName; + + /** The phase that was checked. */ + @XmlAttribute + String phase; + + /** The subphase that was checked. */ + @XmlAttribute + String subphase; + + /** The period that was checked. */ + Period period; + + /** + * The magnitude of the fee, in the specified units, with an optional description. + * + *

This is a list because a single operation can involve multiple fees. + */ + List fee; + + /** + * The type of the fee. + * + *

We will use "premium" for fees on premium names, and omit the field otherwise. + */ + @XmlElement(name = "class") + String feeClass; + + public String getFeeClass() { + return feeClass; + } + + /** Builder for {@link FeeCheckResponseExtensionItemCommandV12}. */ + public static class Builder + extends GenericBuilder { + + public Builder setCommandName(CommandName commandName) { + getInstance().commandName = Ascii.toLowerCase(commandName.name()); + return this; + } + + public Builder setPhase(String phase) { + getInstance().phase = phase; + return this; + } + + public Builder setSubphase(String subphase) { + getInstance().subphase = subphase; + return this; + } + + public Builder setPeriod(Period period) { + getInstance().period = period; + return this; + } + + public Builder setFee(List fees) { + getInstance().fee = forceEmptyToNull(ImmutableList.copyOf(fees)); + return this; + } + + public Builder setClass(String feeClass) { + getInstance().feeClass = feeClass; + return this; + } + } +} diff --git a/java/google/registry/model/domain/fee12/FeeCheckResponseExtensionItemV12.java b/java/google/registry/model/domain/fee12/FeeCheckResponseExtensionItemV12.java new file mode 100644 index 000000000..fc957009b --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeCheckResponseExtensionItemV12.java @@ -0,0 +1,115 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import static google.registry.util.CollectionUtils.forceEmptyToNull; + +import com.google.common.collect.ImmutableList; +import google.registry.model.Buildable.GenericBuilder; +import google.registry.model.ImmutableObject; +import google.registry.model.domain.DomainObjectSpec; +import google.registry.model.domain.Period; +import google.registry.model.domain.fee.Fee; +import google.registry.model.domain.fee.FeeCheckResponseExtensionItem; +import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName; +import java.util.List; +import javax.xml.bind.annotation.XmlType; +import org.joda.money.CurrencyUnit; + +/** + * The version 0.12 response for a domain check on a single resource. + */ +@XmlType(propOrder = {"object", "command"}) +public class FeeCheckResponseExtensionItemV12 + extends ImmutableObject implements FeeCheckResponseExtensionItem { + + /** The domain that was checked. */ + DomainObjectSpec object; + + /** The command that was checked. */ + FeeCheckResponseExtensionItemCommandV12 command; + + @Override + public String getFeeClass() { + return command.getFeeClass(); + } + + /** Builder for {@link FeeCheckResponseExtensionItemV12}. */ + public static class Builder + extends GenericBuilder + implements FeeCheckResponseExtensionItem.Builder { + + final FeeCheckResponseExtensionItemCommandV12.Builder commandBuilder; + + Builder() { + super(); + commandBuilder = new FeeCheckResponseExtensionItemCommandV12.Builder(); + } + + @Override + public Builder setCommand(CommandName commandName, String phase, String subphase) { + commandBuilder.setCommandName(commandName); + commandBuilder.setPhase(phase); + commandBuilder.setSubphase(subphase); + return this; + } + + @Override + public Builder setPeriod(Period period) { + commandBuilder.setPeriod(period); + return this; + } + + @Override + public Builder setFees(List fees) { + commandBuilder.setFee(forceEmptyToNull(ImmutableList.copyOf(fees))); + return this; + } + + @Override + public Builder setClass(String feeClass) { + commandBuilder.setClass(feeClass); + return this; + } + + @Override + public Builder setDomainNameIfSupported(String name) { + getInstance().object = new DomainObjectSpec(name); + return this; + } + + /** Version 0.12 does not support currency in check items. */ + @Override + public Builder setCurrencyIfSupported(CurrencyUnit currency) { + return this; + } + + @Override + public Builder setAvailIfSupported(boolean avail) { + return this; + } + + @Override + public Builder setReasonIfSupported(String reason) { + return this; + } + + @Override + public FeeCheckResponseExtensionItemV12 build() { + getInstance().command = commandBuilder.build(); + return super.build(); + } + } +} diff --git a/java/google/registry/model/domain/fee12/FeeCheckResponseExtensionV12.java b/java/google/registry/model/domain/fee12/FeeCheckResponseExtensionV12.java new file mode 100644 index 000000000..9c02ed0b5 --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeCheckResponseExtensionV12.java @@ -0,0 +1,59 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import google.registry.model.ImmutableObject; +import google.registry.model.domain.fee.FeeCheckResponseExtension; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.joda.money.CurrencyUnit; + +/** + * An XML data object that represents version 0.12 of the fee extension that may be present on the + * response to EPP domain check commands. + */ +@XmlRootElement(name = "chkData") +@XmlType(propOrder = {"currency", "items"}) +public class FeeCheckResponseExtensionV12 + extends ImmutableObject implements FeeCheckResponseExtension { + + CurrencyUnit currency; + + /** Check responses. */ + @XmlElement(name = "cd") + ImmutableList items; + + @Override + public void setCurrencyIfSupported(CurrencyUnit currency) { + this.currency = currency; + } + + @VisibleForTesting + @Override + public ImmutableList getItems() { + return items; + } + + static FeeCheckResponseExtensionV12 + create(CurrencyUnit currency, ImmutableList items) { + FeeCheckResponseExtensionV12 instance = new FeeCheckResponseExtensionV12(); + instance.currency = currency; + instance.items = items; + return instance; + } +} diff --git a/java/google/registry/model/domain/fee12/FeeCreateCommandExtensionV12.java b/java/google/registry/model/domain/fee12/FeeCreateCommandExtensionV12.java new file mode 100644 index 000000000..9c17ae7d8 --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeCreateCommandExtensionV12.java @@ -0,0 +1,33 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import google.registry.model.domain.fee.FeeTransformCommandExtension; +import google.registry.model.domain.fee.FeeTransformCommandExtensionImpl; +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** A fee extension that may be present on domain create commands. */ +@XmlRootElement(name = "create") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeCreateCommandExtensionV12 + extends FeeTransformCommandExtensionImpl implements FeeTransformCommandExtension { + + @Override + public FeeTransformResponseExtension.Builder createResponseBuilder() { + return new FeeCreateResponseExtensionV12.Builder(); + } +} diff --git a/java/google/registry/model/domain/fee12/FeeCreateResponseExtensionV12.java b/java/google/registry/model/domain/fee12/FeeCreateResponseExtensionV12.java new file mode 100644 index 000000000..dcf014078 --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeCreateResponseExtensionV12.java @@ -0,0 +1,31 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import google.registry.model.domain.fee.FeeTransformResponseExtensionImpl; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain create commands. + */ +@XmlRootElement(name = "creData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeCreateResponseExtensionV12 extends FeeTransformResponseExtensionImpl { + /** A builder for {@link FeeCreateResponseExtensionV12}. */ + public static class Builder + extends FeeTransformResponseExtensionImpl.Builder {} +} diff --git a/java/google/registry/model/domain/fee12/FeeDeleteResponseExtensionV12.java b/java/google/registry/model/domain/fee12/FeeDeleteResponseExtensionV12.java new file mode 100644 index 000000000..c84f2fd3b --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeDeleteResponseExtensionV12.java @@ -0,0 +1,32 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import google.registry.model.domain.fee.FeeTransformResponseExtensionImpl; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain create commands. + */ +@XmlRootElement(name = "delData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeDeleteResponseExtensionV12 extends FeeTransformResponseExtensionImpl { + + /** Builder for {@link FeeDeleteResponseExtensionV12}. */ + public static class Builder + extends FeeTransformResponseExtensionImpl.Builder {} +} diff --git a/java/google/registry/model/domain/fee12/FeeRenewCommandExtensionV12.java b/java/google/registry/model/domain/fee12/FeeRenewCommandExtensionV12.java new file mode 100644 index 000000000..b4402aca3 --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeRenewCommandExtensionV12.java @@ -0,0 +1,33 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import google.registry.model.domain.fee.FeeTransformCommandExtension; +import google.registry.model.domain.fee.FeeTransformCommandExtensionImpl; +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** A fee extension that may be present on domain renew commands. */ +@XmlRootElement(name = "renew") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeRenewCommandExtensionV12 + extends FeeTransformCommandExtensionImpl implements FeeTransformCommandExtension { + + @Override + public FeeTransformResponseExtension.Builder createResponseBuilder() { + return new FeeRenewResponseExtensionV12.Builder(); + } +} diff --git a/java/google/registry/model/domain/fee12/FeeRenewResponseExtensionV12.java b/java/google/registry/model/domain/fee12/FeeRenewResponseExtensionV12.java new file mode 100644 index 000000000..4cc37b2ce --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeRenewResponseExtensionV12.java @@ -0,0 +1,31 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import google.registry.model.domain.fee.FeeTransformResponseExtensionImpl; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain renew commands. + */ +@XmlRootElement(name = "renData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeRenewResponseExtensionV12 extends FeeTransformResponseExtensionImpl { + /** A builder for {@link FeeRenewResponseExtensionV12}. */ + public static class Builder + extends FeeTransformResponseExtensionImpl.Builder {} +} diff --git a/java/google/registry/model/domain/fee12/FeeTransferCommandExtensionV12.java b/java/google/registry/model/domain/fee12/FeeTransferCommandExtensionV12.java new file mode 100644 index 000000000..d7594fa9c --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeTransferCommandExtensionV12.java @@ -0,0 +1,33 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import google.registry.model.domain.fee.FeeTransformCommandExtension; +import google.registry.model.domain.fee.FeeTransformCommandExtensionImpl; +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** A fee extension that may be present on domain transfer requests. */ +@XmlRootElement(name = "transfer") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeTransferCommandExtensionV12 + extends FeeTransformCommandExtensionImpl implements FeeTransformCommandExtension { + + @Override + public FeeTransformResponseExtension.Builder createResponseBuilder() { + return new FeeTransferResponseExtensionV12.Builder(); + } +} diff --git a/java/google/registry/model/domain/fee12/FeeTransferResponseExtensionV12.java b/java/google/registry/model/domain/fee12/FeeTransferResponseExtensionV12.java new file mode 100644 index 000000000..92ca3d0ed --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeTransferResponseExtensionV12.java @@ -0,0 +1,31 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import google.registry.model.domain.fee.FeeTransformResponseExtensionImpl; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain transfer requests. + */ +@XmlRootElement(name = "trnData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeTransferResponseExtensionV12 extends FeeTransformResponseExtensionImpl { + /** A builder for {@link FeeTransferResponseExtensionV12}. */ + public static class Builder + extends FeeTransformResponseExtensionImpl.Builder {} +} diff --git a/java/google/registry/model/domain/fee12/FeeUpdateCommandExtensionV12.java b/java/google/registry/model/domain/fee12/FeeUpdateCommandExtensionV12.java new file mode 100644 index 000000000..ffc1ce719 --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeUpdateCommandExtensionV12.java @@ -0,0 +1,33 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import google.registry.model.domain.fee.FeeTransformCommandExtension; +import google.registry.model.domain.fee.FeeTransformCommandExtensionImpl; +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** A fee extension that may be present on domain update commands. */ +@XmlRootElement(name = "update") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeUpdateCommandExtensionV12 + extends FeeTransformCommandExtensionImpl implements FeeTransformCommandExtension { + + @Override + public FeeTransformResponseExtension.Builder createResponseBuilder() { + return new FeeUpdateResponseExtensionV12.Builder(); + } +} diff --git a/java/google/registry/model/domain/fee12/FeeUpdateResponseExtensionV12.java b/java/google/registry/model/domain/fee12/FeeUpdateResponseExtensionV12.java new file mode 100644 index 000000000..fa1fe53f8 --- /dev/null +++ b/java/google/registry/model/domain/fee12/FeeUpdateResponseExtensionV12.java @@ -0,0 +1,31 @@ +// Copyright 2016 The Domain Registry 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.fee12; + +import google.registry.model.domain.fee.FeeTransformResponseExtensionImpl; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain update commands. + */ +@XmlRootElement(name = "updData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeUpdateResponseExtensionV12 extends FeeTransformResponseExtensionImpl { + /** A builder for {@link FeeUpdateResponseExtensionV12}. */ + public static class Builder + extends FeeTransformResponseExtensionImpl.Builder {} +} diff --git a/java/google/registry/model/domain/fee12/package-info.java b/java/google/registry/model/domain/fee12/package-info.java new file mode 100644 index 000000000..73a24dd91 --- /dev/null +++ b/java/google/registry/model/domain/fee12/package-info.java @@ -0,0 +1,29 @@ +// Copyright 2016 The Domain Registry 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:fee-0.12", + xmlns = @XmlNs(prefix = "fee12", namespaceURI = "urn:ietf:params:xml:ns:fee-0.12"), + elementFormDefault = XmlNsForm.QUALIFIED) +@XmlAccessorType(XmlAccessType.FIELD) +@XmlJavaTypeAdapter(CurrencyUnitAdapter.class) +package google.registry.model.domain.fee12; + +import google.registry.model.translators.CurrencyUnitAdapter; +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; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; diff --git a/java/google/registry/model/eppcommon/ProtocolDefinition.java b/java/google/registry/model/eppcommon/ProtocolDefinition.java index bbe61d54a..77d3ebe2f 100644 --- a/java/google/registry/model/eppcommon/ProtocolDefinition.java +++ b/java/google/registry/model/eppcommon/ProtocolDefinition.java @@ -26,6 +26,8 @@ import google.registry.model.domain.fee06.FeeCheckCommandExtensionV06; import google.registry.model.domain.fee06.FeeCheckResponseExtensionV06; import google.registry.model.domain.fee11.FeeCheckCommandExtensionV11; import google.registry.model.domain.fee11.FeeCheckResponseExtensionV11; +import google.registry.model.domain.fee12.FeeCheckCommandExtensionV12; +import google.registry.model.domain.fee12.FeeCheckResponseExtensionV12; import google.registry.model.domain.launch.LaunchCreateExtension; import google.registry.model.domain.metadata.MetadataExtension; import google.registry.model.domain.rgp.RgpUpdateExtension; @@ -54,6 +56,7 @@ public class ProtocolDefinition { SECURE_DNS_1_1(SecDnsCreateExtension.class, null, true), FEE_0_6(FeeCheckCommandExtensionV06.class, FeeCheckResponseExtensionV06.class, true), FEE_0_11(FeeCheckCommandExtensionV11.class, FeeCheckResponseExtensionV11.class, true), + FEE_0_12(FeeCheckCommandExtensionV12.class, FeeCheckResponseExtensionV12.class, true), ALLOCATE_1_0(AllocateCreateExtension.class, null, false), METADATA_1_0(MetadataExtension.class, null, false); diff --git a/java/google/registry/model/eppinput/EppInput.java b/java/google/registry/model/eppinput/EppInput.java index 62f1199e6..3552c9bfd 100644 --- a/java/google/registry/model/eppinput/EppInput.java +++ b/java/google/registry/model/eppinput/EppInput.java @@ -36,6 +36,11 @@ import google.registry.model.domain.fee11.FeeCreateCommandExtensionV11; import google.registry.model.domain.fee11.FeeRenewCommandExtensionV11; import google.registry.model.domain.fee11.FeeTransferCommandExtensionV11; import google.registry.model.domain.fee11.FeeUpdateCommandExtensionV11; +import google.registry.model.domain.fee12.FeeCheckCommandExtensionV12; +import google.registry.model.domain.fee12.FeeCreateCommandExtensionV12; +import google.registry.model.domain.fee12.FeeRenewCommandExtensionV12; +import google.registry.model.domain.fee12.FeeTransferCommandExtensionV12; +import google.registry.model.domain.fee12.FeeUpdateCommandExtensionV12; import google.registry.model.domain.launch.LaunchCheckExtension; import google.registry.model.domain.launch.LaunchCreateExtension; import google.registry.model.domain.launch.LaunchDeleteExtension; @@ -311,6 +316,12 @@ public class EppInput extends ImmutableObject { @XmlElementRef(type = FeeRenewCommandExtensionV11.class), @XmlElementRef(type = FeeTransferCommandExtensionV11.class), @XmlElementRef(type = FeeUpdateCommandExtensionV11.class), + // fee extension version 0.12 + @XmlElementRef(type = FeeCheckCommandExtensionV12.class), + @XmlElementRef(type = FeeCreateCommandExtensionV12.class), + @XmlElementRef(type = FeeRenewCommandExtensionV12.class), + @XmlElementRef(type = FeeTransferCommandExtensionV12.class), + @XmlElementRef(type = FeeUpdateCommandExtensionV12.class), // other extensions @XmlElementRef(type = LaunchCheckExtension.class), @XmlElementRef(type = LaunchCreateExtension.class), diff --git a/java/google/registry/model/eppoutput/EppResponse.java b/java/google/registry/model/eppoutput/EppResponse.java index a1d453d4b..ec95facf8 100644 --- a/java/google/registry/model/eppoutput/EppResponse.java +++ b/java/google/registry/model/eppoutput/EppResponse.java @@ -35,6 +35,12 @@ import google.registry.model.domain.fee11.FeeDeleteResponseExtensionV11; import google.registry.model.domain.fee11.FeeRenewResponseExtensionV11; import google.registry.model.domain.fee11.FeeTransferResponseExtensionV11; import google.registry.model.domain.fee11.FeeUpdateResponseExtensionV11; +import google.registry.model.domain.fee12.FeeCheckResponseExtensionV12; +import google.registry.model.domain.fee12.FeeCreateResponseExtensionV12; +import google.registry.model.domain.fee12.FeeDeleteResponseExtensionV12; +import google.registry.model.domain.fee12.FeeRenewResponseExtensionV12; +import google.registry.model.domain.fee12.FeeTransferResponseExtensionV12; +import google.registry.model.domain.fee12.FeeUpdateResponseExtensionV12; import google.registry.model.domain.launch.LaunchCheckResponseExtension; import google.registry.model.domain.launch.LaunchCreateResponseExtension; import google.registry.model.domain.launch.LaunchInfoResponseExtension; @@ -140,6 +146,12 @@ public class EppResponse extends ImmutableObject implements ResponseOrGreeting { @XmlElementRef(type = FeeRenewResponseExtensionV11.class), @XmlElementRef(type = FeeTransferResponseExtensionV11.class), @XmlElementRef(type = FeeUpdateResponseExtensionV11.class), + @XmlElementRef(type = FeeCheckResponseExtensionV12.class), + @XmlElementRef(type = FeeCreateResponseExtensionV12.class), + @XmlElementRef(type = FeeDeleteResponseExtensionV12.class), + @XmlElementRef(type = FeeRenewResponseExtensionV12.class), + @XmlElementRef(type = FeeTransferResponseExtensionV12.class), + @XmlElementRef(type = FeeUpdateResponseExtensionV12.class), @XmlElementRef(type = LaunchCheckResponseExtension.class), @XmlElementRef(type = LaunchCreateResponseExtension.class), @XmlElementRef(type = LaunchInfoResponseExtension.class), diff --git a/java/google/registry/xjc/XjcXmlTransformer.java b/java/google/registry/xjc/XjcXmlTransformer.java index b8837ddf5..8353d4454 100644 --- a/java/google/registry/xjc/XjcXmlTransformer.java +++ b/java/google/registry/xjc/XjcXmlTransformer.java @@ -44,6 +44,7 @@ public class XjcXmlTransformer { .put("smd", "smd.xsd") .put("fee06", "fee06.xsd") .put("fee11", "fee11.xsd") + .put("fee12", "fee12.xsd") .put("launch", "launch.xsd") .put("rde", "rde.xsd") .put("rdeheader", "rde-header.xsd") diff --git a/java/google/registry/xjc/bindings.xjb b/java/google/registry/xjc/bindings.xjb index 2cc7a83ef..c46406180 100644 --- a/java/google/registry/xjc/bindings.xjb +++ b/java/google/registry/xjc/bindings.xjb @@ -155,6 +155,15 @@ + + + + + + + + + diff --git a/java/google/registry/xjc/generated_files.bzl b/java/google/registry/xjc/generated_files.bzl index 00eebaa87..ba0cc46a7 100644 --- a/java/google/registry/xjc/generated_files.bzl +++ b/java/google/registry/xjc/generated_files.bzl @@ -1,3 +1,4 @@ + # # .'``'. ... # :o o `....'` ; @@ -25,6 +26,7 @@ pkginfo_generated_files = [ "eppcom/package-info.java", "fee06/package-info.java", "fee11/package-info.java", + "fee12/package-info.java", "host/package-info.java", "iirdea/package-info.java", "launch/package-info.java", @@ -208,6 +210,25 @@ xjc_generated_files = [ "fee11/XjcFee11TrnData.java", "fee11/XjcFee11UpdData.java", "fee11/XjcFee11Update.java", + "fee12/ObjectFactory.java", + "fee12/XjcFee12Check.java", + "fee12/XjcFee12ChkData.java", + "fee12/XjcFee12CommandCDType.java", + "fee12/XjcFee12CommandCheckType.java", + "fee12/XjcFee12CreData.java", + "fee12/XjcFee12Create.java", + "fee12/XjcFee12CreditType.java", + "fee12/XjcFee12DelData.java", + "fee12/XjcFee12FeeType.java", + "fee12/XjcFee12ObjectCDType.java", + "fee12/XjcFee12RenData.java", + "fee12/XjcFee12Renew.java", + "fee12/XjcFee12Transfer.java", + "fee12/XjcFee12TransformCommandType.java", + "fee12/XjcFee12TransformResultType.java", + "fee12/XjcFee12TrnData.java", + "fee12/XjcFee12UpdData.java", + "fee12/XjcFee12Update.java", "host/ObjectFactory.java", "host/XjcHostAddRemType.java", "host/XjcHostAddrType.java", diff --git a/java/google/registry/xjc/make_pkginfo.sh b/java/google/registry/xjc/make_pkginfo.sh index 30f8d7317..65ebfa1d5 100755 --- a/java/google/registry/xjc/make_pkginfo.sh +++ b/java/google/registry/xjc/make_pkginfo.sh @@ -35,6 +35,7 @@ create epp urn:ietf:params:xml:ns:epp-1.0 create eppcom urn:ietf:params:xml:ns:eppcom-1.0 create fee06 urn:ietf:params:xml:ns:fee-0.6 create fee11 urn:ietf:params:xml:ns:fee-0.11 +create fee12 urn:ietf:params:xml:ns:fee-0.12 create host urn:ietf:params:xml:ns:host-1.0 create iirdea urn:ietf:params:xml:ns:iirdea-1.0 create launch urn:ietf:params:xml:ns:launch-1.0 diff --git a/java/google/registry/xjc/package-info.java.in b/java/google/registry/xjc/package-info.java.in index f58d05f36..8a2fecc50 100644 --- a/java/google/registry/xjc/package-info.java.in +++ b/java/google/registry/xjc/package-info.java.in @@ -24,6 +24,9 @@ @javax.xml.bind.annotation.XmlNs( prefix = "fee11", namespaceURI = "urn:ietf:params:xml:ns:fee-0.11"), + @javax.xml.bind.annotation.XmlNs( + prefix = "fee12", + namespaceURI = "urn:ietf:params:xml:ns:fee-0.12"), @javax.xml.bind.annotation.XmlNs( prefix = "host", namespaceURI = "urn:ietf:params:xml:ns:host-1.0"), diff --git a/java/google/registry/xml/xsd/fee12.xsd b/java/google/registry/xml/xsd/fee12.xsd new file mode 100644 index 000000000..d900cfaaa --- /dev/null +++ b/java/google/registry/xml/xsd/fee12.xsd @@ -0,0 +1,242 @@ + + + + + + + + Extensible Provisioning Protocol + v1.0 extension schema for fee + information. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java index f246b2edb..62917448f 100644 --- a/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainApplicationCreateFlowTest.java @@ -479,6 +479,15 @@ public class DomainApplicationCreateFlowTest doSuccessfulTest("domain_create_landrush_fee_response.xml", false, "0.11", "fee11"); } + @Test + public void testSuccess_landrushApplicationWithFee_v12() throws Exception { + createTld("tld", TldState.LANDRUSH); + setEppInput("domain_create_landrush_fee.xml", ImmutableMap.of("FEE_VERSION", "0.12")); + persistContactsAndHosts(); + clock.advanceOneMilli(); + doSuccessfulTest("domain_create_landrush_fee_response.xml", false, "0.12", "fee12"); + } + @Test public void testSuccess_landrushApplicationWithFee_withDefaultAttributes_v06() throws Exception { createTld("tld", TldState.LANDRUSH); @@ -497,6 +506,15 @@ public class DomainApplicationCreateFlowTest doSuccessfulTest("domain_create_landrush_fee_response.xml", false, "0.11", "fee11"); } + @Test + public void testSuccess_landrushApplicationWithFee_withDefaultAttributes_v12() throws Exception { + createTld("tld", TldState.LANDRUSH); + setEppInput("domain_create_landrush_fee_defaults.xml", ImmutableMap.of("FEE_VERSION", "0.12")); + persistContactsAndHosts(); + clock.advanceOneMilli(); + doSuccessfulTest("domain_create_landrush_fee_response.xml", false, "0.12", "fee12"); + } + @Test public void testFailure_landrushApplicationWithRefundableFee_v06() throws Exception { thrown.expect(UnsupportedFeeAttributeException.class); @@ -518,6 +536,17 @@ public class DomainApplicationCreateFlowTest runFlow(); } + @Test + public void testFailure_landrushApplicationWithRefundableFee_v12() throws Exception { + thrown.expect(UnsupportedFeeAttributeException.class); + createTld("tld", TldState.LANDRUSH); + persistContactsAndHosts(); + clock.advanceOneMilli(); + setEppInput( + "domain_create_landrush_fee_refundable.xml", ImmutableMap.of("FEE_VERSION", "0.12")); + runFlow(); + } + @Test public void testFailure_landrushApplicationWithGracePeriodFee_v06() throws Exception { thrown.expect(UnsupportedFeeAttributeException.class); @@ -540,6 +569,17 @@ public class DomainApplicationCreateFlowTest runFlow(); } + @Test + public void testFailure_landrushApplicationWithGracePeriodFee_v12() throws Exception { + thrown.expect(UnsupportedFeeAttributeException.class); + createTld("tld", TldState.LANDRUSH); + persistContactsAndHosts(); + clock.advanceOneMilli(); + setEppInput( + "domain_create_landrush_fee_grace_period.xml", ImmutableMap.of("FEE_VERSION", "0.12")); + runFlow(); + } + @Test public void testFailure_landrushApplicationWithAppliedFee_v06() throws Exception { thrown.expect(UnsupportedFeeAttributeException.class); @@ -560,6 +600,16 @@ public class DomainApplicationCreateFlowTest runFlow(); } + @Test + public void testFailure_landrushApplicationWithAppliedFee_v12() throws Exception { + thrown.expect(UnsupportedFeeAttributeException.class); + createTld("tld", TldState.LANDRUSH); + persistContactsAndHosts(); + clock.advanceOneMilli(); + setEppInput("domain_create_landrush_fee_applied.xml", ImmutableMap.of("FEE_VERSION", "0.12")); + runFlow(); + } + @Test public void testSuccess_landrushWithClaims() throws Exception { createTld("tld", TldState.LANDRUSH); @@ -1211,6 +1261,18 @@ public class DomainApplicationCreateFlowTest runFlow(); } + @Test + public void testFailure_wrongFeeLandrushApplication_v12() throws Exception { + thrown.expect(FeesMismatchException.class); + createTld("tld", TldState.LANDRUSH); + setEppInput("domain_create_landrush_fee.xml", ImmutableMap.of("FEE_VERSION", "0.12")); + persistResource( + Registry.get("tld").asBuilder().setCreateBillingCost(Money.of(USD, 20)).build()); + persistContactsAndHosts(); + clock.advanceOneMilli(); + runFlow(); + } + @Test public void testFailure_wrongCurrency_v06() throws Exception { thrown.expect(CurrencyUnitMismatchException.class); @@ -1247,6 +1309,24 @@ public class DomainApplicationCreateFlowTest runFlow(); } + @Test + public void testFailure_wrongCurrency_v12() throws Exception { + thrown.expect(CurrencyUnitMismatchException.class); + createTld("tld", TldState.LANDRUSH); + setEppInput("domain_create_landrush_fee.xml", ImmutableMap.of("FEE_VERSION", "0.12")); + persistResource(Registry.get("tld").asBuilder() + .setCurrency(CurrencyUnit.EUR) + .setCreateBillingCost(Money.of(EUR, 13)) + .setRestoreBillingCost(Money.of(EUR, 11)) + .setRenewBillingCostTransitions(ImmutableSortedMap.of(START_OF_TIME, Money.of(EUR, 7))) + .setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(EUR))) + .setServerStatusChangeBillingCost(Money.of(EUR, 19)) + .build()); + persistContactsAndHosts(); + clock.advanceOneMilli(); + runFlow(); + } + @Test public void testFailure_feeGivenInWrongScale_v06() throws Exception { thrown.expect(CurrencyValueScaleException.class); @@ -1267,6 +1347,16 @@ public class DomainApplicationCreateFlowTest runFlow(); } + @Test + public void testFailure_feeGivenInWrongScale_v12() throws Exception { + thrown.expect(CurrencyValueScaleException.class); + createTld("tld", TldState.LANDRUSH); + setEppInput("domain_create_landrush_fee_bad_scale.xml", ImmutableMap.of("FEE_VERSION", "0.12")); + persistContactsAndHosts(); + clock.advanceOneMilli(); + runFlow(); + } + @Test public void testFailure_alreadyExists() throws Exception { // This fails fast and throws DomainAlreadyExistsException from init() as a special case. diff --git a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java index 3701e744f..fe2d89492 100644 --- a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java @@ -396,6 +396,13 @@ public class DomainCheckFlowTest runFlowAssertResponse(readFile("domain_check_fee_response_v11.xml")); } + @Test + public void testFeeExtension_v12() throws Exception { + persistActiveDomain("example1.tld"); + setEppInput("domain_check_fee_v12.xml"); + runFlowAssertResponse(readFile("domain_check_fee_response_v12.xml")); + } + /** * Test commands for create, renew, transfer, restore and update with implicit period and * currency. */ @@ -407,6 +414,12 @@ public class DomainCheckFlowTest // Version 11 cannot have multiple commands. + @Test + public void testFeeExtension_multipleCommands_v12() throws Exception { + setEppInput("domain_check_fee_multiple_commands_v12.xml"); + runFlowAssertResponse(readFile("domain_check_fee_multiple_commands_response_v12.xml")); + } + /** Test the same as {@link #testFeeExtension_multipleCommands_v06} with premium labels. */ @Test public void testFeeExtension_premiumLabels_v06() throws Exception { @@ -450,6 +463,13 @@ public class DomainCheckFlowTest runFlowAssertResponse(readFile("domain_check_fee_premium_response_v11_update.xml")); } + @Test + public void testFeeExtension_premiumLabels_v12() throws Exception { + createTld("example"); + setEppInput("domain_check_fee_premium_v12.xml"); + runFlowAssertResponse(readFile("domain_check_fee_premium_response_v12.xml")); + } + @Test public void testFeeExtension_fractionalCost() throws Exception { // Note that the response xml expects to see "11.10" with two digits after the decimal point. @@ -514,6 +534,16 @@ public class DomainCheckFlowTest runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v11_restore.xml")); } + @Test + public void testFeeExtension_reservedName_v12() throws Exception { + persistResource(Registry.get("tld").asBuilder() + .setReservedLists(createReservedList()) + .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) + .build()); + setEppInput("domain_check_fee_reserved_v12.xml"); + runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v12.xml")); + } + @Test public void testFeeExtension_feesNotOmittedOnReservedNamesInSunrise_v06() throws Exception { createTld("tld", TldState.SUNRISE); @@ -573,6 +603,17 @@ public class DomainCheckFlowTest runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v11_restore.xml")); } + @Test + public void testFeeExtension_feesNotOmittedOnReservedNamesInSunrise_v12() throws Exception { + createTld("tld", TldState.SUNRISE); + persistResource(Registry.get("tld").asBuilder() + .setReservedLists(createReservedList()) + .setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70")) + .build()); + setEppInput("domain_check_fee_reserved_v12.xml"); + runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v12.xml")); + } + @Test public void testFeeExtension_wrongCurrency_v06() throws Exception { thrown.expect(CurrencyUnitMismatchException.class); @@ -587,6 +628,13 @@ public class DomainCheckFlowTest runFlow(); } + @Test + public void testFeeExtension_wrongCurrency_v12() throws Exception { + thrown.expect(CurrencyUnitMismatchException.class); + setEppInput("domain_check_fee_euro_v12.xml"); + runFlow(); + } + @Test public void testFeeExtension_periodNotInYears_v06() throws Exception { thrown.expect(BadPeriodUnitException.class); @@ -601,6 +649,13 @@ public class DomainCheckFlowTest runFlow(); } + @Test + public void testFeeExtension_periodNotInYears_v12() throws Exception { + thrown.expect(BadPeriodUnitException.class); + setEppInput("domain_check_fee_bad_period_v12.xml"); + runFlow(); + } + @Test public void testFeeExtension_commandWithPhase_v06() throws Exception { thrown.expect(FeeChecksDontSupportPhasesException.class); @@ -615,6 +670,13 @@ public class DomainCheckFlowTest runFlow(); } + @Test + public void testFeeExtension_commandWithPhase_v12() throws Exception { + thrown.expect(FeeChecksDontSupportPhasesException.class); + setEppInput("domain_check_fee_command_phase_v12.xml"); + runFlow(); + } + @Test public void testFeeExtension_commandSubphase_v06() throws Exception { thrown.expect(FeeChecksDontSupportPhasesException.class); @@ -629,6 +691,13 @@ public class DomainCheckFlowTest runFlow(); } + @Test + public void testFeeExtension_commandSubphase_v12() throws Exception { + thrown.expect(FeeChecksDontSupportPhasesException.class); + setEppInput("domain_check_fee_command_subphase_v12.xml"); + runFlow(); + } + // This test is only relevant for v06, since domain names are not specified in v11 or v12. @Test public void testFeeExtension_feeCheckNotInAvailabilityCheck() throws Exception { @@ -651,6 +720,13 @@ public class DomainCheckFlowTest runFlow(); } + @Test + public void testFeeExtension_multiyearRestore_v12() throws Exception { + thrown.expect(RestoresAreAlwaysForOneYearException.class); + setEppInput("domain_check_fee_multiyear_restore_v12.xml"); + runFlow(); + } + @Test public void testFeeExtension_unknownCommand_v06() throws Exception { thrown.expect(UnknownFeeCommandException.class); @@ -665,6 +741,13 @@ public class DomainCheckFlowTest runFlow(); } + @Test + public void testFeeExtension_unknownCommand_v12() throws Exception { + thrown.expect(UnknownFeeCommandException.class); + setEppInput("domain_check_fee_unknown_command_v12.xml"); + runFlow(); + } + @Test public void testFeeExtension_invalidCommand_v06() throws Exception { thrown.expect(UnknownFeeCommandException.class); @@ -679,6 +762,13 @@ public class DomainCheckFlowTest runFlow(); } + @Test + public void testFeeExtension_invalidCommand_v12() throws Exception { + thrown.expect(UnknownFeeCommandException.class); + setEppInput("domain_check_fee_invalid_command_v12.xml"); + runFlow(); + } + private void runEapFeeCheckTest(String inputFile, String outputFile) throws Exception { clock.setTo(DateTime.parse("2010-01-01T10:00:00Z")); persistActiveDomain("example1.tld"); @@ -701,5 +791,9 @@ public class DomainCheckFlowTest public void testSuccess_eapFeeCheck_v11() throws Exception { runEapFeeCheckTest("domain_check_fee_v11.xml", "domain_check_eap_fee_response_v11.xml"); } -} + @Test + public void testSuccess_eapFeeCheck_v12() throws Exception { + runEapFeeCheckTest("domain_check_fee_v12.xml", "domain_check_eap_fee_response_v12.xml"); + } +} diff --git a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java index e097262ee..e10fef938 100644 --- a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java @@ -16,6 +16,7 @@ package google.registry.flows.domain; import static com.google.common.io.BaseEncoding.base16; import static com.google.common.truth.Truth.assertThat; +import static google.registry.model.domain.fee.Fee.FEE_EXTENSION_URIS; import static google.registry.pricing.PricingEngineProxy.getPricesForDomainName; import static google.registry.testing.DatastoreHelper.assertBillingEvents; import static google.registry.testing.DatastoreHelper.createTld; @@ -105,7 +106,6 @@ import google.registry.model.domain.launch.ApplicationStatus; import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.secdns.DelegationSignerData; -import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension; import google.registry.model.eppcommon.StatusValue; import google.registry.model.registrar.Registrar; import google.registry.model.registry.Registry; @@ -335,6 +335,14 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase exception) throws Exception { @@ -1414,6 +1501,20 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase FEE_11_MAP = ImmutableMap.of("FEE_VERSION", "0.11", "FEE_NS", "fee11"); + private static final ImmutableMap FEE_12_MAP = + ImmutableMap.of("FEE_VERSION", "0.12", "FEE_NS", "fee12"); public DomainDeleteFlowTest() { setEppInput("domain_delete.xml"); @@ -270,14 +272,21 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCaseof()); @@ -343,14 +352,21 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase FEE_11_MAP = ImmutableMap.of("FEE_VERSION", "0.11", "FEE_NS", "fee11"); + private static final ImmutableMap FEE_12_MAP = + ImmutableMap.of("FEE_VERSION", "0.12", "FEE_NS", "fee12"); final DateTime expirationTime = DateTime.parse("2000-04-03T22:00:00.0Z"); @@ -220,6 +222,13 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase FEE_11_MAP = ImmutableMap.of("FEE_VERSION", "0.11", "FEE_NS", "fee11"); + private static final ImmutableMap FEE_12_MAP = + ImmutableMap.of("FEE_VERSION", "0.12", "FEE_NS", "fee12"); public DomainRestoreRequestFlowTest() { setEppInput("domain_update_restore_request.xml"); @@ -195,6 +197,12 @@ public class DomainRestoreRequestFlowTest extends runFlowAssertResponse(readFile("domain_update_restore_request_response_fee.xml", FEE_11_MAP)); } + @Test + public void testSuccess_fee_v12() throws Exception { + setEppInput("domain_update_restore_request_fee.xml", FEE_12_MAP); + persistPendingDeleteDomain(); + runFlowAssertResponse(readFile("domain_update_restore_request_response_fee.xml", FEE_12_MAP)); + } @Test public void testSuccess_fee_withDefaultAttributes_v06() throws Exception { setEppInput("domain_update_restore_request_fee_defaults.xml", FEE_06_MAP); @@ -209,6 +217,13 @@ public class DomainRestoreRequestFlowTest extends runFlowAssertResponse(readFile("domain_update_restore_request_response_fee.xml", FEE_11_MAP)); } + @Test + public void testSuccess_fee_withDefaultAttributes_v12() throws Exception { + setEppInput("domain_update_restore_request_fee_defaults.xml", FEE_12_MAP); + persistPendingDeleteDomain(); + runFlowAssertResponse(readFile("domain_update_restore_request_response_fee.xml", FEE_12_MAP)); + } + @Test public void testFailure_refundableFee_v06() throws Exception { thrown.expect(UnsupportedFeeAttributeException.class); @@ -225,6 +240,14 @@ public class DomainRestoreRequestFlowTest extends runFlow(); } + @Test + public void testFailure_refundableFee_v12() throws Exception { + thrown.expect(UnsupportedFeeAttributeException.class); + setEppInput("domain_update_restore_request_fee_refundable.xml", FEE_12_MAP); + persistPendingDeleteDomain(); + runFlow(); + } + @Test public void testFailure_gracePeriodFee_v06() throws Exception { thrown.expect(UnsupportedFeeAttributeException.class); @@ -241,6 +264,14 @@ public class DomainRestoreRequestFlowTest extends runFlow(); } + @Test + public void testFailure_gracePeriodFee_v12() throws Exception { + thrown.expect(UnsupportedFeeAttributeException.class); + setEppInput("domain_update_restore_request_fee_grace_period.xml", FEE_12_MAP); + persistPendingDeleteDomain(); + runFlow(); + } + @Test public void testFailure_appliedFee_v06() throws Exception { thrown.expect(UnsupportedFeeAttributeException.class); @@ -257,6 +288,14 @@ public class DomainRestoreRequestFlowTest extends runFlow(); } + @Test + public void testFailure_appliedFee_v12() throws Exception { + thrown.expect(UnsupportedFeeAttributeException.class); + setEppInput("domain_update_restore_request_fee_applied.xml", FEE_12_MAP); + persistPendingDeleteDomain(); + runFlow(); + } + @Test public void testSuccess_premiumNotBlocked() throws Exception { createTld("example"); @@ -323,6 +362,16 @@ public class DomainRestoreRequestFlowTest extends runFlow(); } + @Test + public void testFailure_wrongFeeAmount_v12() throws Exception { + thrown.expect(FeesMismatchException.class); + setEppInput("domain_update_restore_request_fee.xml", FEE_12_MAP); + persistPendingDeleteDomain(); + persistResource( + Registry.get("tld").asBuilder().setRestoreBillingCost(Money.of(USD, 100)).build()); + runFlow(); + } + private void runWrongCurrencyTest(Map substitutions) throws Exception { thrown.expect(CurrencyUnitMismatchException.class); setEppInput("domain_update_restore_request_fee.xml", substitutions); @@ -350,6 +399,11 @@ public class DomainRestoreRequestFlowTest extends runWrongCurrencyTest(FEE_11_MAP); } + @Test + public void testFailure_wrongCurrency_v12() throws Exception { + runWrongCurrencyTest(FEE_12_MAP); + } + @Test public void testFailure_feeGivenInWrongScale_v06() throws Exception { thrown.expect(CurrencyValueScaleException.class); @@ -366,6 +420,14 @@ public class DomainRestoreRequestFlowTest extends runFlow(); } + @Test + public void testFailure_feeGivenInWrongScale_v12() throws Exception { + thrown.expect(CurrencyValueScaleException.class); + setEppInput("domain_update_restore_request_fee_bad_scale.xml", FEE_12_MAP); + persistPendingDeleteDomain(); + runFlow(); + } + @Test public void testFailure_notInRedemptionPeriod() throws Exception { thrown.expect(DomainNotEligibleForRestoreException.class); diff --git a/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java b/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java index 4203235ee..e0ebfe21e 100644 --- a/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainTransferRequestFlowTest.java @@ -85,6 +85,9 @@ public class DomainTransferRequestFlowTest ImmutableMap.of("FEE_VERSION", "0.6", "FEE_NS", "fee"); private static final ImmutableMap FEE_11_MAP = ImmutableMap.of("FEE_VERSION", "0.11", "FEE_NS", "fee11"); + private static final ImmutableMap FEE_12_MAP = + ImmutableMap.of("FEE_VERSION", "0.12", "FEE_NS", "fee12"); + @Before public void setUp() throws Exception { @@ -350,6 +353,12 @@ public class DomainTransferRequestFlowTest "domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_11_MAP); } + @Test + public void testSuccess_fee_v12() throws Exception { + doSuccessfulTest( + "domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_12_MAP); + } + @Test public void testSuccess_fee_withDefaultAttributes_v06() throws Exception { doSuccessfulTest( @@ -366,19 +375,31 @@ public class DomainTransferRequestFlowTest FEE_11_MAP); } + @Test + public void testSuccess_fee_withDefaultAttributes_v12() throws Exception { + doSuccessfulTest( + "domain_transfer_request_fee_defaults.xml", + "domain_transfer_request_response_fee.xml", + FEE_12_MAP); + } + @Test public void testFailure_refundableFee_v06() throws Exception { thrown.expect(UnsupportedFeeAttributeException.class); doFailingTest("domain_transfer_request_fee_refundable.xml", FEE_06_MAP); } - @Test public void testFailure_refundableFee_v11() throws Exception { thrown.expect(UnsupportedFeeAttributeException.class); doFailingTest("domain_transfer_request_fee_refundable.xml", FEE_11_MAP); } + @Test + public void testFailure_refundableFee_v12() throws Exception { + thrown.expect(UnsupportedFeeAttributeException.class); + doFailingTest("domain_transfer_request_fee_refundable.xml", FEE_12_MAP); + } @Test public void testFailure_gracePeriodFee_v06() throws Exception { @@ -392,6 +413,12 @@ public class DomainTransferRequestFlowTest doFailingTest("domain_transfer_request_fee_grace_period.xml", FEE_11_MAP); } + @Test + public void testFailure_gracePeriodFee_v12() throws Exception { + thrown.expect(UnsupportedFeeAttributeException.class); + doFailingTest("domain_transfer_request_fee_grace_period.xml", FEE_12_MAP); + } + @Test public void testFailure_appliedFee_v06() throws Exception { thrown.expect(UnsupportedFeeAttributeException.class); @@ -404,6 +431,12 @@ public class DomainTransferRequestFlowTest doFailingTest("domain_transfer_request_fee_applied.xml", FEE_11_MAP); } + @Test + public void testFailure_appliedFee_v12() throws Exception { + thrown.expect(UnsupportedFeeAttributeException.class); + doFailingTest("domain_transfer_request_fee_applied.xml", FEE_12_MAP); + } + @Test public void testSuccess_nonDefaultAutomaticTransferLength() throws Exception { persistResource( @@ -532,6 +565,11 @@ public class DomainTransferRequestFlowTest runWrongCurrencyTest(FEE_11_MAP); } + @Test + public void testFailure_wrongCurrency_v12() throws Exception { + runWrongCurrencyTest(FEE_12_MAP); + } + @Test public void testFailure_feeGivenInWrongScale_v06() throws Exception { thrown.expect(CurrencyValueScaleException.class); @@ -544,6 +582,13 @@ public class DomainTransferRequestFlowTest doFailingTest("domain_transfer_request_fee_bad_scale.xml", FEE_11_MAP); } + @Test + public void testFailure_feeGivenInWrongScale_v12() throws Exception { + thrown.expect(CurrencyValueScaleException.class); + doFailingTest("domain_transfer_request_fee_bad_scale.xml", FEE_12_MAP); + } + + private void runWrongFeeAmountTest(Map substitutions) throws Exception { thrown.expect(FeesMismatchException.class); persistResource( @@ -564,6 +609,11 @@ public class DomainTransferRequestFlowTest runWrongFeeAmountTest(FEE_11_MAP); } + @Test + public void testFailure_wrongFeeAmount_v12() throws Exception { + runWrongFeeAmountTest(FEE_12_MAP); + } + @Test public void testFailure_premiumBlocked() throws Exception { thrown.expect(PremiumNameBlockedException.class); diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_eap_fee_response_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_eap_fee_response_v12.xml new file mode 100644 index 000000000..c6664c581 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_eap_fee_response_v12.xml @@ -0,0 +1,61 @@ + + + + Command completed successfully + + + + + example1.tld + In use + + + example2.tld + + + example3.tld + + + + + + USD + + + example1.tld + + + 1 + 13.00 + 100.00 + + + + + example2.tld + + + 1 + 13.00 + 100.00 + + + + + example3.tld + + + 1 + 13.00 + 100.00 + + + + + + ABC-12345 + server-trid + + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_bad_period_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_bad_period_v12.xml new file mode 100644 index 000000000..3efb5f623 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_bad_period_v12.xml @@ -0,0 +1,19 @@ + + + + + example1.tld + + + + + + example1.tld + create + 1 + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_command_phase_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_command_phase_v12.xml new file mode 100644 index 000000000..58f62bc99 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_command_phase_v12.xml @@ -0,0 +1,15 @@ + + + + + example1.tld + + + + + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_command_subphase_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_command_subphase_v12.xml new file mode 100644 index 000000000..95d7e319a --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_command_subphase_v12.xml @@ -0,0 +1,15 @@ + + + + + example1.tld + + + + + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_euro_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_euro_v12.xml new file mode 100644 index 000000000..ca0d1b8ab --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_euro_v12.xml @@ -0,0 +1,23 @@ + + + + + example1.tld + example2.tld + example3.tld + + + + + custom + + + EUR + + 1 + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_invalid_command_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_invalid_command_v12.xml new file mode 100644 index 000000000..5f6ecab10 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_invalid_command_v12.xml @@ -0,0 +1,17 @@ + + + + + example1.tld + + + + + + 1 + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_multiple_commands_response_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_multiple_commands_response_v12.xml new file mode 100644 index 000000000..110835458 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_multiple_commands_response_v12.xml @@ -0,0 +1,69 @@ + + + + Command completed successfully + + + + + example1.tld + + + + + + + + example1.tld + + + 1 + 13.00 + + + + + example1.tld + + + 1 + 11.00 + + + + + example1.tld + + + 1 + 11.00 + + + + + example1.tld + + + 1 + 11.00 + 17.00 + + + + + example1.tld + + + 1 + 11.00 + + + + + + ABC-12345 + server-trid + + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_multiple_commands_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_multiple_commands_v12.xml new file mode 100644 index 000000000..ea294063f --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_multiple_commands_v12.xml @@ -0,0 +1,19 @@ + + + + + example1.tld + + + + + + + + + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_multiyear_restore_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_multiyear_restore_v12.xml new file mode 100644 index 000000000..5d192bf28 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_multiyear_restore_v12.xml @@ -0,0 +1,20 @@ + + + + + example1.tld + + + + + custom + + + + 2 + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_premium_response_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_premium_response_v12.xml new file mode 100644 index 000000000..c07f6ba64 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_premium_response_v12.xml @@ -0,0 +1,74 @@ + + + + Command completed successfully + + + + + rich.example + + + + + + + + rich.example + + + 1 + 100.00 + premium + + + + + rich.example + + + 1 + 100.00 + premium + + + + + rich.example + + + 1 + 100.00 + premium + + + + + rich.example + + + 1 + 100.00 + 17.00 + premium + + + + + rich.example + + + 1 + 100.00 + premium + + + + + + ABC-12345 + server-trid + + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_premium_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_premium_v12.xml new file mode 100644 index 000000000..d6bb87d34 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_premium_v12.xml @@ -0,0 +1,19 @@ + + + + + rich.example + + + + + + + + + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_reserved_response_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_reserved_response_v12.xml new file mode 100644 index 000000000..15530cb06 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_reserved_response_v12.xml @@ -0,0 +1,188 @@ + + + + Command completed successfully + + + + + reserved.tld + Reserved + + + allowedinsunrise.tld + Reserved for non-sunrise + + + collision.tld + Cannot be delegated + + + premiumcollision.tld + Cannot be delegated + + + + + + USD + + + reserved.tld + + + 1 + reserved + + + + + reserved.tld + + + 1 + 11.00 + + + + + reserved.tld + + + 1 + 11.00 + + + + + reserved.tld + + + 1 + 11.00 + 17.00 + + + + + allowedinsunrise.tld + + + 1 + reserved + + + + + allowedinsunrise.tld + + + 1 + 11.00 + + + + + allowedinsunrise.tld + + + 1 + 11.00 + + + + + allowedinsunrise.tld + + + 1 + 11.00 + 17.00 + + + + + collision.tld + + + 1 + reserved + + + + + collision.tld + + + 1 + 11.00 + + + + + collision.tld + + + 1 + 11.00 + + + + + collision.tld + + + 1 + 11.00 + 17.00 + + + + + premiumcollision.tld + + + 1 + reserved + + + + + premiumcollision.tld + + + 1 + 70.00 + premium + + + + + premiumcollision.tld + + + 1 + 70.00 + premium + + + + + premiumcollision.tld + + + 1 + 70.00 + 17.00 + premium + + + + + + ABC-12345 + server-trid + + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_reserved_sunrise_response_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_reserved_sunrise_response_v12.xml new file mode 100644 index 000000000..df0ffb2a7 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_reserved_sunrise_response_v12.xml @@ -0,0 +1,193 @@ + + + + Command completed successfully + + + + + reserved.tld + Reserved + + + allowedinsunrise.tld + Reserved for non-sunrise + + + collision.tld + Cannot be delegated + + + premiumcollision.tld + Cannot be delegated + + + + + + USD + + + reserved.tld + + + 1 + reserved + + + + + reserved.tld + + + 1 + 11.00 + + + + + reserved.tld + + + 1 + 11.00 + + + + + reserved.tld + + + 1 + 11.00 + 17.00 + + + + + allowedinsunrise.tld + + + 1 + 13.00 + + + + + allowedinsunrise.tld + + + 1 + 11.00 + + + + + allowedinsunrise.tld + + + 1 + 11.00 + + + + + allowedinsunrise.tld + + + 1 + 11.00 + 17.00 + + + + + collision.tld + + + 1 + 13.00 + collision + + + + + collision.tld + + + 1 + 11.00 + collision + + + + + collision.tld + + + 1 + 11.00 + collision + + + + + collision.tld + + + 1 + 11.00 + 17.00 + collision + + + + + premiumcollision.tld + + + 1 + 70.00 + premium-collision + + + + + premiumcollision.tld + + + 1 + 70.00 + premium-collision + + + + + premiumcollision.tld + + + 1 + 70.00 + premium-collision + + + + + premiumcollision.tld + + + 1 + 70.00 + 17.00 + premium-collision + + + + + + ABC-12345 + server-trid + + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_reserved_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_reserved_v12.xml new file mode 100644 index 000000000..2b4c40d71 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_reserved_v12.xml @@ -0,0 +1,33 @@ + + + + + reserved.tld + allowedinsunrise.tld + collision.tld + premiumcollision.tld + + + + + custom + + + USD + + 1 + + + 1 + + + 1 + + + 1 + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_response_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_response_v12.xml new file mode 100644 index 000000000..ca86d775d --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_response_v12.xml @@ -0,0 +1,58 @@ + + + + Command completed successfully + + + + + example1.tld + In use + + + example2.tld + + + example3.tld + + + + + + USD + + + example1.tld + + + 1 + 13.00 + + + + + example2.tld + + + 1 + 13.00 + + + + + example3.tld + + + 1 + 13.00 + + + + + + ABC-12345 + server-trid + + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_unknown_command_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_unknown_command_v12.xml new file mode 100644 index 000000000..f2eded5f2 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_unknown_command_v12.xml @@ -0,0 +1,17 @@ + + + + + example1.tld + + + + + + 1 + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/domain/testdata/domain_check_fee_v12.xml b/javatests/google/registry/flows/domain/testdata/domain_check_fee_v12.xml new file mode 100644 index 000000000..b452d4191 --- /dev/null +++ b/javatests/google/registry/flows/domain/testdata/domain_check_fee_v12.xml @@ -0,0 +1,25 @@ + + + + + example1.tld + example2.tld + example3.tld + + + + + custom + + + USD + + 1 + premium + 2017-05-17T13:22:21.0Z + + + + ABC-12345 + + diff --git a/javatests/google/registry/flows/session/testdata/greeting_crr.xml b/javatests/google/registry/flows/session/testdata/greeting_crr.xml index cfc646e7e..874cfc0d3 100644 --- a/javatests/google/registry/flows/session/testdata/greeting_crr.xml +++ b/javatests/google/registry/flows/session/testdata/greeting_crr.xml @@ -14,6 +14,7 @@ urn:ietf:params:xml:ns:secDNS-1.1 urn:ietf:params:xml:ns:fee-0.6 urn:ietf:params:xml:ns:fee-0.11 + urn:ietf:params:xml:ns:fee-0.12 diff --git a/javatests/google/registry/flows/testdata/greeting_crr.xml b/javatests/google/registry/flows/testdata/greeting_crr.xml index cfc646e7e..874cfc0d3 100644 --- a/javatests/google/registry/flows/testdata/greeting_crr.xml +++ b/javatests/google/registry/flows/testdata/greeting_crr.xml @@ -14,6 +14,7 @@ urn:ietf:params:xml:ns:secDNS-1.1 urn:ietf:params:xml:ns:fee-0.6 urn:ietf:params:xml:ns:fee-0.11 + urn:ietf:params:xml:ns:fee-0.12