Inject targetId into contact flows

Other flows to come. This removes the need for
most of the flows to inject the command at all.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133163030
This commit is contained in:
cgoldfeder 2016-09-14 13:06:59 -07:00 committed by Ben McIlwain
parent 8c39e10dec
commit 65ef712f35
10 changed files with 38 additions and 39 deletions

View file

@ -186,6 +186,13 @@ public class FlowModule {
return Optional.fromNullable(((SingleResourceCommand) resourceCommand).getAuthInfo());
}
@Provides
@FlowScope
@TargetId
static String provideTargetId(ResourceCommand resourceCommand) {
return ((SingleResourceCommand) resourceCommand).getTargetId();
}
/**
* Provides a partially filled in {@link HistoryEntry} builder.
*
@ -234,6 +241,11 @@ public class FlowModule {
@Documented
public @interface ClientId {}
/** Dagger qualifier for the target id (foreign key) for single resource flows. */
@Qualifier
@Documented
public @interface TargetId {}
/** Dagger qualifier for whether a flow is in dry run mode. */
@Qualifier
@Documented