1616import javax .annotation .Nullable ;
1717import lombok .RequiredArgsConstructor ;
1818import lombok .extern .slf4j .Slf4j ;
19+ import org .jetbrains .annotations .NotNull ;
1920import org .springframework .http .ResponseEntity ;
2021import org .springframework .web .bind .annotation .RestController ;
2122import org .springframework .web .server .ServerWebExchange ;
@@ -94,8 +95,14 @@ public Mono<ResponseEntity<Flux<BrokerConfigDTO>>> getBrokerConfig(String cluste
9495 .operationParams (Map .of (BROKER_ID , id ))
9596 .build ();
9697
98+ return validateAccess (context ).thenReturn (
99+ getBrokerConfigIml (id , clusterName )
100+ ).doOnEach (sig -> audit (context , sig ));
101+ }
102+
103+ private @ NotNull ResponseEntity <Flux <BrokerConfigDTO >> getBrokerConfigIml (Integer id , String clusterName ) {
97104 var kafkaCluster = getCluster (clusterName );
98- Flux < BrokerConfigDTO > brokerConfigs = brokerService .getBrokerConfig (kafkaCluster , id )
105+ var brokerConfigs = brokerService .getBrokerConfig (kafkaCluster , id )
99106 .map (clusterMapper ::toBrokerConfig );
100107
101108 if (kafkaCluster .isReadOnly ()) {
@@ -105,10 +112,7 @@ public Mono<ResponseEntity<Flux<BrokerConfigDTO>>> getBrokerConfig(String cluste
105112 });
106113 }
107114
108- return validateAccess (context ).thenReturn (
109- ResponseEntity .ok (
110- brokerConfigs )
111- ).doOnEach (sig -> audit (context , sig ));
115+ return ResponseEntity .ok (brokerConfigs );
112116 }
113117
114118 @ Override
0 commit comments