mirror of
https://github.com/google/nomulus
synced 2026-07-19 22:42:23 +00:00
Turn Flow into an interface and inject all its fields
This concludes your flow flattening experience. Please fill out a flow flattening satisfaction survey before exiting. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137903095
This commit is contained in:
@@ -21,7 +21,8 @@ import google.registry.flows.EppException;
|
||||
import google.registry.flows.ExtensionManager;
|
||||
import google.registry.flows.Flow;
|
||||
import google.registry.flows.FlowModule.ClientId;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.flows.SessionMetadata;
|
||||
import google.registry.model.eppoutput.EppResponse;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
@@ -29,17 +30,19 @@ import javax.inject.Inject;
|
||||
*
|
||||
* @error {@link google.registry.flows.FlowUtils.NotLoggedInException}
|
||||
*/
|
||||
public class LogoutFlow extends Flow {
|
||||
public class LogoutFlow implements Flow {
|
||||
|
||||
@Inject ExtensionManager extensionManager;
|
||||
@Inject @ClientId String clientId;
|
||||
@Inject SessionMetadata sessionMetadata;
|
||||
@Inject EppResponse.Builder responseBuilder;
|
||||
@Inject LogoutFlow() {}
|
||||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
public final EppResponse run() throws EppException {
|
||||
extensionManager.validate(); // There are no legal extensions for this flow.
|
||||
validateClientIsLoggedIn(clientId);
|
||||
sessionMetadata.invalidate();
|
||||
return createOutput(SUCCESS_AND_CLOSE);
|
||||
return responseBuilder.setResultFromCode(SUCCESS_AND_CLOSE).build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user