mirror of
https://github.com/google/nomulus.git
synced 2025-07-25 20:18:34 +02:00
Delete end-date sunrise, landrush, and sunrush phases
This also deletes the associated commands and domain application specific entities. We haven't used any of these TLD phases since early 2015 and have no intent to do so in the future, so it makes sense to delete them now so we don't have to carry them through the Registry 3.0 migration. Note that, while there are data model changes, there should be no required data migrations. The fields and entities being removed will simply remain as orphans. I confirmed that the removed types (such as the SUNRUSH_ADD GracePeriodType) are no longer used in production data, and left types that are still used, e.g. BillingEvent.Flag.LANDRUSH or HistoryEntry.Type.ALLOCATE. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=228752843
This commit is contained in:
parent
c74ffd7559
commit
580302898d
282 changed files with 344 additions and 17634 deletions
|
@ -1,151 +0,0 @@
|
|||
// 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;
|
||||
|
||||
import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.googlecode.objectify.annotation.EntitySubclass;
|
||||
import google.registry.model.annotations.ExternalMessagingName;
|
||||
import google.registry.model.domain.launch.ApplicationStatus;
|
||||
import google.registry.model.domain.launch.LaunchPhase;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.smd.EncodedSignedMark;
|
||||
import java.util.List;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** An application to create a domain. */
|
||||
@EntitySubclass(index = true)
|
||||
@ExternalMessagingName("application")
|
||||
public class DomainApplication extends DomainBase {
|
||||
|
||||
/**
|
||||
* The transaction id of the EPP command that created this application. This is saved off so that
|
||||
* we can generate the poll message communicating the application result once it is rejected or
|
||||
* allocated.
|
||||
*
|
||||
* <p>This field may be null for applications that were created before the field was added.
|
||||
*/
|
||||
Trid creationTrid;
|
||||
|
||||
/**
|
||||
* The phase which this application is registered for. We store this only so we can return it back
|
||||
* to the user on info commands.
|
||||
*/
|
||||
LaunchPhase phase;
|
||||
|
||||
/** The requested registration period. */
|
||||
Period period;
|
||||
|
||||
/** The current status of this application. */
|
||||
ApplicationStatus applicationStatus;
|
||||
|
||||
/** The encoded signed marks which were asserted when this application was created. */
|
||||
List<EncodedSignedMark> encodedSignedMarks;
|
||||
|
||||
/** The amount paid at auction for the right to register the domain. Used only for reporting. */
|
||||
Money auctionPrice;
|
||||
|
||||
@Override
|
||||
public String getFullyQualifiedDomainName() {
|
||||
return fullyQualifiedDomainName;
|
||||
}
|
||||
|
||||
public Trid getCreationTrid() {
|
||||
return creationTrid;
|
||||
}
|
||||
|
||||
public LaunchPhase getPhase() {
|
||||
return phase;
|
||||
}
|
||||
|
||||
public Period getPeriod() {
|
||||
return period;
|
||||
}
|
||||
|
||||
public ApplicationStatus getApplicationStatus() {
|
||||
return applicationStatus;
|
||||
}
|
||||
|
||||
public ImmutableList<EncodedSignedMark> getEncodedSignedMarks() {
|
||||
return nullToEmptyImmutableCopy(encodedSignedMarks);
|
||||
}
|
||||
|
||||
public Money getAuctionPrice() {
|
||||
return auctionPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* The application id is the repoId.
|
||||
*/
|
||||
@Override
|
||||
public String getForeignKey() {
|
||||
return getRepoId();
|
||||
}
|
||||
|
||||
/** This is a no-op and should never be called on an application explicitly. */
|
||||
@Deprecated
|
||||
@Override
|
||||
public DomainApplication cloneProjectedAtTime(DateTime now) {
|
||||
// Applications have no grace periods and can't be transferred, so there is nothing to project.
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Builder asBuilder() {
|
||||
return new Builder(clone(this));
|
||||
}
|
||||
|
||||
/** A builder for constructing {@link DomainApplication}, since it is immutable. */
|
||||
public static class Builder extends DomainBase.Builder<DomainApplication, Builder> {
|
||||
|
||||
public Builder() {}
|
||||
|
||||
private Builder(DomainApplication instance) {
|
||||
super(instance);
|
||||
}
|
||||
|
||||
public Builder setCreationTrid(Trid creationTrid) {
|
||||
getInstance().creationTrid = creationTrid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPhase(LaunchPhase phase) {
|
||||
getInstance().phase = phase;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPeriod(Period period) {
|
||||
getInstance().period = period;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setApplicationStatus(ApplicationStatus applicationStatus) {
|
||||
getInstance().applicationStatus = applicationStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setEncodedSignedMarks(ImmutableList<EncodedSignedMark> encodedSignedMarks) {
|
||||
getInstance().encodedSignedMarks = encodedSignedMarks;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAuctionPrice(Money auctionPrice) {
|
||||
getInstance().auctionPrice = auctionPrice;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -50,7 +50,8 @@ import java.util.Objects;
|
|||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** Shared base class for {@link DomainResource} and {@link DomainApplication}. */
|
||||
/** Base class for {@link DomainResource}. */
|
||||
// TODO(b/121028829): Squash DomainResource into this.
|
||||
@ReportedOn
|
||||
@Entity
|
||||
public abstract class DomainBase extends EppResource {
|
||||
|
|
|
@ -106,26 +106,13 @@ public class DomainResource extends DomainBase
|
|||
Set<GracePeriod> gracePeriods;
|
||||
|
||||
/**
|
||||
* The id of the signed mark that was used to create the sunrise application for this domain.
|
||||
* Will only be populated for domains allocated from a sunrise application.
|
||||
* The id of the signed mark that was used to create this domain in sunrise.
|
||||
*
|
||||
* <p>Will only be populated for domains created in sunrise.
|
||||
*/
|
||||
@IgnoreSave(IfNull.class)
|
||||
String smdId;
|
||||
|
||||
/**
|
||||
* The time that the application used to allocate this domain was created. Will only be populated
|
||||
* for domains allocated from an application.
|
||||
*/
|
||||
@IgnoreSave(IfNull.class)
|
||||
DateTime applicationTime;
|
||||
|
||||
/**
|
||||
* A key to the application used to allocate this domain. Will only be populated for domains
|
||||
* allocated from an application.
|
||||
*/
|
||||
@IgnoreSave(IfNull.class)
|
||||
Key<DomainApplication> application;
|
||||
|
||||
/** Data about any pending or past transfers on this domain. */
|
||||
TransferData transferData;
|
||||
|
||||
|
@ -164,14 +151,6 @@ public class DomainResource extends DomainBase
|
|||
return smdId;
|
||||
}
|
||||
|
||||
public DateTime getApplicationTime() {
|
||||
return applicationTime;
|
||||
}
|
||||
|
||||
public Key<DomainApplication> getApplication() {
|
||||
return application;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final TransferData getTransferData() {
|
||||
return Optional.ofNullable(transferData).orElse(TransferData.EMPTY);
|
||||
|
@ -426,16 +405,6 @@ public class DomainResource extends DomainBase
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setApplicationTime(DateTime applicationTime) {
|
||||
getInstance().applicationTime = applicationTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setApplication(Key<DomainApplication> application) {
|
||||
getInstance().application = application;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setGracePeriods(ImmutableSet<GracePeriod> gracePeriods) {
|
||||
getInstance().gracePeriods = gracePeriods;
|
||||
return this;
|
||||
|
|
|
@ -59,12 +59,7 @@ public class GracePeriod extends ImmutableObject {
|
|||
Key<BillingEvent.Recurring> billingEventRecurring = null;
|
||||
|
||||
public GracePeriodStatus getType() {
|
||||
// NB: We implicitly convert SUNRUSH_ADD to ADD, since they should be functionally equivalent.
|
||||
return type == GracePeriodStatus.SUNRUSH_ADD ? GracePeriodStatus.ADD : type;
|
||||
}
|
||||
|
||||
public boolean isSunrushAddGracePeriod() {
|
||||
return type == GracePeriodStatus.SUNRUSH_ADD;
|
||||
return type;
|
||||
}
|
||||
|
||||
public DateTime getExpirationTime() {
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
// 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.allocate;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.eppinput.EppInput.CommandExtension;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
* An XML data object that represents an allocate extension that will be present on EPP commands to
|
||||
* allocate a domain from an application.
|
||||
*
|
||||
* <p>This object holds XML data which JAXB will unmarshal from an EPP domain create command
|
||||
* extension. The XML will have the following enclosing structure:
|
||||
*
|
||||
* <pre> {@code
|
||||
* <epp>
|
||||
* <command>
|
||||
* <create>
|
||||
* <!-- domain create XML data -->
|
||||
* </create>
|
||||
* <extension>
|
||||
* <allocate:create>
|
||||
* <!-- allocate create XML payload data -->
|
||||
* </allocate:create>
|
||||
* </extension>
|
||||
* </command>
|
||||
* </epp>
|
||||
* } </pre>
|
||||
*
|
||||
* @see CommandExtension
|
||||
*/
|
||||
@XmlRootElement(name = "create")
|
||||
public class AllocateCreateExtension extends ImmutableObject implements CommandExtension {
|
||||
|
||||
/** Holds the ROID of the application that was used to allocate this domain. */
|
||||
String applicationRoid;
|
||||
|
||||
/** The time that the application was created. */
|
||||
DateTime applicationTime;
|
||||
|
||||
/**
|
||||
* Signed mark identifier for this create. Only present when allocating a domain from a sunrise
|
||||
* application.
|
||||
*/
|
||||
String smdId;
|
||||
|
||||
/**
|
||||
* The claims notice for this create. Only present when allocating a domain from a landrush
|
||||
* application that matches a pre-registered mark in the TMCH.
|
||||
*/
|
||||
LaunchNotice notice;
|
||||
|
||||
public String getApplicationRoid() {
|
||||
return applicationRoid;
|
||||
}
|
||||
|
||||
public DateTime getApplicationTime() {
|
||||
return applicationTime;
|
||||
}
|
||||
|
||||
public String getSmdId() {
|
||||
return smdId;
|
||||
}
|
||||
|
||||
public LaunchNotice getNotice() {
|
||||
return notice;
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
// 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:google:params:xml:ns:allocate-1.0",
|
||||
xmlns = @XmlNs(prefix = "allocate", namespaceURI = "urn:google:params:xml:ns:allocate-1.0"),
|
||||
elementFormDefault = XmlNsForm.QUALIFIED)
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlJavaTypeAdapter(UtcDateTimeAdapter.class)
|
||||
package google.registry.model.domain.allocate;
|
||||
|
||||
import google.registry.xml.UtcDateTimeAdapter;
|
||||
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;
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
// 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.launch;
|
||||
|
||||
import google.registry.model.eppinput.EppInput.CommandExtension;
|
||||
|
||||
/** Marker interface for EPP extensions which override the EPP notion of id with their own. */
|
||||
public interface ApplicationIdTargetExtension extends CommandExtension {
|
||||
/** Get the application id to use as the resource id for commands using this extension. */
|
||||
String getApplicationId();
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
// 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.launch;
|
||||
|
||||
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
|
||||
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
|
||||
|
||||
import google.registry.model.translators.EnumToAttributeAdapter;
|
||||
import google.registry.model.translators.EnumToAttributeAdapter.EppEnum;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
||||
/**
|
||||
* Represents the EPP application status.
|
||||
*
|
||||
* <p>These values are never read from a command and only used in responses, so, we don't need to
|
||||
* model anything we don't output. We don't model the CUSTOM status because we don't use it. This
|
||||
* allows us to also avoid modeling the "name" attribute which is only used with CUSTOM. We don't
|
||||
* model the "lang" attribute because we only support English and that's the default.
|
||||
*
|
||||
* <p>Given all of this, we can use {@link EnumToAttributeAdapter} to make this code very simple.
|
||||
*
|
||||
* @see <a href="http://tools.ietf.org/html/draft-tan-epp-launchphase-11#section-2.3">
|
||||
* Launch Phase Mapping for EPP - Status Values</a>
|
||||
*/
|
||||
@XmlJavaTypeAdapter(EnumToAttributeAdapter.class)
|
||||
public enum ApplicationStatus implements EppEnum {
|
||||
ALLOCATED,
|
||||
INVALID,
|
||||
PENDING_ALLOCATION,
|
||||
PENDING_VALIDATION,
|
||||
REJECTED,
|
||||
VALIDATED;
|
||||
|
||||
@Override
|
||||
public String getXmlName() {
|
||||
return UPPER_UNDERSCORE.to(LOWER_CAMEL, name());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this status is a final status - that is, it should not transition to any other
|
||||
* application status after this one.
|
||||
*/
|
||||
public boolean isFinalStatus() {
|
||||
return ALLOCATED.equals(this) || REJECTED.equals(this);
|
||||
}
|
||||
}
|
|
@ -60,6 +60,9 @@ public class LaunchCreateExtension extends LaunchExtension implements CommandExt
|
|||
/**
|
||||
* A Launch Application refers to a registration made during a launch phase when the server
|
||||
* accepts multiple applications for the same domain name.
|
||||
*
|
||||
* <p>This is no longer used, but is retained so incoming commands with this value error out
|
||||
* with a descriptive message rather than failing XML marshalling.
|
||||
*/
|
||||
@XmlEnumValue("application")
|
||||
APPLICATION,
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
// 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.launch;
|
||||
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* An XML data object that represents a launch extension that may be present on the response to EPP
|
||||
* domain application create commands.
|
||||
*/
|
||||
@XmlRootElement(name = "creData")
|
||||
@XmlType(propOrder = {"phase", "applicationId"})
|
||||
public class LaunchCreateResponseExtension extends LaunchExtension implements ResponseExtension {
|
||||
/** Builder for {@link LaunchCreateResponseExtension}. */
|
||||
public static class Builder
|
||||
extends LaunchExtension.Builder<LaunchCreateResponseExtension, Builder> {}
|
||||
}
|
|
@ -21,5 +21,4 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* commands.
|
||||
*/
|
||||
@XmlRootElement(name = "delete")
|
||||
public class LaunchDeleteExtension
|
||||
extends LaunchExtension implements ApplicationIdTargetExtension {}
|
||||
public class LaunchDeleteExtension extends LaunchExtension {}
|
||||
|
|
|
@ -16,7 +16,6 @@ package google.registry.model.domain.launch;
|
|||
|
||||
import google.registry.model.Buildable.GenericBuilder;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
|
@ -29,29 +28,17 @@ public abstract class LaunchExtension extends ImmutableObject {
|
|||
/** The launch phase that this domain application was created in. */
|
||||
LaunchPhase phase;
|
||||
|
||||
/** Application ID of the domain application. */
|
||||
@XmlElement(name = "applicationID")
|
||||
String applicationId;
|
||||
|
||||
public LaunchPhase getPhase() {
|
||||
return phase;
|
||||
}
|
||||
|
||||
public String getApplicationId() {
|
||||
return applicationId;
|
||||
}
|
||||
|
||||
/** A builder for constructing {@link LaunchExtension}. */
|
||||
public static class Builder<T extends LaunchExtension, B extends Builder<?, ?>>
|
||||
extends GenericBuilder<T, B> {
|
||||
|
||||
public B setPhase(LaunchPhase phase) {
|
||||
getInstance().phase = phase;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B setApplicationId(String applicationId) {
|
||||
getInstance().applicationId = applicationId;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* commands.
|
||||
*/
|
||||
@XmlRootElement(name = "info")
|
||||
public class LaunchInfoExtension
|
||||
extends LaunchExtension implements ApplicationIdTargetExtension {
|
||||
public class LaunchInfoExtension extends LaunchExtension {
|
||||
|
||||
/** Whether or not to include mark information in the response. */
|
||||
@XmlAttribute
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
// 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.launch;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.googlecode.objectify.annotation.Embed;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
import google.registry.model.mark.Mark;
|
||||
import java.util.List;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* An XML data object that represents a launch extension that may be present on the response to EPP
|
||||
* domain application info commands.
|
||||
*/
|
||||
@Embed
|
||||
@XmlRootElement(name = "infData")
|
||||
@XmlType(propOrder = { "phase", "applicationId", "applicationStatus", "marks"})
|
||||
public class LaunchInfoResponseExtension extends LaunchExtension implements ResponseExtension {
|
||||
|
||||
/** The current status of this application. */
|
||||
@XmlElement(name = "status")
|
||||
ApplicationStatus applicationStatus;
|
||||
|
||||
/** The marks associated with this application. */
|
||||
@XmlElement(name = "mark", namespace = "urn:ietf:params:xml:ns:mark-1.0")
|
||||
List<Mark> marks;
|
||||
|
||||
/** Builder for {@link LaunchInfoResponseExtension}. */
|
||||
public static class Builder
|
||||
extends LaunchExtension.Builder<LaunchInfoResponseExtension, Builder> {
|
||||
public Builder setApplicationStatus(ApplicationStatus applicationStatus) {
|
||||
getInstance().applicationStatus = applicationStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMarks(ImmutableList<Mark> marks) {
|
||||
getInstance().marks = marks;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,15 +14,10 @@
|
|||
|
||||
package google.registry.model.domain.launch;
|
||||
|
||||
import static com.google.common.base.CaseFormat.LOWER_CAMEL;
|
||||
import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE;
|
||||
import static google.registry.util.TypeUtils.getTypesafeEnumMapping;
|
||||
import static java.util.Objects.hash;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.googlecode.objectify.annotation.Embed;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlValue;
|
||||
|
@ -48,9 +43,9 @@ import javax.xml.bind.annotation.XmlValue;
|
|||
* we will return an error if it's the wrong phase (or if the marks are invalid) even though we
|
||||
* didn't require them.
|
||||
*
|
||||
* <p>This is OK (?) because the Anchor Tenants field is set internally and manually.. The person
|
||||
* who sets it is the one that needs to make sure the domain isn't a trademark and that the fields
|
||||
* are correct.
|
||||
* <p>This is OK (?) because the Anchor Tenants field is set internally and manually. The person who
|
||||
* sets it is the one that needs to make sure the domain isn't a trademark and that the fields are
|
||||
* correct.
|
||||
*/
|
||||
@Embed
|
||||
public class LaunchPhase extends ImmutableObject {
|
||||
|
@ -58,61 +53,33 @@ public class LaunchPhase extends ImmutableObject {
|
|||
/**
|
||||
* The phase during which trademark holders can submit registrations or applications with
|
||||
* trademark information that can be validated by the server.
|
||||
*
|
||||
* This phase works for both start-date and end-data sunrise.
|
||||
*
|
||||
* TODO(b/74006379): maybe make this work for sunrush phase?
|
||||
*/
|
||||
public static final LaunchPhase SUNRISE = create("sunrise", null);
|
||||
|
||||
/**
|
||||
* A post-Sunrise phase when non-trademark holders are allowed to register domain names with steps
|
||||
* taken to address a large volume of initial registrations.
|
||||
*/
|
||||
public static final LaunchPhase LANDRUSH = create("landrush", null);
|
||||
|
||||
/** A combined sunrise/landrush phase. */
|
||||
public static final LaunchPhase SUNRUSH = create("sunrise", "landrush");
|
||||
public static final LaunchPhase SUNRISE = create("sunrise");
|
||||
|
||||
/**
|
||||
* The Trademark Claims phase, as defined in the TMCH Functional Specification, in which a Claims
|
||||
* Notice must be displayed to a prospective registrant of a domain name that matches trademarks.
|
||||
*/
|
||||
public static final LaunchPhase CLAIMS = create("claims", null);
|
||||
public static final LaunchPhase CLAIMS = create("claims");
|
||||
|
||||
/** A post-launch phase that is also referred to as "steady state". */
|
||||
public static final LaunchPhase OPEN = create("open", null);
|
||||
|
||||
/** A custom server launch phase that is defined using the "name" attribute. */
|
||||
public static final LaunchPhase CUSTOM = create("custom", null);
|
||||
|
||||
private static final ImmutableMap<String, LaunchPhase> LAUNCH_PHASES = initEnumMapping();
|
||||
|
||||
/**
|
||||
* Returns a map of the static final fields to their values, case-converted.
|
||||
*/
|
||||
private static ImmutableMap<String, LaunchPhase> initEnumMapping() {
|
||||
ImmutableMap.Builder<String, LaunchPhase> builder = new ImmutableMap.Builder<>();
|
||||
for (Entry<String, LaunchPhase> entry : getTypesafeEnumMapping(LaunchPhase.class).entrySet()) {
|
||||
builder.put(UPPER_UNDERSCORE.to(LOWER_CAMEL, entry.getKey()), entry.getValue());
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
public static final LaunchPhase OPEN = create("open");
|
||||
|
||||
/** Private create function for the typesafe enum pattern. */
|
||||
public static LaunchPhase create(String phase, String subphase) {
|
||||
public static LaunchPhase create(String phase) {
|
||||
LaunchPhase instance = new LaunchPhase();
|
||||
instance.phase = phase;
|
||||
instance.subphase = subphase;
|
||||
return instance;
|
||||
}
|
||||
|
||||
@XmlValue
|
||||
String phase;
|
||||
@XmlValue String phase;
|
||||
|
||||
/**
|
||||
* Holds the name of a custom phase if the main phase is "custom", or a sub-phase for all other
|
||||
* values.
|
||||
*
|
||||
* <p>This is currently unused, but is retained so that incoming XMLs that include a subphase can
|
||||
* have it be reflected back.
|
||||
*/
|
||||
@XmlAttribute(name = "name")
|
||||
String subphase;
|
||||
|
@ -121,14 +88,6 @@ public class LaunchPhase extends ImmutableObject {
|
|||
return phase;
|
||||
}
|
||||
|
||||
public String getSubphase() {
|
||||
return subphase;
|
||||
}
|
||||
|
||||
public static LaunchPhase fromValue(String value) {
|
||||
return LAUNCH_PHASES.get(value);
|
||||
}
|
||||
|
||||
/** A special equals implementation that only considers the string value. */
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
|
|
|
@ -21,5 +21,4 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
* commands.
|
||||
*/
|
||||
@XmlRootElement(name = "update")
|
||||
public class LaunchUpdateExtension
|
||||
extends LaunchExtension implements ApplicationIdTargetExtension {}
|
||||
public class LaunchUpdateExtension extends LaunchExtension {}
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
package google.registry.model.domain.rgp;
|
||||
|
||||
import static com.google.common.base.Predicates.equalTo;
|
||||
import static com.google.common.base.Predicates.not;
|
||||
import static com.google.common.collect.ImmutableMap.toImmutableMap;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
@ -77,18 +75,6 @@ public enum GracePeriodStatus implements EppEnum {
|
|||
*/
|
||||
PENDING_RESTORE("pendingRestore"),
|
||||
|
||||
/**
|
||||
* This grace period is provided after the allocation of a domain name that was applied for during
|
||||
* sunrise or landrush. If the domain name is deleted by the registrar during this period, the
|
||||
* registry provides a credit to the registrar for the cost of the registration. This grace period
|
||||
* is cancelled when any nameservers are set on the domain, at which point it converts to a
|
||||
* standard add grace period.
|
||||
*
|
||||
* <p>Note that this status shows up as "addPeriod" in XML, which is the same as the add grace
|
||||
* period. This is done deliberately so as not to break the standard EPP schema.
|
||||
*/
|
||||
SUNRUSH_ADD("addPeriod"),
|
||||
|
||||
/**
|
||||
* This grace period is provided after the successful transfer of domain name registration
|
||||
* sponsorship from one registrar to another registrar. If the domain name is deleted by the new
|
||||
|
@ -100,7 +86,6 @@ public enum GracePeriodStatus implements EppEnum {
|
|||
/** Provide a quick lookup of GracePeriodStatus from XML name. */
|
||||
private static final ImmutableMap<String, GracePeriodStatus> XML_NAME_TO_GRACE_PERIOD_STATUS =
|
||||
Stream.of(GracePeriodStatus.values())
|
||||
.filter(not(equalTo(SUNRUSH_ADD)))
|
||||
.collect(
|
||||
toImmutableMap(
|
||||
(GracePeriodStatus gracePeriodStatus) -> gracePeriodStatus.xmlName,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue