mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Rename Response in the epp model to EppResponse
So that it doesn't conflict with request.Response. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=124595393
This commit is contained in:
parent
0ce293325c
commit
7cf4ddce97
41 changed files with 92 additions and 83 deletions
|
@ -30,7 +30,7 @@ import com.googlecode.objectify.annotation.Id;
|
|||
import com.googlecode.objectify.annotation.Index;
|
||||
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppoutput.Response.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
import google.registry.model.ofy.CommitLogManifest;
|
||||
import google.registry.model.transfer.TransferData;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.model.domain;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.google.common.annotations.VisibleForTesting;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.model.domain.fee;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.google.common.collect.ImmutableList;
|
|||
|
||||
import google.registry.model.Buildable.GenericBuilder;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import org.joda.money.CurrencyUnit;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.model.domain.fee;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.model.domain.fee;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.model.domain.fee;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.model.domain.fee;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.google.common.annotations.VisibleForTesting;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.model.domain.launch;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
|
|
@ -18,7 +18,7 @@ import com.google.common.collect.ImmutableList;
|
|||
|
||||
import com.googlecode.objectify.annotation.Embed;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
import google.registry.model.mark.Mark;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -16,7 +16,7 @@ package google.registry.model.domain.regtype;
|
|||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.model.domain.rgp;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.googlecode.objectify.annotation.Embed;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.model.eppoutput;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.eppoutput.Response.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.model.eppoutput;
|
||||
|
||||
import google.registry.model.eppoutput.Response.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||
@XmlRootElement(name = "epp")
|
||||
public class EppOutput extends ImmutableObject {
|
||||
@XmlElements({
|
||||
@XmlElement(name = "response", type = Response.class),
|
||||
@XmlElement(name = "response", type = EppResponse.class),
|
||||
@XmlElement(name = "greeting", type = Greeting.class) })
|
||||
ResponseOrGreeting responseOrGreeting;
|
||||
|
||||
|
@ -38,15 +38,15 @@ public class EppOutput extends ImmutableObject {
|
|||
|
||||
@VisibleForTesting
|
||||
public boolean isSuccess() {
|
||||
return ((Response) responseOrGreeting).result.getCode().isSuccess();
|
||||
return ((EppResponse) responseOrGreeting).result.getCode().isSuccess();
|
||||
}
|
||||
|
||||
public Response getResponse() {
|
||||
return (Response) responseOrGreeting;
|
||||
public EppResponse getResponse() {
|
||||
return (EppResponse) responseOrGreeting;
|
||||
}
|
||||
|
||||
public boolean isResponse() {
|
||||
return responseOrGreeting instanceof Response;
|
||||
return responseOrGreeting instanceof EppResponse;
|
||||
}
|
||||
|
||||
/** Marker interface for types allowed inside of an {@link EppOutput}. */
|
||||
|
|
|
@ -60,7 +60,7 @@ import javax.xml.bind.annotation.XmlTransient;
|
|||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* The Response class represents an EPP response message.
|
||||
* The EppResponse class represents an EPP response message.
|
||||
*
|
||||
* <p>From the RFC: "An EPP server responds to a client command by returning a response to the
|
||||
* client. EPP commands are atomic, so a command will either succeed completely or fail completely.
|
||||
|
@ -69,7 +69,7 @@ import javax.xml.bind.annotation.XmlType;
|
|||
* @see "http://tools.ietf.org/html/rfc5730#section-2.6"
|
||||
*/
|
||||
@XmlType(propOrder = {"result", "messageQueueInfo", "resData", "extensions", "trid"})
|
||||
public class Response extends ImmutableObject implements ResponseOrGreeting {
|
||||
public class EppResponse extends ImmutableObject implements ResponseOrGreeting {
|
||||
|
||||
/** The TRID associated with this response. */
|
||||
@XmlElement(name = "trID")
|
||||
|
@ -165,8 +165,8 @@ public class Response extends ImmutableObject implements ResponseOrGreeting {
|
|||
/** Marker interface for types that can go in the {@link #extensions} field. */
|
||||
public interface ResponseExtension {}
|
||||
|
||||
/** Builder for {@link Response} because it is immutable. */
|
||||
public static class Builder extends Buildable.Builder<Response> {
|
||||
/** Builder for {@link EppResponse} because it is immutable. */
|
||||
public static class Builder extends Buildable.Builder<EppResponse> {
|
||||
public Builder setTrid(Trid trid) {
|
||||
getInstance().trid = trid;
|
||||
return this;
|
|
@ -21,7 +21,7 @@ import com.googlecode.objectify.annotation.Embed;
|
|||
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.eppoutput.Response.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
@ -70,15 +70,14 @@ public abstract class PendingActionNotificationResponse
|
|||
return nameOrId.actionResult;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected <T extends PendingActionNotificationResponse> T init(
|
||||
String nameOrId, boolean actionResult, Trid trid, DateTime processedDate) {
|
||||
this.nameOrId = new NameOrId();
|
||||
this.nameOrId.value = nameOrId;
|
||||
this.nameOrId.actionResult = actionResult;
|
||||
this.trid = trid;
|
||||
this.processedDate = processedDate;
|
||||
return (T) this;
|
||||
protected static <T extends PendingActionNotificationResponse> T init(
|
||||
T response, String nameOrId, boolean actionResult, Trid trid, DateTime processedDate) {
|
||||
response.nameOrId = new NameOrId();
|
||||
response.nameOrId.value = nameOrId;
|
||||
response.nameOrId.actionResult = actionResult;
|
||||
response.trid = trid;
|
||||
response.processedDate = processedDate;
|
||||
return response;
|
||||
}
|
||||
|
||||
/** An adapter to output the XML in response to resolving a pending command on a domain. */
|
||||
|
@ -97,8 +96,12 @@ public abstract class PendingActionNotificationResponse
|
|||
|
||||
public static DomainPendingActionNotificationResponse create(
|
||||
String fullyQualifiedDomainName, boolean actionResult, Trid trid, DateTime processedDate) {
|
||||
return new DomainPendingActionNotificationResponse().init(
|
||||
fullyQualifiedDomainName, actionResult, trid, processedDate);
|
||||
return init(
|
||||
new DomainPendingActionNotificationResponse(),
|
||||
fullyQualifiedDomainName,
|
||||
actionResult,
|
||||
trid,
|
||||
processedDate);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,8 +121,12 @@ public abstract class PendingActionNotificationResponse
|
|||
|
||||
public static ContactPendingActionNotificationResponse create(
|
||||
String contactId, boolean actionResult, Trid trid, DateTime processedDate) {
|
||||
return new ContactPendingActionNotificationResponse().init(
|
||||
contactId, actionResult, trid, processedDate);
|
||||
return init(
|
||||
new ContactPendingActionNotificationResponse(),
|
||||
contactId,
|
||||
actionResult,
|
||||
trid,
|
||||
processedDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,8 +41,8 @@ import google.registry.model.contact.ContactResource;
|
|||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainRenewData;
|
||||
import google.registry.model.domain.launch.LaunchInfoResponseExtension;
|
||||
import google.registry.model.eppoutput.Response.ResponseData;
|
||||
import google.registry.model.eppoutput.Response.ResponseExtension;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
import google.registry.model.poll.PendingActionNotificationResponse.ContactPendingActionNotificationResponse;
|
||||
import google.registry.model.poll.PendingActionNotificationResponse.DomainPendingActionNotificationResponse;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.model.transfer;
|
|||
import com.googlecode.objectify.annotation.Embed;
|
||||
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.eppoutput.Response.ResponseData;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue