mirror of
https://github.com/google/nomulus.git
synced 2025-05-21 03:39:36 +02:00
Dagger, meet Flows. Flows, meet Dagger.
Daggerizes all of the EPP flows. This does not change anything yet about the flows themselves, just how they are invoked, but after this CL it's safe to @Inject things into flow classes. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=125382478
This commit is contained in:
parent
116bf1f4d6
commit
c9a16f7f11
69 changed files with 973 additions and 292 deletions
|
@ -35,6 +35,8 @@ import google.registry.model.tmch.ClaimsListShard;
|
|||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that checks whether strings are trademarked.
|
||||
*
|
||||
|
@ -48,6 +50,8 @@ public class ClaimsCheckFlow extends BaseDomainCheckFlow {
|
|||
public static final ImmutableSet<TldState> DISALLOWED_TLD_STATES = Sets.immutableEnumSet(
|
||||
TldState.PREDELEGATION, TldState.SUNRISE);
|
||||
|
||||
@Inject ClaimsCheckFlow() {}
|
||||
|
||||
@Override
|
||||
protected void initDomainCheckFlow() throws EppException {
|
||||
registerExtensions(LaunchCheckExtension.class);
|
||||
|
|
|
@ -48,6 +48,8 @@ import google.registry.model.registry.label.ReservationType;
|
|||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.tmch.LordnTask;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that allocates a new domain resource from a domain application.
|
||||
*
|
||||
|
@ -62,6 +64,8 @@ public class DomainAllocateFlow extends DomainCreateOrAllocateFlow {
|
|||
protected AllocateCreateExtension allocateCreate;
|
||||
protected DomainApplication application;
|
||||
|
||||
@Inject DomainAllocateFlow() {}
|
||||
|
||||
@Override
|
||||
protected final void initDomainCreateOrAllocateFlow() {
|
||||
registerExtensions(AllocateCreateExtension.class);
|
||||
|
|
|
@ -51,6 +51,8 @@ import google.registry.model.smd.EncodedSignedMark;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that creates a new application for a domain resource.
|
||||
*
|
||||
|
@ -114,6 +116,8 @@ import java.util.List;
|
|||
*/
|
||||
public class DomainApplicationCreateFlow extends BaseDomainCreateFlow<DomainApplication, Builder> {
|
||||
|
||||
@Inject DomainApplicationCreateFlow() {}
|
||||
|
||||
@Override
|
||||
protected void initDomainCreateFlow() {
|
||||
registerExtensions(FeeCreateExtension.class, LaunchCreateExtension.class);
|
||||
|
|
|
@ -36,6 +36,8 @@ import google.registry.model.reporting.HistoryEntry;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that deletes a domain application.
|
||||
*
|
||||
|
@ -51,6 +53,8 @@ import java.util.Set;
|
|||
public class DomainApplicationDeleteFlow
|
||||
extends ResourceSyncDeleteFlow<DomainApplication, Builder, Delete> {
|
||||
|
||||
@Inject DomainApplicationDeleteFlow() {}
|
||||
|
||||
@Override
|
||||
protected void initResourceCreateOrMutateFlow() throws EppException {
|
||||
registerExtensions(LaunchDeleteExtension.class);
|
||||
|
|
|
@ -32,6 +32,8 @@ import google.registry.model.mark.Mark;
|
|||
import google.registry.model.smd.EncodedSignedMark;
|
||||
import google.registry.model.smd.SignedMark;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that reads a domain application.
|
||||
*
|
||||
|
@ -45,6 +47,8 @@ public class DomainApplicationInfoFlow extends BaseDomainInfoFlow<DomainApplicat
|
|||
|
||||
private boolean includeMarks;
|
||||
|
||||
@Inject DomainApplicationInfoFlow() {}
|
||||
|
||||
@Override
|
||||
protected final void initSingleResourceFlow() throws EppException {
|
||||
registerExtensions(LaunchInfoExtension.class);
|
||||
|
|
|
@ -30,6 +30,8 @@ import google.registry.model.domain.secdns.SecDnsUpdateExtension;
|
|||
import google.registry.model.registry.Registry.TldState;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that updates a domain resource.
|
||||
*
|
||||
|
@ -59,6 +61,8 @@ import google.registry.model.reporting.HistoryEntry;
|
|||
public class DomainApplicationUpdateFlow
|
||||
extends BaseDomainUpdateFlow<DomainApplication, Builder> {
|
||||
|
||||
@Inject DomainApplicationUpdateFlow() {}
|
||||
|
||||
@Override
|
||||
protected void initDomainUpdateFlow() throws EppException {
|
||||
registerExtensions(LaunchUpdateExtension.class, SecDnsUpdateExtension.class);
|
||||
|
|
|
@ -48,6 +48,8 @@ import google.registry.model.registry.label.ReservationType;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that checks whether a domain can be provisioned.
|
||||
*
|
||||
|
@ -81,6 +83,8 @@ public class DomainCheckFlow extends BaseDomainCheckFlow {
|
|||
|
||||
protected RegTypeCheckExtension regTypeExtension;
|
||||
|
||||
@Inject DomainCheckFlow() {}
|
||||
|
||||
@Override
|
||||
protected void initDomainCheckFlow() throws EppException {
|
||||
registerExtensions(
|
||||
|
|
|
@ -41,6 +41,8 @@ import google.registry.tmch.LordnTask;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that creates a new domain resource.
|
||||
*
|
||||
|
@ -101,6 +103,8 @@ public class DomainCreateFlow extends DomainCreateOrAllocateFlow {
|
|||
|
||||
protected RegTypeCreateExtension regTypeExtension;
|
||||
|
||||
@Inject DomainCreateFlow() {}
|
||||
|
||||
private boolean isAnchorTenant() {
|
||||
return isAnchorTenantViaReservation || isAnchorTenantViaExtension;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,8 @@ import org.joda.money.CurrencyUnit;
|
|||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that deletes a domain resource.
|
||||
*
|
||||
|
@ -73,6 +75,8 @@ public class DomainDeleteFlow extends ResourceSyncDeleteFlow<DomainResource, Bui
|
|||
|
||||
ImmutableList<Credit> credits;
|
||||
|
||||
@Inject DomainDeleteFlow() {}
|
||||
|
||||
@Override
|
||||
protected void initResourceCreateOrMutateFlow() throws EppException {
|
||||
registerExtensions(SecDnsUpdateExtension.class);
|
||||
|
|
|
@ -31,6 +31,8 @@ import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that reads a domain.
|
||||
*
|
||||
|
@ -45,6 +47,8 @@ public class DomainInfoFlow extends BaseDomainInfoFlow<DomainResource, Builder>
|
|||
|
||||
protected List<String> registrationTypes;
|
||||
|
||||
@Inject DomainInfoFlow() {}
|
||||
|
||||
@Override
|
||||
protected void initSingleResourceFlow() throws EppException {
|
||||
registerExtensions(FeeInfoExtension.class);
|
||||
|
|
|
@ -59,6 +59,8 @@ import org.joda.time.DateTime;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that updates a domain resource.
|
||||
*
|
||||
|
@ -86,6 +88,8 @@ public class DomainRenewFlow extends OwnedResourceMutateFlow<DomainResource, Ren
|
|||
protected FeeRenewExtension feeRenew;
|
||||
protected Money renewCost;
|
||||
|
||||
@Inject DomainRenewFlow() {}
|
||||
|
||||
@Override
|
||||
protected Set<StatusValue> getDisallowedStatuses() {
|
||||
return RENEW_DISALLOWED_STATUSES;
|
||||
|
|
|
@ -54,6 +54,8 @@ import google.registry.model.reporting.HistoryEntry;
|
|||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that requests that a deleted domain be restored.
|
||||
*
|
||||
|
@ -77,6 +79,8 @@ public class DomainRestoreRequestFlow extends OwnedResourceMutateFlow<DomainReso
|
|||
protected Money restoreCost;
|
||||
protected Money renewCost;
|
||||
|
||||
@Inject DomainRestoreRequestFlow() {}
|
||||
|
||||
@Override
|
||||
protected final void initResourceCreateOrMutateFlow() throws EppException {
|
||||
registerExtensions(FeeUpdateExtension.class, RgpUpdateExtension.class);
|
||||
|
|
|
@ -45,6 +45,8 @@ import google.registry.model.transfer.TransferData;
|
|||
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that approves a pending transfer on a {@link DomainResource}.
|
||||
*
|
||||
|
@ -60,6 +62,8 @@ import org.joda.time.DateTime;
|
|||
public class DomainTransferApproveFlow extends
|
||||
ResourceTransferApproveFlow<DomainResource, Builder, Transfer> {
|
||||
|
||||
@Inject DomainTransferApproveFlow() {}
|
||||
|
||||
@Override
|
||||
protected void verifyOwnedResourcePendingTransferMutationAllowed() throws EppException {
|
||||
checkAllowedAccessToTld(getAllowedTlds(), existingResource.getTld());
|
||||
|
|
|
@ -25,6 +25,8 @@ import google.registry.model.domain.DomainResource;
|
|||
import google.registry.model.domain.DomainResource.Builder;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that cancels a pending transfer on a {@link DomainResource}.
|
||||
*
|
||||
|
@ -37,6 +39,8 @@ import google.registry.model.reporting.HistoryEntry;
|
|||
public class DomainTransferCancelFlow
|
||||
extends ResourceTransferCancelFlow<DomainResource, Builder, Transfer> {
|
||||
|
||||
@Inject DomainTransferCancelFlow() {}
|
||||
|
||||
/**
|
||||
* Reopen the autorenew event and poll message that we closed for the implicit transfer.
|
||||
* This may end up recreating the autorenew poll message if it was deleted when the transfer
|
||||
|
|
|
@ -18,6 +18,8 @@ import google.registry.flows.ResourceTransferQueryFlow;
|
|||
import google.registry.model.domain.DomainCommand.Transfer;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that queries a pending transfer on a {@link DomainResource}.
|
||||
*
|
||||
|
@ -26,4 +28,6 @@ import google.registry.model.domain.DomainResource;
|
|||
* @error {@link google.registry.flows.ResourceTransferQueryFlow.NoTransferHistoryToQueryException}
|
||||
* @error {@link google.registry.flows.ResourceTransferQueryFlow.NotAuthorizedToViewTransferException}
|
||||
*/
|
||||
public class DomainTransferQueryFlow extends ResourceTransferQueryFlow<DomainResource, Transfer> {}
|
||||
public class DomainTransferQueryFlow extends ResourceTransferQueryFlow<DomainResource, Transfer> {
|
||||
@Inject DomainTransferQueryFlow() {}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ import google.registry.model.domain.DomainResource;
|
|||
import google.registry.model.domain.DomainResource.Builder;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that rejects a pending transfer on a {@link DomainResource}.
|
||||
*
|
||||
|
@ -37,6 +39,8 @@ import google.registry.model.reporting.HistoryEntry;
|
|||
public class DomainTransferRejectFlow
|
||||
extends ResourceTransferRejectFlow<DomainResource, Builder, Transfer> {
|
||||
|
||||
@Inject DomainTransferRejectFlow() {}
|
||||
|
||||
@Override
|
||||
protected void verifyOwnedResourcePendingTransferMutationAllowed() throws EppException {
|
||||
checkAllowedAccessToTld(getAllowedTlds(), existingResource.getTld());
|
||||
|
|
|
@ -56,6 +56,8 @@ import org.joda.time.Duration;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that requests a transfer on a {@link DomainResource}.
|
||||
*
|
||||
|
@ -97,6 +99,8 @@ public class DomainTransferRequestFlow
|
|||
*/
|
||||
private FeeTransferExtension feeTransfer;
|
||||
|
||||
@Inject DomainTransferRequestFlow() {}
|
||||
|
||||
@Override
|
||||
protected Duration getAutomaticTransferLength() {
|
||||
return Registry.get(existingResource.getTld()).getAutomaticTransferLength();
|
||||
|
|
|
@ -39,6 +39,8 @@ import org.joda.time.DateTime;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow that updates a domain resource.
|
||||
*
|
||||
|
@ -70,6 +72,8 @@ public class DomainUpdateFlow extends BaseDomainUpdateFlow<DomainResource, Build
|
|||
|
||||
protected RegTypeUpdateExtension regTypeExtension;
|
||||
|
||||
@Inject DomainUpdateFlow() {}
|
||||
|
||||
@Override
|
||||
protected void initDomainUpdateFlow() {
|
||||
registerExtensions(SecDnsUpdateExtension.class, RegTypeUpdateExtension.class);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue