mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 13:51:15 +02:00
[]
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133597433
This commit is contained in:
parent
c30c5bc399
commit
0518f63aad
5 changed files with 76 additions and 40 deletions
|
@ -14,6 +14,7 @@
|
|||
|
||||
package google.registry.flows.contact;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.denyPendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
import static google.registry.flows.contact.ContactFlowUtils.createGainingTransferPollMessage;
|
||||
|
@ -37,6 +38,7 @@ import google.registry.model.eppcommon.AuthInfo;
|
|||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.model.transfer.TransferStatus;
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -68,13 +70,13 @@ public class ContactTransferRejectFlow extends LoggedInFlow implements Transacti
|
|||
throw new ResourceToMutateDoesNotExistException(ContactResource.class, targetId);
|
||||
}
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingResource);
|
||||
if (existingResource.getTransferData().getTransferStatus() != TransferStatus.PENDING) {
|
||||
TransferData transferData = existingResource.getTransferData();
|
||||
if (transferData.getTransferStatus() != TransferStatus.PENDING) {
|
||||
throw new NotPendingTransferException(targetId);
|
||||
}
|
||||
verifyResourceOwnership(clientId, existingResource);
|
||||
ContactResource newResource = existingResource.asBuilder()
|
||||
.clearPendingTransfer(TransferStatus.CLIENT_REJECTED, now)
|
||||
.build();
|
||||
ContactResource newResource =
|
||||
denyPendingTransfer(existingResource, TransferStatus.CLIENT_REJECTED, now);
|
||||
HistoryEntry historyEntry = historyBuilder
|
||||
.setType(HistoryEntry.Type.CONTACT_TRANSFER_REJECT)
|
||||
.setModificationTime(now)
|
||||
|
@ -85,7 +87,7 @@ public class ContactTransferRejectFlow extends LoggedInFlow implements Transacti
|
|||
ofy().save().<Object>entities(newResource, historyEntry, gainingPollMessage);
|
||||
// Delete the billing event and poll messages that were written in case the transfer would have
|
||||
// been implicitly server approved.
|
||||
ofy().delete().keys(existingResource.getTransferData().getServerApproveEntities());
|
||||
ofy().delete().keys(transferData.getServerApproveEntities());
|
||||
return createOutput(SUCCESS, createTransferResponse(targetId, newResource.getTransferData()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue