16
16
import javax .annotation .Nullable ;
17
17
import lombok .RequiredArgsConstructor ;
18
18
import lombok .extern .slf4j .Slf4j ;
19
+ import org .jetbrains .annotations .NotNull ;
19
20
import org .springframework .http .ResponseEntity ;
20
21
import org .springframework .web .bind .annotation .RestController ;
21
22
import org .springframework .web .server .ServerWebExchange ;
@@ -94,8 +95,14 @@ public Mono<ResponseEntity<Flux<BrokerConfigDTO>>> getBrokerConfig(String cluste
94
95
.operationParams (Map .of (BROKER_ID , id ))
95
96
.build ();
96
97
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 ) {
97
104
var kafkaCluster = getCluster (clusterName );
98
- Flux < BrokerConfigDTO > brokerConfigs = brokerService .getBrokerConfig (kafkaCluster , id )
105
+ var brokerConfigs = brokerService .getBrokerConfig (kafkaCluster , id )
99
106
.map (clusterMapper ::toBrokerConfig );
100
107
101
108
if (kafkaCluster .isReadOnly ()) {
@@ -105,10 +112,7 @@ public Mono<ResponseEntity<Flux<BrokerConfigDTO>>> getBrokerConfig(String cluste
105
112
});
106
113
}
107
114
108
- return validateAccess (context ).thenReturn (
109
- ResponseEntity .ok (
110
- brokerConfigs )
111
- ).doOnEach (sig -> audit (context , sig ));
115
+ return ResponseEntity .ok (brokerConfigs );
112
116
}
113
117
114
118
@ Override
0 commit comments