From c8d655e416f3060ba217aed47c2814bf3d5c726e Mon Sep 17 00:00:00 2001 From: mcilwain Date: Fri, 18 Mar 2016 08:33:55 -0700 Subject: [PATCH] Add ability to manually trigger contact group syncs ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117549773 --- .../registry/tools/CreateOrUpdateRegistrarCommand.java | 10 ++++++++++ .../registry/tools/UpdateRegistrarCommandTest.java | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/java/com/google/domain/registry/tools/CreateOrUpdateRegistrarCommand.java b/java/com/google/domain/registry/tools/CreateOrUpdateRegistrarCommand.java index a127c8b3b..57aa161ef 100644 --- a/java/com/google/domain/registry/tools/CreateOrUpdateRegistrarCommand.java +++ b/java/com/google/domain/registry/tools/CreateOrUpdateRegistrarCommand.java @@ -217,6 +217,13 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand { arity = 1) private Boolean blockPremiumNames; + @Nullable + @Parameter( + names = "--sync_groups", + description = "Whether this registrar's groups should be updated at the next scheduled sync", + arity = 1) + private Boolean contactsRequireSyncing; + @Nullable @Parameter( names = "--drive_id", @@ -361,6 +368,9 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand { if (blockPremiumNames != null) { builder.setBlockPremiumNames(blockPremiumNames); } + if (contactsRequireSyncing != null) { + builder.setContactsRequireSyncing(contactsRequireSyncing); + } // When creating a new REAL registrar or changing the type to REAL, a passcode is required. // Leave existing REAL registrars alone. if (Registrar.Type.REAL.equals(registrarType) diff --git a/javatests/com/google/domain/registry/tools/UpdateRegistrarCommandTest.java b/javatests/com/google/domain/registry/tools/UpdateRegistrarCommandTest.java index 22c0a1a32..20aeb8166 100644 --- a/javatests/com/google/domain/registry/tools/UpdateRegistrarCommandTest.java +++ b/javatests/com/google/domain/registry/tools/UpdateRegistrarCommandTest.java @@ -17,6 +17,7 @@ package com.google.domain.registry.tools; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Strings.isNullOrEmpty; import static com.google.common.truth.Truth.assertThat; +import static com.google.domain.registry.model.registrar.Registrar.loadByClientId; import static com.google.domain.registry.testing.CertificateSamples.SAMPLE_CERT; import static com.google.domain.registry.testing.CertificateSamples.SAMPLE_CERT_HASH; import static com.google.domain.registry.testing.DatastoreHelper.createTlds; @@ -416,6 +417,15 @@ public class UpdateRegistrarCommandTest extends CommandTestCase