java.lang.Object
java.lang.Enum<Server.Version>
com.aoindustries.aoserv.client.mysql.Server.Version
All Implemented Interfaces:
Serializable, Comparable<Server.Version>
Enclosing class:
Server

public static enum Server.Version extends Enum<Server.Version>
The supported versions of MySQL in series order.
  • Enum Constant Details

  • Field Details

    • PREFERRED_VERSIONS

      public static final List<Server.Version> PREFERRED_VERSIONS
      Gets the versions of MySQL in order of preference. Index 0 is the most preferred.
  • Method Details

    • values

      public static Server.Version[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Server.Version valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • parse

      public static Server.Version parse(String versionString) throws IllegalArgumentException
      Gets the version matching the given X.Y.* version string.
      Throws:
      IllegalArgumentException - when no matching version found. Selected this exception type for consistency with valueOf(java.lang.String).
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Server.Version>
    • matches

      public boolean matches(String versionString)
      Checks whether this version matches the given X.Y.* version string.
    • isAtLeast

      public boolean isAtLeast(Server.Version other)
    • isAtMost

      public boolean isAtMost(Server.Version other)
    • isBefore

      public boolean isBefore(Server.Version other)
    • isAfter

      public boolean isAfter(Server.Version other)
    • getUserPermissions

      public Set<Permission> getUserPermissions()
      Gets an unmodifiable set of the user permissions for this MySQL version.
      See Also:
    • getDatabaseUserPermissions

      public Set<Permission> getDatabaseUserPermissions()
      Gets an unmodifiable set of the database-user permissions for this MySQL version.
      See Also:
    • hasMaxUserConnections

      public boolean hasMaxUserConnections()
      Max user connections (as found in user.max_user_connections) is present in MySQL 5.0 and above.
    • hasAccountLocked

      public boolean hasAccountLocked()
      Account locking (as found in user.account_locked) is present in MySQL 5.7 and above.
    • supportsDirectGrantTableUpdates

      public boolean supportsDirectGrantTableUpdates()
      Should MySQL permissions be maintained by direct updates to the user and db grant tables?
      Returns:
      true for older MySQL versions or false for where platform now uses GRANT and REVOKE.
    • getSystemDatabases

      public Set<Database.Name> getSystemDatabases()
      Gets the system databases that exist for this MySQL version.
    • getSystemDatabaseUsers

      public Set<Tuple2<Database.Name,User.Name>> getSystemDatabaseUsers()
      Gets the system database users that exist for this MySQL version.
    • isAlwaysLocked

      public boolean isAlwaysLocked(User.Name user)
      Is the given user always locked in this version?