ROT: Signatur für `AdderBusinessLogic` und neue Erwartungen formuliert
[demos/kafka/training] / src / main / java / de / juplo / kafka / AdderBusinessLogic.java
index 1f3d9aa..ecd9590 100644 (file)
@@ -22,14 +22,6 @@ public class AdderBusinessLogic
   }
 
 
-  public synchronized void startSum(String user)
-  {
-    if (state.containsKey(user))
-      throw new IllegalStateException("Sumation for " + user + " already in progress, state: " + state.get(user));
-
-    state.put(user, 0l);
-  }
-
   public synchronized Optional<Long> getSum(String user)
   {
     return Optional.ofNullable(state.get(user));
@@ -46,7 +38,7 @@ public class AdderBusinessLogic
     state.put(user, result);
   }
 
-  public synchronized Long endSum(String user)
+  public synchronized Long calculate(String user)
   {
     if (!state.containsKey(user))
       throw new IllegalStateException("No sumation for " + user + " in progress");