Class SchemaManager


  • public class SchemaManager
    extends Object
    Manages database schemas for Openfire and Openfire plugins. The manager uses the ofVersion database table to figure out which database schema is currently installed and then attempts to automatically apply database schema changes as necessary.

    Running database schemas automatically requires appropriate database permissions. Without those permissions, the automatic installation/upgrade process will fail and users will be prompted to apply database changes manually.

    Author:
    Matt Tucker
    See Also:
    DbConnectionManager.getSchemaManager()
    • Constructor Detail

      • SchemaManager

        public SchemaManager()
    • Method Detail

      • checkOpenfireSchema

        public boolean checkOpenfireSchema​(Connection con)
        Checks the Openfire database schema to ensure that it's installed and up to date. If the schema isn't present or up to date, an automatic update will be attempted.
        Parameters:
        con - a connection to the database.
        Returns:
        true if database schema checked out fine, or was automatically installed or updated successfully.
      • checkPluginSchema

        public boolean checkPluginSchema​(Plugin plugin)
        Checks the plugin's database schema (if one is required) to ensure that it's installed and up to date. If the schema isn't present or up to date, an automatic update will be attempted.
        Parameters:
        plugin - the plugin.
        Returns:
        true if database schema checked out fine, or was automatically installed or updated successfully, or if it isn't needed. False will only be returned if there is an error.