diff --git a/core/src/main/java/google/registry/model/tmch/ClaimsListShard.java b/core/src/main/java/google/registry/model/tmch/ClaimsListShard.java index 3a3b3a790..f33072f23 100644 --- a/core/src/main/java/google/registry/model/tmch/ClaimsListShard.java +++ b/core/src/main/java/google/registry/model/tmch/ClaimsListShard.java @@ -156,7 +156,7 @@ public class ClaimsListShard extends ImmutableObject { try { loadAndCompareCloudSqlList(datastoreList); } catch (Throwable t) { - logger.atSevere().withCause(t).log("Error comparing reserved lists."); + logger.atSevere().withCause(t).log("Error comparing claims lists."); } return datastoreList; }; diff --git a/core/src/main/java/google/registry/tools/CommandWithCloudSql.java b/core/src/main/java/google/registry/tools/CommandWithCloudSql.java deleted file mode 100644 index c04f633e1..000000000 --- a/core/src/main/java/google/registry/tools/CommandWithCloudSql.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2019 The Nomulus Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package google.registry.tools; - -/** - * Marker interface for commands that use Cloud Sql. - * - *
Just implementing this is sufficient to use Cloud Sql; {@link RegistryTool} will install it as
- * needed.
- */
-interface CommandWithCloudSql extends CommandWithRemoteApi {}
diff --git a/core/src/main/java/google/registry/tools/LockOrUnlockDomainCommand.java b/core/src/main/java/google/registry/tools/LockOrUnlockDomainCommand.java
index 43b59b5f6..d66173cab 100644
--- a/core/src/main/java/google/registry/tools/LockOrUnlockDomainCommand.java
+++ b/core/src/main/java/google/registry/tools/LockOrUnlockDomainCommand.java
@@ -34,7 +34,7 @@ import javax.inject.Inject;
/** Shared base class for commands to registry lock or unlock a domain via EPP. */
public abstract class LockOrUnlockDomainCommand extends ConfirmingCommand
- implements CommandWithCloudSql {
+ implements CommandWithRemoteApi {
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
diff --git a/core/src/main/java/google/registry/tools/RegistryCli.java b/core/src/main/java/google/registry/tools/RegistryCli.java
index 4fb7ede2f..0a3542f2e 100644
--- a/core/src/main/java/google/registry/tools/RegistryCli.java
+++ b/core/src/main/java/google/registry/tools/RegistryCli.java
@@ -212,8 +212,6 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
}
// CommandWithRemoteApis need to have the remote api installed to work.
- // CommandWithCloudSql extends CommandWithRemoteApi so the command will also get the remote
- // api installed. This is because the DB password is stored in Datastore.
if (command instanceof CommandWithRemoteApi) {
if (installer == null) {
installer = new RemoteApiInstaller();
@@ -235,9 +233,10 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
// Make sure we start the command with a clean cache, so that any previous command won't
// interfere with this one.
ofy().clearSessionCache();
- }
- if (command instanceof CommandWithCloudSql) {
+ // Enable Cloud SQL for command that needs remote API as they will very likely use
+ // Cloud SQL after the database migration. Note that the DB password is stored in Datastore
+ // and it is already initialized above.
RegistryToolEnvironment.get().enableJpaTm();
}
diff --git a/core/src/main/java/google/registry/tools/UpdateCursorsCommand.java b/core/src/main/java/google/registry/tools/UpdateCursorsCommand.java
index 4507587c2..2d49f7607 100644
--- a/core/src/main/java/google/registry/tools/UpdateCursorsCommand.java
+++ b/core/src/main/java/google/registry/tools/UpdateCursorsCommand.java
@@ -29,7 +29,7 @@ import org.joda.time.DateTime;
/** Modifies {@link Cursor} timestamps used by locking rolling cursor tasks, like in RDE. */
@Parameters(separators = " =", commandDescription = "Modifies cursor timestamps used by LRC tasks")
-final class UpdateCursorsCommand extends ConfirmingCommand implements CommandWithCloudSql {
+final class UpdateCursorsCommand extends ConfirmingCommand implements CommandWithRemoteApi {
@Parameter(description = "TLDs on which to operate. Omit for global cursors.")
private List