Package io.github.mfvanek.pg.spring
Class DatabaseStructureHealthProperties
java.lang.Object
io.github.mfvanek.pg.spring.DatabaseStructureHealthProperties
@ConstructorBinding
@ConfigurationProperties(prefix="pg.index.health.test")
public class DatabaseStructureHealthProperties
extends Object
Represents properties for managing pg-index-health-test-starter configuration.
- Since:
- 2021.08.29
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe standard name of the primaryDataSourcebean.static final StringThe standard property name for the datasource URL in Spring configuration. -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseStructureHealthProperties(boolean enabled, String datasourceBeanName, String datasourceUrlPropertyName) Constructs a newDatabaseStructureHealthPropertiesinstance with the specified values. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the name of the datasource bean to be used.Retrieves the name of the datasource URL property.booleanChecks if the autoconfiguration is enabled.toString()
-
Field Details
-
STANDARD_DATASOURCE_BEAN_NAME
The standard name of the primaryDataSourcebean.This constant is used as the default name when no custom datasource bean name is specified in the configuration.
- See Also:
-
STANDARD_DATASOURCE_URL_PROPERTY_NAME
The standard property name for the datasource URL in Spring configuration.This constant is used as the default key for retrieving the datasource URL from the
Environment.- See Also:
-
-
Constructor Details
-
DatabaseStructureHealthProperties
public DatabaseStructureHealthProperties(@DefaultValue("true") boolean enabled, @DefaultValue("dataSource") String datasourceBeanName, @DefaultValue("spring.datasource.url") String datasourceUrlPropertyName) Constructs a newDatabaseStructureHealthPropertiesinstance with the specified values.- Parameters:
enabled- whether the autoconfiguration is enabled (default:true)datasourceBeanName- the name of the datasource bean (default:"dataSource", must not be blank)datasourceUrlPropertyName- the name of the datasource URL property (default:"spring.datasource.url", must not be blank)- Throws:
IllegalArgumentException- ifdatasourceBeanNameordatasourceUrlPropertyNameis blank
-
-
Method Details
-
isEnabled
public boolean isEnabled()Checks if the autoconfiguration is enabled.- Returns:
trueif the starter is enabled;falseotherwise
-
getDatasourceBeanName
Retrieves the name of the datasource bean to be used.- Returns:
- the name of the datasource bean (default:
"dataSource")
-
getDatasourceUrlPropertyName
Retrieves the name of the datasource URL property.- Returns:
- the name of the datasource URL property (default:
"spring.datasource.url")
-
toString
-