mirror of
https://github.com/google/nomulus.git
synced 2025-05-16 01:17:14 +02:00
Remove LoggedInFlow
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137444791
This commit is contained in:
parent
8b068250d6
commit
b84d7f1fb5
50 changed files with 763 additions and 429 deletions
|
@ -15,6 +15,7 @@
|
|||
package google.registry.flows.poll;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static google.registry.flows.FlowUtils.validateClientIsLoggedIn;
|
||||
import static google.registry.flows.poll.PollFlowUtils.getPollMessagesQuery;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS_WITH_NO_MESSAGES;
|
||||
|
@ -28,9 +29,10 @@ import google.registry.flows.EppException.AuthorizationErrorException;
|
|||
import google.registry.flows.EppException.ObjectDoesNotExistException;
|
||||
import google.registry.flows.EppException.ParameterValueSyntaxErrorException;
|
||||
import google.registry.flows.EppException.RequiredParameterMissingException;
|
||||
import google.registry.flows.ExtensionManager;
|
||||
import google.registry.flows.Flow;
|
||||
import google.registry.flows.FlowModule.ClientId;
|
||||
import google.registry.flows.FlowModule.PollMessageId;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.model.poll.MessageQueueInfo;
|
||||
|
@ -53,14 +55,17 @@ import org.joda.time.DateTime;
|
|||
* @error {@link PollAckFlow.MissingMessageIdException}
|
||||
* @error {@link PollAckFlow.NotAuthorizedToAckMessageException}
|
||||
*/
|
||||
public class PollAckFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
public class PollAckFlow extends Flow implements TransactionalFlow {
|
||||
|
||||
@Inject ExtensionManager extensionManager;
|
||||
@Inject @ClientId String clientId;
|
||||
@Inject @PollMessageId String messageId;
|
||||
@Inject PollAckFlow() {}
|
||||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
extensionManager.validate(); // There are no legal extensions for this flow.
|
||||
validateClientIsLoggedIn(clientId);
|
||||
if (messageId.isEmpty()) {
|
||||
throw new MissingMessageIdException();
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
package google.registry.flows.poll;
|
||||
|
||||
import static google.registry.flows.FlowUtils.validateClientIsLoggedIn;
|
||||
import static google.registry.flows.poll.PollFlowUtils.getPollMessagesQuery;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS_WITH_ACK_MESSAGE;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS_WITH_NO_MESSAGES;
|
||||
|
@ -22,9 +23,10 @@ import static google.registry.util.CollectionUtils.forceEmptyToNull;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.EppException.ParameterValueSyntaxErrorException;
|
||||
import google.registry.flows.ExtensionManager;
|
||||
import google.registry.flows.Flow;
|
||||
import google.registry.flows.FlowModule.ClientId;
|
||||
import google.registry.flows.FlowModule.PollMessageId;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.model.poll.MessageQueueInfo;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
|
@ -42,14 +44,17 @@ import javax.inject.Inject;
|
|||
*
|
||||
* @error {@link PollRequestFlow.UnexpectedMessageIdException}
|
||||
*/
|
||||
public class PollRequestFlow extends LoggedInFlow {
|
||||
public class PollRequestFlow extends Flow {
|
||||
|
||||
@Inject ExtensionManager extensionManager;
|
||||
@Inject @ClientId String clientId;
|
||||
@Inject @PollMessageId String messageId;
|
||||
@Inject PollRequestFlow() {}
|
||||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
extensionManager.validate(); // There are no legal extensions for this flow.
|
||||
validateClientIsLoggedIn(clientId);
|
||||
if (!messageId.isEmpty()) {
|
||||
throw new UnexpectedMessageIdException();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue