mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 14:54:51 +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
|
@ -20,12 +20,10 @@ import google.registry.model.common.Cursor;
|
|||
import google.registry.model.common.EntityGroupRoot;
|
||||
import google.registry.model.common.GaeUserIdConverter;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.DomainApplicationIndex;
|
||||
import google.registry.model.index.EppResourceIndex;
|
||||
import google.registry.model.index.EppResourceIndexBucket;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
|
@ -74,8 +72,6 @@ public final class EntityClasses {
|
|||
CommitLogMutation.class,
|
||||
ContactResource.class,
|
||||
Cursor.class,
|
||||
DomainApplication.class,
|
||||
DomainApplicationIndex.class,
|
||||
DomainBase.class,
|
||||
DomainResource.class,
|
||||
EntityGroupRoot.class,
|
||||
|
|
|
@ -51,7 +51,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.ExecutionException;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** An EPP entity object (i.e. a domain, application, contact, or host). */
|
||||
/** An EPP entity object (i.e. a domain, contact, or host). */
|
||||
public abstract class EppResource extends BackupGroupRoot implements Buildable {
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,7 +33,6 @@ import google.registry.model.EppResource.BuilderWithTransferData;
|
|||
import google.registry.model.EppResource.ForeignKeyedEppResource;
|
||||
import google.registry.model.EppResource.ResourceWithTransferData;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
|
@ -158,22 +157,6 @@ public final class EppResourceUtils {
|
|||
resource, latestOf(now, resource.getUpdateAutoTimestamp().getTimestamp())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the domain application with the given application id if it exists, or absent if it does
|
||||
* not or is soft-deleted as of the given time.
|
||||
*/
|
||||
public static Optional<DomainApplication> loadDomainApplication(
|
||||
String applicationId, DateTime now) {
|
||||
DomainApplication application =
|
||||
ofy().load().key(Key.create(DomainApplication.class, applicationId)).now();
|
||||
if (application == null || isAtOrAfter(now, application.getDeletionTime())) {
|
||||
return Optional.empty();
|
||||
}
|
||||
// Applications don't have any speculative changes that become effective later, so no need to
|
||||
// clone forward in time.
|
||||
return Optional.of(application);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks multiple {@link EppResource} objects from Datastore by unique ids.
|
||||
*
|
||||
|
|
|
@ -100,7 +100,6 @@ public final class OteAccountBuilder {
|
|||
|
||||
private final ImmutableMap<String, String> clientIdToTld;
|
||||
private final Registry sunriseTld;
|
||||
private final Registry landrushTld;
|
||||
private final Registry gaTld;
|
||||
private final Registry eapTld;
|
||||
private final ImmutableList.Builder<RegistrarContact> contactsBuilder =
|
||||
|
@ -117,8 +116,6 @@ public final class OteAccountBuilder {
|
|||
sunriseTld =
|
||||
createTld(
|
||||
baseClientId + "-sunrise", TldState.START_DATE_SUNRISE, null, null, null, false, 0);
|
||||
landrushTld =
|
||||
createTld(baseClientId + "-landrush", TldState.LANDRUSH, null, null, null, false, 1);
|
||||
gaTld =
|
||||
createTld(
|
||||
baseClientId + "-ga",
|
||||
|
@ -260,7 +257,7 @@ public final class OteAccountBuilder {
|
|||
private void saveAllEntities() {
|
||||
ofy().assertInTransaction();
|
||||
|
||||
ImmutableList<Registry> registries = ImmutableList.of(sunriseTld, landrushTld, gaTld, eapTld);
|
||||
ImmutableList<Registry> registries = ImmutableList.of(sunriseTld, gaTld, eapTld);
|
||||
ImmutableList<RegistrarContact> contacts = contactsBuilder.build();
|
||||
|
||||
if (!replaceExisting) {
|
||||
|
@ -368,7 +365,7 @@ public final class OteAccountBuilder {
|
|||
baseClientId);
|
||||
return new ImmutableMap.Builder<String, String>()
|
||||
.put(baseClientId + "-1", baseClientId + "-sunrise")
|
||||
.put(baseClientId + "-2", baseClientId + "-landrush")
|
||||
// The -2 registrar no longer exists because landrush no longer exists.
|
||||
.put(baseClientId + "-3", baseClientId + "-ga")
|
||||
.put(baseClientId + "-4", baseClientId + "-ga")
|
||||
.put(baseClientId + "-5", baseClientId + "-eap")
|
||||
|
|
|
@ -102,12 +102,6 @@ public class OteStats {
|
|||
CONTACT_TRANSFER_REJECTS(0, equalTo(Type.CONTACT_TRANSFER_REJECT)),
|
||||
CONTACT_TRANSFER_REQUESTS(0, equalTo(Type.CONTACT_TRANSFER_REQUEST)),
|
||||
CONTACT_UPDATES(0, equalTo(Type.CONTACT_UPDATE)),
|
||||
DOMAIN_APPLICATION_CREATES(0, equalTo(Type.DOMAIN_APPLICATION_CREATE)),
|
||||
DOMAIN_APPLICATION_CREATES_LANDRUSH(
|
||||
0, equalTo(Type.DOMAIN_APPLICATION_CREATE), IS_SUNRISE.negate()),
|
||||
DOMAIN_APPLICATION_CREATES_SUNRISE(0, equalTo(Type.DOMAIN_APPLICATION_CREATE), IS_SUNRISE),
|
||||
DOMAIN_APPLICATION_DELETES(0, equalTo(Type.DOMAIN_APPLICATION_DELETE)),
|
||||
DOMAIN_APPLICATION_UPDATES(0, equalTo(Type.DOMAIN_APPLICATION_UPDATE)),
|
||||
DOMAIN_AUTORENEWS(0, equalTo(Type.DOMAIN_AUTORENEW)),
|
||||
DOMAIN_CREATES(0, equalTo(Type.DOMAIN_CREATE)),
|
||||
DOMAIN_CREATES_ASCII(1, equalTo(Type.DOMAIN_CREATE), IS_IDN.negate()),
|
||||
|
|
|
@ -70,6 +70,9 @@ public abstract class BillingEvent extends ImmutableObject
|
|||
ALLOCATION,
|
||||
ANCHOR_TENANT,
|
||||
AUTO_RENEW,
|
||||
/**
|
||||
* Landrush billing events are historical only and are no longer created.
|
||||
*/
|
||||
LANDRUSH,
|
||||
/**
|
||||
* This flag is used on create {@link OneTime} billing events for domains that were reserved.
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -19,7 +19,6 @@ import static com.google.common.collect.Maps.uniqueIndex;
|
|||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.model.domain.allocate.AllocateCreateExtension;
|
||||
import google.registry.model.domain.fee06.FeeCheckCommandExtensionV06;
|
||||
import google.registry.model.domain.fee06.FeeCheckResponseExtensionV06;
|
||||
import google.registry.model.domain.fee11.FeeCheckCommandExtensionV11;
|
||||
|
@ -55,7 +54,6 @@ public class ProtocolDefinition {
|
|||
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);
|
||||
|
||||
private final Class<? extends CommandExtension> commandExtensionClass;
|
||||
|
|
|
@ -21,7 +21,6 @@ import static com.google.common.base.Strings.nullToEmpty;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.translators.EnumToAttributeAdapter.EppEnum;
|
||||
|
@ -77,9 +76,9 @@ public enum StatusValue implements EppEnum {
|
|||
/**
|
||||
* A status for a resource undergoing asynchronous creation.
|
||||
*
|
||||
* <p>We only use this for unallocated applications.
|
||||
* <p>This status is here for completeness, but it is not used by our system.
|
||||
*/
|
||||
PENDING_CREATE(AllowedOn.APPLICATIONS),
|
||||
PENDING_CREATE(AllowedOn.NONE),
|
||||
|
||||
/**
|
||||
* A status for a resource indicating that deletion has been requested but has not yet happened.
|
||||
|
@ -92,18 +91,16 @@ public enum StatusValue implements EppEnum {
|
|||
* Otherwise, domains go through an extended deletion process, consisting of a 30-day redemption
|
||||
* grace period followed by a 5-day "pending delete" period before they are actually 100% deleted.
|
||||
* These domains have the PENDING_DELETE status throughout that 35-day window.
|
||||
*
|
||||
* <p>Applications are deleted synchronously and never have this status.
|
||||
*/
|
||||
PENDING_DELETE(AllowedOn.ALL_BUT_APPLICATIONS),
|
||||
PENDING_DELETE(AllowedOn.ALL),
|
||||
|
||||
/**
|
||||
* A status for a resource with an unresolved transfer request.
|
||||
*
|
||||
* <p>Applications can't be transferred. Hosts transfer indirectly via superordinate domain.
|
||||
* <p>Hosts transfer indirectly via superordinate domain.
|
||||
*/
|
||||
// TODO(b/34844887): Remove PENDING_TRANSFER from all host resources and forbid it here.
|
||||
PENDING_TRANSFER(AllowedOn.ALL_BUT_APPLICATIONS),
|
||||
PENDING_TRANSFER(AllowedOn.ALL),
|
||||
|
||||
/**
|
||||
* A status for a resource undergoing an asynchronous update.
|
||||
|
@ -130,11 +127,9 @@ public enum StatusValue implements EppEnum {
|
|||
|
||||
/** Enum to help clearly list which resource types a status value is allowed to be present on. */
|
||||
private enum AllowedOn {
|
||||
ALL(ContactResource.class, DomainApplication.class, DomainResource.class, HostResource.class),
|
||||
ALL(ContactResource.class, DomainResource.class, HostResource.class),
|
||||
NONE,
|
||||
DOMAINS(DomainResource.class),
|
||||
APPLICATIONS(DomainApplication.class),
|
||||
ALL_BUT_APPLICATIONS(ContactResource.class, DomainResource.class, HostResource.class);
|
||||
DOMAINS(DomainResource.class);
|
||||
|
||||
private final ImmutableSet<Class<? extends EppResource>> classes;
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableSet;
|
|||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.contact.ContactCommand;
|
||||
import google.registry.model.domain.DomainCommand;
|
||||
import google.registry.model.domain.allocate.AllocateCreateExtension;
|
||||
import google.registry.model.domain.fee06.FeeCheckCommandExtensionV06;
|
||||
import google.registry.model.domain.fee06.FeeCreateCommandExtensionV06;
|
||||
import google.registry.model.domain.fee06.FeeInfoCommandExtensionV06;
|
||||
|
@ -328,8 +327,6 @@ public class EppInput extends ImmutableObject {
|
|||
|
||||
/** Zero or more command extensions. */
|
||||
@XmlElementRefs({
|
||||
// allocate create extension
|
||||
@XmlElementRef(type = AllocateCreateExtension.class),
|
||||
// allocation token extension
|
||||
@XmlElementRef(type = AllocationTokenExtension.class),
|
||||
// fee extension version 0.6
|
||||
|
|
|
@ -43,8 +43,6 @@ 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;
|
||||
import google.registry.model.domain.rgp.RgpInfoExtension;
|
||||
import google.registry.model.domain.secdns.SecDnsInfoExtension;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
|
@ -139,8 +137,6 @@ public class EppResponse extends ImmutableObject implements ResponseOrGreeting {
|
|||
@XmlElementRef(type = FeeTransferResponseExtensionV12.class),
|
||||
@XmlElementRef(type = FeeUpdateResponseExtensionV12.class),
|
||||
@XmlElementRef(type = LaunchCheckResponseExtension.class),
|
||||
@XmlElementRef(type = LaunchCreateResponseExtension.class),
|
||||
@XmlElementRef(type = LaunchInfoResponseExtension.class),
|
||||
@XmlElementRef(type = RgpInfoExtension.class),
|
||||
@XmlElementRef(type = SecDnsInfoExtension.class) })
|
||||
@XmlElementWrapper(name = "extension")
|
||||
|
|
|
@ -1,137 +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.index;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Strings.isNullOrEmpty;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.util.CollectionUtils.isNullOrEmpty;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.annotation.Entity;
|
||||
import com.googlecode.objectify.annotation.Id;
|
||||
import google.registry.model.BackupGroupRoot;
|
||||
import google.registry.model.annotations.ReportedOn;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.util.CollectionUtils;
|
||||
import java.util.Set;
|
||||
import javax.annotation.Nullable;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
* Entity for tracking all domain applications with a given fully qualified domain name.
|
||||
*
|
||||
* <p>Since this resource is always kept up to date as additional domain applications are created,
|
||||
* it is never necessary to query them explicitly from Datastore.
|
||||
*/
|
||||
@ReportedOn
|
||||
@Entity
|
||||
public class DomainApplicationIndex extends BackupGroupRoot {
|
||||
|
||||
@Id
|
||||
String fullyQualifiedDomainName;
|
||||
|
||||
/**
|
||||
* A set of all domain applications with this fully qualified domain name. Never null or empty.
|
||||
*
|
||||
* <p>Although this stores {@link Key}s it is named "references" for historical reasons.
|
||||
*/
|
||||
Set<Key<DomainApplication>> references;
|
||||
|
||||
/** Returns a cloned list of all keys on this index. */
|
||||
public ImmutableSet<Key<DomainApplication>> getKeys() {
|
||||
return ImmutableSet.copyOf(references);
|
||||
}
|
||||
|
||||
public String getFullyQualifiedDomainName() {
|
||||
return fullyQualifiedDomainName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a DomainApplicationIndex with the specified list of keys.
|
||||
*
|
||||
* <p>Only use this method for data migrations. You probably want {@link #createUpdatedInstance}.
|
||||
*/
|
||||
public static DomainApplicationIndex createWithSpecifiedKeys(
|
||||
String fullyQualifiedDomainName, ImmutableSet<Key<DomainApplication>> keys) {
|
||||
checkArgument(!isNullOrEmpty(fullyQualifiedDomainName),
|
||||
"fullyQualifiedDomainName must not be null or empty.");
|
||||
checkArgument(!isNullOrEmpty(keys), "Keys must not be null or empty.");
|
||||
DomainApplicationIndex instance = new DomainApplicationIndex();
|
||||
instance.fullyQualifiedDomainName = fullyQualifiedDomainName;
|
||||
instance.references = keys;
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static Key<DomainApplicationIndex> createKey(DomainApplication application) {
|
||||
return Key.create(DomainApplicationIndex.class, application.getFullyQualifiedDomainName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set of all active DomainApplications for the given fully qualified domain name.
|
||||
*
|
||||
* <p>Note that loading the individual applications referenced by the keys are explicitly
|
||||
* non-transactional. This is to avoid potentially over-enlisting multiple entity groups within a
|
||||
* transaction.
|
||||
*
|
||||
* <p>Consequently within a transaction this method will not return any applications that are not
|
||||
* yet committed to datastore, even if called on an updated DomainApplicationIndex instance
|
||||
* storing keys to those applications.
|
||||
*/
|
||||
public static ImmutableSet<DomainApplication> loadActiveApplicationsByDomainName(
|
||||
String fullyQualifiedDomainName, final DateTime now) {
|
||||
final DomainApplicationIndex index = load(fullyQualifiedDomainName);
|
||||
if (index == null) {
|
||||
return ImmutableSet.of();
|
||||
}
|
||||
// Perform eventually consistent query, to avoid overenlisting cross entity groups
|
||||
return ofy().doTransactionless(() -> {
|
||||
ImmutableSet.Builder<DomainApplication> apps = new ImmutableSet.Builder<>();
|
||||
for (DomainApplication app : ofy().load().keys(index.getKeys()).values()) {
|
||||
if (app.getDeletionTime().isAfter(now)) {
|
||||
apps.add(app);
|
||||
}
|
||||
}
|
||||
return apps.build();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the DomainApplicationIndex for the given fully qualified domain name.
|
||||
*
|
||||
* <p>Note that this can return null if there are no domain applications for this fully qualified
|
||||
* domain name.
|
||||
*/
|
||||
@Nullable
|
||||
public static DomainApplicationIndex load(String fullyQualifiedDomainName) {
|
||||
return ofy().load().type(DomainApplicationIndex.class).id(fullyQualifiedDomainName).now();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a new DomainApplicationIndex for this resource or updates the existing one.
|
||||
*
|
||||
* <p>This is the preferred method for creating an instance of DomainApplicationIndex because this
|
||||
* performs the correct merging logic to add the given domain application to an existing index if
|
||||
* there is one.
|
||||
*/
|
||||
public static DomainApplicationIndex createUpdatedInstance(DomainApplication application) {
|
||||
DomainApplicationIndex existing = load(application.getFullyQualifiedDomainName());
|
||||
ImmutableSet<Key<DomainApplication>> newKeys = CollectionUtils.union(
|
||||
(existing == null ? ImmutableSet.of() : existing.getKeys()),
|
||||
Key.create(application));
|
||||
return createWithSpecifiedKeys(application.getFullyQualifiedDomainName(), newKeys);
|
||||
}
|
||||
}
|
|
@ -32,9 +32,7 @@ import google.registry.model.EppResource;
|
|||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.annotations.ExternalMessagingName;
|
||||
import google.registry.model.domain.DomainRenewData;
|
||||
import google.registry.model.domain.launch.LaunchInfoResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
import google.registry.model.poll.PendingActionNotificationResponse.ContactPendingActionNotificationResponse;
|
||||
import google.registry.model.poll.PendingActionNotificationResponse.DomainPendingActionNotificationResponse;
|
||||
import google.registry.model.poll.PendingActionNotificationResponse.HostPendingActionNotificationResponse;
|
||||
|
@ -57,15 +55,14 @@ import org.joda.time.DateTime;
|
|||
*
|
||||
* <p>Poll messages are parented off of the {@link HistoryEntry} that resulted in their creation.
|
||||
* This means that poll messages are contained in the Datastore entity group of the parent {@link
|
||||
* EppResource} (which can be a domain, application, contact, or host). It is thus possible to
|
||||
* perform a strongly consistent query to find all poll messages associated with a given EPP
|
||||
* resource.
|
||||
* EppResource} (which can be a domain, contact, or host). It is thus possible to perform a strongly
|
||||
* consistent query to find all poll messages associated with a given EPP resource.
|
||||
*
|
||||
* <p>Poll messages are identified externally by registrars using the format defined in {@link
|
||||
* PollMessageExternalKeyConverter}.
|
||||
*
|
||||
* @see <a href="https://tools.ietf.org/html/rfc5730#section-2.9.2.3">
|
||||
* RFC5730 - EPP - <poll> Command</a>
|
||||
* @see <a href="https://tools.ietf.org/html/rfc5730#section-2.9.2.3">RFC5730 - EPP - <poll>
|
||||
* Command</a>
|
||||
*/
|
||||
@Entity
|
||||
@ExternalMessagingName("message")
|
||||
|
@ -113,8 +110,6 @@ public abstract class PollMessage extends ImmutableObject
|
|||
|
||||
public abstract ImmutableList<ResponseData> getResponseData();
|
||||
|
||||
public abstract ImmutableList<ResponseExtension> getResponseExtensions();
|
||||
|
||||
/** Override Buildable.asBuilder() to give this method stronger typing. */
|
||||
@Override
|
||||
public abstract Builder<?, ?> asBuilder();
|
||||
|
@ -193,15 +188,6 @@ public abstract class PollMessage extends ImmutableObject
|
|||
List<DomainTransferResponse> domainTransferResponses;
|
||||
List<HostPendingActionNotificationResponse> hostPendingActionNotificationResponses;
|
||||
|
||||
// Extensions. Objectify cannot persist a base class type, so we must have a separate field
|
||||
// to hold every possible derived type of ResponseExtensions that we might store.
|
||||
//
|
||||
// Note that we cannot store a list of LaunchInfoResponseExtension objects since it contains a
|
||||
// list of embedded Mark objects, and embedded lists of lists are not allowed. This shouldn't
|
||||
// matter since there's no scenario where multiple launch info response extensions are ever
|
||||
// returned.
|
||||
LaunchInfoResponseExtension launchInfoResponseExtension;
|
||||
|
||||
@Override
|
||||
public Builder asBuilder() {
|
||||
return new Builder(clone(this));
|
||||
|
@ -218,17 +204,11 @@ public abstract class PollMessage extends ImmutableObject
|
|||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<ResponseExtension> getResponseExtensions() {
|
||||
return (launchInfoResponseExtension == null)
|
||||
? ImmutableList.of()
|
||||
: ImmutableList.of(launchInfoResponseExtension);
|
||||
}
|
||||
|
||||
/** A builder for {@link OneTime} since it is immutable. */
|
||||
public static class Builder extends PollMessage.Builder<OneTime, Builder> {
|
||||
|
||||
public Builder() {}
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
private Builder(OneTime instance) {
|
||||
super(instance);
|
||||
|
@ -272,18 +252,6 @@ public abstract class PollMessage extends ImmutableObject
|
|||
.collect(toImmutableList()));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setResponseExtensions(
|
||||
ImmutableList<? extends ResponseExtension> responseExtensions) {
|
||||
getInstance().launchInfoResponseExtension =
|
||||
responseExtensions
|
||||
.stream()
|
||||
.filter(LaunchInfoResponseExtension.class::isInstance)
|
||||
.map(LaunchInfoResponseExtension.class::cast)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,11 +288,6 @@ public abstract class PollMessage extends ImmutableObject
|
|||
DomainRenewData.create(getTargetId(), getEventTime().plusYears(1)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<ResponseExtension> getResponseExtensions() {
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Builder asBuilder() {
|
||||
return new Builder(clone(this));
|
||||
|
|
|
@ -16,7 +16,7 @@ package google.registry.model.pricing;
|
|||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Strings.emptyToNull;
|
||||
import static google.registry.model.registry.Registry.TldState.SUNRISE;
|
||||
import static google.registry.model.registry.Registry.TldState.START_DATE_SUNRISE;
|
||||
import static google.registry.model.registry.label.PremiumListUtils.getPremiumPrice;
|
||||
import static google.registry.model.registry.label.ReservationType.NAME_COLLISION;
|
||||
import static google.registry.model.registry.label.ReservedList.getReservationTypes;
|
||||
|
@ -45,7 +45,7 @@ public final class StaticPremiumListPricingEngine implements PremiumPricingEngin
|
|||
Registry registry = Registry.get(checkNotNull(tld, "tld"));
|
||||
Optional<Money> premiumPrice = getPremiumPrice(label, registry);
|
||||
boolean isNameCollisionInSunrise =
|
||||
registry.getTldState(priceTime).equals(SUNRISE)
|
||||
registry.getTldState(priceTime).equals(START_DATE_SUNRISE)
|
||||
&& getReservationTypes(label, tld).contains(NAME_COLLISION);
|
||||
String feeClass = emptyToNull(Joiner.on('-').skipNulls().join(
|
||||
premiumPrice.isPresent() ? "premium" : null,
|
||||
|
|
|
@ -97,7 +97,6 @@ public class Registry extends ImmutableObject implements Buildable {
|
|||
public static final boolean DEFAULT_ESCROW_ENABLED = false;
|
||||
public static final boolean DEFAULT_DNS_PAUSED = false;
|
||||
public static final Duration DEFAULT_ADD_GRACE_PERIOD = Duration.standardDays(5);
|
||||
public static final Duration DEFAULT_SUNRUSH_ADD_GRACE_PERIOD = Duration.standardDays(5);
|
||||
public static final Duration DEFAULT_AUTO_RENEW_GRACE_PERIOD = Duration.standardDays(45);
|
||||
public static final Duration DEFAULT_REDEMPTION_GRACE_PERIOD = Duration.standardDays(30);
|
||||
public static final Duration DEFAULT_RENEW_GRACE_PERIOD = Duration.standardDays(5);
|
||||
|
@ -126,28 +125,10 @@ public class Registry extends ImmutableObject implements Buildable {
|
|||
* sequence of states (ignoring {@link #PDT} which is a pseudo-state).
|
||||
*/
|
||||
public enum TldState {
|
||||
|
||||
/** The state of not yet being delegated to this registry in the root zone by IANA. */
|
||||
PREDELEGATION,
|
||||
|
||||
/**
|
||||
* The state in which only trademark holders can submit applications for domains. Doing so
|
||||
* requires a claims notice to be submitted with the application.
|
||||
*/
|
||||
SUNRISE,
|
||||
|
||||
/**
|
||||
* The state representing the overlap of {@link #SUNRISE} with a "landrush" state in which
|
||||
* anyone can submit an application for a domain name. Sunrise applications may continue during
|
||||
* landrush, so we model the overlap as a distinct state named "sunrush".
|
||||
*/
|
||||
SUNRUSH,
|
||||
|
||||
/**
|
||||
* The state in which anyone can submit an application for a domain name. Sunrise applications
|
||||
* are not allowed during this phase.
|
||||
*/
|
||||
LANDRUSH,
|
||||
|
||||
/**
|
||||
* The state in which only trademark holders can submit a "create" request. It is identical to
|
||||
* {@link #GENERAL_AVAILABILITY} in all other respects.
|
||||
|
@ -155,9 +136,9 @@ public class Registry extends ImmutableObject implements Buildable {
|
|||
START_DATE_SUNRISE,
|
||||
|
||||
/**
|
||||
* A state in which no domain operations are permitted. Generally used after sunrise or landrush
|
||||
* to allocate uncontended applications and send contended applications to auction. This state
|
||||
* is special in that it has no ordering constraints and can appear after any phase.
|
||||
* A state in which no domain operations are permitted. Generally used between sunrise and
|
||||
* general availability. This state is special in that it has no ordering constraints and can
|
||||
* appear after any phase.
|
||||
*/
|
||||
QUIET_PERIOD,
|
||||
|
||||
|
@ -373,9 +354,6 @@ public class Registry extends ImmutableObject implements Buildable {
|
|||
/** The length of the anchor tenant add grace period for this TLD. */
|
||||
Duration anchorTenantAddGracePeriodLength = DEFAULT_ANCHOR_TENANT_ADD_GRACE_PERIOD;
|
||||
|
||||
/** The length of the add grace period during sunrush for this TLD. */
|
||||
Duration sunrushAddGracePeriodLength = DEFAULT_SUNRUSH_ADD_GRACE_PERIOD;
|
||||
|
||||
/** The length of the auto renew grace period for this TLD. */
|
||||
Duration autoRenewGracePeriodLength = DEFAULT_AUTO_RENEW_GRACE_PERIOD;
|
||||
|
||||
|
@ -499,10 +477,6 @@ public class Registry extends ImmutableObject implements Buildable {
|
|||
return addGracePeriodLength;
|
||||
}
|
||||
|
||||
public Duration getSunrushAddGracePeriodLength() {
|
||||
return sunrushAddGracePeriodLength;
|
||||
}
|
||||
|
||||
public Duration getAutoRenewGracePeriodLength() {
|
||||
return autoRenewGracePeriodLength;
|
||||
}
|
||||
|
@ -720,14 +694,6 @@ public class Registry extends ImmutableObject implements Buildable {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setSunrushAddGracePeriodLength(Duration sunrushAddGracePeriodLength) {
|
||||
checkArgument(
|
||||
sunrushAddGracePeriodLength.isLongerThan(Duration.ZERO),
|
||||
"sunrushAddGracePeriodLength must be non-zero");
|
||||
getInstance().sunrushAddGracePeriodLength = sunrushAddGracePeriodLength;
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Warning! Changing this will affect the billing time of autorenew events in the past. */
|
||||
public Builder setAutoRenewGracePeriodLength(Duration autoRenewGracePeriodLength) {
|
||||
checkArgument(
|
||||
|
|
|
@ -50,11 +50,15 @@ public class HistoryEntry extends ImmutableObject implements Buildable {
|
|||
CONTACT_TRANSFER_REJECT,
|
||||
CONTACT_TRANSFER_REQUEST,
|
||||
CONTACT_UPDATE,
|
||||
/**
|
||||
* Used for history entries that were allocated as a result of a domain application.
|
||||
*
|
||||
* <p>Domain applications (and thus allocating from an application) no longer exist, but we have
|
||||
* existing domains in the system that were created via allocation and thus have history entries
|
||||
* of this type under them, so this is retained for legacy purposes.
|
||||
*/
|
||||
@Deprecated
|
||||
DOMAIN_ALLOCATE,
|
||||
DOMAIN_APPLICATION_CREATE,
|
||||
DOMAIN_APPLICATION_DELETE,
|
||||
DOMAIN_APPLICATION_UPDATE,
|
||||
DOMAIN_APPLICATION_STATUS_UPDATE,
|
||||
/**
|
||||
* Used for domain registration autorenews explicitly logged by
|
||||
* {@link google.registry.batch.ExpandRecurringBillingEventsAction}.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue