mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 06:44:51 +02:00
Load referenced contact/hosts from EPP more efficiently
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=122459862
This commit is contained in:
parent
86f3287761
commit
618050dc32
11 changed files with 113 additions and 64 deletions
|
@ -17,7 +17,9 @@ package google.registry.flows;
|
|||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import google.registry.model.annotations.ExternalMessagingName;
|
||||
import google.registry.model.eppinput.EppInput.InnerCommand;
|
||||
|
@ -117,11 +119,21 @@ public abstract class EppException extends Exception {
|
|||
super(
|
||||
String.format(
|
||||
"The %s with given ID (%s) doesn't exist.",
|
||||
!type.isAnnotationPresent(ExternalMessagingName.class)
|
||||
? "object"
|
||||
: type.getAnnotation(ExternalMessagingName.class).value(),
|
||||
type.isAnnotationPresent(ExternalMessagingName.class)
|
||||
? type.getAnnotation(ExternalMessagingName.class).value()
|
||||
: "object",
|
||||
id));
|
||||
}
|
||||
|
||||
public ObjectDoesNotExistException(Class<?> type, ImmutableSet<String> ids) {
|
||||
super(
|
||||
String.format(
|
||||
"The %s with given IDs (%s) don't exist.",
|
||||
type.isAnnotationPresent(ExternalMessagingName.class)
|
||||
? type.getAnnotation(ExternalMessagingName.class).value() + " objects"
|
||||
: "objects",
|
||||
Joiner.on(',').join(ids)));
|
||||
}
|
||||
}
|
||||
|
||||
/** Abstract exception class. Do not throw this directly or catch in tests. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue