package com.provectus.kafka.ui.rest; import com.provectus.kafka.ui.api.ApiClustersApi; import com.provectus.kafka.ui.cluster.service.ClusterService; import com.provectus.kafka.ui.model.*; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import javax.validation.Valid; import java.util.ArrayList; @RestController @RequiredArgsConstructor public class MetricsRestController implements ApiClustersApi { private final ClusterService clusterService; @Override public Mono>> getClusters(ServerWebExchange exchange) { return clusterService.getClusters(); } @Override public Mono> getBrokersMetrics(String clusterId, ServerWebExchange exchange) { return clusterService.getBrokersMetrics(clusterId); } @Override public Mono>> getTopics(String clusterId, ServerWebExchange exchange) { return clusterService.getTopics(clusterId); } @Override public Mono> getTopicDetails(String clusterId, String topicName, ServerWebExchange exchange) { return clusterService.getTopicDetails(clusterId, topicName); } @Override public Mono>> getTopicConfigs(String clusterId, String topicName, ServerWebExchange exchange) { return clusterService.getTopicConfigs(clusterId, topicName); } @Override public Mono> createTopic(String clusterId, @Valid Mono topicFormData, ServerWebExchange exchange) { return clusterService.createTopic(clusterId, topicFormData); } @Override public Mono>> getBrokers(String clusterId, ServerWebExchange exchange) { return Mono.just(ResponseEntity.ok(Flux.fromIterable(new ArrayList<>()))); } }