Renamed proto files to use standard (lowercase-underscore) naming convention); added a separate proto for bb webapp

bb-server
Tal Moran 2017-06-30 02:28:03 +03:00
parent 68e1737f22
commit 05c7a25bb7
85 changed files with 188 additions and 155 deletions

View File

@ -1,6 +1,6 @@
package meerkat.bulletinboard; package meerkat.bulletinboard;
import meerkat.protobuf.BulletinBoardAPI.BatchChunk; import meerkat.protobuf.BulletinBoardApi.BatchChunk;
import meerkat.bulletinboard.AsyncBulletinBoardClient.BatchIdentifier; import meerkat.bulletinboard.AsyncBulletinBoardClient.BatchIdentifier;
import java.util.List; import java.util.List;

View File

@ -3,7 +3,7 @@ package meerkat.bulletinboard;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import com.google.protobuf.Timestamp; import com.google.protobuf.Timestamp;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Crypto.Signature; import meerkat.protobuf.Crypto.Signature;
import meerkat.protobuf.Voting.*; import meerkat.protobuf.Voting.*;

View File

@ -8,7 +8,7 @@ import meerkat.comm.MessageInputStream;
import meerkat.comm.MessageInputStream.MessageInputStreamFactory; import meerkat.comm.MessageInputStream.MessageInputStreamFactory;
import meerkat.comm.MessageOutputStream; import meerkat.comm.MessageOutputStream;
import meerkat.crypto.concrete.SHA256Digest; import meerkat.crypto.concrete.SHA256Digest;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Crypto.Signature; import meerkat.protobuf.Crypto.Signature;
import meerkat.protobuf.Voting.*; import meerkat.protobuf.Voting.*;
import meerkat.util.BulletinBoardUtils; import meerkat.util.BulletinBoardUtils;

View File

@ -6,8 +6,8 @@ import com.google.protobuf.Int64Value;
import meerkat.bulletinboard.workers.singleserver.*; import meerkat.bulletinboard.workers.singleserver.*;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.crypto.concrete.SHA256Digest; import meerkat.crypto.concrete.SHA256Digest;
import meerkat.protobuf.BulletinBoardAPI; import meerkat.protobuf.BulletinBoardApi;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Voting.*; import meerkat.protobuf.Voting.*;
import meerkat.rest.*; import meerkat.rest.*;
import meerkat.util.BulletinBoardUtils; import meerkat.util.BulletinBoardUtils;

View File

@ -3,7 +3,7 @@ package meerkat.bulletinboard;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.util.BulletinBoardUtils; import meerkat.util.BulletinBoardUtils;
import java.util.LinkedList; import java.util.LinkedList;

View File

@ -9,7 +9,7 @@ import com.google.protobuf.Timestamp;
import meerkat.bulletinboard.workers.singleserver.*; import meerkat.bulletinboard.workers.singleserver.*;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.crypto.concrete.SHA256Digest; import meerkat.crypto.concrete.SHA256Digest;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.protobuf.Voting.BulletinBoardClientParams; import meerkat.protobuf.Voting.BulletinBoardClientParams;
import meerkat.util.BulletinBoardUtils; import meerkat.util.BulletinBoardUtils;

View File

@ -4,7 +4,7 @@ import com.google.common.util.concurrent.FutureCallback;
import com.google.protobuf.Timestamp; import com.google.protobuf.Timestamp;
import meerkat.bulletinboard.workers.multiserver.*; import meerkat.bulletinboard.workers.multiserver.*;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Crypto.Signature; import meerkat.protobuf.Crypto.Signature;
import meerkat.protobuf.Voting.*; import meerkat.protobuf.Voting.*;

View File

@ -3,10 +3,10 @@ package meerkat.bulletinboard;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import com.google.protobuf.Timestamp; import com.google.protobuf.Timestamp;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.util.BulletinBoardUtils; import meerkat.util.BulletinBoardUtils;
import static meerkat.protobuf.BulletinBoardAPI.FilterType.*; import static meerkat.protobuf.BulletinBoardApi.FilterType.*;
import java.util.*; import java.util.*;
import java.util.concurrent.Semaphore; import java.util.concurrent.Semaphore;

View File

@ -4,7 +4,7 @@ import com.google.common.util.concurrent.FutureCallback;
import meerkat.bulletinboard.MultiServerWorker; import meerkat.bulletinboard.MultiServerWorker;
import meerkat.bulletinboard.SingleServerBulletinBoardClient; import meerkat.bulletinboard.SingleServerBulletinBoardClient;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;

View File

@ -2,7 +2,7 @@ package meerkat.bulletinboard.workers.multiserver;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import meerkat.bulletinboard.SingleServerBulletinBoardClient; import meerkat.bulletinboard.SingleServerBulletinBoardClient;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.BulletinBoardMessage;
import java.util.List; import java.util.List;

View File

@ -2,7 +2,7 @@ package meerkat.bulletinboard.workers.multiserver;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import meerkat.bulletinboard.SingleServerBulletinBoardClient; import meerkat.bulletinboard.SingleServerBulletinBoardClient;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import java.util.List; import java.util.List;

View File

@ -2,7 +2,7 @@ package meerkat.bulletinboard.workers.multiserver;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import meerkat.bulletinboard.SingleServerBulletinBoardClient; import meerkat.bulletinboard.SingleServerBulletinBoardClient;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import java.util.List; import java.util.List;

View File

@ -2,8 +2,8 @@ package meerkat.bulletinboard.workers.multiserver;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import meerkat.bulletinboard.SingleServerBulletinBoardClient; import meerkat.bulletinboard.SingleServerBulletinBoardClient;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.BulletinBoardMessage;
import meerkat.protobuf.BulletinBoardAPI.MessageID; import meerkat.protobuf.BulletinBoardApi.MessageID;
import java.util.List; import java.util.List;

View File

@ -2,7 +2,7 @@ package meerkat.bulletinboard.workers.multiserver;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import meerkat.bulletinboard.SingleServerBulletinBoardClient; import meerkat.bulletinboard.SingleServerBulletinBoardClient;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import java.util.List; import java.util.List;

View File

@ -3,7 +3,7 @@ package meerkat.bulletinboard.workers.singleserver;
import com.google.protobuf.Int64Value; import com.google.protobuf.Int64Value;
import meerkat.bulletinboard.SingleServerWorker; import meerkat.bulletinboard.SingleServerWorker;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.BeginBatchMessage; import meerkat.protobuf.BulletinBoardApi.BeginBatchMessage;
import meerkat.rest.Constants; import meerkat.rest.Constants;
import javax.ws.rs.ProcessingException; import javax.ws.rs.ProcessingException;

View File

@ -1,6 +1,6 @@
package meerkat.bulletinboard.workers.singleserver; package meerkat.bulletinboard.workers.singleserver;
import meerkat.protobuf.BulletinBoardAPI.CloseBatchMessage; import meerkat.protobuf.BulletinBoardApi.CloseBatchMessage;
import static meerkat.bulletinboard.BulletinBoardConstants.CLOSE_BATCH_PATH; import static meerkat.bulletinboard.BulletinBoardConstants.CLOSE_BATCH_PATH;

View File

@ -3,8 +3,8 @@ package meerkat.bulletinboard.workers.singleserver;
import com.google.protobuf.Int64Value; import com.google.protobuf.Int64Value;
import meerkat.bulletinboard.SingleServerWorker; import meerkat.bulletinboard.SingleServerWorker;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.SyncQuery; import meerkat.protobuf.BulletinBoardApi.SyncQuery;
import meerkat.protobuf.BulletinBoardAPI.GenerateSyncQueryParams; import meerkat.protobuf.BulletinBoardApi.GenerateSyncQueryParams;
import meerkat.rest.Constants; import meerkat.rest.Constants;
import javax.ws.rs.ProcessingException; import javax.ws.rs.ProcessingException;

