Package com.azure.spring.cloud.config
Class AppConfigurationRefresh
java.lang.Object
com.azure.spring.cloud.config.AppConfigurationRefresh
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationEventPublisherAware
@Component
public class AppConfigurationRefresh
extends Object
implements org.springframework.context.ApplicationEventPublisherAware
Enables checking of Configuration updates.
-
Constructor Summary
ConstructorDescriptionAppConfigurationRefresh
(AppConfigurationProperties properties, AppConfigurationProviderProperties appProperties, ClientStore clientStore) Component used for checking for and triggering configuration refreshes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
expireRefreshInterval
(String endpoint, String syncToken) Soft expires refresh interval.Gets latest Health connection info for refresh.Checks configurations to see if configurations should be reloaded.void
setApplicationEventPublisher
(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
-
Constructor Details
-
AppConfigurationRefresh
public AppConfigurationRefresh(AppConfigurationProperties properties, AppConfigurationProviderProperties appProperties, ClientStore clientStore) Component used for checking for and triggering configuration refreshes.- Parameters:
properties
- Client properties to check against.appProperties
- Library properties for configuring backoffclientStore
- Clients stores used to connect to App Configuration.
-
-
Method Details
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) - Specified by:
setApplicationEventPublisher
in interfaceorg.springframework.context.ApplicationEventPublisherAware
-
refreshConfigurations
Checks configurations to see if configurations should be reloaded. If the refresh interval has passed and a trigger has been updated configuration are reloaded.- Returns:
- Future with a boolean of if a RefreshEvent was published. If refreshConfigurations is currently being run elsewhere this method will return right away as false.
-
expireRefreshInterval
Soft expires refresh interval. Sets amount of time to next refresh to be a random value between 0 and 15 seconds, unless value is less than the amount of time to the next refresh check.- Parameters:
endpoint
- Config Store endpoint to expire refresh interval on.syncToken
- syncToken to verify latest changes are available on pull
-
getAppConfigurationStoresHealth
Gets latest Health connection info for refresh.- Returns:
- Map of String, endpoint, and Health information.
-