Remove nearly all uses of ReferenceUnion

ReferenceUnion is a hack to work around the mismatch between how
we store references (by roid) and how they are represented in EPP
(by foreign key). If it ever needed to exist (not entirely clear...)
it should have remained tightly scoped within the domain commands
and resources. Instead it has leaked everywhere in the project,
causing lots of boilerplate. This CL hides all of that behind
standard Refs, and should be followed by work to remove ReferenceUnion
completely.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122424416
This commit is contained in:
cgoldfeder 2016-05-16 08:55:54 -07:00 committed by Justine Tunney
parent 56c8bb0f2a
commit 9a2afc7a9b
59 changed files with 448 additions and 454 deletions

View file

@ -17,12 +17,12 @@ package google.registry.flows;
import static google.registry.model.eppoutput.Result.Code.SuccessWithActionPending;
import static google.registry.model.ofy.ObjectifyService.ofy;
import com.googlecode.objectify.Ref;
import com.googlecode.objectify.Work;
import google.registry.flows.EppException.AssociationProhibitsOperationException;
import google.registry.model.EppResource;
import google.registry.model.EppResource.Builder;
import google.registry.model.domain.ReferenceUnion;
import google.registry.model.eppcommon.StatusValue;
import google.registry.model.eppinput.ResourceCommand.SingleResourceCommand;
import google.registry.model.eppoutput.Result.Code;
@ -51,7 +51,7 @@ public abstract class ResourceAsyncDeleteFlow
// that would be hard to reason about, and there's no real gain in doing so.
return false;
}
return isLinkedForFailfast(ReferenceUnion.create(fki.getReference()));
return isLinkedForFailfast(fki.getReference());
}
});
if (isLinked) {
@ -60,7 +60,7 @@ public abstract class ResourceAsyncDeleteFlow
}
/** Subclasses must override this to check if the supplied reference has incoming links. */
protected abstract boolean isLinkedForFailfast(ReferenceUnion<R> ref);
protected abstract boolean isLinkedForFailfast(Ref<R> ref);
@Override
protected final R createOrMutateResource() {