View File

@ -3,7 +3,7 @@ package meerkat.bulletinboard.workers.singleserver;
import meerkat.bulletinboard.SingleServerWorker; import meerkat.bulletinboard.SingleServerWorker;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.comm.MessageInputStream; import meerkat.comm.MessageInputStream;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.rest.Constants; import meerkat.rest.Constants;
import javax.ws.rs.client.Client; import javax.ws.rs.client.Client;

View File

@ -1,6 +1,6 @@
package meerkat.bulletinboard.workers.singleserver; package meerkat.bulletinboard.workers.singleserver;
import meerkat.protobuf.BulletinBoardAPI.BatchMessage; import meerkat.protobuf.BulletinBoardApi.BatchMessage;
import static meerkat.bulletinboard.BulletinBoardConstants.POST_BATCH_PATH; import static meerkat.bulletinboard.BulletinBoardConstants.POST_BATCH_PATH;

View File

@ -1,6 +1,6 @@
package meerkat.bulletinboard.workers.singleserver; package meerkat.bulletinboard.workers.singleserver;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.BulletinBoardMessage;
import static meerkat.bulletinboard.BulletinBoardConstants.POST_MESSAGE_PATH; import static meerkat.bulletinboard.BulletinBoardConstants.POST_MESSAGE_PATH;

View File

@ -2,8 +2,8 @@ package meerkat.bulletinboard.workers.singleserver;
import meerkat.bulletinboard.SingleServerWorker; import meerkat.bulletinboard.SingleServerWorker;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.SyncQuery; import meerkat.protobuf.BulletinBoardApi.SyncQuery;
import meerkat.protobuf.BulletinBoardAPI.SyncQueryResponse; import meerkat.protobuf.BulletinBoardApi.SyncQueryResponse;
import meerkat.rest.Constants; import meerkat.rest.Constants;
import javax.ws.rs.ProcessingException; import javax.ws.rs.ProcessingException;

View File

@ -3,7 +3,7 @@ package meerkat.bulletinboard.workers.singleserver;
import meerkat.bulletinboard.SingleServerWorker; import meerkat.bulletinboard.SingleServerWorker;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.comm.MessageInputStream; import meerkat.comm.MessageInputStream;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.rest.Constants; import meerkat.rest.Constants;
import javax.ws.rs.client.Client; import javax.ws.rs.client.Client;

View File

@ -3,10 +3,10 @@ package meerkat.bulletinboard.workers.singleserver;
import meerkat.bulletinboard.SingleServerWorker; import meerkat.bulletinboard.SingleServerWorker;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.comm.MessageInputStream; import meerkat.comm.MessageInputStream;
import meerkat.protobuf.BulletinBoardAPI; import meerkat.protobuf.BulletinBoardApi;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessageList; import meerkat.protobuf.BulletinBoardApi.BulletinBoardMessageList;
import meerkat.protobuf.BulletinBoardAPI.MessageFilterList; import meerkat.protobuf.BulletinBoardApi.MessageFilterList;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.BulletinBoardMessage;
import meerkat.rest.Constants; import meerkat.rest.Constants;
import javax.ws.rs.ProcessingException; import javax.ws.rs.ProcessingException;

View File

@ -11,7 +11,7 @@ import meerkat.bulletinboard.sqlserver.H2QueryProvider;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.crypto.concrete.ECDSASignature; import meerkat.crypto.concrete.ECDSASignature;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.util.BulletinBoardMessageComparator; import meerkat.util.BulletinBoardMessageComparator;
import meerkat.util.BulletinBoardMessageGenerator; import meerkat.util.BulletinBoardMessageGenerator;
import org.junit.*; import org.junit.*;

View File

@ -6,7 +6,7 @@ import com.google.protobuf.Timestamp;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.crypto.concrete.ECDSASignature; import meerkat.crypto.concrete.ECDSASignature;
import meerkat.crypto.concrete.SHA256Digest; import meerkat.crypto.concrete.SHA256Digest;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.util.BulletinBoardMessageComparator; import meerkat.util.BulletinBoardMessageComparator;
import meerkat.util.BulletinBoardMessageGenerator; import meerkat.util.BulletinBoardMessageGenerator;

View File

@ -5,7 +5,7 @@ import com.google.protobuf.ByteString;
import com.google.protobuf.Timestamp; import com.google.protobuf.Timestamp;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.crypto.concrete.ECDSASignature; import meerkat.crypto.concrete.ECDSASignature;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.util.BulletinBoardMessageComparator; import meerkat.util.BulletinBoardMessageComparator;
import meerkat.util.BulletinBoardMessageGenerator; import meerkat.util.BulletinBoardMessageGenerator;

View File

@ -6,6 +6,7 @@ plugins {
} }
apply plugin: 'org.akhikhl.gretty' apply plugin: 'org.akhikhl.gretty'
apply plugin: 'com.google.protobuf'
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'idea' apply plugin: 'idea'

View File

@ -3,7 +3,7 @@ package meerkat.bulletinboard.service;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@ -18,7 +18,7 @@ import meerkat.comm.MessageOutputStream;
import meerkat.crypto.DigitalSignature; import meerkat.crypto.DigitalSignature;
import meerkat.crypto.concrete.SHA256Digest; import meerkat.crypto.concrete.SHA256Digest;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Comm; import meerkat.protobuf.Comm;
import meerkat.protobuf.Crypto.Signature; import meerkat.protobuf.Crypto.Signature;
import meerkat.protobuf.Crypto.SignatureVerificationKey; import meerkat.protobuf.Crypto.SignatureVerificationKey;

View File

@ -1,6 +1,6 @@
package meerkat.bulletinboard.sqlserver; package meerkat.bulletinboard.sqlserver;
import meerkat.protobuf.BulletinBoardAPI.FilterType; import meerkat.protobuf.BulletinBoardApi.FilterType;
import org.apache.commons.dbcp2.BasicDataSource; import org.apache.commons.dbcp2.BasicDataSource;
import javax.sql.DataSource; import javax.sql.DataSource;

View File

@ -1,7 +1,7 @@
package meerkat.bulletinboard.sqlserver; package meerkat.bulletinboard.sqlserver;
import meerkat.bulletinboard.sqlserver.BulletinBoardSQLServer.SQLQueryProvider; import meerkat.bulletinboard.sqlserver.BulletinBoardSQLServer.SQLQueryProvider;
import meerkat.protobuf.BulletinBoardAPI.FilterType; import meerkat.protobuf.BulletinBoardApi.FilterType;
import org.apache.commons.dbcp2.BasicDataSource; import org.apache.commons.dbcp2.BasicDataSource;
import javax.sql.DataSource; import javax.sql.DataSource;

View File

@ -1,6 +1,6 @@
package meerkat.bulletinboard.sqlserver; package meerkat.bulletinboard.sqlserver;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import org.apache.commons.dbcp2.BasicDataSource; import org.apache.commons.dbcp2.BasicDataSource;
import org.sqlite.SQLiteDataSource; import org.sqlite.SQLiteDataSource;

View File

@ -1,7 +1,7 @@
package meerkat.bulletinboard.sqlserver.mappers; package meerkat.bulletinboard.sqlserver.mappers;
import meerkat.comm.MessageOutputStream; import meerkat.comm.MessageOutputStream;
import meerkat.protobuf.BulletinBoardAPI.BatchChunk; import meerkat.protobuf.BulletinBoardApi.BatchChunk;
import org.springframework.jdbc.core.RowCallbackHandler; import org.springframework.jdbc.core.RowCallbackHandler;
import java.io.IOException; import java.io.IOException;

