Class SentinelPropertyValidator

java.lang.Object
ubic.gemma.core.config.SentinelPropertyValidator
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean

@Component @Profile({"production","dev"}) public class SentinelPropertyValidator extends Object implements org.springframework.beans.factory.InitializingBean
Fail-fast startup hook for unresolved sentinel (XXXXXX) placeholder values shipped by default.properties. Container deployers who forget to set, e.g., GEMMA_DB_PASSWORD would otherwise see Spring's @Value resolution substitute the literal XXXXXX into the JDBC URL / security tokens, and the failure would surface deep into the runtime as a confusing MySQL "Access denied" or auth error.

This validator runs in InitializingBean.afterPropertiesSet() (after the Environment has merged environment-variable overrides, system properties, and on-disk Gemma.properties), walks a hardcoded list of keys that ship with XXXXXX-class placeholders, and throws IllegalStateException naming each unresolved key plus the matching GEMMA_* environment variable the deployer should set.

Active only under EnvironmentProfiles.PRODUCTION and EnvironmentProfiles.DEV — tests run under EnvironmentProfiles.TEST where the sentinel values are tolerated (the keys are either unused or used only for internal token equality checks).

Bypass via gemma.sentinels.ignore=true if a deployer has a justified reason to keep a sentinel value (e.g. a future-deployment placeholder during staging). Off by default.

See Also:
  • Constructor Details

    • SentinelPropertyValidator

      public SentinelPropertyValidator(@Qualifier("settingsPropertySources") org.springframework.core.env.PropertySources propertySources)
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean