google-nomulus/java/google/registry/model/eppoutput/CreateData.java
Justine Tunney 5012893c1d mv com/google/domain/registry google/registry
This change renames directories in preparation for the great package
rename. The repository is now in a broken state because the code
itself hasn't been updated. However this should ensure that git
correctly preserves history for each file.
2016-05-13 18:55:08 -04:00

84 lines
3 KiB
Java

// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.domain.registry.model.eppoutput;
import com.google.domain.registry.model.eppoutput.Response.ResponseData;
import org.joda.time.DateTime;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
/** The {@link ResponseData} returned when creating a resource. */
@XmlTransient
public abstract class CreateData implements ResponseData {
@XmlElement(name = "crDate")
protected DateTime creationDate;
/** An acknowledgment message indicating that a contact was created. */
@XmlRootElement(name = "creData", namespace = "urn:ietf:params:xml:ns:contact-1.0")
@XmlType(propOrder = {"id", "creationDate"}, namespace = "urn:ietf:params:xml:ns:contact-1.0")
public static class ContactCreateData extends CreateData {
String id;
public static ContactCreateData create(String id, DateTime creationDate) {
ContactCreateData instance = new ContactCreateData();
instance.id = id;
instance.creationDate = creationDate;
return instance;
}
}
/** An acknowledgment message indicating that a domain was created. */
@XmlRootElement(name = "creData", namespace = "urn:ietf:params:xml:ns:domain-1.0")
@XmlType(
propOrder = {"name", "creationDate", "expirationDate"},
namespace = "urn:ietf:params:xml:ns:domain-1.0")
public static class DomainCreateData extends CreateData {
String name;
@XmlElement(name = "exDate")
DateTime expirationDate;
public static DomainCreateData create(
String name, DateTime creationDate, DateTime expirationDate) {
DomainCreateData instance = new DomainCreateData();
instance.name = name;
instance.creationDate = creationDate;
instance.expirationDate = expirationDate;
return instance;
}
}
/** An acknowledgment message indicating that a host was created. */
@XmlRootElement(name = "creData", namespace = "urn:ietf:params:xml:ns:host-1.0")
@XmlType(propOrder = {"name", "creationDate"}, namespace = "urn:ietf:params:xml:ns:host-1.0")
public static class HostCreateData extends CreateData {
String name;
public static HostCreateData create(String name, DateTime creationDate) {
HostCreateData instance = new HostCreateData();
instance.name = name;
instance.creationDate = creationDate;
return instance;
}
}
}