Class SimpleDeprecatedConfigWarner
-
- All Implemented Interfaces:
@Component()@ConditionalOnProperty(name = {"embabel.agent.platform.migration.warnings.enabled"}, havingValue = "true", matchIfMissing = true) public final class SimpleDeprecatedConfigWarnerSimple 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSimpleDeprecatedConfigWarner.DeprecationInfoData class for storing deprecation information.
public enumSimpleDeprecatedConfigWarner.DeprecationTypeCategories of deprecation types.
public final classSimpleDeprecatedConfigWarner.DeprecationCategoriesOrganized deprecation information by category.
-
Constructor Summary
Constructors Constructor Description SimpleDeprecatedConfigWarner(Environment environment, DeprecatedPropertyWarningConfig warningConfig)
-
Method Summary
Modifier and Type Method Description final UnitwarnDeprecatedProperty(String deprecatedProperty, String recommendedProperty, String deprecationReason)Issue a warning for deprecated property usage. final UnitwarnDeprecatedProfile(String deprecatedProfile, String recommendedProperty, String deprecationReason)Issue a warning for deprecated profile usage. final UnitwarnDeprecatedConfigurationProperties(String className, String annotationDetails, String recommendedApproach)Issue a warning for deprecated @ConfigurationProperties prefix usage. final UnitwarnDeprecatedConditional(String className, String annotationDetails, String recommendedApproach)Issue a warning for deprecated conditional annotation usage. final UnitlogAggregatedSummary()Log an aggregated summary of all deprecated configuration usage. final SimpleDeprecatedConfigWarner.DeprecationCategoriesgetDeprecationCategories()Get categorized deprecation information for analysis or reporting. final IntegergetWarningCount()Get the count of unique deprecated warnings issued. final Set<String>getWarnedItems()Get the list of deprecated properties/profiles that have been warned about. final UnitclearWarnings()Clear all warning tracking (mainly for testing purposes). -
-
Constructor Detail
-
SimpleDeprecatedConfigWarner
SimpleDeprecatedConfigWarner(Environment environment, DeprecatedPropertyWarningConfig warningConfig)
-
-
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 namerecommendedProperty- The recommended replacement propertydeprecationReason- 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 namerecommendedProperty- The recommended replacement propertydeprecationReason- 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 annotationannotationDetails- Details about the deprecated @ConfigurationProperties annotationrecommendedApproach- 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 annotationannotationDetails- Details about the deprecated annotationrecommendedApproach- 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.
-
getDeprecationCategories
final SimpleDeprecatedConfigWarner.DeprecationCategories getDeprecationCategories()
Get categorized deprecation information for analysis or reporting.
-
getWarningCount
final Integer getWarningCount()
Get the count of unique deprecated warnings issued.
-
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).
-
-
-
-