mirror of
https://github.com/google/nomulus
synced 2026-01-09 15:43:52 +00:00
Streamline transfer resolving helpers in ResourceFlowUtils
In the great flow flattening, ResourceFlowUtils grew a couple nice helpers for rebuilding transferrable resources (Domains and Contacts) upon the resolution of a transfer - approvePendingTransfer() and denyPendingTransfer(). Most transfer-resolving callsites use one of these two helpers, but for legacy reasons the deletion flows (DomainDeleteFlow and DeleteContactsAndHostsAction) were instead using the "manual" resolvePendingTransfer() method or its even more low-level createResolvedTransferData() helper instead of denyPendingTransfer(). It's simpler to just have two options - approve and deny - so this CL inlines createResolvedTransferData() into resolvePendingTransfer() and makes the latter a private helper for the approve/denyPendingTransfer() public helpers. This CL also adds sanity checks that approve/denyPendingTransfer() are called only with the logically appropriate values of TransferStatus. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=170819358
This commit is contained in:
@@ -54,4 +54,10 @@ public enum TransferStatus {
|
||||
public boolean isApproved() {
|
||||
return this.equals(CLIENT_APPROVED) || this.equals(SERVER_APPROVED);
|
||||
}
|
||||
|
||||
public boolean isDenied() {
|
||||
return this.equals(CLIENT_CANCELLED)
|
||||
|| this.equals(CLIENT_REJECTED)
|
||||
|| this.equals(SERVER_CANCELLED);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user