Class RegistrarPocBase

java.lang.Object
google.registry.model.ImmutableObject
google.registry.model.registrar.RegistrarPocBase
All Implemented Interfaces:
Jsonifiable, UnsafeSerializable, Serializable, Cloneable
Direct Known Subclasses:
RegistrarPoc

@Embeddable @MappedSuperclass public class RegistrarPocBase extends ImmutableObject implements Jsonifiable, UnsafeSerializable
A contact for a Registrar. Note, equality, hashCode and comparable have been overridden to only enable key equality.

IMPORTANT NOTE: Any time that you change, update, or delete RegistrarContact entities, you *MUST* also modify the persisted Registrar entity with RegistrarBase.contactsRequireSyncing set to true.

This class deliberately does not include an Id so that any foreign-keyed fields can refer to the proper parent entity's ID, whether we're storing this in the DB itself or as part of another entity.

See Also:
  • Field Details

    • registrarId

      @Expose public String registrarId
  • Constructor Details

    • RegistrarPocBase

      public RegistrarPocBase()
  • Method Details

    • updateContacts

      public static void updateContacts(Registrar registrar, com.google.common.collect.ImmutableSet<RegistrarPoc> contacts)
      Helper to update the contacts associated with a Registrar. This requires querying for the existing contacts, deleting existing contacts that are not part of the given contacts set, and then saving the given contacts.

      IMPORTANT NOTE: If you call this method then it is your responsibility to also persist the relevant Registrar entity with the RegistrarBase.contactsRequireSyncing field set to true.

    • getName

      public String getName()
    • getEmailAddress

      public String getEmailAddress()
    • getRegistryLockEmailAddress

      public Optional<String> getRegistryLockEmailAddress()
    • getPhoneNumber

      public String getPhoneNumber()
    • getFaxNumber

      public String getFaxNumber()
    • getTypes

      public com.google.common.collect.ImmutableSortedSet<RegistrarPocBase.Type> getTypes()
    • getVisibleInWhoisAsAdmin

      public boolean getVisibleInWhoisAsAdmin()
    • getVisibleInWhoisAsTech

      public boolean getVisibleInWhoisAsTech()
    • getVisibleInDomainWhoisAsAbuse

      public boolean getVisibleInDomainWhoisAsAbuse()
    • asBuilder

      public RegistrarPocBase.Builder<? extends RegistrarPocBase,?> asBuilder()
    • isAllowedToSetRegistryLockPassword

      public boolean isAllowedToSetRegistryLockPassword()
    • isRegistryLockAllowed

      public boolean isRegistryLockAllowed()
    • verifyRegistryLockPassword

      public boolean verifyRegistryLockPassword(String registryLockPassword)
    • toStringMultilinePlainText

      public String toStringMultilinePlainText()
      Returns a string representation that's human friendly.

      The output will look something like this:

      
       Some Person
       person@example.com
       Tel: +1.2125650666
       Types: [ADMIN, WHOIS]
       Visible in WHOIS as Admin contact: Yes
       Visible in WHOIS as Technical contact: No
       Registrar-Console access: Yes
       Login Email Address: person@registry.example
       
    • toJsonMap

      public Map<String,Object> toJsonMap()
      Description copied from interface: Jsonifiable
      Returns a JSON representation of this object.

      The returned value must not return sensitive fields, so that it may be safe to return to the client via an API response.

      Specified by:
      toJsonMap in interface Jsonifiable
    • setEmailAddress

      public void setEmailAddress(String emailAddress)
      These methods set the email address and registrar ID

      This should only be used for restoring the fields of an object being loaded in a PostLoad method (effectively, when it is still under construction by Hibernate). In all other cases, the object should be regarded as immutable and changes should go through a Builder.

      In addition to this special case use, this method must exist to satisfy Hibernate.

    • setRegistrarId

      public void setRegistrarId(String registrarId)