Search in sources :

Example 1 with ClusterSettingValidity

use of io.datarouter.clustersetting.ClusterSettingValidity in project datarouter by hotpads.

the class ClusterSettingService method scanClusterSettingAndValidityWithPrefix.

public Scanner<ClusterSettingAndValidityJspDto> scanClusterSettingAndValidityWithPrefix(String prefix) {
    WebappInstance currentWebappInstance = webappInstanceDao.get(webappInstanceService.buildCurrentWebappInstanceKey());
    Range<ClusterSettingKey> range = prefix == null ? Range.everything() : KeyRangeTool.forPrefixWithWildcard(prefix, name -> new ClusterSettingKey(name, null, null, null));
    return clusterSettingDao.scan(range).map(setting -> {
        ClusterSettingValidity validity = getValidityForWebappInstance(setting, currentWebappInstance);
        return new ClusterSettingAndValidityJspDto(setting, validity);
    });
}
Also used : Scanner(io.datarouter.scanner.Scanner) DatarouterServerTypeSupplier(io.datarouter.storage.config.properties.DatarouterServerTypeSupplier) ServerTypes(io.datarouter.storage.servertype.ServerTypes) ServerType(io.datarouter.storage.servertype.ServerType) ClusterSettingFinder(io.datarouter.clustersetting.ClusterSettingFinder) CachedSetting(io.datarouter.storage.setting.cached.CachedSetting) DatarouterClusterSettingLogDao(io.datarouter.clustersetting.storage.clustersettinglog.DatarouterClusterSettingLogDao) Singleton(javax.inject.Singleton) DatarouterClusterSettingRoot(io.datarouter.clustersetting.config.DatarouterClusterSettingRoot) ServerName(io.datarouter.storage.config.properties.ServerName) Function(java.util.function.Function) DatarouterSettingTag(io.datarouter.storage.setting.DatarouterSettingTag) ClusterSettingScope(io.datarouter.clustersetting.ClusterSettingScope) ClusterSettingAndValidityJspDto(io.datarouter.clustersetting.web.dto.ClusterSettingAndValidityJspDto) Inject(javax.inject.Inject) ClusterSetting(io.datarouter.clustersetting.storage.clustersetting.ClusterSetting) CachedClusterSettingTags(io.datarouter.storage.setting.cached.CachedClusterSettingTags) Map(java.util.Map) KeyRangeTool(io.datarouter.storage.util.KeyRangeTool) SettingRootFinder(io.datarouter.storage.setting.SettingRoot.SettingRootFinder) ClusterSettingScopeComparator(io.datarouter.clustersetting.ClusterSettingScopeComparator) DefaultSettingValue(io.datarouter.storage.setting.DefaultSettingValue) WebappInstanceService(io.datarouter.webappinstance.service.WebappInstanceService) ClusterSettingKey(io.datarouter.clustersetting.storage.clustersetting.ClusterSettingKey) ClusterSettingValidity(io.datarouter.clustersetting.ClusterSettingValidity) WebappInstance(io.datarouter.webappinstance.storage.webappinstance.WebappInstance) StringTool(io.datarouter.util.string.StringTool) Objects(java.util.Objects) Range(io.datarouter.util.tuple.Range) List(java.util.List) EnvironmentName(io.datarouter.storage.config.properties.EnvironmentName) ClusterSettingComparisonTool(io.datarouter.clustersetting.ClusterSettingComparisonTool) DatarouterClusterSettingDao(io.datarouter.clustersetting.storage.clustersetting.DatarouterClusterSettingDao) DatarouterEnvironmentTypeSupplier(io.datarouter.storage.config.properties.DatarouterEnvironmentTypeSupplier) BooleanTool(io.datarouter.util.BooleanTool) Optional(java.util.Optional) DatarouterWebappInstanceDao(io.datarouter.webappinstance.storage.webappinstance.DatarouterWebappInstanceDao) ClusterSettingKey(io.datarouter.clustersetting.storage.clustersetting.ClusterSettingKey) ClusterSettingAndValidityJspDto(io.datarouter.clustersetting.web.dto.ClusterSettingAndValidityJspDto) ClusterSettingValidity(io.datarouter.clustersetting.ClusterSettingValidity) WebappInstance(io.datarouter.webappinstance.storage.webappinstance.WebappInstance)

Aggregations

ClusterSettingComparisonTool (io.datarouter.clustersetting.ClusterSettingComparisonTool)1 ClusterSettingFinder (io.datarouter.clustersetting.ClusterSettingFinder)1 ClusterSettingScope (io.datarouter.clustersetting.ClusterSettingScope)1 ClusterSettingScopeComparator (io.datarouter.clustersetting.ClusterSettingScopeComparator)1 ClusterSettingValidity (io.datarouter.clustersetting.ClusterSettingValidity)1 DatarouterClusterSettingRoot (io.datarouter.clustersetting.config.DatarouterClusterSettingRoot)1 ClusterSetting (io.datarouter.clustersetting.storage.clustersetting.ClusterSetting)1 ClusterSettingKey (io.datarouter.clustersetting.storage.clustersetting.ClusterSettingKey)1 DatarouterClusterSettingDao (io.datarouter.clustersetting.storage.clustersetting.DatarouterClusterSettingDao)1 DatarouterClusterSettingLogDao (io.datarouter.clustersetting.storage.clustersettinglog.DatarouterClusterSettingLogDao)1 ClusterSettingAndValidityJspDto (io.datarouter.clustersetting.web.dto.ClusterSettingAndValidityJspDto)1 Scanner (io.datarouter.scanner.Scanner)1 DatarouterEnvironmentTypeSupplier (io.datarouter.storage.config.properties.DatarouterEnvironmentTypeSupplier)1 DatarouterServerTypeSupplier (io.datarouter.storage.config.properties.DatarouterServerTypeSupplier)1 EnvironmentName (io.datarouter.storage.config.properties.EnvironmentName)1 ServerName (io.datarouter.storage.config.properties.ServerName)1 ServerType (io.datarouter.storage.servertype.ServerType)1 ServerTypes (io.datarouter.storage.servertype.ServerTypes)1 DatarouterSettingTag (io.datarouter.storage.setting.DatarouterSettingTag)1 DefaultSettingValue (io.datarouter.storage.setting.DefaultSettingValue)1