mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Remove unused and misused methods from EppResourceUtils and DomainBase.
The methods in DomainBase were the only callers for the methods in EppResourceUtils, so I first inlined them. Then I realized that there were no callers for loadReferencedContacts() anywhere. For loadNameservers(), all but one invocation actually wanted to load the foreign keys, and was repeating that work, so I replaced it with loadNameserverFullyQualifiedHostNames(). The last invocation, in the Rdap code, was incorrectly assuming this was an async load when in fact it blocks, so I replaced it with a real async load. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=122433897
This commit is contained in:
parent
9a2afc7a9b
commit
d9875ea302
8 changed files with 31 additions and 60 deletions
|
@ -24,7 +24,6 @@ import static google.registry.util.DateTimeUtils.isBeforeOrAt;
|
|||
import static google.registry.util.DateTimeUtils.latestOf;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.Ref;
|
||||
|
@ -138,29 +137,6 @@ public final class EppResourceUtils {
|
|||
latestOf(now, resource.getUpdateAutoTimestamp().getTimestamp()));
|
||||
}
|
||||
|
||||
/** Loads and returns the hosts specified by the given reference. */
|
||||
public static ImmutableSet<HostResource> loadReferencedNameservers(
|
||||
Set<Ref<HostResource>> hostRefs) {
|
||||
ImmutableSet.Builder<HostResource> builder = new ImmutableSet.Builder<>();
|
||||
for (Ref<HostResource> hostRef : hostRefs) {
|
||||
HostResource host = hostRef.get();
|
||||
if (host != null) {
|
||||
builder.add(host);
|
||||
}
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/** Loads and returns the contacts specified by the given references. */
|
||||
public static ImmutableSet<ContactResource> loadReferencedContacts(
|
||||
Set<Ref<ContactResource>> contactRefs) {
|
||||
ImmutableSet.Builder<ContactResource> builder = new ImmutableSet.Builder<>();
|
||||
for (Ref<ContactResource> contactRef : contactRefs) {
|
||||
builder.add(contactRef.get());
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks multiple {@link EppResource} objects from the datastore by unique ids.
|
||||
* <p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue