diff src/alice/jungle/persistence/NetworkJournal.java @ 85:e641f559559c

Added some files for persistent
author one
date Mon, 28 Oct 2013 17:21:56 +0900
parents 82d1d3dac7bc
children f142dd4abc74
line wrap: on
line diff
--- a/src/alice/jungle/persistence/NetworkJournal.java	Sun Oct 27 20:05:53 2013 +0900
+++ b/src/alice/jungle/persistence/NetworkJournal.java	Mon Oct 28 17:21:56 2013 +0900
@@ -19,7 +19,6 @@
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeListWriter;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.Journal;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.Result;
-import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet;
 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation;
 
 public class NetworkJournal  implements Journal {
@@ -53,6 +52,14 @@
 		in.close();
 	}
 	
+	public void setOutputFile(File file) throws FileNotFoundException {
+		out = new FileOutputStream(file);
+	}
+	
+	public void setInputFile(File file) throws FileNotFoundException {
+		in = new FileInputStream(file);
+	}
+	
 	public void setOutputStream(OutputStream _out) {
 		out = _out;
 	}
@@ -83,19 +90,6 @@
 			}
 			return Result.SUCCESS;
 		}
-
-		public Result write(ChangeSet cs)
-		{
-			NetworkTreeOperationLog log = new NetworkTreeOperationLog(cs.uuid(),cs.getChangeList());
-			try {
-				msgpack.write(out, log);
-				out.flush();
-			} catch (IOException e) {
-				return null;
-			}
-			return Result.SUCCESS;
-		}
-		
 	}
 	
 	public static MessagePack getMessagePack() {
@@ -104,8 +98,6 @@
 
 	private static class NetworkChangeListReader implements ChangeListReader
 	{
-		
-		
 		@Override
 		public ChangeListReader newReader()
 		{