1 package de.juplo.kafka;
3 import java.util.HashMap;
7 public class SumBusinessLogic
9 private final Map<String, Long> state;
12 public SumBusinessLogic()
14 this(new HashMap<>());
17 public SumBusinessLogic(Map<String, Long> state)
23 public synchronized void startSum(String user)
25 if (state.containsKey(user))
26 throw new IllegalStateException("Sumation for " + user + " already in progress, state: " + state.get(user));