java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.PlatformFactory

public class PlatformFactory extends Object
A factory of org.apache.ddlutils.Platform instances based on a case insensitive database name. Note that this is a convenience class as the platforms can also simply be created via their constructors.
Version:
$Revision: 209952 $
  • Constructor Details

    • PlatformFactory

      public PlatformFactory()
  • Method Details

    • createNewPlatformInstance

      public static Platform createNewPlatformInstance(String databaseName) throws DdlUtilsException
      Creates a new platform for the given (case insensitive) database name or returns null if the database is not recognized.
      Parameters:
      databaseName - The name of the database (case is not important)
      Returns:
      The platform or null if the database is not supported
      Throws:
      DdlUtilsException
    • createNewPlatformInstance

      public static Platform createNewPlatformInstance(String jdbcDriver, String jdbcConnectionUrl) throws DdlUtilsException
      Creates a new platform for the specified database. This is a shortcut method that uses PlatformUtils.determineDatabaseType(String, String) to determine the parameter for createNewPlatformInstance(String). Note that no database connection is established when using this method.
      Parameters:
      jdbcDriver - The jdbc driver
      jdbcConnectionUrl - The connection url
      Returns:
      The platform or null if the database is not supported
      Throws:
      DdlUtilsException
    • createNewPlatformInstance

      public static Platform createNewPlatformInstance(DataSource dataSource) throws DdlUtilsException
      Creates a new platform for the specified database. This is a shortcut method that uses PlatformUtils.determineDatabaseType(DataSource) to determine the parameter for createNewPlatformInstance(String). Note that this method sets the data source at the returned platform instance (method Platform.setDataSource(DataSource)).
      Parameters:
      dataSource - The data source for the database
      Returns:
      The platform or null if the database is not supported
      Throws:
      DdlUtilsException
    • createNewPlatformInstance

      public static Platform createNewPlatformInstance(DataSource dataSource, String username, String password) throws DdlUtilsException
      Creates a new platform for the specified database. This is a shortcut method that uses PlatformUtils.determineDatabaseType(DataSource) to determine the parameter for createNewPlatformInstance(String). Note that this method sets the data source at the returned platform instance (method Platform.setDataSource(DataSource)).
      Parameters:
      dataSource - The data source for the database
      username - The user name to use for connecting to the database
      password - The password to use for connecting to the database
      Returns:
      The platform or null if the database is not supported
      Throws:
      DdlUtilsException
    • getSupportedPlatforms

      public static String[] getSupportedPlatforms()
      Returns a list of all supported platforms.
      Returns:
      The names of the currently registered platforms
    • isPlatformSupported

      public static boolean isPlatformSupported(String platformName)
      Determines whether the indicated platform is supported.
      Parameters:
      platformName - The name of the platform
      Returns:
      true if the platform is supported
    • registerPlatform

      public static void registerPlatform(String platformName, Class platformClass)
      Registers a new platform.
      Parameters:
      platformName - The platform name
      platformClass - The platform class which must implement the Platform interface