mirror of
https://github.com/google/nomulus
synced 2026-01-09 23:47:49 +00:00
Flatten the domain info flows
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133955573
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package google.registry.flows;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static com.google.common.base.Strings.nullToEmpty;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Strings;
|
||||
@@ -22,6 +23,7 @@ import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import google.registry.flows.exceptions.OnlyToolCanPassMetadataException;
|
||||
import google.registry.flows.picker.FlowPicker;
|
||||
import google.registry.model.domain.launch.ApplicationIdTargetExtension;
|
||||
import google.registry.model.domain.metadata.MetadataExtension;
|
||||
import google.registry.model.eppcommon.AuthInfo;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
@@ -194,6 +196,15 @@ public class FlowModule {
|
||||
return ((SingleResourceCommand) resourceCommand).getTargetId();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FlowScope
|
||||
@ApplicationId
|
||||
static String provideApplicationId(EppInput eppInput) {
|
||||
// Treat a missing application id as empty so we can always inject a non-null value.
|
||||
return nullToEmpty(
|
||||
eppInput.getSingleExtension(ApplicationIdTargetExtension.class).getApplicationId());
|
||||
}
|
||||
|
||||
@Provides
|
||||
@FlowScope
|
||||
@PollMessageId
|
||||
@@ -254,6 +265,11 @@ public class FlowModule {
|
||||
@Documented
|
||||
public @interface TargetId {}
|
||||
|
||||
/** Dagger qualifier for the application id for domain application flows. */
|
||||
@Qualifier
|
||||
@Documented
|
||||
public @interface ApplicationId {}
|
||||
|
||||
/** Dagger qualifier for the message id for poll flows. */
|
||||
@Qualifier
|
||||
@Documented
|
||||
|
||||
Reference in New Issue
Block a user