All Downloads are FREE. Search and download functionalities are using the official Maven repository.

au.net.causal.maven.plugins.boxdb.db.BaseMySqlFactory Maven / Gradle / Ivy

There is a newer version: 3.3
Show newest version
package au.net.causal.maven.plugins.boxdb.db;

/**
 * Base factory for MySQL and MariaDB databases, since they have many things in common.
 */
public abstract class BaseMySqlFactory extends DockerDatabaseFactory
{
    protected BaseMySqlFactory(String name)
    {
        super(name);
    }

    @Override
    protected void initializeDefaults(BoxConfiguration boxConfiguration)
    {
        if (boxConfiguration.getDatabaseUser() == null)
            boxConfiguration.setDatabaseUser("app");
        if (boxConfiguration.getDatabasePassword() == null)
            boxConfiguration.setDatabasePassword(boxConfiguration.getDatabaseUser());
        if (boxConfiguration.getAdminUser() == null)
            boxConfiguration.setAdminUser("root");
        if (boxConfiguration.getAdminPassword() == null)
            boxConfiguration.setAdminPassword("mysqlbox");
        if (boxConfiguration.getDatabaseName() == null)
            boxConfiguration.setDatabaseName("app");
        if (boxConfiguration.getDatabasePort() <= 0)
            boxConfiguration.setDatabasePort(3307);

        super.initializeDefaults(boxConfiguration);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy