Add LRP TLD states to Registry and *_tld tools

Also had to add an EnumParameter class to support
List<T extends Enum<T>>, as these aren't natively supported by
JCommander (although single Enum parameters are.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129464699
This commit is contained in:
Chris Tingue 2016-08-05 11:39:06 -07:00 committed by Justine Tunney
parent 751df4b488
commit 1ef8716177
10 changed files with 259 additions and 2 deletions

View file

@ -443,4 +443,21 @@ public class RegistryTest extends EntityTestCase {
.setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(EUR)))
.build();
}
@Test
public void testFailure_lrpTldState_notInTransitions() {
Registry registry = Registry.get("tld").asBuilder()
.setTldStateTransitions(ImmutableSortedMap.<DateTime, TldState>naturalOrder()
.put(START_OF_TIME, TldState.PREDELEGATION)
.put(clock.nowUtc().plusMonths(1), TldState.SUNRISE)
.put(clock.nowUtc().plusMonths(3), TldState.LANDRUSH)
.put(clock.nowUtc().plusMonths(4), TldState.QUIET_PERIOD)
.put(clock.nowUtc().plusMonths(5), TldState.GENERAL_AVAILABILITY)
.build())
.build();
thrown.expect(
IllegalArgumentException.class,
"Cannot specify an LRP TLD state that is not part of the TLD state transitions.");
registry.asBuilder().setLrpTldStates(ImmutableSet.of(TldState.SUNRUSH)).build();
}
}

View file

@ -683,6 +683,7 @@ class google.registry.model.registry.Registry {
java.lang.String tldStr;
java.lang.String tldUnicode;
java.util.Set<com.googlecode.objectify.Key<google.registry.model.registry.label.ReservedList>> reservedLists;
java.util.Set<google.registry.model.registry.Registry$TldState> lrpTldStates;
java.util.Set<java.lang.String> allowedFullyQualifiedHostNames;
java.util.Set<java.lang.String> allowedRegistrantContactIds;
org.joda.money.CurrencyUnit currency;