Add registration type response extension to info commands

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123323993
This commit is contained in:
mcilwain 2016-05-26 09:02:08 -07:00 committed by Ben McIlwain
parent 041b2c4116
commit 6355ef5922
4 changed files with 52 additions and 2 deletions

View file

@ -32,10 +32,10 @@ public class BaseRegTypeCommand extends ImmutableObject {
/** The registration type (which may be a comma-delimited list of values). */
@XmlElement(name = "type")
String type;
String regType;
public List<String> getRegistrationTypes() {
return Splitter.on(',').splitToList(type);
return Splitter.on(',').splitToList(regType);
}
}

View file

@ -0,0 +1,39 @@
// 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 google.registry.model.domain.regtype;
import com.google.common.base.Joiner;
import google.registry.model.eppoutput.Response.ResponseExtension;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
/**
* An XML data object that represents a registration type extension that may be present on the
* response to EPP domain info EPP commands.
*/
@XmlRootElement(name = "infData")
public class RegTypeInfoResponseExtension extends BaseRegTypeCommand implements ResponseExtension {
public static RegTypeInfoResponseExtension create(List<String> registrationTypes) {
RegTypeInfoResponseExtension instance = new RegTypeInfoResponseExtension();
instance.regType = Joiner.on(",").join(registrationTypes);
return instance;
}
private RegTypeInfoResponseExtension() {}
}

View file

@ -32,6 +32,7 @@ import google.registry.model.domain.fee.FeeUpdateResponseExtension;
import google.registry.model.domain.launch.LaunchCheckResponseExtension;
import google.registry.model.domain.launch.LaunchCreateResponseExtension;
import google.registry.model.domain.launch.LaunchInfoResponseExtension;
import google.registry.model.domain.regtype.RegTypeInfoResponseExtension;
import google.registry.model.domain.rgp.RgpInfoExtension;
import google.registry.model.domain.secdns.SecDnsInfoExtension;
import google.registry.model.eppcommon.Trid;
@ -132,6 +133,7 @@ public class Response extends ImmutableObject implements ResponseOrGreeting {
@XmlElementRef(type = LaunchCheckResponseExtension.class),
@XmlElementRef(type = LaunchCreateResponseExtension.class),
@XmlElementRef(type = LaunchInfoResponseExtension.class),
@XmlElementRef(type = RegTypeInfoResponseExtension.class),
@XmlElementRef(type = RgpInfoExtension.class),
@XmlElementRef(type = SecDnsInfoExtension.class) })
@XmlElementWrapper(name = "extension")