Rename ClaimsCheckFlow to DomainClaimsCheckFlow

This way it is consistent with the rest of our domain-related flows, which
consistently use the Domain* prefix. Note that claims checks are just a
special case of domain checks anyway, which run under DomainCheckFlow. This
will make dashboards looking at domain commands "just work" with a regexp of
Domain.*, without having to special-case in ClaimsCheck.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172608964
This commit is contained in:
mcilwain 2017-10-18 09:05:10 -07:00 committed by jianglai
parent 77ee3e3544
commit e62e1af863
5 changed files with 43 additions and 40 deletions

View file

@ -1,26 +1,5 @@
# Nomulus EPP Command API Documentation
## ClaimsCheckFlow
### Description
An EPP flow that checks whether strings are trademarked.
### Errors
* 2002
* Command is not allowed in the current registry phase.
* Claims checks are not allowed during sunrise.
* 2004
* Domain name is under tld which doesn't exist.
* 2201
* Registrar is not authorized to access this TLD.
* 2304
* The claims period for this TLD has ended.
* 2306
* Too many resource checks requested in one check command.
## ContactCheckFlow
### Description
@ -504,6 +483,27 @@ information.
* By server policy, fee check names must be listed in the availability
check.
## DomainClaimsCheckFlow
### Description
An EPP flow that checks whether domain labels are trademarked.
### Errors
* 2002
* Command is not allowed in the current registry phase.
* Claims checks are not allowed during sunrise.
* 2004
* Domain name is under tld which doesn't exist.
* 2201
* Registrar is not authorized to access this TLD.
* 2304
* The claims period for this TLD has ended.
* 2306
* Too many resource checks requested in one check command.
## DomainCreateFlow
### Description

View file

@ -30,13 +30,13 @@ import google.registry.flows.contact.ContactTransferRejectFlow;
import google.registry.flows.contact.ContactTransferRequestFlow;
import google.registry.flows.contact.ContactUpdateFlow;
import google.registry.flows.custom.CustomLogicModule;
import google.registry.flows.domain.ClaimsCheckFlow;
import google.registry.flows.domain.DomainAllocateFlow;
import google.registry.flows.domain.DomainApplicationCreateFlow;
import google.registry.flows.domain.DomainApplicationDeleteFlow;
import google.registry.flows.domain.DomainApplicationInfoFlow;
import google.registry.flows.domain.DomainApplicationUpdateFlow;
import google.registry.flows.domain.DomainCheckFlow;
import google.registry.flows.domain.DomainClaimsCheckFlow;
import google.registry.flows.domain.DomainCreateFlow;
import google.registry.flows.domain.DomainDeleteFlow;
import google.registry.flows.domain.DomainInfoFlow;
@ -84,13 +84,13 @@ public interface FlowComponent {
ContactTransferRejectFlow contactTransferRejectFlow();
ContactTransferRequestFlow contactTransferRequestFlow();
ContactUpdateFlow contactUpdateFlow();
ClaimsCheckFlow claimsCheckFlow();
DomainAllocateFlow domainAllocateFlow();
DomainApplicationCreateFlow domainApplicationCreateFlow();
DomainApplicationDeleteFlow domainApplicationDeleteFlow();
DomainApplicationInfoFlow domainApplicationInfoFlow();
DomainApplicationUpdateFlow domainApplicationUpdateFlow();
DomainCheckFlow domainCheckFlow();
DomainClaimsCheckFlow domainClaimsCheckFlow();
DomainCreateFlow domainCreateFlow();
DomainDeleteFlow domainDeleteFlow();
DomainInfoFlow domainInfoFlow();
@ -138,13 +138,13 @@ public interface FlowComponent {
: clazz.equals(ContactTransferRejectFlow.class) ? flows.contactTransferRejectFlow()
: clazz.equals(ContactTransferRequestFlow.class) ? flows.contactTransferRequestFlow()
: clazz.equals(ContactUpdateFlow.class) ? flows.contactUpdateFlow()
: clazz.equals(ClaimsCheckFlow.class) ? flows.claimsCheckFlow()
: clazz.equals(DomainAllocateFlow.class) ? flows.domainAllocateFlow()
: clazz.equals(DomainApplicationCreateFlow.class) ? flows.domainApplicationCreateFlow()
: clazz.equals(DomainApplicationDeleteFlow.class) ? flows.domainApplicationDeleteFlow()
: clazz.equals(DomainApplicationInfoFlow.class) ? flows.domainApplicationInfoFlow()
: clazz.equals(DomainApplicationUpdateFlow.class) ? flows.domainApplicationUpdateFlow()
: clazz.equals(DomainCheckFlow.class) ? flows.domainCheckFlow()
: clazz.equals(DomainClaimsCheckFlow.class) ? flows.domainClaimsCheckFlow()
: clazz.equals(DomainCreateFlow.class) ? flows.domainCreateFlow()
: clazz.equals(DomainDeleteFlow.class) ? flows.domainDeleteFlow()
: clazz.equals(DomainInfoFlow.class) ? flows.domainInfoFlow()

View file

@ -53,17 +53,17 @@ import javax.inject.Inject;
import org.joda.time.DateTime;
/**
* An EPP flow that checks whether strings are trademarked.
* An EPP flow that checks whether domain labels are trademarked.
*
* @error {@link google.registry.flows.exceptions.TooManyResourceChecksException}
* @error {@link DomainFlowUtils.BadCommandForRegistryPhaseException}
* @error {@link DomainFlowUtils.ClaimsPeriodEndedException}
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
* @error {@link DomainFlowUtils.TldDoesNotExistException}
* @error {@link ClaimsCheckNotAllowedInSunrise}
* @error {@link DomainClaimsCheckNotAllowedInSunrise}
*/
@ReportingSpec(ActivityReportField.DOMAIN_CHECK) // Claims check is a special domain check.
public final class ClaimsCheckFlow implements Flow {
public final class DomainClaimsCheckFlow implements Flow {
@Inject ExtensionManager extensionManager;
@Inject ResourceCommand resourceCommand;
@ -72,7 +72,9 @@ public final class ClaimsCheckFlow implements Flow {
@Inject Clock clock;
@Inject @Config("maxChecks") int maxChecks;
@Inject EppResponse.Builder responseBuilder;
@Inject ClaimsCheckFlow() {}
@Inject
DomainClaimsCheckFlow() {}
@Override
public EppResponse run() throws EppException {
@ -95,7 +97,7 @@ public final class ClaimsCheckFlow implements Flow {
DateTime now = clock.nowUtc();
verifyNotInPredelegation(registry, now);
if (registry.getTldState(now) == TldState.SUNRISE) {
throw new ClaimsCheckNotAllowedInSunrise();
throw new DomainClaimsCheckNotAllowedInSunrise();
}
verifyClaimsPeriodNotEnded(registry, now);
}
@ -111,8 +113,8 @@ public final class ClaimsCheckFlow implements Flow {
}
/** Claims checks are not allowed during sunrise. */
static class ClaimsCheckNotAllowedInSunrise extends CommandUseErrorException {
public ClaimsCheckNotAllowedInSunrise() {
static class DomainClaimsCheckNotAllowedInSunrise extends CommandUseErrorException {
public DomainClaimsCheckNotAllowedInSunrise() {
super("Claims checks are not allowed during sunrise");
}
}

View file

@ -35,13 +35,13 @@ import google.registry.flows.contact.ContactTransferQueryFlow;
import google.registry.flows.contact.ContactTransferRejectFlow;
import google.registry.flows.contact.ContactTransferRequestFlow;
import google.registry.flows.contact.ContactUpdateFlow;
import google.registry.flows.domain.ClaimsCheckFlow;
import google.registry.flows.domain.DomainAllocateFlow;
import google.registry.flows.domain.DomainApplicationCreateFlow;
import google.registry.flows.domain.DomainApplicationDeleteFlow;
import google.registry.flows.domain.DomainApplicationInfoFlow;
import google.registry.flows.domain.DomainApplicationUpdateFlow;
import google.registry.flows.domain.DomainCheckFlow;
import google.registry.flows.domain.DomainClaimsCheckFlow;
import google.registry.flows.domain.DomainCreateFlow;
import google.registry.flows.domain.DomainDeleteFlow;
import google.registry.flows.domain.DomainInfoFlow;
@ -191,7 +191,7 @@ public class FlowPicker {
}
if (CheckType.CLAIMS.equals(extension.getCheckType())
&& LaunchPhase.CLAIMS.equals(extension.getPhase())) {
return ClaimsCheckFlow.class;
return DomainClaimsCheckFlow.class;
}
return null;
}};

View file

@ -22,7 +22,7 @@ import static google.registry.testing.DatastoreHelper.persistResource;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import google.registry.flows.ResourceFlowTestCase;
import google.registry.flows.domain.ClaimsCheckFlow.ClaimsCheckNotAllowedInSunrise;
import google.registry.flows.domain.DomainClaimsCheckFlow.DomainClaimsCheckNotAllowedInSunrise;
import google.registry.flows.domain.DomainFlowUtils.BadCommandForRegistryPhaseException;
import google.registry.flows.domain.DomainFlowUtils.ClaimsPeriodEndedException;
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
@ -34,10 +34,11 @@ import google.registry.model.registry.Registry.TldState;
import org.junit.Before;
import org.junit.Test;
/** Unit tests for {@link ClaimsCheckFlow}. */
public class ClaimsCheckFlowTest extends ResourceFlowTestCase<ClaimsCheckFlow, DomainResource> {
/** Unit tests for {@link DomainClaimsCheckFlow}. */
public class DomainClaimsCheckFlowTest
extends ResourceFlowTestCase<DomainClaimsCheckFlow, DomainResource> {
public ClaimsCheckFlowTest() {
public DomainClaimsCheckFlowTest() {
setEppInput("domain_check_claims.xml");
}
@ -152,7 +153,7 @@ public class ClaimsCheckFlowTest extends ResourceFlowTestCase<ClaimsCheckFlow, D
createTld("tld", TldState.SUNRISE);
persistResource(Registry.get("tld").asBuilder().build());
setEppInput("domain_check_claims.xml");
thrown.expect(ClaimsCheckNotAllowedInSunrise.class);
thrown.expect(DomainClaimsCheckNotAllowedInSunrise.class);
runFlow();
}