mirror of
https://github.com/google/nomulus.git
synced 2025-05-30 01:10:14 +02:00
Make loadByForeignKey() and related methods return Optional
This is safer and addresses a common source of confusion in the codebase because it's always explicit that the resource returned may not be present, whether because it's soft-deleted when projected to the given time or because it never existed in the first place. In production code, the presence of the returned value is always checked. In test code, its presence is assumed using .get() where that is expected and convenient, as it not being present will throw an NPE that will cause the test to fail anyway. Note that the roughly equivalent reloadResourceByForeignKey(), which is widely used in test code, is not having this same treatment applied to it. That is out of the scope of this CL, and has much smaller returns anyway because it's only used in tests (where the unexpected absence of a given resource would just cause the test to fail). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=225424002
This commit is contained in:
parent
b573ec4969
commit
4491b7b909
52 changed files with 374 additions and 290 deletions
|
@ -65,13 +65,14 @@ public final class RefreshDnsAction implements Runnable {
|
|||
|
||||
private <T extends EppResource & ForeignKeyedEppResource>
|
||||
T loadAndVerifyExistence(Class<T> clazz, String foreignKey) {
|
||||
T resource = loadByForeignKey(clazz, foreignKey, clock.nowUtc());
|
||||
if (resource == null) {
|
||||
String typeName = clazz.getAnnotation(ExternalMessagingName.class).value();
|
||||
throw new NotFoundException(
|
||||
String.format("%s %s not found", typeName, domainOrHostName));
|
||||
}
|
||||
return resource;
|
||||
return loadByForeignKey(clazz, foreignKey, clock.nowUtc())
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new NotFoundException(
|
||||
String.format(
|
||||
"%s %s not found",
|
||||
clazz.getAnnotation(ExternalMessagingName.class).value(),
|
||||
domainOrHostName)));
|
||||
}
|
||||
|
||||
private static void verifyHostIsSubordinate(HostResource host) {
|
||||
|
|
|
@ -120,9 +120,9 @@ public class CloudDnsWriter extends BaseDnsWriter {
|
|||
// Canonicalize name
|
||||
String absoluteDomainName = getAbsoluteHostName(domainName);
|
||||
|
||||
// Load the target domain. Note that it can be null if this domain was just deleted.
|
||||
// Load the target domain. Note that it can be absent if this domain was just deleted.
|
||||
Optional<DomainResource> domainResource =
|
||||
Optional.ofNullable(loadByForeignKey(DomainResource.class, domainName, clock.nowUtc()));
|
||||
loadByForeignKey(DomainResource.class, domainName, clock.nowUtc());
|
||||
|
||||
// Return early if no DNS records should be published.
|
||||
// desiredRecordsBuilder is populated with an empty set to indicate that all existing records
|
||||
|
@ -188,11 +188,10 @@ public class CloudDnsWriter extends BaseDnsWriter {
|
|||
// Canonicalize name
|
||||
String absoluteHostName = getAbsoluteHostName(hostName);
|
||||
|
||||
// Load the target host. Note that it can be null if this host was just deleted.
|
||||
// Load the target host. Note that it can be absent if this host was just deleted.
|
||||
// desiredRecords is populated with an empty set to indicate that all existing records
|
||||
// should be deleted.
|
||||
Optional<HostResource> host =
|
||||
Optional.ofNullable(loadByForeignKey(HostResource.class, hostName, clock.nowUtc()));
|
||||
Optional<HostResource> host = loadByForeignKey(HostResource.class, hostName, clock.nowUtc());
|
||||
|
||||
// Return early if the host is deleted.
|
||||
if (!host.isPresent()) {
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
package google.registry.dns.writer.dnsupdate;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static com.google.common.base.Verify.verify;
|
||||
import static com.google.common.collect.Sets.intersection;
|
||||
import static com.google.common.collect.Sets.union;
|
||||
|
@ -126,9 +127,12 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
* this domain refresh request
|
||||
*/
|
||||
private void publishDomain(String domainName, String requestingHostName) {
|
||||
DomainResource domain = loadByForeignKey(DomainResource.class, domainName, clock.nowUtc());
|
||||
Optional<DomainResource> domainOptional =
|
||||
loadByForeignKey(DomainResource.class, domainName, clock.nowUtc());
|
||||
update.delete(toAbsoluteName(domainName), Type.ANY);
|
||||
if (domain != null) {
|
||||
// If the domain is now deleted, then don't update DNS for it.
|
||||
if (domainOptional.isPresent()) {
|
||||
DomainResource domain = domainOptional.get();
|
||||
// As long as the domain exists, orphan glues should be cleaned.
|
||||
deleteSubordinateHostAddressSet(domain, requestingHostName, update);
|
||||
if (domain.shouldPublishToDns()) {
|
||||
|
@ -213,9 +217,10 @@ public class DnsUpdateWriter extends BaseDnsWriter {
|
|||
for (String hostName :
|
||||
intersection(
|
||||
domain.loadNameserverFullyQualifiedHostNames(), domain.getSubordinateHosts())) {
|
||||
HostResource host = loadByForeignKey(HostResource.class, hostName, clock.nowUtc());
|
||||
update.add(makeAddressSet(host));
|
||||
update.add(makeV6AddressSet(host));
|
||||
Optional<HostResource> host = loadByForeignKey(HostResource.class, hostName, clock.nowUtc());
|
||||
checkState(host.isPresent(), "Host %s cannot be loaded", hostName);
|
||||
update.add(makeAddressSet(host.get()));
|
||||
update.add(makeV6AddressSet(host.get()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -292,11 +292,8 @@ public final class ResourceFlowUtils {
|
|||
}
|
||||
|
||||
public static <R extends EppResource> R verifyExistence(
|
||||
Class<R> clazz, String targetId, R resource) throws ResourceDoesNotExistException {
|
||||
if (resource == null) {
|
||||
throw new ResourceDoesNotExistException(clazz, targetId);
|
||||
}
|
||||
return resource;
|
||||
Class<R> clazz, String targetId, Optional<R> resource) throws ResourceDoesNotExistException {
|
||||
return resource.orElseThrow(() -> new ResourceDoesNotExistException(clazz, targetId));
|
||||
}
|
||||
|
||||
public static <R extends EppResource> void verifyResourceDoesNotExist(
|
||||
|
|
|
@ -224,10 +224,9 @@ public class DomainAllocateFlow implements TransactionalFlow {
|
|||
|
||||
private DomainApplication loadAndValidateApplication(
|
||||
String applicationRoid, DateTime now) throws EppException {
|
||||
DomainApplication application = loadDomainApplication(applicationRoid, now);
|
||||
if (application == null) {
|
||||
throw new MissingApplicationException(applicationRoid);
|
||||
}
|
||||
DomainApplication application =
|
||||
loadDomainApplication(applicationRoid, now)
|
||||
.orElseThrow(() -> new MissingApplicationException(applicationRoid));
|
||||
if (application.getApplicationStatus().isFinalStatus()) {
|
||||
throw new HasFinalStatusException();
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@ import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
|||
import static google.registry.flows.domain.DomainFlowUtils.addSecDnsExtensionIfPresent;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.loadForeignKeyedDesignatedContacts;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.verifyApplicationDomainMatchesTargetId;
|
||||
import static google.registry.model.EppResourceUtils.loadDomainApplication;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.EppException.ParameterValuePolicyErrorException;
|
||||
import google.registry.flows.EppException.RequiredParameterMissingException;
|
||||
|
@ -89,13 +89,10 @@ public final class DomainApplicationInfoFlow implements Flow {
|
|||
throw new MissingApplicationIdException();
|
||||
}
|
||||
DomainApplication application =
|
||||
ofy().load().key(Key.create(DomainApplication.class, applicationId)).now();
|
||||
verifyExistence(
|
||||
DomainApplication.class,
|
||||
applicationId,
|
||||
application != null && clock.nowUtc().isBefore(application.getDeletionTime())
|
||||
? application
|
||||
: null);
|
||||
verifyExistence(
|
||||
DomainApplication.class,
|
||||
applicationId,
|
||||
loadDomainApplication(applicationId, clock.nowUtc()));
|
||||
verifyApplicationDomainMatchesTargetId(application, targetId);
|
||||
verifyOptionalAuthInfo(authInfo, application);
|
||||
LaunchInfoExtension launchInfo = eppInput.getSingleExtension(LaunchInfoExtension.class).get();
|
||||
|
|
|
@ -87,16 +87,15 @@ public class HostFlowUtils {
|
|||
}
|
||||
// This is a subordinate host
|
||||
String domainName =
|
||||
hostName
|
||||
.parts()
|
||||
.stream()
|
||||
hostName.parts().stream()
|
||||
.skip(hostName.parts().size() - (tld.get().parts().size() + 1))
|
||||
.collect(joining("."));
|
||||
DomainResource superordinateDomain = loadByForeignKey(DomainResource.class, domainName, now);
|
||||
if (superordinateDomain == null || !isActive(superordinateDomain, now)) {
|
||||
Optional<DomainResource> superordinateDomain =
|
||||
loadByForeignKey(DomainResource.class, domainName, now);
|
||||
if (!superordinateDomain.isPresent() || !isActive(superordinateDomain.get(), now)) {
|
||||
throw new SuperordinateDomainDoesNotExistException(domainName);
|
||||
}
|
||||
return Optional.of(superordinateDomain);
|
||||
return superordinateDomain;
|
||||
}
|
||||
|
||||
/** Superordinate domain for this hostname does not exist. */
|
||||
|
|
|
@ -76,7 +76,7 @@ public final class EppResourceUtils {
|
|||
/**
|
||||
* Loads the last created version of an {@link EppResource} from Datastore by foreign key.
|
||||
*
|
||||
* <p>Returns null if no resource with this foreign key was ever created, or if the most recently
|
||||
* <p>Returns empty if no resource with this foreign key was ever created, or if the most recently
|
||||
* created resource was deleted before time "now".
|
||||
*
|
||||
* <p>Loading an {@link EppResource} by itself is not sufficient to know its current state since
|
||||
|
@ -92,10 +92,9 @@ public final class EppResourceUtils {
|
|||
* @param foreignKey id to match
|
||||
* @param now the current logical time to project resources at
|
||||
*/
|
||||
@Nullable
|
||||
public static <T extends EppResource> T loadByForeignKey(
|
||||
public static <T extends EppResource> Optional<T> loadByForeignKey(
|
||||
Class<T> clazz, String foreignKey, DateTime now) {
|
||||
return loadByForeignKeyHelper(clazz, foreignKey, now, false).orElse(null);
|
||||
return loadByForeignKeyHelper(clazz, foreignKey, now, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -160,19 +159,19 @@ public final class EppResourceUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the domain application with the given application id if it exists, or null if it does
|
||||
* Returns the domain application with the given application id if it exists, or absent if it does
|
||||
* not or is soft-deleted as of the given time.
|
||||
*/
|
||||
@Nullable
|
||||
public static DomainApplication loadDomainApplication(String applicationId, DateTime now) {
|
||||
public static Optional<DomainApplication> loadDomainApplication(
|
||||
String applicationId, DateTime now) {
|
||||
DomainApplication application =
|
||||
ofy().load().key(Key.create(DomainApplication.class, applicationId)).now();
|
||||
if (application == null || isAtOrAfter(now, application.getDeletionTime())) {
|
||||
return null;
|
||||
return Optional.empty();
|
||||
}
|
||||
// Applications don't have any speculative changes that become effective later, so no need to
|
||||
// clone forward in time.
|
||||
return application;
|
||||
return Optional.of(application);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,6 +21,7 @@ import static com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet;
|
|||
import static com.google.common.collect.Sets.difference;
|
||||
import static com.google.common.collect.Sets.union;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.util.CollectionUtils.forceEmptyToNull;
|
||||
import static google.registry.util.CollectionUtils.nullToEmpty;
|
||||
import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
||||
import static google.registry.util.CollectionUtils.nullToEmptyImmutableSortedCopy;
|
||||
|
@ -231,21 +232,38 @@ public abstract class DomainBase extends EppResource {
|
|||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B setNameservers(ImmutableSet<Key<HostResource>> nameservers) {
|
||||
getInstance().nsHosts = nameservers;
|
||||
public B setNameservers(Key<HostResource> nameserver) {
|
||||
getInstance().nsHosts = ImmutableSet.of(nameserver);
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B setNameservers(ImmutableSet<Key<HostResource>> nameservers) {
|
||||
getInstance().nsHosts = forceEmptyToNull(nameservers);
|
||||
return thisCastToDerived();
|
||||
}
|
||||
|
||||
public B addNameserver(Key<HostResource> nameserver) {
|
||||
return addNameservers(ImmutableSet.of(nameserver));
|
||||
}
|
||||
|
||||
public B addNameservers(ImmutableSet<Key<HostResource>> nameservers) {
|
||||
return setNameservers(
|
||||
ImmutableSet.copyOf(union(getInstance().getNameservers(), nameservers)));
|
||||
}
|
||||
|
||||
public B removeNameserver(Key<HostResource> nameserver) {
|
||||
return removeNameservers(ImmutableSet.of(nameserver));
|
||||
}
|
||||
|
||||
public B removeNameservers(ImmutableSet<Key<HostResource>> nameservers) {
|
||||
return setNameservers(
|
||||
ImmutableSet.copyOf(difference(getInstance().getNameservers(), nameservers)));
|
||||
}
|
||||
|
||||
public B setContacts(DesignatedContact contact) {
|
||||
return setContacts(ImmutableSet.of(contact));
|
||||
}
|
||||
|
||||
public B setContacts(ImmutableSet<DesignatedContact> contacts) {
|
||||
checkArgument(contacts.stream().noneMatch(IS_REGISTRANT), "Registrant cannot be a contact");
|
||||
// Replace the non-registrant contacts inside allContacts.
|
||||
|
|
|
@ -272,6 +272,18 @@ public abstract class RdapActionBase implements Runnable {
|
|||
|| registrarParam.get().equals(eppResource.getPersistedCurrentSponsorClientId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the EPP resource should be visible.
|
||||
*
|
||||
* <p>This is true iff:
|
||||
* 1. The passed in resource exists and is not deleted (deleted ones will have been projected
|
||||
* forward in time to empty),
|
||||
* 2. The request did not specify a registrar to filter on, or the registrar matches.
|
||||
*/
|
||||
boolean shouldBeVisible(Optional<? extends EppResource> eppResource, DateTime now) {
|
||||
return eppResource.isPresent() && shouldBeVisible(eppResource.get(), now);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the registrar should be visible.
|
||||
*
|
||||
|
|
|
@ -29,6 +29,7 @@ import google.registry.request.Action;
|
|||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.HttpException.NotFoundException;
|
||||
import google.registry.request.auth.Auth;
|
||||
import java.util.Optional;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
@ -74,14 +75,14 @@ public class RdapDomainAction extends RdapActionBase {
|
|||
pathSearchString, getHumanReadableObjectTypeName(), e.getMessage()));
|
||||
}
|
||||
// The query string is not used; the RDAP syntax is /rdap/domain/mydomain.com.
|
||||
DomainResource domainResource =
|
||||
Optional<DomainResource> domainResource =
|
||||
loadByForeignKey(
|
||||
DomainResource.class, pathSearchString, shouldIncludeDeleted() ? START_OF_TIME : now);
|
||||
if ((domainResource == null) || !shouldBeVisible(domainResource, now)) {
|
||||
if (!shouldBeVisible(domainResource, now)) {
|
||||
throw new NotFoundException(pathSearchString + " not found");
|
||||
}
|
||||
return rdapJsonFormatter.makeRdapJsonForDomain(
|
||||
domainResource,
|
||||
domainResource.get(),
|
||||
true,
|
||||
fullServletPath,
|
||||
rdapWhoisServer,
|
||||
|
|
|
@ -216,13 +216,13 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
*/
|
||||
private RdapSearchResults searchByDomainNameWithoutWildcard(
|
||||
final RdapSearchPattern partialStringQuery, final DateTime now) {
|
||||
DomainResource domainResource =
|
||||
Optional<DomainResource> domainResource =
|
||||
loadByForeignKey(DomainResource.class, partialStringQuery.getInitialString(), now);
|
||||
ImmutableList<DomainResource> results =
|
||||
((domainResource == null) || !shouldBeVisible(domainResource, now))
|
||||
? ImmutableList.of()
|
||||
: ImmutableList.of(domainResource);
|
||||
return makeSearchResults(results, now);
|
||||
return makeSearchResults(
|
||||
shouldBeVisible(domainResource, now)
|
||||
? ImmutableList.of(domainResource.get())
|
||||
: ImmutableList.of(),
|
||||
now);
|
||||
}
|
||||
|
||||
/** Searches for domains by domain name with an initial string, wildcard and possible suffix. */
|
||||
|
@ -343,15 +343,15 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
// the key.
|
||||
Optional<String> desiredRegistrar = getDesiredRegistrar();
|
||||
if (desiredRegistrar.isPresent()) {
|
||||
HostResource host =
|
||||
Optional<HostResource> host =
|
||||
loadByForeignKey(
|
||||
HostResource.class,
|
||||
partialStringQuery.getInitialString(),
|
||||
shouldIncludeDeleted() ? START_OF_TIME : now);
|
||||
return ((host == null)
|
||||
|| !desiredRegistrar.get().equals(host.getPersistedCurrentSponsorClientId()))
|
||||
return (!host.isPresent()
|
||||
|| !desiredRegistrar.get().equals(host.get().getPersistedCurrentSponsorClientId()))
|
||||
? ImmutableList.of()
|
||||
: ImmutableList.of(Key.create(host));
|
||||
: ImmutableList.of(Key.create(host.get()));
|
||||
} else {
|
||||
Key<HostResource> hostKey =
|
||||
loadAndGetKey(
|
||||
|
@ -370,15 +370,14 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
// with no initial string.
|
||||
DomainResource domainResource =
|
||||
loadByForeignKey(
|
||||
DomainResource.class,
|
||||
partialStringQuery.getSuffix(),
|
||||
shouldIncludeDeleted() ? START_OF_TIME : now);
|
||||
if (domainResource == null) {
|
||||
// Don't allow wildcards with suffixes which are not domains we manage. That would risk a
|
||||
// table scan in some easily foreseeable cases.
|
||||
throw new UnprocessableEntityException(
|
||||
"A suffix in a lookup by nameserver name must be a domain defined in the system");
|
||||
}
|
||||
DomainResource.class,
|
||||
partialStringQuery.getSuffix(),
|
||||
shouldIncludeDeleted() ? START_OF_TIME : now)
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new UnprocessableEntityException(
|
||||
"A suffix in a lookup by nameserver name "
|
||||
+ "must be a domain defined in the system"));
|
||||
Optional<String> desiredRegistrar = getDesiredRegistrar();
|
||||
ImmutableList.Builder<Key<HostResource>> builder = new ImmutableList.Builder<>();
|
||||
for (String fqhn : ImmutableSortedSet.copyOf(domainResource.getSubordinateHosts())) {
|
||||
|
@ -386,12 +385,12 @@ public class RdapDomainSearchAction extends RdapSearchActionBase {
|
|||
// then the query ns.exam*.example.com would match against nameserver ns.example.com.
|
||||
if (partialStringQuery.matches(fqhn)) {
|
||||
if (desiredRegistrar.isPresent()) {
|
||||
HostResource host =
|
||||
Optional<HostResource> host =
|
||||
loadByForeignKey(
|
||||
HostResource.class, fqhn, shouldIncludeDeleted() ? START_OF_TIME : now);
|
||||
if ((host != null)
|
||||
&& desiredRegistrar.get().equals(host.getPersistedCurrentSponsorClientId())) {
|
||||
builder.add(Key.create(host));
|
||||
if (host.isPresent()
|
||||
&& desiredRegistrar.get().equals(host.get().getPersistedCurrentSponsorClientId())) {
|
||||
builder.add(Key.create(host.get()));
|
||||
}
|
||||
} else {
|
||||
Key<HostResource> hostKey =
|
||||
|
|
|
@ -29,6 +29,7 @@ import google.registry.request.Action;
|
|||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.HttpException.NotFoundException;
|
||||
import google.registry.request.auth.Auth;
|
||||
import java.util.Optional;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
@ -76,13 +77,13 @@ public class RdapNameserverAction extends RdapActionBase {
|
|||
}
|
||||
// If there are no undeleted nameservers with the given name, the foreign key should point to
|
||||
// the most recently deleted one.
|
||||
HostResource hostResource =
|
||||
Optional<HostResource> hostResource =
|
||||
loadByForeignKey(
|
||||
HostResource.class, pathSearchString, shouldIncludeDeleted() ? START_OF_TIME : now);
|
||||
if ((hostResource == null) || !shouldBeVisible(hostResource, now)) {
|
||||
if (!shouldBeVisible(hostResource, now)) {
|
||||
throw new NotFoundException(pathSearchString + " not found");
|
||||
}
|
||||
return rdapJsonFormatter.makeRdapJsonForHost(
|
||||
hostResource, true, fullServletPath, rdapWhoisServer, now, OutputDataType.FULL);
|
||||
hostResource.get(), true, fullServletPath, rdapWhoisServer, now, OutputDataType.FULL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,9 +183,9 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
|
|||
*/
|
||||
private RdapSearchResults searchByNameUsingForeignKey(
|
||||
final RdapSearchPattern partialStringQuery, final DateTime now) {
|
||||
HostResource hostResource =
|
||||
Optional<HostResource> hostResource =
|
||||
loadByForeignKey(HostResource.class, partialStringQuery.getInitialString(), now);
|
||||
if ((hostResource == null) || !shouldBeVisible(hostResource, now)) {
|
||||
if (!shouldBeVisible(hostResource, now)) {
|
||||
metricInformationBuilder.setNumHostsRetrieved(0);
|
||||
throw new NotFoundException("No nameservers found");
|
||||
}
|
||||
|
@ -193,15 +193,20 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
|
|||
return RdapSearchResults.create(
|
||||
ImmutableList.of(
|
||||
rdapJsonFormatter.makeRdapJsonForHost(
|
||||
hostResource, false, fullServletPath, rdapWhoisServer, now, OutputDataType.FULL)));
|
||||
hostResource.get(),
|
||||
false,
|
||||
fullServletPath,
|
||||
rdapWhoisServer,
|
||||
now,
|
||||
OutputDataType.FULL)));
|
||||
}
|
||||
|
||||
/** Searches for nameservers by name using the superordinate domain as a suffix. */
|
||||
private RdapSearchResults searchByNameUsingSuperordinateDomain(
|
||||
final RdapSearchPattern partialStringQuery, final DateTime now) {
|
||||
DomainResource domainResource =
|
||||
Optional<DomainResource> domainResource =
|
||||
loadByForeignKey(DomainResource.class, partialStringQuery.getSuffix(), now);
|
||||
if (domainResource == null) {
|
||||
if (!domainResource.isPresent()) {
|
||||
// Don't allow wildcards with suffixes which are not domains we manage. That would risk a
|
||||
// table scan in many easily foreseeable cases. The user might ask for ns*.zombo.com,
|
||||
// forcing us to query for all hosts beginning with ns, then filter for those ending in
|
||||
|
@ -211,16 +216,16 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
|
|||
"A suffix after a wildcard in a nameserver lookup must be an in-bailiwick domain");
|
||||
}
|
||||
List<HostResource> hostList = new ArrayList<>();
|
||||
for (String fqhn : ImmutableSortedSet.copyOf(domainResource.getSubordinateHosts())) {
|
||||
for (String fqhn : ImmutableSortedSet.copyOf(domainResource.get().getSubordinateHosts())) {
|
||||
if (cursorString.isPresent() && (fqhn.compareTo(cursorString.get()) <= 0)) {
|
||||
continue;
|
||||
}
|
||||
// We can't just check that the host name starts with the initial query string, because
|
||||
// then the query ns.exam*.example.com would match against nameserver ns.example.com.
|
||||
if (partialStringQuery.matches(fqhn)) {
|
||||
HostResource hostResource = loadByForeignKey(HostResource.class, fqhn, now);
|
||||
if ((hostResource != null) && shouldBeVisible(hostResource, now)) {
|
||||
hostList.add(hostResource);
|
||||
Optional<HostResource> hostResource = loadByForeignKey(HostResource.class, fqhn, now);
|
||||
if (shouldBeVisible(hostResource, now)) {
|
||||
hostList.add(hostResource.get());
|
||||
if (hostList.size() > rdapResultSetMaxSize) {
|
||||
break;
|
||||
}
|
||||
|
@ -230,7 +235,7 @@ public class RdapNameserverSearchAction extends RdapSearchActionBase {
|
|||
return makeSearchResults(
|
||||
hostList,
|
||||
IncompletenessWarningType.COMPLETE,
|
||||
domainResource.getSubordinateHosts().size(),
|
||||
domainResource.get().getSubordinateHosts().size(),
|
||||
CursorType.NAME,
|
||||
now);
|
||||
}
|
||||
|
|
|
@ -195,11 +195,14 @@ public class RdeHostLinkAction implements Runnable {
|
|||
.stream()
|
||||
.skip(hostName.parts().size() - (tld.get().parts().size() + 1))
|
||||
.collect(joining("."));
|
||||
DomainResource superordinateDomain = loadByForeignKey(DomainResource.class, domainName, now);
|
||||
Optional<DomainResource> superordinateDomain =
|
||||
loadByForeignKey(DomainResource.class, domainName, now);
|
||||
// Hosts can't be linked if domains import hasn't been run
|
||||
checkState(
|
||||
superordinateDomain != null, "Superordinate domain does not exist: %s", domainName);
|
||||
return Optional.of(superordinateDomain);
|
||||
superordinateDomain.isPresent(),
|
||||
"Superordinate domain does not exist or is deleted: %s",
|
||||
domainName);
|
||||
return superordinateDomain;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,10 +212,4 @@ public class RdeHostLinkAction implements Runnable {
|
|||
SUPERORDINATE_DOMAIN_IN_PENDING_DELETE,
|
||||
HOST_LINKED;
|
||||
}
|
||||
|
||||
private static class HostLinkException extends RuntimeException {
|
||||
HostLinkException(String hostname, String xml, Throwable cause) {
|
||||
super(String.format("Error linking host %s; xml=%s", hostname, xml), cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,9 +31,7 @@ final class GetApplicationCommand extends GetEppResourceCommand {
|
|||
|
||||
@Override
|
||||
public void runAndPrint() {
|
||||
for (String applicationId : mainParameters) {
|
||||
printResource(
|
||||
"Application", applicationId, loadDomainApplication(applicationId, readTimestamp));
|
||||
}
|
||||
mainParameters.forEach(
|
||||
appId -> printResource("Application", appId, loadDomainApplication(appId, readTimestamp)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.beust.jcommander.Parameter;
|
|||
import com.beust.jcommander.Parameters;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.EppResource;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Optional;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** Abstract command to print one or more resources to stdout. */
|
||||
|
@ -44,17 +44,20 @@ abstract class GetEppResourceCommand implements CommandWithRemoteApi {
|
|||
abstract void runAndPrint();
|
||||
|
||||
/**
|
||||
* Prints a possibly-null resource to stdout, using resourceType and uniqueId to construct a
|
||||
* Prints a possibly-absent resource to stdout, using resourceType and uniqueId to construct a
|
||||
* nice error message if the resource was null (i.e. doesn't exist).
|
||||
*
|
||||
* <p>The websafe key is appended to the output for use in e.g. manual mapreduce calls.
|
||||
*/
|
||||
void printResource(String resourceType, String uniqueId, @Nullable EppResource resource) {
|
||||
System.out.println(resource != null
|
||||
? String.format("%s\n\nWebsafe key: %s",
|
||||
expand ? resource.toHydratedString() : resource,
|
||||
Key.create(resource).getString())
|
||||
: String.format("%s '%s' does not exist or is deleted\n", resourceType, uniqueId));
|
||||
void printResource(
|
||||
String resourceType, String uniqueId, Optional<? extends EppResource> resource) {
|
||||
System.out.println(
|
||||
resource.isPresent()
|
||||
? String.format(
|
||||
"%s\n\nWebsafe key: %s",
|
||||
expand ? resource.get().toHydratedString() : resource.get(),
|
||||
Key.create(resource.get()).getString())
|
||||
: String.format("%s '%s' does not exist or is deleted\n", resourceType, uniqueId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,9 +32,7 @@ final class GetHostCommand extends GetEppResourceCommand {
|
|||
|
||||
@Override
|
||||
public void runAndPrint() {
|
||||
for (String hostName : mainParameters) {
|
||||
printResource(
|
||||
"Host", hostName, loadByForeignKey(HostResource.class, hostName, readTimestamp));
|
||||
}
|
||||
mainParameters.forEach(
|
||||
h -> printResource("Host", h, loadByForeignKey(HostResource.class, h, readTimestamp)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentPresent;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
@ -28,6 +28,7 @@ import com.google.template.soy.data.SoyMapData;
|
|||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.tools.soy.DomainUpdateSoyInfo;
|
||||
import java.util.Optional;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
|
@ -45,10 +46,11 @@ public class LockDomainCommand extends LockOrUnlockDomainCommand {
|
|||
// Project all domains as of the same time so that argument order doesn't affect behavior.
|
||||
DateTime now = DateTime.now(UTC);
|
||||
for (String domain : getDomains()) {
|
||||
DomainResource domainResource = loadByForeignKey(DomainResource.class, domain, now);
|
||||
checkArgument(domainResource != null, "Domain '%s' does not exist", domain);
|
||||
Optional<DomainResource> domainResource = loadByForeignKey(DomainResource.class, domain, now);
|
||||
checkArgumentPresent(domainResource, "Domain '%s' does not exist or is deleted", domain);
|
||||
ImmutableSet<StatusValue> statusesToAdd =
|
||||
Sets.difference(REGISTRY_LOCK_STATUSES, domainResource.getStatusValues()).immutableCopy();
|
||||
Sets.difference(REGISTRY_LOCK_STATUSES, domainResource.get().getStatusValues())
|
||||
.immutableCopy();
|
||||
if (statusesToAdd.isEmpty()) {
|
||||
logger.atInfo().log("Domain '%s' is already locked and needs no updates.", domain);
|
||||
continue;
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.tools;
|
|||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.util.CollectionUtils.findDuplicates;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentPresent;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
@ -27,6 +27,7 @@ import google.registry.model.domain.DomainResource;
|
|||
import google.registry.tools.soy.RenewDomainSoyInfo;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
|
@ -56,9 +57,11 @@ final class RenewDomainCommand extends MutatingEppToolCommand {
|
|||
checkArgument(period < 10, "Cannot renew domains for 10 or more years");
|
||||
DateTime now = clock.nowUtc();
|
||||
for (String domainName : mainParameters) {
|
||||
DomainResource domain = loadByForeignKey(DomainResource.class, domainName, now);
|
||||
checkArgumentNotNull(domain, "Domain '%s' does not exist or is deleted", domainName);
|
||||
Optional<DomainResource> domainOptional =
|
||||
loadByForeignKey(DomainResource.class, domainName, now);
|
||||
checkArgumentPresent(domainOptional, "Domain '%s' does not exist or is deleted", domainName);
|
||||
setSoyTemplate(RenewDomainSoyInfo.getInstance(), RenewDomainSoyInfo.RENEWDOMAIN);
|
||||
DomainResource domain = domainOptional.get();
|
||||
addSoyRecord(
|
||||
domain.getCurrentSponsorClientId(),
|
||||
new SoyMapData(
|
||||
|
|
|
@ -20,6 +20,7 @@ import static com.google.common.collect.Sets.difference;
|
|||
import static google.registry.model.EppResourceUtils.checkResourcesExist;
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentPresent;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
|
@ -37,6 +38,7 @@ import google.registry.tools.soy.UniformRapidSuspensionSoyInfo;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -119,17 +121,17 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
|
|||
} catch (ClassCastException | ParseException e) {
|
||||
throw new IllegalArgumentException("Invalid --dsdata JSON", e);
|
||||
}
|
||||
DomainResource domain = loadByForeignKey(DomainResource.class, domainName, now);
|
||||
checkArgument(domain != null, "Domain '%s' does not exist", domainName);
|
||||
Optional<DomainResource> domain = loadByForeignKey(DomainResource.class, domainName, now);
|
||||
checkArgumentPresent(domain, "Domain '%s' does not exist or is deleted", domainName);
|
||||
Set<String> missingHosts =
|
||||
difference(newHostsSet, checkResourcesExist(HostResource.class, newHosts, now));
|
||||
checkArgument(missingHosts.isEmpty(), "Hosts do not exist: %s", missingHosts);
|
||||
checkArgument(
|
||||
locksToPreserve.isEmpty() || undo,
|
||||
"Locks can only be preserved when running with --undo");
|
||||
existingNameservers = getExistingNameservers(domain);
|
||||
existingLocks = getExistingLocks(domain);
|
||||
existingDsData = getExistingDsData(domain);
|
||||
existingNameservers = getExistingNameservers(domain.get());
|
||||
existingLocks = getExistingLocks(domain.get());
|
||||
existingDsData = getExistingDsData(domain.get());
|
||||
setSoyTemplate(
|
||||
UniformRapidSuspensionSoyInfo.getInstance(),
|
||||
UniformRapidSuspensionSoyInfo.UNIFORMRAPIDSUSPENSION);
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
||||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentPresent;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
@ -28,6 +28,7 @@ import com.google.template.soy.data.SoyMapData;
|
|||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.tools.soy.DomainUpdateSoyInfo;
|
||||
import java.util.Optional;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
|
@ -45,10 +46,10 @@ public class UnlockDomainCommand extends LockOrUnlockDomainCommand {
|
|||
// Project all domains as of the same time so that argument order doesn't affect behavior.
|
||||
DateTime now = DateTime.now(UTC);
|
||||
for (String domain : getDomains()) {
|
||||
DomainResource domainResource = loadByForeignKey(DomainResource.class, domain, now);
|
||||
checkArgument(domainResource != null, "Domain '%s' does not exist", domain);
|
||||
Optional<DomainResource> domainResource = loadByForeignKey(DomainResource.class, domain, now);
|
||||
checkArgumentPresent(domainResource, "Domain '%s' does not exist or is deleted", domain);
|
||||
ImmutableSet<StatusValue> statusesToRemove =
|
||||
Sets.intersection(domainResource.getStatusValues(), REGISTRY_LOCK_STATUSES)
|
||||
Sets.intersection(domainResource.get().getStatusValues(), REGISTRY_LOCK_STATUSES)
|
||||
.immutableCopy();
|
||||
if (statusesToRemove.isEmpty()) {
|
||||
logger.atInfo().log("Domain '%s' is already unlocked and needs no updates.", domain);
|
||||
|
|
|
@ -43,6 +43,7 @@ import google.registry.model.reporting.HistoryEntry.Type;
|
|||
import google.registry.util.Clock;
|
||||
import google.registry.util.NonFinalForTesting;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
@ -90,16 +91,17 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
|||
domainsNonexistentBuilder.add(domainName);
|
||||
continue;
|
||||
}
|
||||
DomainResource domain = loadByForeignKey(DomainResource.class, domainName, now);
|
||||
if (domain == null || domain.getStatusValues().contains(StatusValue.PENDING_DELETE)) {
|
||||
Optional<DomainResource> domain = loadByForeignKey(DomainResource.class, domainName, now);
|
||||
if (!domain.isPresent()
|
||||
|| domain.get().getStatusValues().contains(StatusValue.PENDING_DELETE)) {
|
||||
domainsDeletingBuilder.add(domainName);
|
||||
continue;
|
||||
}
|
||||
domainsWithDisallowedStatusesBuilder.putAll(
|
||||
domainName, Sets.intersection(domain.getStatusValues(), DISALLOWED_STATUSES));
|
||||
domainName, Sets.intersection(domain.get().getStatusValues(), DISALLOWED_STATUSES));
|
||||
if (isBeforeOrAt(
|
||||
leapSafeSubtractYears(domain.getRegistrationExpirationTime(), period), now)) {
|
||||
domainsExpiringTooSoonBuilder.put(domainName, domain.getRegistrationExpirationTime());
|
||||
leapSafeSubtractYears(domain.get().getRegistrationExpirationTime(), period), now)) {
|
||||
domainsExpiringTooSoonBuilder.put(domainName, domain.get().getRegistrationExpirationTime());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,13 +151,16 @@ class UnrenewDomainCommand extends ConfirmingCommand implements CommandWithRemot
|
|||
private void unrenewDomain(String domainName) {
|
||||
ofy().assertInTransaction();
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
DomainResource domain = loadByForeignKey(DomainResource.class, domainName, now);
|
||||
Optional<DomainResource> domainOptional =
|
||||
loadByForeignKey(DomainResource.class, domainName, now);
|
||||
// Transactional sanity checks on the off chance that something changed between init() running
|
||||
// and here.
|
||||
checkState(
|
||||
domain != null && !domain.getStatusValues().contains(StatusValue.PENDING_DELETE),
|
||||
domainOptional.isPresent()
|
||||
&& !domainOptional.get().getStatusValues().contains(StatusValue.PENDING_DELETE),
|
||||
"Domain %s was deleted or is pending deletion",
|
||||
domainName);
|
||||
DomainResource domain = domainOptional.get();
|
||||
checkState(
|
||||
Sets.intersection(domain.getStatusValues(), DISALLOWED_STATUSES).isEmpty(),
|
||||
"Domain %s has prohibited status values",
|
||||
|
|
|
@ -19,7 +19,6 @@ import static com.google.common.base.Preconditions.checkState;
|
|||
import static google.registry.model.EppResourceUtils.loadDomainApplication;
|
||||
import static google.registry.model.domain.launch.ApplicationStatus.ALLOCATED;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentPresent;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
|
@ -83,9 +82,12 @@ final class UpdateApplicationStatusCommand extends MutatingCommand {
|
|||
ofy().assertInTransaction();
|
||||
DateTime now = ofy().getTransactionTime();
|
||||
|
||||
// Load the domain application.
|
||||
DomainApplication domainApplication = loadDomainApplication(applicationId, now);
|
||||
checkArgumentNotNull(domainApplication, "Domain application does not exist");
|
||||
DomainApplication domainApplication =
|
||||
loadDomainApplication(applicationId, now)
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new IllegalArgumentException(
|
||||
"Domain application does not exist or is deleted"));
|
||||
|
||||
// It's not an error if the application already has the intended status. We want the method
|
||||
// to be idempotent.
|
||||
|
|
|
@ -82,16 +82,20 @@ final class UpdateClaimsNoticeCommand implements CommandWithRemoteApi {
|
|||
DateTime now = ofy().getTransactionTime();
|
||||
|
||||
// Load the domain application.
|
||||
DomainApplication domainApplication = loadDomainApplication(applicationId, now);
|
||||
checkArgument(domainApplication != null, "Domain application does not exist");
|
||||
DomainApplication domainApplication =
|
||||
loadDomainApplication(applicationId, now)
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new IllegalArgumentException(
|
||||
"Domain application does not exist or is deleted"));
|
||||
|
||||
// Make sure this isn't a sunrise application.
|
||||
checkArgument(domainApplication.getEncodedSignedMarks().isEmpty(),
|
||||
"Can't update claims notice on sunrise applications.");
|
||||
|
||||
// Validate the new launch notice checksum.
|
||||
String domainLabel = InternetDomainName.from(domainApplication.getFullyQualifiedDomainName())
|
||||
.parts().get(0);
|
||||
String domainLabel =
|
||||
InternetDomainName.from(domainApplication.getFullyQualifiedDomainName()).parts().get(0);
|
||||
launchNotice.validate(domainLabel);
|
||||
|
||||
DomainApplication updatedApplication = domainApplication.asBuilder()
|
||||
|
|
|
@ -19,7 +19,7 @@ import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
|||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.model.eppcommon.StatusValue.SERVER_UPDATE_PROHIBITED;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentPresent;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
|
@ -37,6 +37,7 @@ import google.registry.tools.soy.DomainUpdateSoyInfo;
|
|||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -172,8 +173,10 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
|||
|
||||
if (!nameservers.isEmpty() || !admins.isEmpty() || !techs.isEmpty() || !statuses.isEmpty()) {
|
||||
DateTime now = DateTime.now(UTC);
|
||||
DomainResource domainResource = loadByForeignKey(DomainResource.class, domain, now);
|
||||
checkArgumentNotNull(domainResource, "Domain '%s' does not exist", domain);
|
||||
Optional<DomainResource> domainOptional =
|
||||
loadByForeignKey(DomainResource.class, domain, now);
|
||||
checkArgumentPresent(domainOptional, "Domain '%s' does not exist or is deleted", domain);
|
||||
DomainResource domainResource = domainOptional.get();
|
||||
checkArgument(
|
||||
!domainResource.getStatusValues().contains(SERVER_UPDATE_PROHIBITED),
|
||||
"The domain '%s' has status SERVER_UPDATE_PROHIBITED. Verify that you are allowed "
|
||||
|
|
|
@ -84,11 +84,16 @@ final class UpdateSmdCommand implements CommandWithRemoteApi {
|
|||
DateTime now = ofy().getTransactionTime();
|
||||
|
||||
// Load the domain application.
|
||||
DomainApplication domainApplication = loadDomainApplication(applicationId, now);
|
||||
checkArgument(domainApplication != null, "Domain application does not exist");
|
||||
DomainApplication domainApplication =
|
||||
loadDomainApplication(applicationId, now)
|
||||
.orElseThrow(
|
||||
() ->
|
||||
new IllegalArgumentException(
|
||||
"Domain application does not exist or is deleted"));
|
||||
|
||||
// Make sure this is a sunrise application.
|
||||
checkArgument(!domainApplication.getEncodedSignedMarks().isEmpty(),
|
||||
checkArgument(
|
||||
!domainApplication.getEncodedSignedMarks().isEmpty(),
|
||||
"Can't update SMD on a landrush application.");
|
||||
|
||||
// Verify the new SMD.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue