Class EmailAddressForm

java.lang.Object
com.iizix.user.EmailAddressForm

public final class EmailAddressForm extends Object
The form of an e-mail address the server and the SignIn module accept (CC-ACCOUNT-EMAIL-PASSWORD): one "@" with something before it, a domain with a dot after it, no whitespace, at most MAXIMUM_LENGTH characters - the check the SignIn module's sign-up has made since L-10a, in one place for every caller that takes an address (the sign-up, the change of address, ServerAdmin's Edit user). Only the form: the verification mail proves the address, and a list of top-level domains would refuse the reserved and the new ones.
Author:
Christopher Mindus
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The most characters an address may have: the size of the column IZS.USERS.email.
    static final String
    The domain of the e-mail address a server's database gives its administrator when the server is installed (createBaseTables.sql: default@iizi.server.administrator): "iizi.server.administrator".
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Checks if an address is a real one a mail can reach: well formed (isWellFormed(String)) and not in the seeded domain (isSeededEmail(String)).
    static boolean
    Checks if an address is in the domain a server's database was created with (SEEDED_DOMAIN, or a subdomain of it), compared without regard to case: the placeholder of the administrator the server was installed with.
    static boolean
    Checks the form of an address.
    static String
    masked(String email)
    Masks an address for a log line: the first character of the local part, three asterisks and the domain (c***@example.com); a string without "@" is masked whole.
  • Field Details

    • MAXIMUM_LENGTH

      public static final int MAXIMUM_LENGTH
      The most characters an address may have: the size of the column IZS.USERS.email.
      See Also:
    • SEEDED_DOMAIN

      public static final String SEEDED_DOMAIN
      The domain of the e-mail address a server's database gives its administrator when the server is installed (createBaseTables.sql: default@iizi.server.administrator): "iizi.server.administrator". No mailbox is there: a mail to it is undeliverable (MDV-D-34).
      See Also:
  • Method Details

    • isWellFormed

      public static boolean isWellFormed(String email)
      Checks the form of an address.
      Parameters:
      email - The address, as typed; null and blank are not addresses.
      Returns:
      true when it has the form of an address and is at most MAXIMUM_LENGTH characters long.
    • masked

      public static String masked(String email)
      Masks an address for a log line: the first character of the local part, three asterisks and the domain (c***@example.com); a string without "@" is masked whole. The log of a server never carries a full address of a user (CC-ACCOUNT-EMAIL-PASSWORD, AE-5).
      Parameters:
      email - The address, null for none.
      Returns:
      The masked address, "-" for null or empty.
    • isSeededEmail

      public static boolean isSeededEmail(String email)
      Checks if an address is in the domain a server's database was created with (SEEDED_DOMAIN, or a subdomain of it), compared without regard to case: the placeholder of the administrator the server was installed with.
      Parameters:
      email - The address, null for none.
      Returns:
      true for an address in that domain, false otherwise and for none.
    • isRealEmail

      public static boolean isRealEmail(String email)
      Checks if an address is a real one a mail can reach: well formed (isWellFormed(String)) and not in the seeded domain (isSeededEmail(String)).
      Parameters:
      email - The address as typed, null for none.
      Returns:
      true for a real address.