diff --git a/java/google/registry/flows/EppController.java b/java/google/registry/flows/EppController.java index 628a67337..0d840932e 100644 --- a/java/google/registry/flows/EppController.java +++ b/java/google/registry/flows/EppController.java @@ -16,7 +16,7 @@ package google.registry.flows; import static google.registry.flows.EppXmlTransformer.marshalWithLenientRetry; import static google.registry.flows.EppXmlTransformer.unmarshal; -import static google.registry.flows.FlowRegistry.getFlowClass; +import static google.registry.flows.picker.FlowPicker.getFlowClass; import com.google.apphosting.api.ApiProxy; import com.google.common.annotations.VisibleForTesting; diff --git a/java/google/registry/flows/FlowRegistry.java b/java/google/registry/flows/picker/FlowPicker.java similarity index 98% rename from java/google/registry/flows/FlowRegistry.java rename to java/google/registry/flows/picker/FlowPicker.java index 5eac4b01f..0f23a99bd 100644 --- a/java/google/registry/flows/FlowRegistry.java +++ b/java/google/registry/flows/picker/FlowPicker.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package google.registry.flows; +package google.registry.flows.picker; import static google.registry.model.domain.launch.LaunchCreateExtension.CreateType.APPLICATION; @@ -22,8 +22,10 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableTable; import com.google.common.collect.Table; +import google.registry.flows.EppException; import google.registry.flows.EppException.SyntaxErrorException; import google.registry.flows.EppException.UnimplementedCommandException; +import google.registry.flows.Flow; import google.registry.flows.contact.ContactCheckFlow; import google.registry.flows.contact.ContactCreateFlow; import google.registry.flows.contact.ContactDeleteFlow; @@ -87,8 +89,8 @@ import google.registry.model.host.HostCommand; import java.util.Map; import java.util.Set; -/** Registry that can select a flow to handle a given Epp command. */ -public class FlowRegistry { +/** Class that picks a flow to handle a given EPP command. */ +public class FlowPicker { /** Marker class for unimplemented flows. */ private abstract static class UnimplementedFlow extends Flow {} diff --git a/java/google/registry/tools/ValidateLoginCredentialsCommand.java b/java/google/registry/tools/ValidateLoginCredentialsCommand.java index d248f0521..46c2a247d 100644 --- a/java/google/registry/tools/ValidateLoginCredentialsCommand.java +++ b/java/google/registry/tools/ValidateLoginCredentialsCommand.java @@ -32,12 +32,12 @@ import com.beust.jcommander.Parameter; import com.beust.jcommander.Parameters; import google.registry.flows.Flow; -import google.registry.flows.FlowRegistry; import google.registry.flows.FlowRunner; import google.registry.flows.FlowRunner.CommitMode; import google.registry.flows.FlowRunner.UserPrivileges; import google.registry.flows.SessionMetadata; import google.registry.flows.TlsCredentials; +import google.registry.flows.picker.FlowPicker; import google.registry.model.eppcommon.Trid; import google.registry.model.eppinput.EppInput; import google.registry.tools.Command.GtechCommand; @@ -103,7 +103,7 @@ final class ValidateLoginCredentialsCommand implements RemoteApiCommand, GtechCo .render() .getBytes(UTF_8); EppInput eppInput = unmarshal(inputXmlBytes); - Class flowClass = FlowRegistry.getFlowClass(eppInput); + Class flowClass = FlowPicker.getFlowClass(eppInput); System.out.println(runFlow( new FlowRunner( flowClass, diff --git a/java/google/registry/tools/server/VerifyOteAction.java b/java/google/registry/tools/server/VerifyOteAction.java index a34f2cdb3..665416128 100644 --- a/java/google/registry/tools/server/VerifyOteAction.java +++ b/java/google/registry/tools/server/VerifyOteAction.java @@ -17,7 +17,7 @@ package google.registry.tools.server; import static com.google.common.base.Predicates.not; import static com.google.common.collect.Maps.toMap; import static google.registry.flows.EppXmlTransformer.unmarshal; -import static google.registry.flows.FlowRegistry.getFlowClass; +import static google.registry.flows.picker.FlowPicker.getFlowClass; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.util.CollectionUtils.isNullOrEmpty; import static google.registry.util.DomainNameUtils.ACE_PREFIX; diff --git a/javatests/google/registry/flows/FlowTestCase.java b/javatests/google/registry/flows/FlowTestCase.java index d7d0df23d..1bae53ff2 100644 --- a/javatests/google/registry/flows/FlowTestCase.java +++ b/javatests/google/registry/flows/FlowTestCase.java @@ -37,6 +37,7 @@ import com.google.common.collect.Maps; import google.registry.flows.FlowRunner.CommitMode; import google.registry.flows.FlowRunner.UserPrivileges; import google.registry.flows.SessionMetadata.SessionSource; +import google.registry.flows.picker.FlowPicker; import google.registry.model.billing.BillingEvent; import google.registry.model.domain.GracePeriod; import google.registry.model.domain.rgp.GracePeriodStatus; @@ -129,7 +130,7 @@ public abstract class FlowTestCase { /** Load a flow from an epp object. */ private FlowRunner createFlowRunner() throws Exception { EppInput eppInput = eppLoader.getEpp(); - flowClass = firstNonNull(flowClass, FlowRegistry.getFlowClass(eppInput)); + flowClass = firstNonNull(flowClass, FlowPicker.getFlowClass(eppInput)); Class expectedFlowClass = new TypeInstantiator(getClass()){}.getExactType(); assertThat(flowClass).isEqualTo(expectedFlowClass); return new FlowRunner( diff --git a/javatests/google/registry/flows/domain/DomainAllocateFlowTest.java b/javatests/google/registry/flows/domain/DomainAllocateFlowTest.java index e5eb39ae2..8a1f65b54 100644 --- a/javatests/google/registry/flows/domain/DomainAllocateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainAllocateFlowTest.java @@ -103,7 +103,7 @@ public class DomainAllocateFlowTest public void initAllocateTest() throws Exception { setEppInput("domain_allocate.xml", ImmutableMap.of("APPLICATIONID", "2-TLD")); clock.setTo(APPLICATION_TIME); - // We must manually set the flow class since this flow is not registered in the flow registry. + // We must manually set the flow class since this flow is not registered in the flow picker. flowClass = DomainAllocateFlow.class; } diff --git a/javatests/google/registry/model/EppResourceUtilsTest.java b/javatests/google/registry/model/EppResourceUtilsTest.java index cb4ea834a..67e3b6ac7 100644 --- a/javatests/google/registry/model/EppResourceUtilsTest.java +++ b/javatests/google/registry/model/EppResourceUtilsTest.java @@ -15,7 +15,7 @@ package google.registry.model; import static com.google.common.truth.Truth.assertThat; -import static google.registry.flows.FlowRegistry.getFlowClass; +import static google.registry.flows.picker.FlowPicker.getFlowClass; import static google.registry.model.EppResourceUtils.loadAtPointInTime; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.testing.DatastoreHelper.createTld; diff --git a/javatests/google/registry/tools/AllocateDomainCommandTest.java b/javatests/google/registry/tools/AllocateDomainCommandTest.java index 5ce17c7d0..d17f51662 100644 --- a/javatests/google/registry/tools/AllocateDomainCommandTest.java +++ b/javatests/google/registry/tools/AllocateDomainCommandTest.java @@ -19,7 +19,7 @@ import static com.google.common.io.Resources.getResource; import static com.google.common.io.Resources.toByteArray; import static com.google.common.truth.Truth.assertThat; import static google.registry.flows.EppServletUtils.APPLICATION_EPP_XML_UTF8; -import static google.registry.flows.FlowRegistry.getFlowClass; +import static google.registry.flows.picker.FlowPicker.getFlowClass; import static google.registry.model.domain.DesignatedContact.Type.ADMIN; import static google.registry.model.domain.DesignatedContact.Type.BILLING; import static google.registry.model.domain.DesignatedContact.Type.TECH;