View File

@ -1,7 +1,7 @@
package meerkat.bulletinboard.sqlserver.mappers; package meerkat.bulletinboard.sqlserver.mappers;
import meerkat.bulletinboard.BulletinBoardDigest; import meerkat.bulletinboard.BulletinBoardDigest;
import meerkat.protobuf.BulletinBoardAPI.BatchChunk; import meerkat.protobuf.BulletinBoardApi.BatchChunk;
import org.springframework.jdbc.core.RowCallbackHandler; import org.springframework.jdbc.core.RowCallbackHandler;
import java.io.IOException; import java.io.IOException;

View File

@ -1,7 +1,7 @@
package meerkat.bulletinboard.sqlserver.mappers; package meerkat.bulletinboard.sqlserver.mappers;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.protobuf.BulletinBoardAPI.BeginBatchMessage; import meerkat.protobuf.BulletinBoardApi.BeginBatchMessage;
import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet; import java.sql.ResultSet;

View File

@ -1,6 +1,6 @@
package meerkat.bulletinboard.sqlserver.mappers; package meerkat.bulletinboard.sqlserver.mappers;
import meerkat.protobuf.BulletinBoardAPI.MessageID; import meerkat.protobuf.BulletinBoardApi.MessageID;
import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet; import java.sql.ResultSet;

View File

@ -4,7 +4,7 @@ import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.bulletinboard.sqlserver.BulletinBoardSQLServer.*; import meerkat.bulletinboard.sqlserver.BulletinBoardSQLServer.*;
import meerkat.bulletinboard.sqlserver.BulletinBoardSQLServer.SQLQueryProvider.*; import meerkat.bulletinboard.sqlserver.BulletinBoardSQLServer.SQLQueryProvider.*;
import meerkat.comm.MessageOutputStream; import meerkat.comm.MessageOutputStream;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import org.springframework.jdbc.core.RowCallbackHandler; import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;

View File

@ -1,8 +1,8 @@
package meerkat.bulletinboard.sqlserver.mappers; package meerkat.bulletinboard.sqlserver.mappers;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.protobuf.BulletinBoardAPI.UnsignedBulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.UnsignedBulletinBoardMessage;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.BulletinBoardMessage;
import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet; import java.sql.ResultSet;

View File

@ -4,8 +4,8 @@ import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.bulletinboard.sqlserver.BulletinBoardSQLServer.SQLQueryProvider.QueryType; import meerkat.bulletinboard.sqlserver.BulletinBoardSQLServer.SQLQueryProvider.QueryType;
import meerkat.comm.MessageOutputStream; import meerkat.comm.MessageOutputStream;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.BulletinBoardMessage;
import meerkat.protobuf.BulletinBoardAPI.UnsignedBulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.UnsignedBulletinBoardMessage;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.util.BulletinBoardUtils; import meerkat.util.BulletinBoardUtils;
import org.springframework.jdbc.core.RowCallbackHandler; import org.springframework.jdbc.core.RowCallbackHandler;

View File

@ -2,8 +2,8 @@ package meerkat.bulletinboard.sqlserver.mappers;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.BulletinBoardMessage;
import meerkat.protobuf.BulletinBoardAPI.UnsignedBulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.UnsignedBulletinBoardMessage;
import meerkat.util.BulletinBoardUtils; import meerkat.util.BulletinBoardUtils;
import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.RowMapper;

View File

@ -1,8 +1,8 @@
package meerkat.bulletinboard.sqlserver.mappers; package meerkat.bulletinboard.sqlserver.mappers;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.BulletinBoardMessage;
import meerkat.protobuf.BulletinBoardAPI.UnsignedBulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.UnsignedBulletinBoardMessage;
import meerkat.protobuf.Crypto.Signature; import meerkat.protobuf.Crypto.Signature;
import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.RowMapper;

View File

@ -18,7 +18,10 @@ import meerkat.bulletinboard.sqlserver.MySQLQueryProvider;
import meerkat.bulletinboard.sqlserver.SQLiteQueryProvider; import meerkat.bulletinboard.sqlserver.SQLiteQueryProvider;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.comm.MessageOutputStream; import meerkat.comm.MessageOutputStream;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.BulletinBoardWebapp.*;
import static meerkat.bulletinboard.BulletinBoardConstants.*; import static meerkat.bulletinboard.BulletinBoardConstants.*;
import static meerkat.rest.Constants.*; import static meerkat.rest.Constants.*;
@ -29,7 +32,7 @@ import java.io.OutputStream;
* An implementation of the BulletinBoardServer which functions as a WebApp * An implementation of the BulletinBoardServer which functions as a WebApp
*/ */
@Path(BULLETIN_BOARD_SERVER_PATH) @Path(BULLETIN_BOARD_SERVER_PATH)
public class BulletinBoardWebApp implements BulletinBoardServer, ServletContextListener{ public class BulletinBoardWebApp implements BulletinBoardServer, ServletContextListener {
private static final String BULLETIN_BOARD_ATTRIBUTE_NAME = "bulletinBoard"; private static final String BULLETIN_BOARD_ATTRIBUTE_NAME = "bulletinBoard";
@ -43,8 +46,10 @@ public class BulletinBoardWebApp implements BulletinBoardServer, ServletContextL
public void init(){ public void init(){
bulletinBoard = (BulletinBoardServer) servletContext.getAttribute(BULLETIN_BOARD_ATTRIBUTE_NAME); bulletinBoard = (BulletinBoardServer) servletContext.getAttribute(BULLETIN_BOARD_ATTRIBUTE_NAME);
} }
@Override
@Override
public void contextInitialized(ServletContextEvent servletContextEvent) { public void contextInitialized(ServletContextEvent servletContextEvent) {
ServletContext servletContext = servletContextEvent.getServletContext(); ServletContext servletContext = servletContextEvent.getServletContext();
String dbType = servletContext.getInitParameter("dbType"); String dbType = servletContext.getInitParameter("dbType");
@ -75,7 +80,23 @@ public class BulletinBoardWebApp implements BulletinBoardServer, ServletContextL
System.err.println(e.getMessage()); System.err.println(e.getMessage());
} }
} }
/**
* Get the current status of the bulletin board server.
* @return
* @throws CommunicationException
*/
@Path(STATUS_PATH)
@POST
@Consumes(MEDIATYPE_PROTOBUF)
@Produces(MEDIATYPE_PROTOBUF)
public ServerStatus getStatus() throws CommunicationException {
return ServerStatus.newBuilder()
.setName("Hello")
.build();
}
@Path(POST_MESSAGE_PATH) @Path(POST_MESSAGE_PATH)
@POST @POST
@Consumes(MEDIATYPE_PROTOBUF) @Consumes(MEDIATYPE_PROTOBUF)

View File

@ -4,7 +4,7 @@ import com.google.protobuf.ByteString;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import meerkat.bulletinboard.service.HelloProtoBuf; import meerkat.bulletinboard.service.HelloProtoBuf;
import meerkat.protobuf.Crypto.*; import meerkat.protobuf.Crypto.*;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.rest.Constants; import meerkat.rest.Constants;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;

View File

@ -0,0 +1,25 @@
syntax = "proto3";
package meerkat;
option java_package = "meerkat.protobuf";
import 'meerkat/crypto.proto';
import 'meerkat/bulletin_board_api.proto';
import 'google/protobuf/timestamp.proto';
// Status of the bulletin board server
message ServerStatus {
enum Mode {
MODE_SETUP_AUTH = 0; // Waiting for authorization setup
MODE_SETUP_DB = 1; // Needs to complete setup
MODE_RUNNING = 2; // Setup is complete
}
Mode mode = 1;
string name = 2; // Human-readable name
SignatureVerificationKey pk = 3; // The server's signing public-key
}

