Benennung vereinheitlicht und projektunabhängig gemacht
[demos/kafka/training] / src / main / java / de / juplo / kafka / DriverController.java
index 1525f5a..09fb762 100644 (file)
@@ -2,11 +2,7 @@ package de.juplo.kafka;
 
 import lombok.RequiredArgsConstructor;
 import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
@@ -17,6 +13,7 @@ import java.util.concurrent.ExecutionException;
 public class DriverController
 {
   private final EndlessConsumer consumer;
+  private final ApplicationRecordHandler recordHandler;
 
 
   @PostMapping("start")
@@ -31,12 +28,14 @@ public class DriverController
     consumer.stop();
   }
 
-  @GetMapping("seen")
-  public Map<Integer, Map<String, Integer>> seen()
+
+  @GetMapping("state")
+  public Map<Integer, Map<String, Long>> state()
   {
-    return consumer.getSeen();
+    return recordHandler.getState();
   }
 
+
   @ExceptionHandler
   @ResponseStatus(HttpStatus.BAD_REQUEST)
   public ErrorResponse illegalStateException(IllegalStateException e)