diff --git a/java/google/registry/model/registrar/Registrar.java b/java/google/registry/model/registrar/Registrar.java index 4e3c46ed9..073e80302 100644 --- a/java/google/registry/model/registrar/Registrar.java +++ b/java/google/registry/model/registrar/Registrar.java @@ -21,7 +21,6 @@ import static com.google.common.base.Predicates.equalTo; import static com.google.common.base.Predicates.in; import static com.google.common.base.Predicates.notNull; import static com.google.common.base.Strings.emptyToNull; -import static com.google.common.base.Strings.isNullOrEmpty; import static com.google.common.base.Strings.nullToEmpty; import static com.google.common.collect.Sets.immutableEnumSet; import static com.google.common.io.BaseEncoding.base64; @@ -162,10 +161,6 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable private static final RegistryEnvironment ENVIRONMENT = RegistryEnvironment.get(); - /** Reports the type of data on file re: registrar certificates (full cert, hash only, none). */ - // Note: May be unnecessary, pending a conversation on how to best report on this data. - public enum CertificateState { NONE, CERTIFICATE_HASH, CERTIFICATE } - /** Regex for E.164 phone number format specified by {@code contact.xsd}. */ private static final Pattern E164_PATTERN = Pattern.compile("\\+[0-9]{1,3}\\.[0-9]{1,14}"); @@ -407,16 +402,6 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable return ACTIVE_STATES.contains(state) && PUBLICLY_VISIBLE_TYPES.contains(type); } - public CertificateState getCertificateState() { - if (!isNullOrEmpty(clientCertificate)) { - return CertificateState.CERTIFICATE; - } else if (!isNullOrEmpty(clientCertificateHash)) { - return CertificateState.CERTIFICATE_HASH; - } else { - return CertificateState.NONE; - } - } - public String getClientCertificate() { return clientCertificate; } diff --git a/javatests/google/registry/model/registrar/RegistrarTest.java b/javatests/google/registry/model/registrar/RegistrarTest.java index e48745f91..ba2300d57 100644 --- a/javatests/google/registry/model/registrar/RegistrarTest.java +++ b/javatests/google/registry/model/registrar/RegistrarTest.java @@ -30,7 +30,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import google.registry.model.EntityTestCase; import google.registry.model.common.EntityGroupRoot; -import google.registry.model.registrar.Registrar.CertificateState; import google.registry.model.registrar.Registrar.State; import google.registry.model.registrar.Registrar.Type; import google.registry.testing.ExceptionRule; @@ -217,20 +216,6 @@ public class RegistrarTest extends EntityTestCase { assertThat(registrar.getFailoverClientCertificateHash()).isNull(); } - @Test - public void testSuccess_certificateStates() throws Exception { - // Initialized registrar should have the full certificate. - assertThat(registrar.getCertificateState()).isEqualTo(CertificateState.CERTIFICATE); - - // Setting a null certificate will also reset the hash. - registrar = registrar.asBuilder().setClientCertificate(null, clock.nowUtc()).build(); - assertThat(registrar.getCertificateState()).isEqualTo(CertificateState.NONE); - - // Set client certificate hash explicitly. - registrar = registrar.asBuilder().setClientCertificateHash(SAMPLE_CERT_HASH).build(); - assertThat(registrar.getCertificateState()).isEqualTo(CertificateState.CERTIFICATE_HASH); - } - @Test public void testSuccess_clearingIanaAndBillingIds() throws Exception { registrar.asBuilder()