comparison src/main/java/app/bbs/NetworkJungleBulletinBoard.java @ 149:06cddf529325

Modified lates renew time
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 28 Jan 2014 11:30:47 +0900
parents 202ea963ec20
children eef85b5faa15
comparison
equal deleted inserted replaced
148:7d248be1d3e4 149:06cddf529325
1 package app.bbs; 1 package app.bbs;
2 2
3 import java.io.File; 3 import java.io.File;
4 import java.io.IOException; 4 import java.io.IOException;
5 import java.nio.ByteBuffer; 5 import java.nio.ByteBuffer;
6 import java.util.Date;
7 import java.util.concurrent.atomic.AtomicInteger; 6 import java.util.concurrent.atomic.AtomicInteger;
8 7
9 import alice.jungle.core.NetworkDefaultJungle; 8 import alice.jungle.core.NetworkDefaultJungle;
10 import alice.jungle.persistent.AliceJournal; 9 import alice.jungle.persistent.AliceJournal;
11 import alice.jungle.persistent.NetworkJournal; 10 import alice.jungle.persistent.NetworkJournal;
163 either = editor.putAttribute(root.add(0),"name",ByteBuffer.wrap(_name.getBytes())); 162 either = editor.putAttribute(root.add(0),"name",ByteBuffer.wrap(_name.getBytes()));
164 if(either.isA()){ 163 if(either.isA()){
165 throw new IllegalStateException(); 164 throw new IllegalStateException();
166 } 165 }
167 editor = either.b(); 166 editor = either.b();
168 final long timestamp = new Date().getTime(); 167 final long timestamp = System.currentTimeMillis();
169 ByteBuffer tBuffer = ByteBuffer.allocate(16); 168 ByteBuffer tBuffer = ByteBuffer.allocate(16);
170 tBuffer.putLong(timestamp); 169 tBuffer.putLong(timestamp);
171 either = editor.putAttribute(root.add(0),"timestamp", tBuffer); 170 either = editor.putAttribute(root.add(0),"timestamp", tBuffer);
172 if(either.isA()){ 171 if(either.isA()){
173 throw new IllegalStateException(); 172 throw new IllegalStateException();
220 if(tree == null){ 219 if(tree == null){
221 throw new IllegalStateException(); 220 throw new IllegalStateException();
222 } 221 }
223 222
224 Either<Error, JungleTreeEditor> either; 223 Either<Error, JungleTreeEditor> either;
225 final long timestamp = new Date().getTime(); 224 final long timestamp = System.currentTimeMillis();
226 final ByteBuffer tBuffer = ByteBuffer.allocate(16); 225 final ByteBuffer tBuffer = ByteBuffer.allocate(16);
227 tBuffer.putLong(timestamp); 226 tBuffer.putLong(timestamp);
228 do{ 227 do{
229 Node node = tree.getRootNode(); 228 Node node = tree.getRootNode();
230 int size = node.getChildren().size(); 229 int size = node.getChildren().size();
269 } 268 }
270 269
271 public void editMessage(String _board,String _uuid,final String _author,final String _message,final String _editKey) 270 public void editMessage(String _board,String _uuid,final String _author,final String _message,final String _editKey)
272 { 271 {
273 requestCounter.incrementAndGet(); 272 requestCounter.incrementAndGet();
274 final long timestamp = new Date().getTime(); 273 final long timestamp = System.currentTimeMillis();
275 final ByteBuffer tBuffer = ByteBuffer.allocate(16); 274 final ByteBuffer tBuffer = ByteBuffer.allocate(16);
276 tBuffer.putLong(timestamp); 275 tBuffer.putLong(timestamp);
277 JungleTree tree = jungle.getTreeByName(_board); 276 JungleTree tree = jungle.getTreeByName(_board);
278 Either<Error, JungleTreeEditor> either = null; 277 Either<Error, JungleTreeEditor> either = null;
279 do { 278 do {