com.azure.spring.cloud.appconfiguration.config.implementation.State Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-cloud-azure-appconfiguration-config Show documentation
Show all versions of spring-cloud-azure-appconfiguration-config Show documentation
Integration of Spring Cloud Config and Azure App Configuration Service
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.spring.cloud.appconfiguration.config.implementation;
import java.time.Instant;
import java.util.List;
import com.azure.data.appconfiguration.models.ConfigurationSetting;
class State {
private final List watchKeys;
private final Instant nextRefreshCheck;
private final String originEndpoint;
private Integer refreshAttempt;
private final int refreshInterval;
State(List watchKeys, int refreshInterval, String originEndpoint) {
this.watchKeys = watchKeys;
this.refreshInterval = refreshInterval;
nextRefreshCheck = Instant.now().plusSeconds(refreshInterval);
this.originEndpoint = originEndpoint;
this.refreshAttempt = 1;
}
State(State oldState, Instant newRefresh) {
this.watchKeys = oldState.getWatchKeys();
this.refreshInterval = oldState.getRefreshInterval();
this.nextRefreshCheck = newRefresh;
this.originEndpoint = oldState.getOriginEndpoint();
this.refreshAttempt = oldState.getRefreshAttempt();
}
/**
* @return the watchKeys
*/
public List getWatchKeys() {
return watchKeys;
}
/**
* @return the nextRefreshCheck
*/
public Instant getNextRefreshCheck() {
return nextRefreshCheck;
}
/**
* @return the originEndpoint
*/
public String getOriginEndpoint() {
return originEndpoint;
}
/**
* @return the refreshAttempt
*/
public Integer getRefreshAttempt() {
return refreshAttempt;
}
/**
* Adds 1 to the number of refresh attempts
*/
public void incrementRefreshAttempt() {
this.refreshAttempt += 1;
}
/**
* @return the refreshInterval
*/
public int getRefreshInterval() {
return refreshInterval;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy