mirror of
https://github.com/google/nomulus.git
synced 2025-07-01 16:53:35 +02:00
Flatten the hosts flows
There's so little meat here that there's not much reason to break this cl up any further ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133171754
This commit is contained in:
parent
00ea99960a
commit
516b5663a5
12 changed files with 336 additions and 210 deletions
|
@ -64,6 +64,13 @@ public class ContactDeleteFlow extends LoggedInFlow implements TransactionalFlow
|
|||
StatusValue.PENDING_DELETE,
|
||||
StatusValue.SERVER_DELETE_PROHIBITED);
|
||||
|
||||
private static final Function<DomainBase, ImmutableSet<?>> GET_REFERENCED_CONTACTS =
|
||||
new Function<DomainBase, ImmutableSet<?>>() {
|
||||
@Override
|
||||
public ImmutableSet<?> apply(DomainBase domain) {
|
||||
return domain.getReferencedContacts();
|
||||
}};
|
||||
|
||||
@Inject AsyncFlowEnqueuer asyncFlowEnqueuer;
|
||||
@Inject @ClientId String clientId;
|
||||
@Inject @TargetId String targetId;
|
||||
|
@ -79,15 +86,7 @@ public class ContactDeleteFlow extends LoggedInFlow implements TransactionalFlow
|
|||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
failfastForAsyncDelete(
|
||||
targetId,
|
||||
now,
|
||||
ContactResource.class,
|
||||
new Function<DomainBase, ImmutableSet<?>>() {
|
||||
@Override
|
||||
public ImmutableSet<?> apply(DomainBase domain) {
|
||||
return domain.getReferencedContacts();
|
||||
}});
|
||||
failfastForAsyncDelete(targetId, now, ContactResource.class, GET_REFERENCED_CONTACTS);
|
||||
ContactResource existingResource = loadByUniqueId(ContactResource.class, targetId, now);
|
||||
if (existingResource == null) {
|
||||
throw new ResourceToMutateDoesNotExistException(ContactResource.class, targetId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue