mirror of
https://github.com/google/nomulus
synced 2026-08-18 13:16:20 +00: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:
@@ -18,8 +18,13 @@ import google.registry.flows.Flow;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.model.eppoutput.Greeting;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/** A flow for an Epp "hello". */
|
||||
public class HelloFlow extends Flow {
|
||||
|
||||
@Inject HelloFlow() {}
|
||||
|
||||
@Override
|
||||
public EppOutput run() {
|
||||
return EppOutput.create(Greeting.create(now));
|
||||
|
||||
@@ -41,6 +41,8 @@ import google.registry.util.FormattingLogger;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow for login.
|
||||
*
|
||||
@@ -68,6 +70,8 @@ public class LoginFlow extends Flow {
|
||||
/** Maximum number of failed login attempts allowed per connection. */
|
||||
private static final int MAX_FAILED_LOGIN_ATTEMPTS_PER_CONNECTION = 3;
|
||||
|
||||
@Inject LoginFlow() {}
|
||||
|
||||
/** Run the flow and log errors. */
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
|
||||
@@ -20,12 +20,17 @@ import google.registry.flows.EppException;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* An EPP flow for logout.
|
||||
*
|
||||
* @error {@link google.registry.flows.LoggedInFlow.NotLoggedInException}
|
||||
*/
|
||||
public class LogoutFlow extends LoggedInFlow {
|
||||
|
||||
@Inject LogoutFlow() {}
|
||||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
sessionMetadata.invalidate();
|
||||
|
||||
Reference in New Issue
Block a user