diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-10-21 19:13:51 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-10-21 19:13:51 +0000 |
commit | 35df3d81f0f5b76b728b3be8ddaa95ecdbbd0e5e (patch) | |
tree | 4dd6f07e063782f39a18fa1031a3f514a8ecc477 /src/main/java/org/gnunet/dht | |
parent | 8ceb5e95568a0a5be9ca6fd28a31fe6b07e06f28 (diff) | |
download | gnunet-java-35df3d81f0f5b76b728b3be8ddaa95ecdbbd0e5e.tar.gz gnunet-java-35df3d81f0f5b76b728b3be8ddaa95ecdbbd0e5e.zip |
- use java naming conventions (no underscores in non-capitalized identifiers) consistently
Diffstat (limited to 'src/main/java/org/gnunet/dht')
7 files changed, 29 insertions, 29 deletions
diff --git a/src/main/java/org/gnunet/dht/ClientGetStopMessage.java b/src/main/java/org/gnunet/dht/ClientGetStopMessage.java index 4cdee12..39915de 100644 --- a/src/main/java/org/gnunet/dht/ClientGetStopMessage.java +++ b/src/main/java/org/gnunet/dht/ClientGetStopMessage.java | |||
@@ -39,7 +39,7 @@ public class ClientGetStopMessage implements GnunetMessage.Body { | |||
39 | @UInt32 | 39 | @UInt32 |
40 | public int reserved = 0; | 40 | public int reserved = 0; |
41 | @UInt64 | 41 | @UInt64 |
42 | public long unique_id; | 42 | public long uniqueId; |
43 | @NestedMessage | 43 | @NestedMessage |
44 | public HashCode key; | 44 | public HashCode key; |
45 | } | 45 | } |
diff --git a/src/main/java/org/gnunet/dht/DistributedHashTable.java b/src/main/java/org/gnunet/dht/DistributedHashTable.java index 0a561bf..10ac00e 100644 --- a/src/main/java/org/gnunet/dht/DistributedHashTable.java +++ b/src/main/java/org/gnunet/dht/DistributedHashTable.java | |||
@@ -122,7 +122,7 @@ public class DistributedHashTable { | |||
122 | public Envelope assembleRequest() { | 122 | public Envelope assembleRequest() { |
123 | MonitorStartStop mss = new MonitorStartStop(); | 123 | MonitorStartStop mss = new MonitorStartStop(); |
124 | if (key != null) { | 124 | if (key != null) { |
125 | mss.filter_key = 1; | 125 | mss.filterKey = 1; |
126 | mss.key = key; | 126 | mss.key = key; |
127 | } else { | 127 | } else { |
128 | mss.key = new HashCode(); | 128 | mss.key = new HashCode(); |
@@ -177,14 +177,14 @@ public class DistributedHashTable { | |||
177 | 177 | ||
178 | public void visit(MonitorGetMessage monitorGetMessage) { | 178 | public void visit(MonitorGetMessage monitorGetMessage) { |
179 | for (MonitorRequest monitorRequest : monitorRequests.iter()) { | 179 | for (MonitorRequest monitorRequest : monitorRequests.iter()) { |
180 | boolean type_ok = (monitorGetMessage.type == BlockType.ANY.val) | 180 | boolean typeOk = (monitorGetMessage.type == BlockType.ANY.val) |
181 | || (monitorGetMessage.type == monitorRequest.blockType); | 181 | || (monitorGetMessage.type == monitorRequest.blockType); |
182 | boolean key_ok = monitorGetMessage.key.isAllZero() | 182 | boolean keyOk = monitorGetMessage.key.isAllZero() |
183 | || monitorGetMessage.key.equals(monitorRequest.key); | 183 | || monitorGetMessage.key.equals(monitorRequest.key); |
184 | 184 | ||
185 | if (key_ok && type_ok && monitorRequest.getHandler != null) { | 185 | if (keyOk && typeOk && monitorRequest.getHandler != null) { |
186 | monitorRequest.getHandler.onGet(monitorGetMessage.options, monitorGetMessage.type, | 186 | monitorRequest.getHandler.onGet(monitorGetMessage.options, monitorGetMessage.type, |
187 | monitorGetMessage.hop_count, monitorGetMessage.desired_replication_level, monitorGetMessage.getPath, | 187 | monitorGetMessage.hopCount, monitorGetMessage.desiredReplicationLevel, monitorGetMessage.getPath, |
188 | monitorGetMessage.key); | 188 | monitorGetMessage.key); |
189 | } | 189 | } |
190 | } | 190 | } |
@@ -192,12 +192,12 @@ public class DistributedHashTable { | |||
192 | 192 | ||
193 | public void visit(MonitorGetRespMessage monitorGetRespMessage) { | 193 | public void visit(MonitorGetRespMessage monitorGetRespMessage) { |
194 | for (MonitorRequest monitorRequest : monitorRequests.iter()) { | 194 | for (MonitorRequest monitorRequest : monitorRequests.iter()) { |
195 | boolean type_ok = (monitorGetRespMessage.type == BlockType.ANY.val) | 195 | boolean typeOk = (monitorGetRespMessage.type == BlockType.ANY.val) |
196 | || (monitorGetRespMessage.type == monitorRequest.blockType); | 196 | || (monitorGetRespMessage.type == monitorRequest.blockType); |
197 | boolean key_ok = monitorGetRespMessage.key.isAllZero() | 197 | boolean keyOk = monitorGetRespMessage.key.isAllZero() |
198 | || monitorGetRespMessage.key.equals(monitorRequest.key); | 198 | || monitorGetRespMessage.key.equals(monitorRequest.key); |
199 | 199 | ||
200 | if (key_ok && type_ok && monitorRequest.getResponseHandler != null) { | 200 | if (keyOk && typeOk && monitorRequest.getResponseHandler != null) { |
201 | monitorRequest.getResponseHandler.onGetResponse( | 201 | monitorRequest.getResponseHandler.onGetResponse( |
202 | monitorGetRespMessage.type, | 202 | monitorGetRespMessage.type, |
203 | monitorGetRespMessage.getPath, | 203 | monitorGetRespMessage.getPath, |
@@ -212,14 +212,14 @@ public class DistributedHashTable { | |||
212 | 212 | ||
213 | public void visit(MonitorPutMessage monitorPutMessage) { | 213 | public void visit(MonitorPutMessage monitorPutMessage) { |
214 | for (MonitorRequest monitorRequest : monitorRequests.iter()) { | 214 | for (MonitorRequest monitorRequest : monitorRequests.iter()) { |
215 | boolean type_ok = (monitorPutMessage.type == BlockType.ANY.val) | 215 | boolean typeOk = (monitorPutMessage.type == BlockType.ANY.val) |
216 | || (monitorPutMessage.type == monitorRequest.blockType); | 216 | || (monitorPutMessage.type == monitorRequest.blockType); |
217 | boolean key_ok = monitorPutMessage.key.isAllZero() | 217 | boolean keyOk = monitorPutMessage.key.isAllZero() |
218 | || monitorPutMessage.key.equals(monitorRequest.key); | 218 | || monitorPutMessage.key.equals(monitorRequest.key); |
219 | 219 | ||
220 | if (key_ok && type_ok && monitorRequest.putHandler != null) { | 220 | if (keyOk && typeOk && monitorRequest.putHandler != null) { |
221 | monitorRequest.putHandler.onPut(monitorPutMessage.options, monitorPutMessage.type, | 221 | monitorRequest.putHandler.onPut(monitorPutMessage.options, monitorPutMessage.type, |
222 | monitorPutMessage.hop_count, monitorPutMessage.expirationTime, | 222 | monitorPutMessage.hopCount, monitorPutMessage.expirationTime, |
223 | monitorPutMessage.putPath, monitorPutMessage.key, monitorPutMessage.data); | 223 | monitorPutMessage.putPath, monitorPutMessage.key, monitorPutMessage.data); |
224 | } | 224 | } |
225 | } | 225 | } |
@@ -402,8 +402,8 @@ public class DistributedHashTable { | |||
402 | dht.startMonitor(BlockType.TEST.val, null, | 402 | dht.startMonitor(BlockType.TEST.val, null, |
403 | new MonitorGetHandler() { | 403 | new MonitorGetHandler() { |
404 | @Override | 404 | @Override |
405 | public void onGet(int options, int type, int hop_count, | 405 | public void onGet(int options, int type, int hopCount, |
406 | int desired_replication_level, PeerIdentity[] getPath, HashCode key) { | 406 | int desiredReplicationLevel, PeerIdentity[] getPath, HashCode key) { |
407 | System.out.println("get monitored"); | 407 | System.out.println("get monitored"); |
408 | } | 408 | } |
409 | }, | 409 | }, |
diff --git a/src/main/java/org/gnunet/dht/MonitorGetHandler.java b/src/main/java/org/gnunet/dht/MonitorGetHandler.java index c7dad7c..d3f5d5f 100644 --- a/src/main/java/org/gnunet/dht/MonitorGetHandler.java +++ b/src/main/java/org/gnunet/dht/MonitorGetHandler.java | |||
@@ -25,6 +25,6 @@ import org.gnunet.util.PeerIdentity; | |||
25 | 25 | ||
26 | 26 | ||
27 | public interface MonitorGetHandler { | 27 | public interface MonitorGetHandler { |
28 | void onGet(int options, int type, int hop_count, int desired_replication_level, PeerIdentity[] getPath, | 28 | void onGet(int options, int type, int hopCount, int desiredReplicationLevel, PeerIdentity[] getPath, |
29 | HashCode key); | 29 | HashCode key); |
30 | } | 30 | } |
diff --git a/src/main/java/org/gnunet/dht/MonitorGetMessage.java b/src/main/java/org/gnunet/dht/MonitorGetMessage.java index e96ec96..a3e6297 100644 --- a/src/main/java/org/gnunet/dht/MonitorGetMessage.java +++ b/src/main/java/org/gnunet/dht/MonitorGetMessage.java | |||
@@ -49,20 +49,20 @@ public class MonitorGetMessage implements GnunetMessage.Body { | |||
49 | * Hop count | 49 | * Hop count |
50 | */ | 50 | */ |
51 | @UInt32 | 51 | @UInt32 |
52 | public int hop_count; | 52 | public int hopCount; |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * Replication level for this message | 55 | * Replication level for this message |
56 | */ | 56 | */ |
57 | @UInt32 | 57 | @UInt32 |
58 | public int desired_replication_level; | 58 | public int desiredReplicationLevel; |
59 | 59 | ||
60 | /** | 60 | /** |
61 | * Number of peers recorded in the outgoing path from source to the | 61 | * Number of peers recorded in the outgoing path from source to the |
62 | * storage location of this message. | 62 | * storage location of this message. |
63 | */ | 63 | */ |
64 | @UInt32 | 64 | @UInt32 |
65 | public int get_path_length; | 65 | public int getPathLength; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * The key to store the value under. | 68 | * The key to store the value under. |
@@ -70,6 +70,6 @@ public class MonitorGetMessage implements GnunetMessage.Body { | |||
70 | @NestedMessage | 70 | @NestedMessage |
71 | public HashCode key; | 71 | public HashCode key; |
72 | 72 | ||
73 | @VariableSizeArray(lengthField = "get_path_length") | 73 | @VariableSizeArray(lengthField = "getPathLength") |
74 | public PeerIdentity[] getPath; | 74 | public PeerIdentity[] getPath; |
75 | } | 75 | } |
diff --git a/src/main/java/org/gnunet/dht/MonitorGetRespMessage.java b/src/main/java/org/gnunet/dht/MonitorGetRespMessage.java index 3bf145b..6a25440 100644 --- a/src/main/java/org/gnunet/dht/MonitorGetRespMessage.java +++ b/src/main/java/org/gnunet/dht/MonitorGetRespMessage.java | |||
@@ -41,13 +41,13 @@ public class MonitorGetRespMessage implements GnunetMessage.Body { | |||
41 | * Length of the PUT path that follows (if tracked). | 41 | * Length of the PUT path that follows (if tracked). |
42 | */ | 42 | */ |
43 | @UInt32 | 43 | @UInt32 |
44 | int put_path_length; | 44 | int putPathLength; |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Length of the GET path that follows (if tracked). | 47 | * Length of the GET path that follows (if tracked). |
48 | */ | 48 | */ |
49 | @UInt32 | 49 | @UInt32 |
50 | int get_path_length; | 50 | int getPathLength; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * When does the content expire? | 53 | * When does the content expire? |
@@ -61,10 +61,10 @@ public class MonitorGetRespMessage implements GnunetMessage.Body { | |||
61 | @NestedMessage | 61 | @NestedMessage |
62 | public HashCode key; | 62 | public HashCode key; |
63 | 63 | ||
64 | @VariableSizeArray(lengthField = "put_path_length") | 64 | @VariableSizeArray(lengthField = "putPathLength") |
65 | public PeerIdentity[] putPath; | 65 | public PeerIdentity[] putPath; |
66 | 66 | ||
67 | @VariableSizeArray(lengthField = "get_path_length") | 67 | @VariableSizeArray(lengthField = "getPathLength") |
68 | public PeerIdentity[] getPath; | 68 | public PeerIdentity[] getPath; |
69 | 69 | ||
70 | @FillWith @UInt8 | 70 | @FillWith @UInt8 |
diff --git a/src/main/java/org/gnunet/dht/MonitorPutMessage.java b/src/main/java/org/gnunet/dht/MonitorPutMessage.java index 103c05b..cf6b1fd 100644 --- a/src/main/java/org/gnunet/dht/MonitorPutMessage.java +++ b/src/main/java/org/gnunet/dht/MonitorPutMessage.java | |||
@@ -47,20 +47,20 @@ public class MonitorPutMessage implements GnunetMessage.Body { | |||
47 | * Hop count so far. | 47 | * Hop count so far. |
48 | */ | 48 | */ |
49 | @UInt32 | 49 | @UInt32 |
50 | public int hop_count; | 50 | public int hopCount; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * Replication level for this message | 53 | * Replication level for this message |
54 | */ | 54 | */ |
55 | @UInt32 | 55 | @UInt32 |
56 | public int desired_replication_level; | 56 | public int desiredReplicationLevel; |
57 | 57 | ||
58 | /** | 58 | /** |
59 | * Number of peers recorded in the outgoing path from source to the | 59 | * Number of peers recorded in the outgoing path from source to the |
60 | * storage location of this message. | 60 | * storage location of this message. |
61 | */ | 61 | */ |
62 | @UInt32 | 62 | @UInt32 |
63 | public int put_path_length; | 63 | public int putPathLength; |
64 | 64 | ||
65 | /** | 65 | /** |
66 | * How long should this data persist? | 66 | * How long should this data persist? |
@@ -74,7 +74,7 @@ public class MonitorPutMessage implements GnunetMessage.Body { | |||
74 | @NestedMessage | 74 | @NestedMessage |
75 | public HashCode key; | 75 | public HashCode key; |
76 | 76 | ||
77 | @VariableSizeArray(lengthField = "put_path_length") | 77 | @VariableSizeArray(lengthField = "putPathLength") |
78 | public PeerIdentity[] putPath; | 78 | public PeerIdentity[] putPath; |
79 | 79 | ||
80 | @FillWith @UInt8 | 80 | @FillWith @UInt8 |
diff --git a/src/main/java/org/gnunet/dht/MonitorStartStop.java b/src/main/java/org/gnunet/dht/MonitorStartStop.java index b3f3268..b79ec3e 100644 --- a/src/main/java/org/gnunet/dht/MonitorStartStop.java +++ b/src/main/java/org/gnunet/dht/MonitorStartStop.java | |||
@@ -60,7 +60,7 @@ public class MonitorStartStop implements GnunetMessage.Body { | |||
60 | * Flag whether to use the provided key to filter messages. | 60 | * Flag whether to use the provided key to filter messages. |
61 | */ | 61 | */ |
62 | @UInt16 | 62 | @UInt16 |
63 | public int filter_key; | 63 | public int filterKey; |
64 | 64 | ||
65 | /* | 65 | /* |
66 | The key to filter messages by. | 66 | The key to filter messages by. |