parse ScannedData serial number
parent
4e1b66f890
commit
646824de44
|
@ -22,6 +22,7 @@ public class PollingStationMainController implements PollingStationControllerInt
|
||||||
private static final String SUB_ADDRESS = "";
|
private static final String SUB_ADDRESS = "";
|
||||||
private static final int PORT = 8080;
|
private static final int PORT = 8080;
|
||||||
|
|
||||||
|
|
||||||
public PollingStationMainController() {
|
public PollingStationMainController() {
|
||||||
queue = new LinkedBlockingQueue<PollingStationCommand>();
|
queue = new LinkedBlockingQueue<PollingStationCommand>();
|
||||||
shutDownHasBeenCalled = false;
|
shutDownHasBeenCalled = false;
|
||||||
|
@ -80,7 +81,7 @@ public class PollingStationMainController implements PollingStationControllerInt
|
||||||
|
|
||||||
private void doProcessScan(ReceivedScanCommand command) {
|
private void doProcessScan(ReceivedScanCommand command) {
|
||||||
logger.info("The Polling Station starts processing the data...");
|
logger.info("The Polling Station starts processing the data...");
|
||||||
logger.info("BallotID = "+command.getBallotSerialNumber());
|
logger.info("Ballot Serial Number = "+command.getBallotSerialNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,7 +93,7 @@ public class PollingStationMainController implements PollingStationControllerInt
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
// TODO: 4/16/2017 Implemet the shutdown behavior
|
// TODO: 4/16/2017 Implement the shutdown behavior
|
||||||
public void callShutDown() {
|
public void callShutDown() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.glassfish.jersey.server.ResourceConfig;
|
||||||
import org.glassfish.jersey.servlet.ServletContainer;
|
import org.glassfish.jersey.servlet.ServletContainer;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.time.Instant;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
|
@ -115,12 +116,13 @@ public class ReceiverScanHandler implements PollingStationScanner.Consumer, Runn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 4/16/2017 Parse protobuf fields properly
|
// TODO: 4/27/2017 set requestID properly
|
||||||
private void doScannedData(ScanDataCallback cb) {
|
private void doScannedData(ScanDataCallback cb) {
|
||||||
PollingStation.ScannedData scan = cb.getScannedData();
|
PollingStation.ScannedData scan = cb.getScannedData();
|
||||||
int channel = ByteBuffer.wrap(scan.getChannel().toByteArray()).getInt();
|
// String channel = scan.getChannel().toStringUtf8();
|
||||||
long channelLong = 12345678910L;
|
int requestID = 1;
|
||||||
controllerQueue.add(new ReceivedScanCommand(channel, channelLong));
|
long serialNumber = scan.getSignedEncryptedBallot().getEncryptedBallot().getSerialNumber();
|
||||||
|
controllerQueue.add(new ReceivedScanCommand(requestID, serialNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doScanError(ScanErrorCallback cb) {
|
private void doScanError(ScanErrorCallback cb) {
|
||||||
|
|
Loading…
Reference in New Issue