All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.allegro.tech.hermes.management.config.ReadinessConfiguration Maven / Gradle / Ivy

There is a newer version: 2.8.0
Show newest version
package pl.allegro.tech.hermes.management.config;

import java.util.List;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import pl.allegro.tech.hermes.management.config.storage.StorageClustersProperties;
import pl.allegro.tech.hermes.management.config.storage.StorageProperties;
import pl.allegro.tech.hermes.management.domain.dc.MultiDatacenterRepositoryCommandExecutor;
import pl.allegro.tech.hermes.management.domain.readiness.DatacenterReadinessRepository;
import pl.allegro.tech.hermes.management.domain.readiness.ReadinessService;

@Configuration
public class ReadinessConfiguration {

  @Bean
  ReadinessService readinessService(
      MultiDatacenterRepositoryCommandExecutor commandExecutor,
      DatacenterReadinessRepository readinessRepository,
      StorageClustersProperties storageClustersProperties) {
    List datacenters =
        storageClustersProperties.getClusters().stream()
            .map(StorageProperties::getDatacenter)
            .toList();
    return new ReadinessService(commandExecutor, readinessRepository, datacenters);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy