Mercurial > hg > Database > jungle-network
comparison src/jungle/test/bbs/NetworkJungleBulletinBoard.java @ 49:a89c3539bff2
modified LogUpdateCodeSegment
author | one |
---|---|
date | Fri, 12 Jul 2013 19:56:12 +0900 |
parents | 686057add8a4 |
children | 459b50f1a6ee |
comparison
equal
deleted
inserted
replaced
48:ab8c655ef457 | 49:a89c3539bff2 |
---|---|
78 if(result.isA()){ | 78 if(result.isA()){ |
79 throw new IllegalStateException(); | 79 throw new IllegalStateException(); |
80 } | 80 } |
81 /* Put DataSegment */ | 81 /* Put DataSegment */ |
82 try { | 82 try { |
83 putTreeOperationLog((NetworkDefaultJungleTreeEditor)result.b()); | 83 putTreeOperationLog((NetworkDefaultJungleTreeEditor)editor); |
84 } catch (IOException e1) { | 84 } catch (IOException e1) { |
85 e1.printStackTrace(); | 85 e1.printStackTrace(); |
86 } | 86 } |
87 | 87 |
88 tree = jungle.getTreeByName(_name); | 88 tree = jungle.getTreeByName(_name); |
108 } | 108 } |
109 editor = either.b(); | 109 editor = either.b(); |
110 editor.success(); | 110 editor.success(); |
111 /* Put DataSegment */ | 111 /* Put DataSegment */ |
112 try { | 112 try { |
113 putTreeOperationLog((NetworkDefaultJungleTreeEditor)result.b()); | 113 putTreeOperationLog((NetworkDefaultJungleTreeEditor)editor); |
114 } catch (IOException e1) { | 114 } catch (IOException e1) { |
115 e1.printStackTrace(); | 115 e1.printStackTrace(); |
116 } | 116 } |
117 | 117 |
118 } | 118 } |
219 } | 219 } |
220 | 220 |
221 private void putTreeOperationLog(NetworkDefaultJungleTreeEditor editor) throws IOException { | 221 private void putTreeOperationLog(NetworkDefaultJungleTreeEditor editor) throws IOException { |
222 String uuid = editor.getID(); | 222 String uuid = editor.getID(); |
223 String treeName = editor.getTreeName(); | 223 String treeName = editor.getTreeName(); |
224 String serverName = editor.getServerName(); | 224 String updaterName = editor.getUpdaterName(); |
225 long revision = Long.parseLong(editor.getRevision()); | 225 long revision = Long.parseLong(editor.getRevision()); |
226 Iterable<TreeOperation> log = editor.getTreeOperationLog(); | 226 Iterable<TreeOperation> log = editor.getTreeOperationLog(); |
227 putDataSegment(uuid, treeName, serverName, log, revision); | 227 putDataSegment(uuid, treeName, updaterName, log, revision); |
228 } | 228 } |
229 | 229 |
230 private void putDataSegment(String _uuid, String _treeName, String _serverName, Iterable<TreeOperation> _log, long nextRevision) throws IOException { | 230 private void putDataSegment(String _uuid, String _treeName, String _updaterName, Iterable<TreeOperation> _log, long nextRevision) throws IOException { |
231 DefaultTreeOperationLogContainer container = new DefaultTreeOperationLogContainer(); | 231 DefaultTreeOperationLogContainer container = new DefaultTreeOperationLogContainer(); |
232 container.setTreeName(_treeName); | 232 container.setTreeName(_treeName); |
233 container.setUUID(_uuid); | 233 container.setUUID(_uuid); |
234 container.setServerName(_serverName); | 234 container.setUpdaterName(_updaterName); |
235 container.setRevision(nextRevision); | 235 container.setRevision(nextRevision); |
236 container.unconvert(_log); | 236 container.unconvert(_log); |
237 NullCodeSegmentForUpdate cs = new NullCodeSegmentForUpdate(); | 237 NullCodeSegmentForUpdate cs = new NullCodeSegmentForUpdate(); |
238 cs.ods.put("log", container); | 238 cs.ods.put("log", container); |
239 } | 239 } |