Package com.atlassian.crowd.config
Class EnvironmentDrivenDatabaseConfigurationListener
java.lang.Object
com.atlassian.crowd.config.EnvironmentDrivenDatabaseConfigurationListener
- All Implemented Interfaces:
DatabaseConfigurationListener
public class EnvironmentDrivenDatabaseConfigurationListener
extends Object
implements DatabaseConfigurationListener
Replaces the database configuration with the one specified in environment properties if a complete database configuration
is provided as environmental variables.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
boolean
void
updateApplicationConfig
(com.atlassian.config.ApplicationConfiguration applicationConfig) Handles database configuration stored inApplicationConfiguration
, should be called after the configuration is loaded, but before it's used by the application.void
updateDatabaseDetails
(com.atlassian.config.db.DatabaseDetails databaseDetails) Handles database configuration stored inDatabaseDetails
, passed after completing database setup.boolean
-
Field Details
-
JDBC_URL_PROPERTY
- See Also:
-
JDBC_USER_PROPERTY
- See Also:
-
JDBC_PASSWORD_PROPERTY
- See Also:
-
JDBC_DRIVER_PROPERTY
- See Also:
-
JDBC_DIALECT_PROPERTY
- See Also:
-
HIBERNATE_POOL_SIZE
- See Also:
-
DEFAULT_POOL_SIZE
public static final int DEFAULT_POOL_SIZE- See Also:
-
-
Constructor Details
-
EnvironmentDrivenDatabaseConfigurationListener
public EnvironmentDrivenDatabaseConfigurationListener()
-
-
Method Details
-
updateApplicationConfig
public void updateApplicationConfig(com.atlassian.config.ApplicationConfiguration applicationConfig) Description copied from interface:DatabaseConfigurationListener
Handles database configuration stored inApplicationConfiguration
, should be called after the configuration is loaded, but before it's used by the application.- Specified by:
updateApplicationConfig
in interfaceDatabaseConfigurationListener
- Parameters:
applicationConfig
- the freshly loaded application configuration
-
updateDatabaseDetails
public void updateDatabaseDetails(com.atlassian.config.db.DatabaseDetails databaseDetails) Description copied from interface:DatabaseConfigurationListener
Handles database configuration stored inDatabaseDetails
, passed after completing database setup.- Specified by:
updateDatabaseDetails
in interfaceDatabaseConfigurationListener
- Parameters:
databaseDetails
- the details used to complete database setup
-
willOverrideDatabaseDetails
public boolean willOverrideDatabaseDetails()- Specified by:
willOverrideDatabaseDetails
in interfaceDatabaseConfigurationListener
- Returns:
- true if the listener will override the default settings in the
DatabaseDetails
.
-
isConfigurationValid
public boolean isConfigurationValid() -
isPoolSizeConfigurationValid
public boolean isPoolSizeConfigurationValid() -
getValidPoolSize
public int getValidPoolSize()
-