Class DatabaseStructureHealthProperties

java.lang.Object
io.github.mfvanek.pg.spring.DatabaseStructureHealthProperties

@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 Details

    • STANDARD_DATASOURCE_BEAN_NAME

      public static final String STANDARD_DATASOURCE_BEAN_NAME
      The standard name of the primary DataSource bean.

      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

      public static final String 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 new DatabaseStructureHealthProperties instance 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 - if datasourceBeanName or datasourceUrlPropertyName is blank
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Checks if the autoconfiguration is enabled.
      Returns:
      true if the starter is enabled; false otherwise
    • getDatasourceBeanName

      public String getDatasourceBeanName()
      Retrieves the name of the datasource bean to be used.
      Returns:
      the name of the datasource bean (default: "dataSource")
    • getDatasourceUrlPropertyName

      public String getDatasourceUrlPropertyName()
      Retrieves the name of the datasource URL property.
      Returns:
      the name of the datasource URL property (default: "spring.datasource.url")
    • toString

      public String toString()
      Overrides:
      toString in class Object