diff --git a/polling-station/src/main/java/meerkat/pollingstation/ReceiverWebAPI.java b/polling-station/src/main/java/meerkat/pollingstation/ReceiverWebAPI.java index 7463db7..b396045 100644 --- a/polling-station/src/main/java/meerkat/pollingstation/ReceiverWebAPI.java +++ b/polling-station/src/main/java/meerkat/pollingstation/ReceiverWebAPI.java @@ -2,7 +2,9 @@ package meerkat.pollingstation; import com.google.common.util.concurrent.FutureCallback; import com.google.protobuf.BoolValue; +import meerkat.pollingstation.controller.callbacks.ScanCallback; import meerkat.pollingstation.controller.callbacks.ScanDataCallback; +import meerkat.pollingstation.controller.callbacks.ScanErrorCallback; import meerkat.protobuf.PollingStation; import javax.annotation.PostConstruct; @@ -28,7 +30,7 @@ public class ReceiverWebAPI implements PollingStationScanner.Producer { @Context ServletContext servletContext; - LinkedBlockingQueue> callbacks; + LinkedBlockingQueue callbacks; /** * This method is called by the Jetty engine when instantiating the servlet @@ -39,7 +41,7 @@ public class ReceiverWebAPI implements PollingStationScanner.Producer { Object context = servletContext.getAttribute(ReceiverScanHandler.CALLBACKS_ATTRIBUTE_NAME); try { - callbacks = (LinkedBlockingQueue>) context; + callbacks = (LinkedBlockingQueue) context; } catch (ClassCastException e) { throw e; } @@ -89,7 +91,7 @@ public class ReceiverWebAPI implements PollingStationScanner.Producer { // // } - ScanDataCallback callback = new ScanDataCallback(errorMsg); + ScanErrorCallback callback = new ScanErrorCallback(errorMsg); // scanner.subscribe(callback); callbacks.add(callback); diff --git a/polling-station/src/main/java/meerkat/pollingstation/controller/callbacks/ScanErrorCallback.java b/polling-station/src/main/java/meerkat/pollingstation/controller/callbacks/ScanErrorCallback.java index 8ddb0c6..58aa16e 100644 --- a/polling-station/src/main/java/meerkat/pollingstation/controller/callbacks/ScanErrorCallback.java +++ b/polling-station/src/main/java/meerkat/pollingstation/controller/callbacks/ScanErrorCallback.java @@ -8,9 +8,9 @@ import meerkat.protobuf.PollingStation; */ public class ScanErrorCallback extends ScanCallback implements FutureCallback { - private final String expectedErrorMessage; + private final PollingStation.ErrorMsg expectedErrorMessage; - public ScanErrorCallback(String expectedErrorMessage) { + public ScanErrorCallback(PollingStation.ErrorMsg expectedErrorMessage) { this.expectedErrorMessage = expectedErrorMessage; }