View File

@ -8,7 +8,7 @@ import com.google.protobuf.TextFormat;
import com.google.protobuf.Timestamp; import com.google.protobuf.Timestamp;
import meerkat.comm.MessageInputStream; import meerkat.comm.MessageInputStream;
import meerkat.protobuf.Crypto.*; import meerkat.protobuf.Crypto.*;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Comm.*; import meerkat.protobuf.Comm.*;
import static meerkat.bulletinboard.BulletinBoardConstants.*; import static meerkat.bulletinboard.BulletinBoardConstants.*;
import meerkat.rest.Constants; import meerkat.rest.Constants;

View File

@ -28,7 +28,7 @@ import meerkat.comm.MessageOutputStream;
import meerkat.comm.MessageInputStream.MessageInputStreamFactory; import meerkat.comm.MessageInputStream.MessageInputStreamFactory;
import meerkat.crypto.concrete.ECDSASignature; import meerkat.crypto.concrete.ECDSASignature;
import meerkat.crypto.concrete.SHA256Digest; import meerkat.crypto.concrete.SHA256Digest;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.util.BulletinBoardMessageComparator; import meerkat.util.BulletinBoardMessageComparator;
import meerkat.util.BulletinBoardMessageGenerator; import meerkat.util.BulletinBoardMessageGenerator;
import meerkat.util.BulletinBoardUtils; import meerkat.util.BulletinBoardUtils;

View File

@ -1,6 +1,6 @@
package meerkat.bulletinboard; package meerkat.bulletinboard;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.rest.Constants; import meerkat.rest.Constants;
import meerkat.rest.ProtobufMessageBodyReader; import meerkat.rest.ProtobufMessageBodyReader;
import meerkat.rest.ProtobufMessageBodyWriter; import meerkat.rest.ProtobufMessageBodyWriter;

View File

