mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 08:52:12 +02:00
Rename "clientIdentifier" to "clientId" almost everywhere
It's best to be consistent and use the same thing everywhere. "clientId" was already used in more places and is shorter and no more ambiguous, so it's the logical one to win out. Note that this CL is almost solely a big Eclipse-assisted refactoring. There are two places that I did not change clientIdentifier -- the actual entity field on Registrar (though I did change all getters and setters), and the name of a column on the exported registrar spreadsheet. Both would require data migrations. Also fixes a few minor nits discovered in touched files, including an incorrect test in OfyFilterTest.java and some superfluous uses of String.format() when calling checkArgument(). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133956465
This commit is contained in:
parent
0564bcdbc9
commit
4813ed392b
62 changed files with 208 additions and 200 deletions
|
@ -402,11 +402,11 @@ public class DomainFlowUtils {
|
|||
* this registrar.
|
||||
*/
|
||||
static void verifyPremiumNameIsNotBlocked(
|
||||
String domainName, DateTime priceTime, String clientIdentifier) throws EppException {
|
||||
String domainName, DateTime priceTime, String clientId) throws EppException {
|
||||
if (getPricesForDomainName(domainName, priceTime).isPremium()) {
|
||||
// NB: The load of the Registar object is transactionless, which means that it should hit
|
||||
// memcache most of the time.
|
||||
if (Registrar.loadByClientId(clientIdentifier).getBlockPremiumNames()) {
|
||||
if (Registrar.loadByClientId(clientId).getBlockPremiumNames()) {
|
||||
throw new PremiumNameBlockedException();
|
||||
}
|
||||
}
|
||||
|
@ -577,7 +577,7 @@ public class DomainFlowUtils {
|
|||
FeeQueryCommandExtensionItem feeRequest,
|
||||
FeeQueryResponseExtensionItem.Builder builder,
|
||||
InternetDomainName domain,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
@Nullable CurrencyUnit topLevelCurrency,
|
||||
DateTime now,
|
||||
EppInput eppInput) throws EppException {
|
||||
|
@ -611,13 +611,13 @@ public class DomainFlowUtils {
|
|||
} else {
|
||||
builder.setAvailIfSupported(true);
|
||||
builder.setFees(TldSpecificLogicProxy.getCreatePrice(
|
||||
registry, domainNameString, clientIdentifier, now, years, eppInput).getFees());
|
||||
registry, domainNameString, clientId, now, years, eppInput).getFees());
|
||||
}
|
||||
break;
|
||||
case RENEW:
|
||||
builder.setAvailIfSupported(true);
|
||||
builder.setFees(TldSpecificLogicProxy.getRenewPrice(
|
||||
registry, domainNameString, clientIdentifier, now, years, eppInput).getFees());
|
||||
registry, domainNameString, clientId, now, years, eppInput).getFees());
|
||||
break;
|
||||
case RESTORE:
|
||||
if (years != 1) {
|
||||
|
@ -625,17 +625,17 @@ public class DomainFlowUtils {
|
|||
}
|
||||
builder.setAvailIfSupported(true);
|
||||
builder.setFees(TldSpecificLogicProxy.getRestorePrice(
|
||||
registry, domainNameString, clientIdentifier, now, eppInput).getFees());
|
||||
registry, domainNameString, clientId, now, eppInput).getFees());
|
||||
break;
|
||||
case TRANSFER:
|
||||
builder.setAvailIfSupported(true);
|
||||
builder.setFees(TldSpecificLogicProxy.getTransferPrice(
|
||||
registry, domainNameString, clientIdentifier, now, years, eppInput).getFees());
|
||||
registry, domainNameString, clientId, now, years, eppInput).getFees());
|
||||
break;
|
||||
case UPDATE:
|
||||
builder.setAvailIfSupported(true);
|
||||
builder.setFees(TldSpecificLogicProxy.getUpdatePrice(
|
||||
registry, domainNameString, clientIdentifier, now, eppInput).getFees());
|
||||
registry, domainNameString, clientId, now, eppInput).getFees());
|
||||
break;
|
||||
default:
|
||||
throw new UnknownFeeCommandException(feeRequest.getUnparsedCommandName());
|
||||
|
|
|
@ -30,12 +30,12 @@ public interface RegistryExtraFlowLogic {
|
|||
|
||||
/** Gets the flags to be used in the EPP flags extension. This is used for EPP info commands. */
|
||||
public List<String> getExtensionFlags(
|
||||
DomainResource domainResource, String clientIdentifier, DateTime asOfDate);
|
||||
DomainResource domainResource, String clientId, DateTime asOfDate);
|
||||
|
||||
/** Computes the expected creation fee, for use in fee challenges and the like. */
|
||||
public BaseFee getCreateFeeOrCredit(
|
||||
String domainName,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
int years,
|
||||
EppInput eppInput) throws EppException;
|
||||
|
@ -46,7 +46,7 @@ public interface RegistryExtraFlowLogic {
|
|||
*/
|
||||
public void performAdditionalDomainCreateLogic(
|
||||
DomainResource domain,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
int years,
|
||||
EppInput eppInput,
|
||||
|
@ -58,7 +58,7 @@ public interface RegistryExtraFlowLogic {
|
|||
*/
|
||||
public void performAdditionalDomainDeleteLogic(
|
||||
DomainResource domain,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
EppInput eppInput,
|
||||
HistoryEntry historyEntry) throws EppException;
|
||||
|
@ -66,7 +66,7 @@ public interface RegistryExtraFlowLogic {
|
|||
/** Computes the expected renewal fee, for use in fee challenges and the like. */
|
||||
public BaseFee getRenewFeeOrCredit(
|
||||
DomainResource domain,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
int years,
|
||||
EppInput eppInput) throws EppException;
|
||||
|
@ -77,7 +77,7 @@ public interface RegistryExtraFlowLogic {
|
|||
*/
|
||||
public void performAdditionalDomainRenewLogic(
|
||||
DomainResource domain,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
int years,
|
||||
EppInput eppInput,
|
||||
|
@ -89,7 +89,7 @@ public interface RegistryExtraFlowLogic {
|
|||
*/
|
||||
public void performAdditionalDomainRestoreLogic(
|
||||
DomainResource domain,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
EppInput eppInput,
|
||||
HistoryEntry historyEntry) throws EppException;
|
||||
|
@ -100,7 +100,7 @@ public interface RegistryExtraFlowLogic {
|
|||
*/
|
||||
public void performAdditionalDomainTransferLogic(
|
||||
DomainResource domain,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
int years,
|
||||
EppInput eppInput,
|
||||
|
@ -109,7 +109,7 @@ public interface RegistryExtraFlowLogic {
|
|||
/** Computes the expected update fee, for use in fee challenges and the like. */
|
||||
public BaseFee getUpdateFeeOrCredit(
|
||||
DomainResource domain,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
EppInput eppInput) throws EppException;
|
||||
|
||||
|
@ -119,7 +119,7 @@ public interface RegistryExtraFlowLogic {
|
|||
*/
|
||||
public void performAdditionalDomainUpdateLogic(
|
||||
DomainResource domain,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
EppInput eppInput,
|
||||
HistoryEntry historyEntry) throws EppException;
|
||||
|
|
|
@ -138,7 +138,7 @@ public final class TldSpecificLogicProxy {
|
|||
public static EppCommandOperations getCreatePrice(
|
||||
Registry registry,
|
||||
String domainName,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime date,
|
||||
int years,
|
||||
EppInput eppInput) throws EppException {
|
||||
|
@ -150,7 +150,7 @@ public final class TldSpecificLogicProxy {
|
|||
RegistryExtraFlowLogicProxy.newInstanceForTld(registry.getTldStr());
|
||||
if (extraFlowLogic.isPresent()) {
|
||||
createFeeOrCredit = extraFlowLogic.get()
|
||||
.getCreateFeeOrCredit(domainName, clientIdentifier, date, years, eppInput);
|
||||
.getCreateFeeOrCredit(domainName, clientId, date, years, eppInput);
|
||||
} else {
|
||||
DomainPrices prices = getPricesForDomainName(domainName, date);
|
||||
createFeeOrCredit =
|
||||
|
@ -173,7 +173,7 @@ public final class TldSpecificLogicProxy {
|
|||
static BaseFee getRenewFeeOrCredit(
|
||||
Registry registry,
|
||||
String domainName,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime date,
|
||||
int years,
|
||||
EppInput eppInput) throws EppException {
|
||||
|
@ -186,7 +186,7 @@ public final class TldSpecificLogicProxy {
|
|||
throw new ResourceToMutateDoesNotExistException(DomainResource.class, domainName);
|
||||
}
|
||||
return
|
||||
extraFlowLogic.get().getRenewFeeOrCredit(domain, clientIdentifier, date, years, eppInput);
|
||||
extraFlowLogic.get().getRenewFeeOrCredit(domain, clientId, date, years, eppInput);
|
||||
} else {
|
||||
DomainPrices prices = getPricesForDomainName(domainName, date);
|
||||
return Fee.create(prices.getRenewCost().multipliedBy(years).getAmount(), FeeType.RENEW);
|
||||
|
@ -197,25 +197,25 @@ public final class TldSpecificLogicProxy {
|
|||
public static EppCommandOperations getRenewPrice(
|
||||
Registry registry,
|
||||
String domainName,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime date,
|
||||
int years,
|
||||
EppInput eppInput) throws EppException {
|
||||
return new EppCommandOperations(
|
||||
registry.getCurrency(),
|
||||
getRenewFeeOrCredit(registry, domainName, clientIdentifier, date, years, eppInput));
|
||||
getRenewFeeOrCredit(registry, domainName, clientId, date, years, eppInput));
|
||||
}
|
||||
|
||||
/** Returns a new restore price for the pricer. */
|
||||
public static EppCommandOperations getRestorePrice(
|
||||
Registry registry,
|
||||
String domainName,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime date,
|
||||
EppInput eppInput) throws EppException {
|
||||
return new EppCommandOperations(
|
||||
registry.getCurrency(),
|
||||
getRenewFeeOrCredit(registry, domainName, clientIdentifier, date, 1, eppInput),
|
||||
getRenewFeeOrCredit(registry, domainName, clientId, date, 1, eppInput),
|
||||
Fee.create(registry.getStandardRestoreCost().getAmount(), FeeType.RESTORE));
|
||||
}
|
||||
|
||||
|
@ -223,20 +223,20 @@ public final class TldSpecificLogicProxy {
|
|||
public static EppCommandOperations getTransferPrice(
|
||||
Registry registry,
|
||||
String domainName,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime transferDate,
|
||||
int years,
|
||||
EppInput eppInput) throws EppException {
|
||||
// Currently, all transfer prices = renew prices, so just pass through.
|
||||
return getRenewPrice(
|
||||
registry, domainName, clientIdentifier, transferDate, years, eppInput);
|
||||
registry, domainName, clientId, transferDate, years, eppInput);
|
||||
}
|
||||
|
||||
/** Returns a new update price for the pricer. */
|
||||
public static EppCommandOperations getUpdatePrice(
|
||||
Registry registry,
|
||||
String domainName,
|
||||
String clientIdentifier,
|
||||
String clientId,
|
||||
DateTime date,
|
||||
EppInput eppInput) throws EppException {
|
||||
CurrencyUnit currency = registry.getCurrency();
|
||||
|
@ -252,7 +252,7 @@ public final class TldSpecificLogicProxy {
|
|||
throw new ResourceToMutateDoesNotExistException(DomainResource.class, domainName);
|
||||
}
|
||||
feeOrCredit =
|
||||
extraFlowLogic.get().getUpdateFeeOrCredit(domain, clientIdentifier, date, eppInput);
|
||||
extraFlowLogic.get().getUpdateFeeOrCredit(domain, clientId, date, eppInput);
|
||||
} else {
|
||||
feeOrCredit = Fee.create(Money.zero(registry.getCurrency()).getAmount(), FeeType.UPDATE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue