From 097aad4e7b453efa044526ada6aa35cb14a4f21f Mon Sep 17 00:00:00 2001 From: Vladimir Eliezer Tokarev Date: Sat, 27 Feb 2016 01:27:19 -0800 Subject: [PATCH] Changed the enumartion of RegistryTags to abstract class with static final strings as tags --- bulletin-board-server/meerkat | Bin 97280 -> 106496 bytes .../Registry/CollectionMessagesUtils.java | 2 +- .../java/meerkat/Registry/RegistryTags.java | 27 +++++----------- .../Registry/RelevantDataCallBack.java | 2 +- .../src/main/java/meerkat/SimpleRegistry.java | 29 +++++++----------- .../java/meerkat/VoterRegistryMessage.java | 18 +---------- .../src/test/java/SimpleRegistryTest.java | 9 +++--- 7 files changed, 26 insertions(+), 61 deletions(-) diff --git a/bulletin-board-server/meerkat b/bulletin-board-server/meerkat index 7257000a698a55e7a2a986ccdd81a57f7410f6f8..162a2ec263ead26f8d7cf1e68e540b42d0543e91 100644 GIT binary patch delta 7916 zcmai330PCd_MbBo5(Gp*t03G2RrUgp)DYF)SKFeSm#VW}lhzhoO9Qi9QZu z-ff9t2k01m;B|~=GZTX1dH5)bV&()zdMU%m7+?x>L%ov7Oe$*$y5}e?1uqOEoX5H< zcmX@;P?S$@lWXJ*IYM?gy9ci&y{Rm{6Av)1ghB8DeHzL=<)C|z%A5%q=-q{EVh0w} z?d{_n(0d{Ap-&nOZ3^<3U42LS6Ec_WpyhUTt}{qj#qDSYvnQ+{OlH< z=*E6L1uq!QM~t5`yc?QN=tmMGSwc3GbL<~Nj7FIr7V7Ms4)NdP5TEVIgdQlkgDDV}yml-bh8)XIDSx8<84GQnBX$ z4qm?eXn$L;@WXctuSS>12HyP7(B>Zu4~%d4RZP9CL-lO0@fn|$O_`w?5iWSL;*lw5 zc^AFc@h|RHDPM~6g?h!B8Z?_(QcyuBjpX$sso^G&+Rn|D&iCokHi(kLW78 zfo`GO=mB~H1iYa$1VIn_d0`Oc2zZ4yaU$r$SU${j&iYV6yxDE&PIrLuFMPR^d(Y_? z({o}PK3>M`5Joa9gptmMk9Xt7H9T*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+k>;|d?Po_P@s51NJV;;<^saQm=NQxI4 z*(~zWA84D#?>mm<^q>ra;tyQe)_$d`n~FHo7J)y$slo6LE`>$4{_)3A+9H9aF$kj0gva&TIrR% zl&iJSH}T)J(D(EEL81REAavajnUqIf-5~LlL{Whnw;(J?-vSKB+iJ;E=#n-c!|+z{ zk9xiXdxNX)TJ5sm*P@Dx8N~krBFZrX0aDwEA-bu=k_T XB~jxn$X_yPf&6DvsyTOoZu0*D-Zqq~ diff --git a/voter-registry/src/main/java/meerkat/Registry/CollectionMessagesUtils.java b/voter-registry/src/main/java/meerkat/Registry/CollectionMessagesUtils.java index 33b8ca5..03d542c 100644 --- a/voter-registry/src/main/java/meerkat/Registry/CollectionMessagesUtils.java +++ b/voter-registry/src/main/java/meerkat/Registry/CollectionMessagesUtils.java @@ -51,7 +51,7 @@ public abstract class CollectionMessagesUtils { // iterate trough all the messages and put into the map the last updated groups actions for (int i = 0 ; i < messages.size() ; i++) { VoterRegistryMessage message = messages.get(i); - String groupId = message.GetWantedTagFromBasicMessage(RegistryTags.GROUP_ID_TAG.toString()); + String groupId = message.GetWantedTagFromBasicMessage(RegistryTags.GROUP_ID_TAG); VoterRegistryMessage temp = groupIdToMessage.get(groupId); if (temp != null && temp != message) { diff --git a/voter-registry/src/main/java/meerkat/Registry/RegistryTags.java b/voter-registry/src/main/java/meerkat/Registry/RegistryTags.java index 9b2ea32..3f4d36a 100644 --- a/voter-registry/src/main/java/meerkat/Registry/RegistryTags.java +++ b/voter-registry/src/main/java/meerkat/Registry/RegistryTags.java @@ -1,28 +1,17 @@ package meerkat.Registry; + /** * Created by Vladimir Eliezer Tokarev on 1/9/2016. * Have the tags for the registry messages */ -public enum RegistryTags { - - ID_TAG("ID:"), - VOTER_ENTRY_TAG("Voter Entry"), - GROUP_ID_TAG("GroupID:"), - GROUP_ACTION_TAG("Group Action:"), - ADD_TO_GROUP_TAG("Add To Group"), - ACTION_TIMESTAMP_TAG("Action timestamp: "), - VOTE_ACTION_TAG("Vote Action"); - - private final String text; - - RegistryTags(final String text){ - this.text = text; - } - - public String toString(){ - return text; - } +public abstract class RegistryTags { + public final static String ID_TAG = "ID:"; + public final static String VOTER_ENTRY_TAG = "VoterEntry:"; + public final static String GROUP_ID_TAG = "GroupID:"; + public final static String ADD_TO_GROUP_TAG = "AddToGroup:"; + public final static String ACTION_TIMESTAMP_TAG = "ActionTimestamp: "; + public final static String VOTE_ACTION_TAG = "VoteAction:"; } diff --git a/voter-registry/src/main/java/meerkat/Registry/RelevantDataCallBack.java b/voter-registry/src/main/java/meerkat/Registry/RelevantDataCallBack.java index 47308e0..8339e62 100644 --- a/voter-registry/src/main/java/meerkat/Registry/RelevantDataCallBack.java +++ b/voter-registry/src/main/java/meerkat/Registry/RelevantDataCallBack.java @@ -60,7 +60,7 @@ public class RelevantDataCallBack implements ClientCallback tags = msg.get(0).getMsg().getTagList(); for (int i = 0 ;i < tags.size(); i++) { String tag = tags.get(i); - if(tag.contains(RegistryTags.GROUP_ID_TAG.toString())) + if(tag.contains(RegistryTags.GROUP_ID_TAG)) { return true; } diff --git a/voter-registry/src/main/java/meerkat/SimpleRegistry.java b/voter-registry/src/main/java/meerkat/SimpleRegistry.java index 762a9a0..8e13e1a 100644 --- a/voter-registry/src/main/java/meerkat/SimpleRegistry.java +++ b/voter-registry/src/main/java/meerkat/SimpleRegistry.java @@ -14,6 +14,10 @@ import java.security.SignatureException; import java.util.ArrayList; import java.util.List; +/** + * TODO : add ability to use DB of certificates + */ + /** * Created by Vladimir Eliezer Tokarev on 1/8/2016. * Gives the ability to synchronously manage voters information @@ -55,26 +59,15 @@ public class SimpleRegistry implements VoterRegistry{ } } - /** - * Tries to post basicMessage and return true if its been successfully posted - * - * @param Message the massage to post - * @return true when the post was successful else false - */ - private void SafePost(BulletinBoardMessage Message, BulletinBoardClient.ClientCallback callback) { - bulletinBoardClient .postMessage(Message, callback); - } - public void AddVoter(VoterInfo voterInfo, RegistryCallBack callback) { UnsignedBulletinBoardMessage.Builder basicMessage = UnsignedBulletinBoardMessage.newBuilder(). addTag(RegistryTags.ID_TAG + voterInfo.getId().getId()) - .addTag(RegistryTags.VOTER_ENTRY_TAG.toString()) + .addTag(RegistryTags.VOTER_ENTRY_TAG) .addTag(RegistryTags.ACTION_TIMESTAMP_TAG + AccurateTimestamp.GetCurrentTimestampString()); basicMessage.setData(voterInfo.getInfoBytes()); - - SafePost(CreateBulletinBoardMessage(basicMessage.build()), new BooleanCallBack(callback)); + bulletinBoardClient.postMessage(CreateBulletinBoardMessage(basicMessage.build()), new BooleanCallBack(callback)); } public void AddToGroup(VoterGroup voterGroup, RegistryCallBack callback) { @@ -82,20 +75,20 @@ public class SimpleRegistry implements VoterRegistry{ UnsignedBulletinBoardMessage.newBuilder() .addTag(RegistryTags.ID_TAG + voterGroup.getVoterId().getId()) .addTag(RegistryTags.GROUP_ID_TAG + voterGroup.getGroupId().getId()) - .addTag(RegistryTags.GROUP_ACTION_TAG .toString() + RegistryTags.ADD_TO_GROUP_TAG) + .addTag(RegistryTags.ADD_TO_GROUP_TAG) .addTag(RegistryTags.ACTION_TIMESTAMP_TAG + AccurateTimestamp.GetCurrentTimestampString()); - SafePost(CreateBulletinBoardMessage(basicMessage.build()), new BooleanCallBack(callback)); + bulletinBoardClient.postMessage(CreateBulletinBoardMessage(basicMessage.build()), new BooleanCallBack(callback)); } public void SetVoted(VoterID voterId, RegistryCallBack callback) { UnsignedBulletinBoardMessage.Builder basicMessage = UnsignedBulletinBoardMessage.newBuilder() .addTag(RegistryTags.ID_TAG + voterId.getId()) - .addTag(RegistryTags.VOTE_ACTION_TAG.toString()) + .addTag(RegistryTags.VOTE_ACTION_TAG) .addTag(RegistryTags.ACTION_TIMESTAMP_TAG + AccurateTimestamp.GetCurrentTimestampString()); - SafePost(CreateBulletinBoardMessage(basicMessage.build()), new BooleanCallBack(callback)); + bulletinBoardClient.postMessage(CreateBulletinBoardMessage(basicMessage.build()), new BooleanCallBack(callback)); } public void GetGroups(GroupID groupID, RegistryCallBack callback) { @@ -109,7 +102,7 @@ public class SimpleRegistry implements VoterRegistry{ public void GetPersonIDDetails(VoterID voterID, RegistryCallBack callback) { List GroupsActionsTags = new ArrayList() {{ add(RegistryTags.ID_TAG + voterID.getId()); - add(RegistryTags.VOTER_ENTRY_TAG.toString()); + add(RegistryTags.VOTER_ENTRY_TAG); }}; bulletinBoardClient.readMessages(CollectionMessagesUtils.GenerateFiltersFromTags(GroupsActionsTags), new RelevantDataCallBack(callback, signer, signature, certificateStream)); diff --git a/voter-registry/src/main/java/meerkat/VoterRegistryMessage.java b/voter-registry/src/main/java/meerkat/VoterRegistryMessage.java index 51910f3..0a6285a 100644 --- a/voter-registry/src/main/java/meerkat/VoterRegistryMessage.java +++ b/voter-registry/src/main/java/meerkat/VoterRegistryMessage.java @@ -56,7 +56,7 @@ public class VoterRegistryMessage { List tags = base.getTagList(); for (int i = 0 ; i < tags.size() ; i++) { String tag = tags.get(i); - if (tag.contains(RegistryTags.ACTION_TIMESTAMP_TAG.toString())) { + if (tag.contains(RegistryTags.ACTION_TIMESTAMP_TAG)) { String[] tagParts = tag.split(" "); String timestamp = tagParts[tagParts.length - 2] + " " + tagParts[tagParts.length - 1]; @@ -66,20 +66,4 @@ public class VoterRegistryMessage { return null; } - - /** - * Checks if the given message have the ADD_TO_GROUP_TAG - * - * @return true when ADD_TO_GROUP_TAG exist else false - */ - public boolean IsGroupAdding() { - List tags = base.getTagList(); - for (int i = 0 ; i < tags.size() ; i++) { - String tag = tags.get(i); - if (tag.contains(RegistryTags.ADD_TO_GROUP_TAG.toString())) { - return true; - } - } - return false; - } } diff --git a/voter-registry/src/test/java/SimpleRegistryTest.java b/voter-registry/src/test/java/SimpleRegistryTest.java index 60ce8c3..80d7500 100644 --- a/voter-registry/src/test/java/SimpleRegistryTest.java +++ b/voter-registry/src/test/java/SimpleRegistryTest.java @@ -178,7 +178,7 @@ public class SimpleRegistryTest extends TestCase { jobSemaphore.acquire(); assertEquals(1, handler.counter ); - List tags = new ArrayList(){{ add(RegistryTags.VOTER_ENTRY_TAG.toString());}}; + List tags = new ArrayList(){{ add(RegistryTags.VOTER_ENTRY_TAG);}}; MessageFilterList filters = CollectionMessagesUtils.GenerateFiltersFromTags(tags); DummyBulletinBoardCallBackHandler bulletinHandler = new DummyBulletinBoardCallBackHandler(); bulletinBoardClient.readMessages(filters, bulletinHandler); @@ -206,7 +206,7 @@ public class SimpleRegistryTest extends TestCase { jobSemaphore.acquire(); assertEquals(1, handler.counter ); - List tags = new ArrayList(){{ add(RegistryTags.VOTE_ACTION_TAG.toString());}}; + List tags = new ArrayList(){{ add(RegistryTags.VOTE_ACTION_TAG);}}; MessageFilterList filters = CollectionMessagesUtils.GenerateFiltersFromTags(tags); DummyBulletinBoardCallBackHandler bulletinHandler = new DummyBulletinBoardCallBackHandler(); bulletinBoardClient.readMessages(filters, bulletinHandler); @@ -236,8 +236,7 @@ public class SimpleRegistryTest extends TestCase { jobSemaphore.acquire(); assertEquals(1, handler.counter); - List tags = new ArrayList(){{ add(RegistryTags.GROUP_ACTION_TAG .toString() - + RegistryTags.ADD_TO_GROUP_TAG.toString());}}; + List tags = new ArrayList(){{add(RegistryTags.ADD_TO_GROUP_TAG);}}; MessageFilterList filters = CollectionMessagesUtils.GenerateFiltersFromTags(tags); DummyBulletinBoardCallBackHandler bulletinHandler = new DummyBulletinBoardCallBackHandler(); bulletinBoardClient.readMessages(filters, bulletinHandler); @@ -305,7 +304,7 @@ public class SimpleRegistryTest extends TestCase { jobSemaphore.acquire(1); assertEquals(RegistryTags.ID_TAG + id, - personalHandler.data.GetWantedTagFromBasicMessage(RegistryTags.ID_TAG.toString())); + personalHandler.data.GetWantedTagFromBasicMessage(RegistryTags.ID_TAG)); assertEquals(data,personalHandler.data.base.getData().toStringUtf8()); } }