@ -1,5 +1,5 @@
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import static meerkat.protobuf.BulletinBoardAPI.*; import static meerkat.protobuf.BulletinBoardApi.*;
import java.io.IOException; import java.io.IOException;
/** /**

View File

@ -2,7 +2,7 @@ package meerkat.bulletinboard;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import com.google.protobuf.Timestamp; import com.google.protobuf.Timestamp;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Crypto.Signature; import meerkat.protobuf.Crypto.Signature;
import java.util.List; import java.util.List;

View File

@ -3,7 +3,7 @@ package meerkat.bulletinboard;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.Voting.*; import meerkat.protobuf.Voting.*;
import static meerkat.protobuf.BulletinBoardAPI.*; import static meerkat.protobuf.BulletinBoardApi.*;
import java.util.List; import java.util.List;

View File

@ -7,6 +7,7 @@ public interface BulletinBoardConstants {
// Relative addresses for Bulletin Board operations // Relative addresses for Bulletin Board operations
public static final String STATUS_PATH = "/status";
public static final String BULLETIN_BOARD_SERVER_PATH = "/bbserver"; public static final String BULLETIN_BOARD_SERVER_PATH = "/bbserver";
public static final String GENERATE_SYNC_QUERY_PATH = "/generatesyncquery"; public static final String GENERATE_SYNC_QUERY_PATH = "/generatesyncquery";
public static final String READ_MESSAGES_PATH = "/readmessages"; public static final String READ_MESSAGES_PATH = "/readmessages";

View File

@ -1,7 +1,7 @@
package meerkat.bulletinboard; package meerkat.bulletinboard;
import meerkat.crypto.Digest; import meerkat.crypto.Digest;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import java.util.List; import java.util.List;

View File

@ -2,7 +2,7 @@ package meerkat.bulletinboard;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
/** /**
* Created by Arbel Deutsch Peled on 13-Apr-16. * Created by Arbel Deutsch Peled on 13-Apr-16.

View File

@ -5,7 +5,7 @@ import com.google.protobuf.Int32Value;
import com.google.protobuf.Int64Value; import com.google.protobuf.Int64Value;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.comm.MessageOutputStream; import meerkat.comm.MessageOutputStream;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
/** /**
@ -15,7 +15,7 @@ import meerkat.protobuf.BulletinBoardAPI.*;
* An implementation of this interface may use any DB and be hosted on any machine. * An implementation of this interface may use any DB and be hosted on any machine.
*/ */
public interface BulletinBoardServer{ public interface BulletinBoardServer {
/** /**
* This method initializes the server by reading the signature data and storing it * This method initializes the server by reading the signature data and storing it
@ -23,7 +23,7 @@ public interface BulletinBoardServer{
* @throws CommunicationException on DB connection error * @throws CommunicationException on DB connection error
*/ */
public void init() throws CommunicationException; public void init() throws CommunicationException;
/** /**
* Post a message to bulletin board. * Post a message to bulletin board.
* @param msg is the actual (signed) message * @param msg is the actual (signed) message

View File

@ -1,9 +1,7 @@
package meerkat.bulletinboard; package meerkat.bulletinboard;
import meerkat.crypto.DigitalSignature; import meerkat.crypto.DigitalSignature;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.BulletinBoardAPI.UnsignedBulletinBoardMessage;
import meerkat.protobuf.Crypto;
import java.security.SignatureException; import java.security.SignatureException;

View File

@ -1,8 +1,7 @@
package meerkat.bulletinboard; package meerkat.bulletinboard;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.BulletinBoardAPI.MessageFilterList;
import java.util.List; import java.util.List;

View File

@ -1,7 +1,7 @@
package meerkat.bulletinboard; package meerkat.bulletinboard;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;

View File

@ -2,8 +2,7 @@ package meerkat.bulletinboard;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import meerkat.crypto.Digest; import meerkat.crypto.Digest;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.BulletinBoardAPI.MessageID;
import java.util.Collection; import java.util.Collection;

View File

@ -2,7 +2,7 @@ package meerkat.bulletinboard;
import com.google.protobuf.BoolValue; import com.google.protobuf.BoolValue;
import meerkat.comm.CommunicationException; import meerkat.comm.CommunicationException;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
/** /**
* Created by Arbel Deutsch Peled on 13-Apr-16. * Created by Arbel Deutsch Peled on 13-Apr-16.

View File

@ -1,12 +1,9 @@
package meerkat.bulletinboard; package meerkat.bulletinboard;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.google.protobuf.BytesValue;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import meerkat.crypto.Digest; import meerkat.crypto.Digest;
import meerkat.protobuf.BulletinBoardAPI; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.BulletinBoardAPI.*;
import meerkat.protobuf.BulletinBoardAPI.MessageID;
/** /**

View File

@ -2,12 +2,8 @@ package meerkat.bulletinboard;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import meerkat.crypto.Digest;
import meerkat.crypto.DigitalSignature; import meerkat.crypto.DigitalSignature;
import meerkat.protobuf.BulletinBoardAPI; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage;
import meerkat.protobuf.BulletinBoardAPI.MessageID;
import meerkat.protobuf.BulletinBoardAPI.UnsignedBulletinBoardMessage;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import java.io.IOException; import java.io.IOException;

View File

@ -2,8 +2,7 @@ package meerkat.bulletinboard;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import meerkat.crypto.Digest; import meerkat.crypto.Digest;
import meerkat.protobuf.BulletinBoardAPI.MessageID; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage;
import java.util.Collection; import java.util.Collection;
@ -11,7 +10,7 @@ import java.util.Collection;
* Created by Arbel Deutsch Peled on 01-Mar-16. * Created by Arbel Deutsch Peled on 01-Mar-16.
* Implementation of Checksum via bitwise XOR of the bytes of message IDs * Implementation of Checksum via bitwise XOR of the bytes of message IDs
*/ */
public class SimpleChecksum implements Checksum{ public class SimpleChecksum implements Checksum {
private Digest digest; private Digest digest;
private long checksum; private long checksum;

View File

@ -1,7 +1,7 @@
package meerkat.crypto; package meerkat.crypto;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import meerkat.protobuf.BulletinBoardAPI.MessageID; import meerkat.protobuf.BulletinBoardApi.MessageID;
import java.security.MessageDigest; import java.security.MessageDigest;

View File

@ -3,7 +3,7 @@ package meerkat.crypto.concrete;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import meerkat.crypto.Digest; import meerkat.crypto.Digest;
import meerkat.protobuf.BulletinBoardAPI.MessageID; import meerkat.protobuf.BulletinBoardApi.MessageID;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -1,7 +1,6 @@
package meerkat.util; package meerkat.util;
import meerkat.protobuf.BulletinBoardAPI; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.BulletinBoardAPI.*;
import meerkat.protobuf.Crypto.*; import meerkat.protobuf.Crypto.*;
import java.util.Comparator; import java.util.Comparator;

View File

@ -2,7 +2,7 @@ package meerkat.util;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import meerkat.crypto.DigitalSignature; import meerkat.crypto.DigitalSignature;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import com.google.protobuf.Timestamp; import com.google.protobuf.Timestamp;
import java.math.BigInteger; import java.math.BigInteger;

View File

@ -2,7 +2,7 @@ package meerkat.util;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.google.protobuf.Int64Value; import com.google.protobuf.Int64Value;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;

View File

@ -4,7 +4,7 @@ package meerkat;
option java_package = "meerkat.protobuf"; option java_package = "meerkat.protobuf";
import 'meerkat/crypto.proto'; import 'meerkat/crypto.proto';
import 'google/protobuf/timestamp.proto'; import 'google/protobuf/timestamp.proto';
message BoolMsg { message BoolMsg {

View File

@ -3,7 +3,7 @@ package meerkat.bulletinboard;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import meerkat.crypto.concrete.ECDSASignature; import meerkat.crypto.concrete.ECDSASignature;
import meerkat.crypto.concrete.SHA256Digest; import meerkat.crypto.concrete.SHA256Digest;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.util.BulletinBoardMessageGenerator; import meerkat.util.BulletinBoardMessageGenerator;
import meerkat.util.BulletinBoardUtils; import meerkat.util.BulletinBoardUtils;
import org.junit.Before; import org.junit.Before;

View File

@ -2,7 +2,7 @@ package meerkat.comm;
import com.google.protobuf.*; import com.google.protobuf.*;
import meerkat.comm.MessageInputStream.MessageInputStreamFactory; import meerkat.comm.MessageInputStream.MessageInputStreamFactory;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.util.BulletinBoardMessageComparator; import meerkat.util.BulletinBoardMessageComparator;
import org.junit.Test; import org.junit.Test;

View File

@ -1,7 +1,7 @@
package meerkat.mixer.main; package meerkat.mixer.main;
import meerkat.mixer.MixerOutput; import meerkat.mixer.MixerOutput;
import meerkat.protobuf.BulletinBoardAPI; import meerkat.protobuf.BulletinBoardApi;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.protobuf.Mixing; import meerkat.protobuf.Mixing;
@ -18,29 +18,29 @@ public class BatchConverter {
* @param mixerOutput * @param mixerOutput
* @return meerkat.mixProverVerifier.network output as list of batch data * @return meerkat.mixProverVerifier.network output as list of batch data
*/ */
public List<BulletinBoardAPI.BatchChunk> MixerOutput2BatchChunk(MixerOutput mixerOutput) { public List<BulletinBoardApi.BatchChunk> MixerOutput2BatchChunk(MixerOutput mixerOutput) {
List<BulletinBoardAPI.BatchChunk> result = new ArrayList<BulletinBoardAPI.BatchChunk>(); List<BulletinBoardApi.BatchChunk> result = new ArrayList<BulletinBoardApi.BatchChunk>();
Mixing.MixBatchHeader header = Mixing.MixBatchHeader.newBuilder() Mixing.MixBatchHeader header = Mixing.MixBatchHeader.newBuilder()
.setLogN(mixerOutput.getLogN()) .setLogN(mixerOutput.getLogN())
.setLayers(mixerOutput.getNumLayers()) .setLayers(mixerOutput.getNumLayers())
.build(); .build();
result.add(BulletinBoardAPI.BatchChunk.newBuilder() result.add(BulletinBoardApi.BatchChunk.newBuilder()
.setData(header.toByteString()) .setData(header.toByteString())
.build()); .build());
for (Mixing.Mix2Proof[] zkpLayer : mixerOutput.getProofs()) { for (Mixing.Mix2Proof[] zkpLayer : mixerOutput.getProofs()) {
for (Mixing.Mix2Proof zkp : zkpLayer) { for (Mixing.Mix2Proof zkp : zkpLayer) {
result.add(BulletinBoardAPI.BatchChunk.newBuilder() result.add(BulletinBoardApi.BatchChunk.newBuilder()
.setData(zkp.toByteString()) .setData(zkp.toByteString())
.build()); .build());
} }
} }
for (Crypto.RerandomizableEncryptedMessage[] encryptionLayer : mixerOutput.getEncryptedMessages()) { for (Crypto.RerandomizableEncryptedMessage[] encryptionLayer : mixerOutput.getEncryptedMessages()) {
for (Crypto.RerandomizableEncryptedMessage encryption : encryptionLayer) { for (Crypto.RerandomizableEncryptedMessage encryption : encryptionLayer) {
result.add(BulletinBoardAPI.BatchChunk.newBuilder() result.add(BulletinBoardApi.BatchChunk.newBuilder()
.setData(encryption.toByteString()) .setData(encryption.toByteString())
.build()); .build());
} }
@ -55,7 +55,7 @@ public class BatchConverter {
* @throws Exception * @throws Exception
*/ */
public MixerOutput BatchChunkList2MixerOutput public MixerOutput BatchChunkList2MixerOutput
(List<BulletinBoardAPI.BatchChunk> batchChunkList) throws Exception { (List<BulletinBoardApi.BatchChunk> batchChunkList) throws Exception {
Mixing.MixBatchHeader header = Mixing.MixBatchHeader.parseFrom(batchChunkList.remove(0).getData()); Mixing.MixBatchHeader header = Mixing.MixBatchHeader.parseFrom(batchChunkList.remove(0).getData());

View File

@ -3,7 +3,7 @@ package meerkat.mixer.main;
import meerkat.mixer.MixGenerator; import meerkat.mixer.MixGenerator;
import meerkat.mixer.MixerOutput; import meerkat.mixer.MixerOutput;
import meerkat.mixer.proofs.Mix2nizk; import meerkat.mixer.proofs.Mix2nizk;
import meerkat.protobuf.BulletinBoardAPI; import meerkat.protobuf.BulletinBoardApi;
import meerkat.protobuf.Crypto; import meerkat.protobuf.Crypto;
import meerkat.mixer.necessary.AsyncBulletinBoardClient; import meerkat.mixer.necessary.AsyncBulletinBoardClient;
@ -95,7 +95,7 @@ public class MainMixing {
, int batchId, AsyncBulletinBoardClient.ClientCallback<?> callback) { , int batchId, AsyncBulletinBoardClient.ClientCallback<?> callback) {
BatchConverter batchConverter = new BatchConverter(); BatchConverter batchConverter = new BatchConverter();
List<BulletinBoardAPI.BatchChunk> batchChunkList = batchConverter.MixerOutput2BatchChunk(mixerOutput); List<BulletinBoardApi.BatchChunk> batchChunkList = batchConverter.MixerOutput2BatchChunk(mixerOutput);
asyncBulletinBoardClient.postBatch(id, batchId, batchChunkList, callback); asyncBulletinBoardClient.postBatch(id, batchId, batchChunkList, callback);
} }

View File

@ -1,6 +1,6 @@
package meerkat.mixer.necessary; package meerkat.mixer.necessary;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import java.util.List; import java.util.List;

View File

@ -5,7 +5,7 @@ import meerkat.protobuf.Voting.BulletinBoardClientParams;
import java.util.List; import java.util.List;
import static meerkat.protobuf.BulletinBoardAPI.*; import static meerkat.protobuf.BulletinBoardApi.*;
/** /**
* Created by talm on 24/10/15. * Created by talm on 24/10/15.

View File

@ -1,7 +1,7 @@
package meerkat.mixer.necessary; package meerkat.mixer.necessary;
import meerkat.protobuf.BulletinBoardAPI.*; import meerkat.protobuf.BulletinBoardApi.*;
import meerkat.protobuf.Crypto.*; import meerkat.protobuf.Crypto.*;
import java.util.LinkedList; import java.util.LinkedList;

View File

@ -2,7 +2,7 @@ package meerkat.voting.gui;
import javafx.application.Application; import javafx.application.Application;
import javafx.stage.Stage; import javafx.stage.Stage;
import meerkat.protobuf.BallotQuestionUIElementOuterClass; import meerkat.protobuf.BallotQuestionUiElement;
import meerkat.voting.gui.configuration.VotingBoothConfiguration; import meerkat.voting.gui.configuration.VotingBoothConfiguration;
import meerkat.voting.gui.managment.ChainBuilder; import meerkat.voting.gui.managment.ChainBuilder;
import org.json.JSONException; import org.json.JSONException;
@ -30,7 +30,7 @@ public class Main extends Application {
*/ */
private VotingBoothConfiguration GetConfig() throws IOException, JSONException, URISyntaxException { private VotingBoothConfiguration GetConfig() throws IOException, JSONException, URISyntaxException {
FileInputStream fis = new FileInputStream(getClass().getResource(DEFAULT_CONFIGURATION_PATH).getPath()); FileInputStream fis = new FileInputStream(getClass().getResource(DEFAULT_CONFIGURATION_PATH).getPath());
BallotQuestionUIElementOuterClass.BallotQuestionsUIElements read_questions = BallotQuestionUIElementOuterClass.BallotQuestionsUIElements.parseFrom(fis); BallotQuestionUiElement.BallotQuestionsUIElements read_questions = BallotQuestionUiElement.BallotQuestionsUIElements.parseFrom(fis);
VotingBoothConfiguration votingBoothConfiguration = new VotingBoothConfiguration(); VotingBoothConfiguration votingBoothConfiguration = new VotingBoothConfiguration();
votingBoothConfiguration.NameSelectionQuestion = read_questions.getQuestions(1); votingBoothConfiguration.NameSelectionQuestion = read_questions.getQuestions(1);
votingBoothConfiguration.NameSelectionByPictureQuestion = read_questions.getQuestions(0); votingBoothConfiguration.NameSelectionByPictureQuestion = read_questions.getQuestions(0);

View File

@ -2,7 +2,7 @@ package meerkat.voting.gui.configuration;
import joptsimple.OptionParser; import joptsimple.OptionParser;
import joptsimple.OptionSet; import joptsimple.OptionSet;
import meerkat.protobuf.BallotQuestionUIElementOuterClass; import meerkat.protobuf.BallotQuestionUiElement.*;
import org.json.JSONException; import org.json.JSONException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -39,10 +39,8 @@ public class Converter {
*/ */
private static void ConvertJsonIntoBinaryFile(VotingBoothConfiguration configuration, String outputPath) throws IOException { private static void ConvertJsonIntoBinaryFile(VotingBoothConfiguration configuration, String outputPath) throws IOException {
FileOutputStream fileOutputStream = new FileOutputStream(outputPath); FileOutputStream fileOutputStream = new FileOutputStream(outputPath);
BallotQuestionUIElementOuterClass.BallotQuestionsUIElements read_questions = BallotQuestionsUIElements read_questions =
BallotQuestionUIElementOuterClass BallotQuestionsUIElements.newBuilder()
.BallotQuestionsUIElements
.newBuilder()
.addQuestions(configuration.NameSelectionByPictureQuestion) .addQuestions(configuration.NameSelectionByPictureQuestion)
.addQuestions(configuration.NameSelectionQuestion) .addQuestions(configuration.NameSelectionQuestion)
.build(); .build();

View File

@ -1,7 +1,7 @@
package meerkat.voting.gui.configuration; package meerkat.voting.gui.configuration;
import javafx.embed.swing.SwingFXUtils; import javafx.embed.swing.SwingFXUtils;
import meerkat.protobuf.BallotQuestionUIElementOuterClass; import meerkat.protobuf.BallotQuestionUiElement;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@ -11,8 +11,8 @@ import java.awt.image.BufferedImage;
* This object contains all the questions and configurations needed for the voting-booth-gui work * This object contains all the questions and configurations needed for the voting-booth-gui work
*/ */
public class VotingBoothConfiguration { public class VotingBoothConfiguration {
public BallotQuestionUIElementOuterClass.BallotQuestionUIElement NameSelectionQuestion; public BallotQuestionUiElement.BallotQuestionUIElement NameSelectionQuestion;
public BallotQuestionUIElementOuterClass.BallotQuestionUIElement NameSelectionByPictureQuestion; public BallotQuestionUiElement.BallotQuestionUIElement NameSelectionByPictureQuestion;
/** /**
* Checks that the configuration that have been given is valud * Checks that the configuration that have been given is valud
@ -29,12 +29,12 @@ public class VotingBoothConfiguration {
return false; return false;
} }
// check that both the types of the questions answers are supported // check that both the types of the questions answers are supported
if (BallotQuestionUIElementOuterClass.ValueType.forNumber(NameSelectionByPictureQuestion.getAnswers().getAnswersType()) == null || if (BallotQuestionUiElement.ValueType.forNumber(NameSelectionByPictureQuestion.getAnswers().getAnswersType()) == null ||
BallotQuestionUIElementOuterClass.ValueType.forNumber(NameSelectionQuestion.getAnswers().getAnswersType()) == null ){ BallotQuestionUiElement.ValueType.forNumber(NameSelectionQuestion.getAnswers().getAnswersType()) == null ){
return false; return false;
} }
// Check that all the given answers are valid bte strings that can be converted into strings // Check that all the given answers are valid bte strings that can be converted into strings
for (BallotQuestionUIElementOuterClass.UIAnswer answer: NameSelectionQuestion.getAnswers().getAnswers().getAnswersList()){ for (BallotQuestionUiElement.UIAnswer answer: NameSelectionQuestion.getAnswers().getAnswers().getAnswersList()){
try { try {
answer.getAnswer().toStringUtf8(); answer.getAnswer().toStringUtf8();
if (answer.getDescription() == null) { if (answer.getDescription() == null) {
@ -45,7 +45,7 @@ public class VotingBoothConfiguration {
} }
} }
// Check that all given byteStrings that are pictures can be converted into pictures // Check that all given byteStrings that are pictures can be converted into pictures
for (BallotQuestionUIElementOuterClass.UIAnswer answer :NameSelectionByPictureQuestion.getAnswers().getAnswers().getAnswersList()){ for (BallotQuestionUiElement.UIAnswer answer :NameSelectionByPictureQuestion.getAnswers().getAnswers().getAnswersList()){
try { try {
BufferedImage bufferedImage = ImageIO.read(answer.getAnswer().newInput()); BufferedImage bufferedImage = ImageIO.read(answer.getAnswer().newInput());
SwingFXUtils.toFXImage(bufferedImage, null); SwingFXUtils.toFXImage(bufferedImage, null);

View File

@ -1,7 +1,7 @@
package meerkat.voting.gui.configuration; package meerkat.voting.gui.configuration;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import meerkat.protobuf.BallotQuestionUIElementOuterClass; import meerkat.protobuf.BallotQuestionUiElement;
import org.factcenter.qilin.util.Pair; import org.factcenter.qilin.util.Pair;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
@ -47,7 +47,7 @@ public class VotingBoothConfigurationCreator {
throw new IOException(WRONG_QUESTIONS_AMOUNT_ERROR_MESSAGE); throw new IOException(WRONG_QUESTIONS_AMOUNT_ERROR_MESSAGE);
} else { } else {
try { try {
BallotQuestionUIElementOuterClass.BallotQuestionUIElement ballotQuestionUIElement = this.convertJSONObjToBallotQuestion(array.getJSONObject(0)); BallotQuestionUiElement.BallotQuestionUIElement ballotQuestionUIElement = this.convertJSONObjToBallotQuestion(array.getJSONObject(0));
config.NameSelectionQuestion = ballotQuestionUIElement; config.NameSelectionQuestion = ballotQuestionUIElement;
ballotQuestionUIElement = this.convertJSONObjToBallotQuestion(array.getJSONObject(1)); ballotQuestionUIElement = this.convertJSONObjToBallotQuestion(array.getJSONObject(1));
@ -81,7 +81,7 @@ public class VotingBoothConfigurationCreator {
* @param object the object to convert * @param object the object to convert
* @return BallotQuestion parsed fron JSONObject * @return BallotQuestion parsed fron JSONObject
*/ */
private BallotQuestionUIElementOuterClass.BallotQuestionUIElement convertJSONObjToBallotQuestion(JSONObject object) throws JSONException, IOException { private BallotQuestionUiElement.BallotQuestionUIElement convertJSONObjToBallotQuestion(JSONObject object) throws JSONException, IOException {
boolean randomize = object.getBoolean("randomize"); boolean randomize = object.getBoolean("randomize");
// Question part // Question part
@ -101,23 +101,23 @@ public class VotingBoothConfigurationCreator {
} }
// Create the UIQuestion and set the values parsed from jason // Create the UIQuestion and set the values parsed from jason
BallotQuestionUIElementOuterClass.UIQuestion uiQuestion = BallotQuestionUIElementOuterClass.UIQuestion.newBuilder() BallotQuestionUiElement.UIQuestion uiQuestion = BallotQuestionUiElement.UIQuestion.newBuilder()
.setQuestionType(questionType) .setQuestionType(questionType)
.setQuestion(BallotQuestionUIElementOuterClass.Question.newBuilder() .setQuestion(BallotQuestionUiElement.Question.newBuilder()
.setQuestion(questionValue)) .setQuestion(questionValue))
.build(); .build();
// Create UIAnswers and set the values parsed from jason // Create UIAnswers and set the values parsed from jason
BallotQuestionUIElementOuterClass.UIAnswers.Builder uiAnswersBuilder = BallotQuestionUIElementOuterClass.UIAnswers.newBuilder() BallotQuestionUiElement.UIAnswers.Builder uiAnswersBuilder = BallotQuestionUiElement.UIAnswers.newBuilder()
.setAnswersType(answersType); .setAnswersType(answersType);
BallotQuestionUIElementOuterClass.ListOfAnswers.Builder listOfAnswers = BallotQuestionUIElementOuterClass.ListOfAnswers.newBuilder(); BallotQuestionUiElement.ListOfAnswers.Builder listOfAnswers = BallotQuestionUiElement.ListOfAnswers.newBuilder();
for(Pair<ByteString, String> pair: answersPairs){ for(Pair<ByteString, String> pair: answersPairs){
listOfAnswers.addAnswers(ConvertPairIntoUIAnswer(pair)); listOfAnswers.addAnswers(ConvertPairIntoUIAnswer(pair));
} }
uiAnswersBuilder.setAnswers(listOfAnswers); uiAnswersBuilder.setAnswers(listOfAnswers);
this.logger.debug("Converted the json object into ballot question object.\n" + object); this.logger.debug("Converted the json object into ballot question object.\n" + object);
return BallotQuestionUIElementOuterClass.BallotQuestionUIElement.newBuilder() return BallotQuestionUiElement.BallotQuestionUIElement.newBuilder()
.setQuestion(uiQuestion) .setQuestion(uiQuestion)
.setAnswers(uiAnswersBuilder.build()) .setAnswers(uiAnswersBuilder.build())
.setRandomizeListOrder(randomize) .setRandomizeListOrder(randomize)
@ -129,8 +129,8 @@ public class VotingBoothConfigurationCreator {
* @param pair A pair of byteString which is the answer and string which is the description of the answer * @param pair A pair of byteString which is the answer and string which is the description of the answer
* @return UIAnswer * @return UIAnswer
*/ */
private BallotQuestionUIElementOuterClass.UIAnswer ConvertPairIntoUIAnswer(Pair<ByteString, String> pair) { private BallotQuestionUiElement.UIAnswer ConvertPairIntoUIAnswer(Pair<ByteString, String> pair) {
return BallotQuestionUIElementOuterClass.UIAnswer.newBuilder() return BallotQuestionUiElement.UIAnswer.newBuilder()
.setAnswer(pair.a) .setAnswer(pair.a)
.setDescription(pair.b) .setDescription(pair.b)
.build(); .build();
@ -144,10 +144,10 @@ public class VotingBoothConfigurationCreator {
* @throws IOException will be thrown if the given type is unsupported * @throws IOException will be thrown if the given type is unsupported
*/ */
private ByteString convertToByteStringBasedOnType(int questionType, JSONObject value) throws IOException, JSONException { private ByteString convertToByteStringBasedOnType(int questionType, JSONObject value) throws IOException, JSONException {
if (questionType == BallotQuestionUIElementOuterClass.ValueType.TEXT_TYPE.getNumber()) { if (questionType == BallotQuestionUiElement.ValueType.TEXT_TYPE.getNumber()) {
return ByteString.copyFromUtf8(value.getString("answer")); return ByteString.copyFromUtf8(value.getString("answer"));
} }
if (questionType == BallotQuestionUIElementOuterClass.ValueType.IMAGE_TYPE.getNumber()) { if (questionType == BallotQuestionUiElement.ValueType.IMAGE_TYPE.getNumber()) {
return ByteString.copyFrom(getImageBytes(value.getString("answer"))); return ByteString.copyFrom(getImageBytes(value.getString("answer")));
} }
else { else {

View File

@ -1,6 +1,6 @@
package meerkat.voting.gui.managment; package meerkat.voting.gui.managment;
import meerkat.protobuf.BallotQuestionUIElementOuterClass; import meerkat.protobuf.BallotQuestionUiElement;
import java.util.List; import java.util.List;
@ -15,7 +15,7 @@ import java.util.List;
public class VotersBallot { public class VotersBallot {
public List<Integer> VoterChannel; public List<Integer> VoterChannel;
public String VotersNameSelection; public String VotersNameSelection;
public BallotQuestionUIElementOuterClass.UIAnswer VotersImageSelection; public BallotQuestionUiElement.UIAnswer VotersImageSelection;
/** /**
* Gets the name of the candidate the voter choose * Gets the name of the candidate the voter choose

View File

@ -13,7 +13,7 @@ import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import javafx.stage.Stage; import javafx.stage.Stage;
import meerkat.protobuf.BallotQuestionUIElementOuterClass; import meerkat.protobuf.BallotQuestionUiElement;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -36,8 +36,8 @@ class PicturesAnswersUpdater implements EventHandler{
private Stage currentStage; private Stage currentStage;
private int columIndex; private int columIndex;
private List<BallotQuestionUIElementOuterClass.UIAnswer> allAvailableAnswers; private List<BallotQuestionUiElement.UIAnswer> allAvailableAnswers;
private FutureCallback<BallotQuestionUIElementOuterClass.UIAnswer> imageUpdate; private FutureCallback<BallotQuestionUiElement.UIAnswer> imageUpdate;
PicturesAnswersUpdater(Stage primaryStage) { PicturesAnswersUpdater(Stage primaryStage) {
this.currentStage = primaryStage; this.currentStage = primaryStage;
@ -52,7 +52,7 @@ class PicturesAnswersUpdater implements EventHandler{
* Sets the call back object which will be called every time the voter choose different candidate picture * Sets the call back object which will be called every time the voter choose different candidate picture
* @param imageUpdate the callback object itself * @param imageUpdate the callback object itself
*/ */
public void SetImageUpdate(FutureCallback<BallotQuestionUIElementOuterClass.UIAnswer> imageUpdate){ public void SetImageUpdate(FutureCallback<BallotQuestionUiElement.UIAnswer> imageUpdate){
this.imageUpdate = imageUpdate; this.imageUpdate = imageUpdate;
} }
@ -61,14 +61,14 @@ class PicturesAnswersUpdater implements EventHandler{
* *
* @param question the ballot question that contains all the pictures that are the answers * @param question the ballot question that contains all the pictures that are the answers
*/ */
void UpdateAnswers(BallotQuestionUIElementOuterClass.BallotQuestionUIElement question) { void UpdateAnswers(BallotQuestionUiElement.BallotQuestionUIElement question) {
this.RemoveAllAnswers(); this.RemoveAllAnswers();
List<BallotQuestionUIElementOuterClass.UIAnswer> answers = new ArrayList<>(question.getAnswers().getAnswers().getAnswersList()); List<BallotQuestionUiElement.UIAnswer> answers = new ArrayList<>(question.getAnswers().getAnswers().getAnswersList());
if (question.getRandomizeListOrder()) { if (question.getRandomizeListOrder()) {
Collections.shuffle(answers); Collections.shuffle(answers);
} }
for (BallotQuestionUIElementOuterClass.UIAnswer answer: answers){ for (BallotQuestionUiElement.UIAnswer answer: answers){
try { try {
this.allAvailableAnswers.add(answer); this.allAvailableAnswers.add(answer);
this.AddAnswer(answer); this.AddAnswer(answer);
@ -104,7 +104,7 @@ class PicturesAnswersUpdater implements EventHandler{
* @param location the location of the picture * @param location the location of the picture
* @return GridPane which contains string and check box * @return GridPane which contains string and check box
*/ */
private GridPane GetAnswerElement(BallotQuestionUIElementOuterClass.UIAnswer answer, int location) throws IOException { private GridPane GetAnswerElement(BallotQuestionUiElement.UIAnswer answer, int location) throws IOException {
GridPane gridPane = new GridPane(); GridPane gridPane = new GridPane();
BufferedImage bufferedImage = ImageIO.read(answer.getAnswer().newInput()); BufferedImage bufferedImage = ImageIO.read(answer.getAnswer().newInput());
@ -139,7 +139,7 @@ class PicturesAnswersUpdater implements EventHandler{
* *
* @param answer the binaryData string to represent to the user * @param answer the binaryData string to represent to the user
*/ */
private void AddAnswer(BallotQuestionUIElementOuterClass.UIAnswer answer) throws IOException { private void AddAnswer(BallotQuestionUiElement.UIAnswer answer) throws IOException {
GridPane container = this.GetAnswersContainer(); GridPane container = this.GetAnswersContainer();
this.columIndex++; this.columIndex++;

View File

@ -3,7 +3,7 @@ package meerkat.voting.gui.panels.select_candidate_by_picture;
import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.FutureCallback;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.input.MouseEvent; import javafx.scene.input.MouseEvent;
import meerkat.protobuf.BallotQuestionUIElementOuterClass; import meerkat.protobuf.BallotQuestionUiElement;
import meerkat.voting.gui.managment.TwoWayNode; import meerkat.voting.gui.managment.TwoWayNode;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -12,7 +12,7 @@ import org.slf4j.LoggerFactory;
* Created by Vladimir Eliezer Tokarev on 8/27/2016. * Created by Vladimir Eliezer Tokarev on 8/27/2016.
* SelectCandidateNameController handle the behavior of select by picture screen * SelectCandidateNameController handle the behavior of select by picture screen
*/ */
public class SelectCandidateByPictureController extends TwoWayNode implements FutureCallback<BallotQuestionUIElementOuterClass.UIAnswer> { public class SelectCandidateByPictureController extends TwoWayNode implements FutureCallback<BallotQuestionUiElement.UIAnswer> {
private final Logger logger = LoggerFactory.getLogger(SelectCandidateByPictureController.class); private final Logger logger = LoggerFactory.getLogger(SelectCandidateByPictureController.class);
@ -50,7 +50,7 @@ public class SelectCandidateByPictureController extends TwoWayNode implements Fu
} }
@Override @Override
public void onSuccess(BallotQuestionUIElementOuterClass.UIAnswer result) { public void onSuccess(BallotQuestionUiElement.UIAnswer result) {
this.votersBallot.VotersImageSelection = result; this.votersBallot.VotersImageSelection = result;
} }

View File

@ -7,7 +7,7 @@ import javafx.scene.control.CheckBox;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import javafx.stage.Stage; import javafx.stage.Stage;
import meerkat.protobuf.BallotQuestionUIElementOuterClass; import meerkat.protobuf.BallotQuestionUiElement;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -104,16 +104,16 @@ class StringsAnswersUpdater implements javafx.event.EventHandler{
* Checks if the answers should be randomized, if they are then randomize them * Checks if the answers should be randomized, if they are then randomize them
* @param question the questions that have all the information to be reporesneted * @param question the questions that have all the information to be reporesneted
*/ */
void UpdateAnswers(BallotQuestionUIElementOuterClass.BallotQuestionUIElement question) { void UpdateAnswers(BallotQuestionUiElement.BallotQuestionUIElement question) {
this.RemoveAllAnswers(); this.RemoveAllAnswers();
List<BallotQuestionUIElementOuterClass.UIAnswer> answers = List<BallotQuestionUiElement.UIAnswer> answers =
new ArrayList<>(question.getAnswers().getAnswers().getAnswersList()); new ArrayList<>(question.getAnswers().getAnswers().getAnswersList());
if (question.getRandomizeListOrder()){ if (question.getRandomizeListOrder()){
Collections.shuffle(answers); Collections.shuffle(answers);
} }
for (BallotQuestionUIElementOuterClass.UIAnswer answer: answers){ for (BallotQuestionUiElement.UIAnswer answer: answers){
this.AddAnswer(answer.getAnswer().toStringUtf8()); this.AddAnswer(answer.getAnswer().toStringUtf8());
} }
this.currentStage.show(); this.currentStage.show();