mirror of
https://github.com/google/nomulus.git
synced 2025-07-20 17:56:08 +02:00
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.
This commit is contained in:
parent
a41677aea1
commit
5012893c1d
2396 changed files with 0 additions and 0 deletions
86
java/google/registry/model/domain/fee/BaseFee.java
Normal file
86
java/google/registry/model/domain/fee/BaseFee.java
Normal file
|
@ -0,0 +1,86 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import static com.google.common.base.MoreObjects.firstNonNull;
|
||||
|
||||
import com.google.domain.registry.model.ImmutableObject;
|
||||
import com.google.domain.registry.xml.PeriodAdapter;
|
||||
|
||||
import org.joda.time.Period;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlEnumValue;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
import javax.xml.bind.annotation.XmlValue;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
||||
/** Base class for the fee and credit types. */
|
||||
@XmlTransient
|
||||
public class BaseFee extends ImmutableObject {
|
||||
|
||||
/** Enum for when a fee is applied. */
|
||||
public enum AppliedType {
|
||||
@XmlEnumValue("immediate")
|
||||
IMMEDIATE,
|
||||
|
||||
@XmlEnumValue("delayed")
|
||||
DELAYED
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
String description;
|
||||
|
||||
@XmlAttribute
|
||||
AppliedType applied;
|
||||
|
||||
@XmlAttribute(name = "grace-period")
|
||||
@XmlJavaTypeAdapter(PeriodAdapter.class)
|
||||
Period gracePeriod;
|
||||
|
||||
@XmlAttribute
|
||||
Boolean refundable;
|
||||
|
||||
@XmlValue
|
||||
BigDecimal cost;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public AppliedType getApplied() {
|
||||
return firstNonNull(applied, AppliedType.IMMEDIATE);
|
||||
}
|
||||
|
||||
public Period getGracePeriod() {
|
||||
return firstNonNull(gracePeriod, Period.ZERO);
|
||||
}
|
||||
|
||||
public Boolean getRefundable() {
|
||||
return firstNonNull(refundable, true);
|
||||
}
|
||||
|
||||
public BigDecimal getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public boolean hasDefaultAttributes() {
|
||||
return getGracePeriod().equals(Period.ZERO)
|
||||
&& getApplied().equals(AppliedType.IMMEDIATE)
|
||||
&& getRefundable();
|
||||
}
|
||||
}
|
48
java/google/registry/model/domain/fee/BaseFeeCommand.java
Normal file
48
java/google/registry/model/domain/fee/BaseFeeCommand.java
Normal file
|
@ -0,0 +1,48 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.ImmutableObject;
|
||||
|
||||
import org.joda.money.CurrencyUnit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/** Base class for general transform commands with fees (create, renew, update, transfer). */
|
||||
@XmlTransient
|
||||
public class BaseFeeCommand extends ImmutableObject {
|
||||
|
||||
/** The currency of the fee. */
|
||||
CurrencyUnit currency;
|
||||
|
||||
/**
|
||||
* The magnitude of the fee, in the specified units, with an optional description.
|
||||
* <p>
|
||||
* This is a list because a single operation can involve multiple fees.
|
||||
*/
|
||||
@XmlElement(name = "fee")
|
||||
List<Fee> fees;
|
||||
|
||||
public CurrencyUnit getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public List<Fee> getFees() {
|
||||
return fees;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.domain.registry.model.Buildable.GenericBuilder;
|
||||
import com.google.domain.registry.model.ImmutableObject;
|
||||
|
||||
import org.joda.money.CurrencyUnit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/** Base class for fee responses on general transform commands (create, update, renew, transfer). */
|
||||
@XmlTransient
|
||||
public class BaseFeeCommandResponse extends ImmutableObject {
|
||||
|
||||
/** The currency of the fee. */
|
||||
CurrencyUnit currency;
|
||||
|
||||
/**
|
||||
* The magnitude of the fee, in the specified units, with an optional description.
|
||||
* <p>
|
||||
* This is a list because a single operation can involve multiple fees.
|
||||
*/
|
||||
List<Fee> fee;
|
||||
|
||||
/** Abstract builder for {@link BaseFeeCommandResponse}. */
|
||||
public abstract static class Builder<T extends BaseFeeCommandResponse, B extends Builder<?, ?>>
|
||||
extends GenericBuilder<T, B> {
|
||||
public B setCurrency(CurrencyUnit currency) {
|
||||
getInstance().currency = currency;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B setFee(ImmutableList<Fee> fee) {
|
||||
getInstance().fee = fee;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
}
|
||||
}
|
52
java/google/registry/model/domain/fee/BaseFeeRequest.java
Normal file
52
java/google/registry/model/domain/fee/BaseFeeRequest.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.domain.registry.model.ImmutableObject;
|
||||
import com.google.domain.registry.model.domain.Period;
|
||||
|
||||
import org.joda.money.CurrencyUnit;
|
||||
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/** Base class for the fee requests on check and info. */
|
||||
@XmlTransient
|
||||
public class BaseFeeRequest extends ImmutableObject {
|
||||
|
||||
/** The default validity period (if not specified) is 1 year for all operations. */
|
||||
static final Period DEFAULT_PERIOD = Period.create(1, Period.Unit.YEARS);
|
||||
|
||||
/** A three-character ISO4217 currency code. */
|
||||
CurrencyUnit currency;
|
||||
|
||||
/** The command being checked. */
|
||||
FeeCommandDescriptor command;
|
||||
|
||||
/** The period for the command being checked. */
|
||||
Period period;
|
||||
|
||||
public CurrencyUnit getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public FeeCommandDescriptor getCommand() {
|
||||
return command;
|
||||
}
|
||||
|
||||
public Period getPeriod() {
|
||||
return Optional.fromNullable(period).or(DEFAULT_PERIOD);
|
||||
}
|
||||
}
|
91
java/google/registry/model/domain/fee/BaseFeeResponse.java
Normal file
91
java/google/registry/model/domain/fee/BaseFeeResponse.java
Normal file
|
@ -0,0 +1,91 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import static com.google.domain.registry.util.CollectionUtils.forceEmptyToNull;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.domain.registry.model.Buildable.GenericBuilder;
|
||||
import com.google.domain.registry.model.ImmutableObject;
|
||||
import com.google.domain.registry.model.domain.Period;
|
||||
|
||||
import org.joda.money.CurrencyUnit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/** Base class for the fee responses on check and info. */
|
||||
@XmlTransient
|
||||
public class BaseFeeResponse extends ImmutableObject {
|
||||
/** The currency of the fee. */
|
||||
CurrencyUnit currency;
|
||||
|
||||
/** The command that was checked. */
|
||||
FeeCommandDescriptor command;
|
||||
|
||||
/** The period that was checked. */
|
||||
Period period;
|
||||
|
||||
/**
|
||||
* The magnitude of the fee, in the specified units, with an optional description.
|
||||
* <p>
|
||||
* This is a list because a single operation can involve multiple fees.
|
||||
*/
|
||||
List<Fee> fee;
|
||||
|
||||
/**
|
||||
* The type of the fee.
|
||||
* <p>
|
||||
* We will use "premium" for fees on premium names, and omit the field otherwise.
|
||||
*/
|
||||
@XmlElement(name = "class")
|
||||
String feeClass;
|
||||
|
||||
public String getFeeClass() {
|
||||
return feeClass;
|
||||
}
|
||||
|
||||
/** Abstract builder for {@link BaseFeeResponse}. */
|
||||
public abstract static class Builder<T extends BaseFeeResponse, B extends Builder<?, ?>>
|
||||
extends GenericBuilder<T, B> {
|
||||
public B setCurrency(CurrencyUnit currency) {
|
||||
getInstance().currency = currency;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B setCommand(FeeCommandDescriptor command) {
|
||||
getInstance().command = command;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B setPeriod(Period period) {
|
||||
getInstance().period = period;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B setFee(Fee... fee) {
|
||||
// If there are no fees, set the field to null to suppress the 'fee' section in the xml.
|
||||
getInstance().fee = forceEmptyToNull(ImmutableList.copyOf(fee));
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B setClass(String feeClass) {
|
||||
getInstance().feeClass = feeClass;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
}
|
||||
}
|
29
java/google/registry/model/domain/fee/Credit.java
Normal file
29
java/google/registry/model/domain/fee/Credit.java
Normal file
|
@ -0,0 +1,29 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/** A credit, in currency units specified elsewhere in the xml, and with an optional description. */
|
||||
public class Credit extends BaseFee {
|
||||
public static Credit create(BigDecimal cost, String description) {
|
||||
Credit instance = new Credit();
|
||||
instance.cost = checkNotNull(cost);
|
||||
instance.description = description;
|
||||
return instance;
|
||||
}
|
||||
}
|
29
java/google/registry/model/domain/fee/Fee.java
Normal file
29
java/google/registry/model/domain/fee/Fee.java
Normal file
|
@ -0,0 +1,29 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/** A fee, in currency units specified elsewhere in the xml, and with an optional description. */
|
||||
public class Fee extends BaseFee {
|
||||
public static Fee create(BigDecimal cost, String description) {
|
||||
Fee instance = new Fee();
|
||||
instance.cost = checkNotNull(cost);
|
||||
instance.description = description;
|
||||
return instance;
|
||||
}
|
||||
}
|
54
java/google/registry/model/domain/fee/FeeCheckExtension.java
Normal file
54
java/google/registry/model/domain/fee/FeeCheckExtension.java
Normal file
|
@ -0,0 +1,54 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import static com.google.domain.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.domain.registry.model.ImmutableObject;
|
||||
import com.google.domain.registry.model.domain.Period;
|
||||
import com.google.domain.registry.model.eppinput.EppInput.CommandExtension;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/** A fee extension that may be present on domain check commands. */
|
||||
@XmlRootElement(name = "check")
|
||||
public class FeeCheckExtension extends ImmutableObject implements CommandExtension {
|
||||
|
||||
/** The default validity period (if not specified) is 1 year for all operations. */
|
||||
static final Period DEFAULT_PERIOD = Period.create(1, Period.Unit.YEARS);
|
||||
|
||||
@XmlElement(name = "domain")
|
||||
Set<DomainCheck> domains;
|
||||
|
||||
public ImmutableSet<DomainCheck> getDomains() {
|
||||
return nullToEmptyImmutableCopy(domains);
|
||||
}
|
||||
|
||||
/** A check request for the fee to perform a given command on a given domain. */
|
||||
@XmlType(propOrder = {"name", "currency", "command", "period"})
|
||||
public static class DomainCheck extends BaseFeeRequest {
|
||||
/** The fully qualified domain name being checked. */
|
||||
String name;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.domain.registry.model.ImmutableObject;
|
||||
import com.google.domain.registry.model.eppoutput.Response.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* An XML data object that represents a fee extension that may be present on the response to EPP
|
||||
* domain check commands.
|
||||
*/
|
||||
@XmlRootElement(name = "chkData")
|
||||
public class FeeCheckResponseExtension extends ImmutableObject implements ResponseExtension {
|
||||
|
||||
/** Check responses. */
|
||||
@XmlElement(name = "cd")
|
||||
ImmutableList<FeeCheck> feeChecks;
|
||||
|
||||
@VisibleForTesting
|
||||
public ImmutableList<FeeCheck> getChecks() {
|
||||
return feeChecks;
|
||||
}
|
||||
|
||||
public static FeeCheckResponseExtension create(ImmutableList<FeeCheck> feeChecks) {
|
||||
FeeCheckResponseExtension instance = new FeeCheckResponseExtension();
|
||||
instance.feeChecks = feeChecks;
|
||||
return instance;
|
||||
}
|
||||
|
||||
/** The response for a check on a single resource. */
|
||||
@XmlType(propOrder = {"name", "currency", "command", "period", "fee", "feeClass"})
|
||||
public static class FeeCheck extends BaseFeeResponse {
|
||||
/** The name of the domain that was checked, with an attribute indicating if it is premium. */
|
||||
String name;
|
||||
|
||||
/** A builder for {@link FeeCheck}. */
|
||||
public static class Builder extends BaseFeeResponse.Builder<FeeCheck, Builder> {
|
||||
public Builder setName(String name) {
|
||||
getInstance().name = name;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.domain.registry.model.ImmutableObject;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlValue;
|
||||
|
||||
/** A command name along with the launch phase and subphase it is to be executed in. */
|
||||
public class FeeCommandDescriptor extends ImmutableObject {
|
||||
|
||||
/** The name of a command that might have an associated fee. */
|
||||
public enum CommandName {
|
||||
CREATE,
|
||||
RENEW,
|
||||
TRANSFER,
|
||||
RESTORE,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
String phase;
|
||||
|
||||
@XmlAttribute
|
||||
String subphase;
|
||||
|
||||
@XmlValue
|
||||
String command;
|
||||
|
||||
public String getPhase() {
|
||||
return phase;
|
||||
}
|
||||
|
||||
public String getSubphase() {
|
||||
return subphase;
|
||||
}
|
||||
|
||||
public String getUnparsedCommandName() {
|
||||
return command;
|
||||
}
|
||||
|
||||
public CommandName getCommand() {
|
||||
// Require the xml string to be lowercase.
|
||||
if (command != null && CharMatcher.javaLowerCase().matchesAllOf(command)) {
|
||||
try {
|
||||
return CommandName.valueOf(command.toUpperCase());
|
||||
} catch (IllegalArgumentException e) {
|
||||
// Swallow this and return UNKNOWN below because there's no matching CommandName.
|
||||
}
|
||||
}
|
||||
return CommandName.UNKNOWN;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppinput.EppInput.CommandExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/** A fee extension that may be present on domain create commands. */
|
||||
@XmlRootElement(name = "create")
|
||||
@XmlType(propOrder = {"currency", "fees"})
|
||||
public class FeeCreateExtension extends BaseFeeCommand implements CommandExtension {}
|
|
@ -0,0 +1,33 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppoutput.Response.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* An XML data object that represents a fee extension that may be present on the response to EPP
|
||||
* domain create commands.
|
||||
*/
|
||||
@XmlRootElement(name = "creData")
|
||||
@XmlType(propOrder = {"currency", "fee"})
|
||||
public class FeeCreateResponseExtension extends BaseFeeCommandResponse
|
||||
implements ResponseExtension {
|
||||
/** A builder for {@link FeeCreateResponseExtension}. */
|
||||
public static class Builder
|
||||
extends BaseFeeCommandResponse.Builder<FeeCreateResponseExtension, Builder> {}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.domain.registry.model.Buildable.GenericBuilder;
|
||||
import com.google.domain.registry.model.ImmutableObject;
|
||||
import com.google.domain.registry.model.eppoutput.Response.ResponseExtension;
|
||||
|
||||
import org.joda.money.CurrencyUnit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
/**
|
||||
* An XML data object that represents a fee extension that may be present on the response to EPP
|
||||
* domain create commands.
|
||||
*/
|
||||
@XmlRootElement(name = "delData")
|
||||
public class FeeDeleteResponseExtension extends ImmutableObject implements ResponseExtension {
|
||||
|
||||
/** The currency of the credit(s). */
|
||||
CurrencyUnit currency;
|
||||
|
||||
/**
|
||||
* The magnitude of the credit(s), in the specified units, with an optional description.
|
||||
* <p>
|
||||
* This is a list because a single delete can receive multiple credits.
|
||||
*/
|
||||
@XmlElement(name = "credit")
|
||||
List<Credit> credits;
|
||||
|
||||
/** Builder for {@link FeeDeleteResponseExtension}. */
|
||||
public static class Builder extends GenericBuilder<FeeDeleteResponseExtension, Builder> {
|
||||
public Builder setCurrency(CurrencyUnit currency) {
|
||||
getInstance().currency = currency;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public Builder setCredits(ImmutableList<Credit> credits) {
|
||||
getInstance().credits = credits;
|
||||
return thisCastToDerived();
|
||||
}
|
||||
}
|
||||
}
|
25
java/google/registry/model/domain/fee/FeeInfoExtension.java
Normal file
25
java/google/registry/model/domain/fee/FeeInfoExtension.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppinput.EppInput.CommandExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/** A fee extension that may be present on domain info commands. */
|
||||
@XmlRootElement(name = "info")
|
||||
@XmlType(propOrder = {"currency", "command", "period"})
|
||||
public class FeeInfoExtension extends BaseFeeRequest implements CommandExtension {}
|
|
@ -0,0 +1,31 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppoutput.Response.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* An XML data object that represents a fee extension that may be present on the response to EPP
|
||||
* domain info commands.
|
||||
*/
|
||||
@XmlRootElement(name = "infData")
|
||||
@XmlType(propOrder = {"currency", "command", "period", "fee", "feeClass"})
|
||||
public class FeeInfoResponseExtension extends BaseFeeResponse implements ResponseExtension {
|
||||
/** A builder for {@link FeeInfoResponseExtension}. */
|
||||
public static class Builder extends BaseFeeResponse.Builder<FeeInfoResponseExtension, Builder> {}
|
||||
}
|
25
java/google/registry/model/domain/fee/FeeRenewExtension.java
Normal file
25
java/google/registry/model/domain/fee/FeeRenewExtension.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppinput.EppInput.CommandExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/** A fee extension that may be present on domain renew commands. */
|
||||
@XmlRootElement(name = "renew")
|
||||
@XmlType(propOrder = {"currency", "fees"})
|
||||
public class FeeRenewExtension extends BaseFeeCommand implements CommandExtension {}
|
|
@ -0,0 +1,33 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppoutput.Response.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* An XML data object that represents a fee extension that may be present on the response to EPP
|
||||
* domain create commands.
|
||||
*/
|
||||
@XmlRootElement(name = "renData")
|
||||
@XmlType(propOrder = {"currency", "fee"})
|
||||
public class FeeRenewResponseExtension extends BaseFeeCommandResponse
|
||||
implements ResponseExtension {
|
||||
/** A builder for {@link FeeRenewResponseExtension}. */
|
||||
public static class Builder
|
||||
extends BaseFeeCommandResponse.Builder<FeeRenewResponseExtension, Builder> {}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppinput.EppInput.CommandExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/** A fee extension that may be present on domain transfer requests. */
|
||||
@XmlRootElement(name = "transfer")
|
||||
@XmlType(propOrder = {"currency", "fees"})
|
||||
public class FeeTransferExtension extends BaseFeeCommand implements CommandExtension {}
|
|
@ -0,0 +1,33 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppoutput.Response.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* An XML data object that represents a fee extension that may be present on the response to EPP
|
||||
* domain transfer requests.
|
||||
*/
|
||||
@XmlRootElement(name = "trnData")
|
||||
@XmlType(propOrder = {"currency", "fee"})
|
||||
public class FeeTransferResponseExtension extends BaseFeeCommandResponse
|
||||
implements ResponseExtension {
|
||||
/** A builder for {@link FeeTransferResponseExtension}. */
|
||||
public static class Builder
|
||||
extends BaseFeeCommandResponse.Builder<FeeTransferResponseExtension, Builder> {}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppinput.EppInput.CommandExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/** A fee extension that may be present on domain update commands. */
|
||||
@XmlRootElement(name = "update")
|
||||
@XmlType(propOrder = {"currency", "fees"})
|
||||
public class FeeUpdateExtension extends BaseFeeCommand implements CommandExtension {}
|
|
@ -0,0 +1,33 @@
|
|||
// 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.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.eppoutput.Response.ResponseExtension;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* An XML data object that represents a fee extension that may be present on the response to EPP
|
||||
* domain update commands.
|
||||
*/
|
||||
@XmlRootElement(name = "updData")
|
||||
@XmlType(propOrder = {"currency", "fee"})
|
||||
public class FeeUpdateResponseExtension extends BaseFeeCommandResponse
|
||||
implements ResponseExtension {
|
||||
/** A builder for {@link FeeUpdateResponseExtension}. */
|
||||
public static class Builder
|
||||
extends BaseFeeCommandResponse.Builder<FeeUpdateResponseExtension, Builder> {}
|
||||
}
|
31
java/google/registry/model/domain/fee/package-info.java
Normal file
31
java/google/registry/model/domain/fee/package-info.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
// 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.
|
||||
|
||||
@XmlSchema(
|
||||
namespace = "urn:ietf:params:xml:ns:fee-0.6",
|
||||
xmlns = @XmlNs(prefix = "fee", namespaceURI = "urn:ietf:params:xml:ns:fee-0.6"),
|
||||
elementFormDefault = XmlNsForm.QUALIFIED)
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlJavaTypeAdapter(CurrencyUnitAdapter.class)
|
||||
package com.google.domain.registry.model.domain.fee;
|
||||
|
||||
import com.google.domain.registry.model.translators.CurrencyUnitAdapter;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlNs;
|
||||
import javax.xml.bind.annotation.XmlNsForm;
|
||||
import javax.xml.bind.annotation.XmlSchema;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue