refactor: 클라이언트 버킷 상태 모니터링 custom.inflow 패키지로 분리

- InflowTargetBucketService/Controller에서 클라이언트 관련 메서드/엔드포인트 제거
- ClientInflowTargetBucketService/Controller를 custom.inflow 패키지에 신규 생성
  (ClientInflowTargetMetricService/Controller 패턴과 일치)
- 관련 단위 테스트 추가 및 기존 테스트에서 클라이언트 케이스 제거

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curry772
2026-05-08 10:22:15 +09:00
parent 31171d0187
commit d46fa8bd1a
9 changed files with 460 additions and 236 deletions
@@ -21,8 +21,6 @@ import org.springframework.web.bind.annotation.RestController;
* GET /manage/inflow/adapter/{adapterId}/bucket-status → 특정 어댑터 버킷 상태
* GET /manage/inflow/interface/bucket-status → 전체 인터페이스 버킷 상태
* GET /manage/inflow/interface/{interfaceId}/bucket-status → 특정 인터페이스 버킷 상태
* GET /manage/inflow/client/bucket-status → 전체 클라이언트 버킷 상태
* GET /manage/inflow/client/{clientId}/bucket-status → 특정 클라이언트 버킷 상태
*/
@RestController
@RequestMapping("/manage/inflow")
@@ -63,22 +61,6 @@ public class InflowTargetBucketController {
return single(dto, "인터페이스를 찾을 수 없습니다: " + interfaceId);
}
// =========================================================================
// 클라이언트
// =========================================================================
@GetMapping("/client/bucket-status")
public ResponseEntity<?> getAllClientBucketStatus() {
List<TargetBucketStatusDTO> list = bucketService.getAllClientBucketStatus();
return ok(list);
}
@GetMapping("/client/{clientId}/bucket-status")
public ResponseEntity<?> getClientBucketStatus(@PathVariable String clientId) {
TargetBucketStatusDTO dto = bucketService.getClientBucketStatus(clientId);
return single(dto, "클라이언트를 찾을 수 없습니다: " + clientId);
}
// =========================================================================
// Helpers
// =========================================================================
@@ -9,7 +9,6 @@ import org.springframework.stereotype.Service;
import com.eactive.eai.common.inflow.AbstractInflowControlManager;
import com.eactive.eai.common.inflow.InflowControlUtil;
import com.eactive.eai.common.inflow.InflowTargetVO;
import com.eactive.eai.common.inflow.dual.ClientDualInflowControlManager;
import com.eactive.eai.common.inflow.dual.DualCustomBucket;
import com.eactive.eai.common.inflow.dual.DualInflowControlManager;
@@ -58,24 +57,6 @@ public class InflowTargetBucketService {
return toDtoList("INTERFACE", manager.getInterfaceBucketMap());
}
// -------------------------------------------------------------------------
// 클라이언트
// -------------------------------------------------------------------------
public TargetBucketStatusDTO getClientBucketStatus(String clientId) {
ClientDualInflowControlManager manager = getClientDualManager();
if (manager == null) return null;
DualCustomBucket bucket = manager.getClientBucket(clientId);
if (bucket == null) return null;
return toDto(clientId, "CLIENT", bucket);
}
public List<TargetBucketStatusDTO> getAllClientBucketStatus() {
ClientDualInflowControlManager manager = getClientDualManager();
if (manager == null) return new ArrayList<>();
return toDtoList("CLIENT", manager.getClientBucketMap());
}
// -------------------------------------------------------------------------
// Private helpers
// -------------------------------------------------------------------------
@@ -85,11 +66,6 @@ public class InflowTargetBucketService {
return (base instanceof DualInflowControlManager) ? (DualInflowControlManager) base : null;
}
protected ClientDualInflowControlManager getClientDualManager() {
AbstractInflowControlManager base = InflowControlUtil.getInflowControlManager();
return (base instanceof ClientDualInflowControlManager) ? (ClientDualInflowControlManager) base : null;
}
private TargetBucketStatusDTO toDto(String targetId, String targetType, DualCustomBucket bucket) {
InflowTargetVO vo = bucket.getInflowTargetVo();
List<GroupBucketStatusDTO.BucketInfo> buckets = new ArrayList<>();