Mercurial > hg > Members > nobuyasu > jungle-network
view src/alice/jungle/persistence/PersistentChangeListWriter.java @ 88:0c98717f186e
Removed cast code
author | one |
---|---|
date | Tue, 05 Nov 2013 09:13:30 +0900 |
parents | f142dd4abc74 |
children | eef737ab3b2c |
line wrap: on
line source
package alice.jungle.persistence; import java.io.IOException; import java.io.OutputStream; import org.msgpack.MessagePack; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeListWriter; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.Result; import alice.jungle.operations.NetworkTreeOperationLog; public class PersistentChangeListWriter implements ChangeListWriter { MessagePack msgpack = NetworkJournal.getMessagePack(); OutputStream out; public PersistentChangeListWriter(OutputStream _out) { out = _out; } @Override public Result write(ChangeList cs) { NetworkTreeOperationLog log = new NetworkTreeOperationLog(cs.uuid(), cs.getTreeName(), cs); try { msgpack.write(out, log); out.flush(); return Result.SUCCESS; } catch (IOException e) { } return null; } }