Class SimpleDeprecatedConfigWarner

  • All Implemented Interfaces:

    @Component()@ConditionalOnProperty(name = {"embabel.agent.platform.migration.warnings.enabled"}, havingValue = "true", matchIfMissing = true) 
    public final class SimpleDeprecatedConfigWarner
    
                        

    Simple implementation for warning about deprecated configuration usage.

    Provides centralized logging and tracking of deprecated configuration warnings during the migration period, including properties, profiles, and conditional annotations. Warnings are rate-limited to prevent log spam and can be aggregated for overview.

    • Method Detail

      • warnDeprecatedProperty

         final Unit warnDeprecatedProperty(String deprecatedProperty, String recommendedProperty, String deprecationReason)

        Issue a warning for deprecated property usage. Each unique property is warned about only once per application lifecycle.

        Parameters:
        deprecatedProperty - The deprecated property name
        recommendedProperty - The recommended replacement property
        deprecationReason - Optional reason for deprecation
      • warnDeprecatedProfile

         final Unit warnDeprecatedProfile(String deprecatedProfile, String recommendedProperty, String deprecationReason)

        Issue a warning for deprecated profile usage. Each unique profile is warned about only once per application lifecycle.

        Parameters:
        deprecatedProfile - The deprecated profile name
        recommendedProperty - The recommended replacement property
        deprecationReason - Optional reason for deprecation
      • warnDeprecatedConfigurationProperties

         final Unit warnDeprecatedConfigurationProperties(String className, String annotationDetails, String recommendedApproach)

        Issue a warning for deprecated @ConfigurationProperties prefix usage.

        Parameters:
        className - The class containing the deprecated annotation
        annotationDetails - Details about the deprecated @ConfigurationProperties annotation
        recommendedApproach - The recommended replacement approach
      • warnDeprecatedConditional

         final Unit warnDeprecatedConditional(String className, String annotationDetails, String recommendedApproach)

        Issue a warning for deprecated conditional annotation usage.

        Parameters:
        className - The class containing the deprecated annotation
        annotationDetails - Details about the deprecated annotation
        recommendedApproach - The recommended replacement approach
      • logAggregatedSummary

         final Unit logAggregatedSummary()

        Log an aggregated summary of all deprecated configuration usage. Provides a high-level overview with migration details for better user experience.

      • getWarnedItems

         final Set<String> getWarnedItems()

        Get the list of deprecated properties/profiles that have been warned about.

      • clearWarnings

         final Unit clearWarnings()

        Clear all warning tracking (mainly for testing purposes).