diff --git a/java/google/registry/model/registry/Registry.java b/java/google/registry/model/registry/Registry.java index 927d4313d..1ecf46c09 100644 --- a/java/google/registry/model/registry/Registry.java +++ b/java/google/registry/model/registry/Registry.java @@ -327,13 +327,18 @@ public class Registry extends ImmutableObject implements Buildable { */ boolean domainCreateRestricted; - /** The length of the add grace period for this TLD. */ + /** + * The length of the add grace period for this TLD. + * + *
Domain deletes are free and effective immediately so long as they take place within this
+ * amount of time following creation.
+ */
Duration addGracePeriodLength = DEFAULT_ADD_GRACE_PERIOD;
- /** The length of the add grace period for this TLD. */
+ /** The length of the anchor tenant add grace period for this TLD. */
Duration anchorTenantAddGracePeriodLength = DEFAULT_ANCHOR_TENANT_ADD_GRACE_PERIOD;
- /** The length of the sunrush add grace period for this TLD. */
+ /** 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. */
diff --git a/java/google/registry/tools/CreateOrUpdateTldCommand.java b/java/google/registry/tools/CreateOrUpdateTldCommand.java
index 93c31fee6..1cbe8907e 100644
--- a/java/google/registry/tools/CreateOrUpdateTldCommand.java
+++ b/java/google/registry/tools/CreateOrUpdateTldCommand.java
@@ -73,25 +73,31 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand {
@Nullable
@Parameter(
names = "--add_grace_period",
- description = "Length of the add grace period")
+ description = "Length of the add grace period (in ISO 8601 duration format)")
Duration addGracePeriod;
+ @Nullable
+ @Parameter(
+ names = "--sunrush_add_grace_period",
+ description = "Length of the add grace period during sunrush (in ISO 8601 duration format)")
+ Duration sunrushAddGracePeriod;
+
@Nullable
@Parameter(
names = "--redemption_grace_period",
- description = "Length of the redemption grace period")
+ description = "Length of the redemption grace period (in ISO 8601 duration format)")
Duration redemptionGracePeriod;
@Nullable
@Parameter(
names = "--pending_delete_length",
- description = "Length of the pending delete period")
+ description = "Length of the pending delete period (in ISO 8601 duration format)")
Duration pendingDeleteLength;
@Nullable
@Parameter(
names = "--automatic_transfer_length",
- description = "Length of the automatic transfer period")
+ description = "Length of the automatic transfer period (in ISO 8601 duration format)")
private Duration automaticTransferLength;
@Nullable
@@ -321,61 +327,23 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand {
builder.setEapFeeSchedule(eapFeeSchedule);
}
- if (addGracePeriod != null) {
- builder.setAddGracePeriodLength(addGracePeriod);
- }
-
- if (redemptionGracePeriod != null) {
- builder.setRedemptionGracePeriodLength(redemptionGracePeriod);
- }
-
- if (pendingDeleteLength != null) {
- builder.setPendingDeleteLength(pendingDeleteLength);
- }
-
- if (automaticTransferLength != null) {
- builder.setAutomaticTransferLength(automaticTransferLength);
- }
-
- if (driveFolderId != null) {
- builder.setDriveFolderId(driveFolderId.orElse(null));
- }
-
- if (createBillingCost != null) {
- builder.setCreateBillingCost(createBillingCost);
- }
-
- if (restoreBillingCost != null) {
- builder.setRestoreBillingCost(restoreBillingCost);
- }
-
- if (roidSuffix != null) {
- builder.setRoidSuffix(roidSuffix);
- }
-
- if (serverStatusChangeCost != null) {
- builder.setServerStatusChangeBillingCost(serverStatusChangeCost);
- }
-
- if (tldType != null) {
- builder.setTldType(tldType);
- }
-
- if (premiumPriceAckRequired != null) {
- builder.setPremiumPriceAckRequired(premiumPriceAckRequired);
- }
-
- if (lordnUsername != null) {
- builder.setLordnUsername(lordnUsername.orElse(null));
- }
-
- if (claimsPeriodEnd != null) {
- builder.setClaimsPeriodEnd(claimsPeriodEnd);
- }
-
- if (domainCreateRestricted != null) {
- builder.setDomainCreateRestricted(domainCreateRestricted);
- }
+ Optional.ofNullable(addGracePeriod).ifPresent(builder::setAddGracePeriodLength);
+ Optional.ofNullable(sunrushAddGracePeriod).ifPresent(builder::setSunrushAddGracePeriodLength);
+ Optional.ofNullable(redemptionGracePeriod).ifPresent(builder::setRedemptionGracePeriodLength);
+ Optional.ofNullable(pendingDeleteLength).ifPresent(builder::setPendingDeleteLength);
+ Optional.ofNullable(automaticTransferLength).ifPresent(builder::setAutomaticTransferLength);
+ Optional.ofNullable(driveFolderId).ifPresent(id -> builder.setDriveFolderId(id.orElse(null)));
+ Optional.ofNullable(createBillingCost).ifPresent(builder::setCreateBillingCost);
+ Optional.ofNullable(restoreBillingCost).ifPresent(builder::setRestoreBillingCost);
+ Optional.ofNullable(roidSuffix).ifPresent(builder::setRoidSuffix);
+ Optional.ofNullable(serverStatusChangeCost)
+ .ifPresent(builder::setServerStatusChangeBillingCost);
+ Optional.ofNullable(tldType).ifPresent(builder::setTldType);
+ Optional.ofNullable(premiumPriceAckRequired).ifPresent(builder::setPremiumPriceAckRequired);
+ Optional.ofNullable(lordnUsername).ifPresent(u -> builder.setLordnUsername(u.orElse(null)));
+ Optional.ofNullable(claimsPeriodEnd).ifPresent(builder::setClaimsPeriodEnd);
+ Optional.ofNullable(domainCreateRestricted).ifPresent(builder::setDomainCreateRestricted);
+ Optional.ofNullable(lrpPeriod).ifPresent(p -> builder.setLrpPeriod(p.orElse(null)));
if (premiumListName != null) {
if (premiumListName.isPresent()) {
@@ -399,10 +367,6 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand {
builder.setDnsWriters(dnsWritersSet);
}
- if (lrpPeriod != null) {
- builder.setLrpPeriod(lrpPeriod.orElse(null));
- }
-
ImmutableSet