# HG changeset patch
# User suruga
# Date 1500448577 -32400
# Node ID 4a66328f0141d611e65371a284ae65e96c8331a4
# Parent 6c584862fe93cee619e514b203d1d31af9e04a51
fix Loggingnode
diff -r 6c584862fe93 -r 4a66328f0141 .idea/gradle.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/gradle.xml Wed Jul 19 16:16:17 2017 +0900
@@ -0,0 +1,24 @@
+
+
+
+
+
+
\ No newline at end of file
diff -r 6c584862fe93 -r 4a66328f0141 .idea/modules.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/modules.xml Wed Jul 19 16:16:17 2017 +0900
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 6c584862fe93 -r 4a66328f0141 .idea/uiDesigner.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/uiDesigner.xml Wed Jul 19 16:16:17 2017 +0900
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff -r 6c584862fe93 -r 4a66328f0141 .idea/vcs.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/vcs.xml Wed Jul 19 16:16:17 2017 +0900
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff -r 6c584862fe93 -r 4a66328f0141 bbs.iml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bbs.iml Wed Jul 19 16:16:17 2017 +0900
@@ -0,0 +1,835 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 6c584862fe93 -r 4a66328f0141 build.gradle
--- a/build.gradle Sat Nov 19 22:31:25 2016 +0900
+++ b/build.gradle Wed Jul 19 16:16:17 2017 +0900
@@ -7,8 +7,7 @@
repositories {
mavenCentral()
- maven { url "http://www.cr.ie.u-ryukyu.ac.jp/hg/maven/raw-file/e6b119647469/"}
- maven { url "http://www.cr.ie.u-ryukyu.ac.jp/maven"}
+ maven { url "http://www.cr.ie.u-ryukyu.ac.jp/maven"}
}
dependencies {
@@ -21,7 +20,6 @@
compile group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '9.3.13.v20161014'
compile group: 'junit', name: 'junit', version: '4.11'
compile group: 'org.hectorclient', name: 'hector-core', version: '1.1-2'
- compile group: 'org.apache.cassandra', name: 'cassandra-all', version: '3.9'
compile group: 'cr.ie.u_ryukyu.ac.jp', name: 'jungle-core', version: '1.0', ext: 'jar'
compile group: 'cr.ie.u_ryukyu.ac.jp', name: 'Alice', version: '1.1', ext: 'jar'
jar {
diff -r 6c584862fe93 -r 4a66328f0141 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/BrowsingBulletinBoard.java
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/BrowsingBulletinBoard.java Sat Nov 19 22:31:25 2016 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/BrowsingBulletinBoard.java Wed Jul 19 16:16:17 2017 +0900
@@ -1,6 +1,7 @@
package jp.ac.u_ryukyu.ie.cr.bbs.browsing;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode;
+import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode;
+
import java.util.Iterator;
public interface BrowsingBulletinBoard
diff -r 6c584862fe93 -r 4a66328f0141 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/FindNodeservlet.java
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/FindNodeservlet.java Sat Nov 19 22:31:25 2016 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/FindNodeservlet.java Wed Jul 19 16:16:17 2017 +0900
@@ -1,12 +1,9 @@
package jp.ac.u_ryukyu.ie.cr.bbs.browsing;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode;
-
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
-import java.util.Iterator;
public class FindNodeServlet extends HttpServlet
{
diff -r 6c584862fe93 -r 4a66328f0141 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/GetAttributeImp.java
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/GetAttributeImp.java Sat Nov 19 22:31:25 2016 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/browsing/GetAttributeImp.java Wed Jul 19 16:16:17 2017 +0900
@@ -1,7 +1,7 @@
package jp.ac.u_ryukyu.ie.cr.bbs.browsing;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode;
+import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode;
import java.util.Iterator;
diff -r 6c584862fe93 -r 4a66328f0141 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/local/CassandraBulletinBoard.java
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/local/CassandraBulletinBoard.java Sat Nov 19 22:31:25 2016 +0900
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-package jp.ac.u_ryukyu.ie.cr.bbs.local;
-
-import me.prettyprint.cassandra.model.ConfigurableConsistencyLevel;
-import me.prettyprint.cassandra.serializers.StringSerializer;
-import me.prettyprint.cassandra.serializers.UUIDSerializer;
-import me.prettyprint.cassandra.service.template.SuperCfResult;
-import me.prettyprint.cassandra.service.template.SuperCfUpdater;
-import me.prettyprint.cassandra.service.template.ThriftSuperCfTemplate;
-import me.prettyprint.cassandra.utils.TimeUUIDUtils;
-import me.prettyprint.hector.api.Cluster;
-import me.prettyprint.hector.api.HConsistencyLevel;
-import me.prettyprint.hector.api.Keyspace;
-import me.prettyprint.hector.api.beans.HSuperColumn;
-import me.prettyprint.hector.api.beans.OrderedSuperRows;
-import me.prettyprint.hector.api.beans.SuperRow;
-import me.prettyprint.hector.api.beans.SuperSlice;
-import me.prettyprint.hector.api.ddl.ColumnFamilyDefinition;
-import me.prettyprint.hector.api.ddl.ColumnType;
-import me.prettyprint.hector.api.ddl.ComparatorType;
-import me.prettyprint.hector.api.ddl.KeyspaceDefinition;
-import me.prettyprint.hector.api.factory.HFactory;
-import me.prettyprint.hector.api.query.QueryResult;
-import me.prettyprint.hector.api.query.RangeSuperSlicesQuery;
-import me.prettyprint.hector.api.query.SuperSliceQuery;
-import org.apache.cassandra.locator.SimpleStrategy;
-
-import java.util.*;
-
-public class CassandraBulletinBoard implements BulletinBoard
-{
- private final String address;
- private final String clusterName;
- private final Cluster cluster;
- private final String keyspace;
- private final ConfigurableConsistencyLevel configurableConsistencyLevel = new ConfigurableConsistencyLevel();
-
- private static final String COLUMN_FAMILY_BOARD = "boards";
- private final int REP_FACTOR;
-
- public CassandraBulletinBoard(String _clusterName, String _address, String _keyspaceName, HConsistencyLevel cLevel, int rep_factor )
- {
- address = _address;
- clusterName = _clusterName;
- keyspace = _keyspaceName;
- cluster = HFactory.getOrCreateCluster(clusterName,address);
- Map clmap = new HashMap();
- clmap.put(COLUMN_FAMILY_BOARD, cLevel);
- configurableConsistencyLevel.setReadCfConsistencyLevels(clmap);
- configurableConsistencyLevel.setWriteCfConsistencyLevels(clmap);
- REP_FACTOR = rep_factor;
- initialize();
- }
-
- public CassandraBulletinBoard(String _clusterName, String _address, String _keyspaceName, HConsistencyLevel cLevel)
- {
- this(_clusterName, _address, _keyspaceName, cLevel, 1);
- }
-
-
-
- private void initialize()
- {
- if(cluster.describeKeyspace(keyspace) == null){
- KeyspaceDefinition keyspaceDefinition = HFactory.createKeyspaceDefinition(keyspace,
- SimpleStrategy.class.getName(),REP_FACTOR,Collections. emptyList());
- cluster.addKeyspace(keyspaceDefinition,false);
- ColumnFamilyDefinition columnFamilyDefinition = HFactory.createColumnFamilyDefinition(keyspace,COLUMN_FAMILY_BOARD,ComparatorType.UUIDTYPE);
- columnFamilyDefinition.setColumnType(ColumnType.SUPER);
- cluster.addColumnFamily(columnFamilyDefinition);
- }
- }
-
- public Iterable getBoards()
- {
- Keyspace ksp = HFactory.createKeyspace(keyspace, cluster, configurableConsistencyLevel);
- RangeSuperSlicesQuery query = HFactory.createRangeSuperSlicesQuery(ksp,StringSerializer.get(),
- UUIDSerializer.get(),StringSerializer.get(),StringSerializer.get());
- query.setColumnFamily(COLUMN_FAMILY_BOARD).setKeys(null,null).setRange(null,null,false,0);
-
- QueryResult> result = query.execute();
- OrderedSuperRows rows = result.get();
- List> list = rows.getList();
-
- IterableConverter.Converter> converter
- = new IterableConverter.Converter>(){
- public String conv(SuperRow _b) {
- return _b.getKey();
- }
- };
-
- return new IterableConverter>(list,converter);
- }
-
- private static final String COLUMN_MESSAGE_AUTHOR = "author";
- private static final String COLUMN_MESSAGE_BODY = "message";
- private static final String COLUMN_MESSAGE_EDIT_KEY = "edit";
-
- public void createBoardMessage(UUID _time,String _name,String _author,String _message,String _editKey)
- {
- Keyspace ksp = HFactory.createKeyspace(keyspace, cluster, configurableConsistencyLevel);
- ThriftSuperCfTemplate template =
- new ThriftSuperCfTemplate(ksp,COLUMN_FAMILY_BOARD,StringSerializer.get(),
- UUIDSerializer.get(),StringSerializer.get());
-
- SuperCfUpdater updater = template.createUpdater(_name,_time);
- updater.setString(COLUMN_MESSAGE_AUTHOR,_author);
- updater.setString(COLUMN_MESSAGE_BODY,_message);
- updater.setString(COLUMN_MESSAGE_EDIT_KEY,_editKey);
-
- template.update(updater);
- }
-
- public void createBoards(String _name,String _author,String _initMessage,String _editKey)
- {
- UUID time = TimeUUIDUtils.getTimeUUID(0);
- createBoardMessage(time,_name,_author,_initMessage,_editKey);
- }
-
- public Iterable getMessages(String _boardName)
- {
- Keyspace ksp = HFactory.createKeyspace(keyspace, cluster, configurableConsistencyLevel);
- SuperSliceQuery query = HFactory.createSuperSliceQuery(ksp, StringSerializer.get(), UUIDSerializer.get(), StringSerializer.get(), StringSerializer.get());
-
- UUID start = TimeUUIDUtils.getTimeUUID(0);
- query.setKey(_boardName).setColumnFamily(COLUMN_FAMILY_BOARD).setRange(start,null,false,100);
-
- QueryResult> result = query.execute();
- SuperSlice ss = result.get();
- List> list = ss.getSuperColumns();
-
- IterableConverter.Converter> converter =
- new IterableConverter.Converter>(){
- public BoardMessage conv(HSuperColumn _b){
- UUID uuid = _b.getName();
- String author = _b.getSubColumnByName(COLUMN_MESSAGE_AUTHOR).getValue();
- String message = _b.getSubColumnByName(COLUMN_MESSAGE_BODY).getValue();
- BoardMessageImpl bm = new BoardMessageImpl(author,message,uuid.toString());
- return bm;
- }
- };
-
-
- return new IterableConverter>(list,converter);
- }
-
- private static class BoardMessageImpl implements BoardMessage
- {
- private final String author;
- private final String message;
- private final String uuid;
-
- public BoardMessageImpl(String _author,String _message,String _uuid)
- {
- author = _author;
- message = _message;
- uuid = _uuid;
- }
-
- public String getAuthor()
- {
- return author;
- }
-
- public String getMessage()
- {
- return message;
- }
-
- public String getUUID()
- {
- return uuid;
- }
- }
-
- public void createBoardMessage(String _board, String _author, String _message,String _editKey)
- {
- UUID time = TimeUUIDUtils.getUniqueTimeUUIDinMillis();
- createBoardMessage(time,_board,_author,_message,_editKey);
- }
-
- public void editMessage(String _board,String _uuid,String _author,String _message,String _editKey)
- {
- Keyspace ksp = HFactory.createKeyspace(keyspace, cluster, configurableConsistencyLevel);
- UUID time = UUID.fromString(_uuid);
- ThriftSuperCfTemplate template =
- new ThriftSuperCfTemplate(ksp,COLUMN_FAMILY_BOARD,StringSerializer.get(),
- UUIDSerializer.get(),StringSerializer.get());
-
- SuperCfResult result = template.querySuperColumn(_board,time);
- String editKey = result.getString(COLUMN_MESSAGE_EDIT_KEY);
- if(!editKey.equals(editKey)){
- return;
- }
-
- SuperCfUpdater updater = template.createUpdater(_board,time);
- updater.setString(COLUMN_MESSAGE_AUTHOR,_author);
- updater.setString(COLUMN_MESSAGE_BODY,_message);
- updater.setString(COLUMN_MESSAGE_EDIT_KEY,_editKey);
-
- template.update(updater);
- }
-
- public String sanitize( String str ) {
- if(str==null) {
- return str;
- }
- str = str.replaceAll("&" , "&" );
- str = str.replaceAll("<" , "<" );
- str = str.replaceAll(">" , ">" );
- str = str.replaceAll("\"", """);
- str = str.replaceAll("'" , "'" );
- return str;
- }
-
- public GetAttributeImp getAttribute(String _bname, String _nodeNum, String revisionStr) {
- return null; // 未実装 使うときに実装する
- }
-
-}
diff -r 6c584862fe93 -r 4a66328f0141 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/local/GetAttributeImp.java
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/local/GetAttributeImp.java Sat Nov 19 22:31:25 2016 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/local/GetAttributeImp.java Wed Jul 19 16:16:17 2017 +0900
@@ -1,7 +1,7 @@
package jp.ac.u_ryukyu.ie.cr.bbs.local;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode;
+import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode;
import java.util.Iterator;
diff -r 6c584862fe93 -r 4a66328f0141 src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/network/NetworkJungleBulletinBoard.java
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/network/NetworkJungleBulletinBoard.java Sat Nov 19 22:31:25 2016 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/bbs/network/NetworkJungleBulletinBoard.java Wed Jul 19 16:16:17 2017 +0900
@@ -5,25 +5,24 @@
import jp.ac.u_ryukyu.ie.cr.bbs.local.GetAttributeImp;
import jp.ac.u_ryukyu.ie.cr.bbs.local.IterableConverter;
import jp.ac.u_ryukyu.ie.cr.jungle.Jungle;
-import jp.ac.u_ryukyu.ie.cr.jungle.JungleTree;
-import jp.ac.u_ryukyu.ie.cr.jungle.JungleTreeEditor;
import jp.ac.u_ryukyu.ie.cr.jungle.core.Children;
import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeList;
import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeListReader;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.DefaultNodePath;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.DefaultTreeEditor;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.logger.DefaultOperationLog;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.logger.LoggingNode;
-import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.logger.OperationLog;
+import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.DefaultOperationLog;
+import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode;
+import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog;
+import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath;
import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditor;
-import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode;
+import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor;
+import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.Default.DefaultTreeNode;
+import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode;
import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultEvaluator;
import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser;
import jp.ac.u_ryukyu.ie.cr.jungle.traverser.Traversal;
+import jp.ac.u_ryukyu.ie.cr.jungle.tree.JungleTree;
import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither;
import jp.ac.u_ryukyu.ie.cr.jungle.util.Either;
-import jp.ac.u_ryukyu.ie.cr.jungle.util.Error;
+import jp.ac.u_ryukyu.ie.cr.jungle.util.jungleError.Error;
import jp.ac.u_ryukyu.ie.cr.jungleNetwork.core.NetworkDefaultJungle;
import jp.ac.u_ryukyu.ie.cr.jungleNetwork.persistent.AliceJournal;
import jp.ac.u_ryukyu.ie.cr.jungleNetwork.persistent.NetworkJournal;
@@ -46,7 +45,7 @@
private NetworkJungleBulletinBoard(String _uuid, NetworkJournal _journal) {
journal = _journal;
- jungle = new NetworkDefaultJungle(journal, _uuid, new DefaultTreeEditor(new DefaultTraverser()));
+ jungle = new NetworkDefaultJungle(journal, _uuid);
BulletinBoardJungleManager.setJungle(jungle);
persistentFlag = false;
requestCounter = BulletinBoardJungleManager.getRequestCounter();
@@ -111,7 +110,7 @@
if (tree == null) {
tree = jungle.createNewTree(treeName);
}
- JungleTreeEditor editor = tree.getLocalTreeEditor();
+ JungleTreeEditor editor = tree.getLocalJungleTreeEditor();
Either either = JungleUpdater.edit(editor, chList);
editor = either.b();
if (either.isA()) {
@@ -148,7 +147,7 @@
}
JungleTree tree = jungle.getTreeByName("boards");
- JungleTreeEditor editor = tree.getTreeEditor();
+ JungleTreeEditor editor = tree.getJungleTreeEditor();
DefaultNodePath root = new DefaultNodePath();
Either either = editor.addNewChildAt(root, 0);
if (either.isA()) {
@@ -174,7 +173,7 @@
}
tree = jungle.getTreeByName(_name);
- editor = tree.getTreeEditor();
+ editor = tree.getJungleTreeEditor();
either = editor.addNewChildAt(root, 0);
if (either.isA()) {
throw new IllegalStateException();
@@ -185,7 +184,7 @@
ByteBuffer tBuffer2 = ByteBuffer.allocate(16);
public Either edit(TreeNode node) {
- LoggingNode logNode = wrap(node, new DefaultOperationLog());
+ LoggingNode logNode = wrap(node,null, new DefaultOperationLog());
logNode = logNode.getAttributes().put("author", ByteBuffer.wrap(_author.getBytes())).b();
logNode = logNode.getAttributes().put("mes", ByteBuffer.wrap(_initMessage.getBytes())).b();
logNode = logNode.getAttributes().put("key", ByteBuffer.wrap(_editKey.getBytes())).b();
@@ -195,8 +194,8 @@
}
@Override
- public LoggingNode wrap(TreeNode node, OperationLog op) {
- return new LoggingNode(node, op);
+ public LoggingNode wrap(TreeNode treeNode, TreeNode treeNode1, OperationLog operationLog) {
+ return new LoggingNode(treeNode, operationLog);
}
};
@@ -240,7 +239,7 @@
Traversal traversal = ret.b();
TreeNode target = traversal.destination();
int size = target.getChildren().size();
- JungleTreeEditor editor = tree.getTreeEditor();
+ JungleTreeEditor editor = tree.getJungleTreeEditor();
either = editor.addNewChildAt(path, size);
if (either.isA()) {
throw new IllegalStateException();
@@ -250,14 +249,14 @@
NodeEditor e = new NodeEditor() {
public Either edit(TreeNode node) {
- LoggingNode logNode = wrap(node, new DefaultOperationLog());
+ LoggingNode logNode = wrap(node,null, new DefaultOperationLog());
logNode = logNode.getAttributes().put("mes", ByteBuffer.wrap(_message.getBytes())).b();
logNode = logNode.getAttributes().put("timestamp", tBuffer).b();
return DefaultEither.newB(logNode);
}
@Override
- public LoggingNode wrap(TreeNode node, OperationLog op) {
+ public LoggingNode wrap(TreeNode node, TreeNode node1, OperationLog op) {
return new LoggingNode(node, op);
}
@@ -290,7 +289,7 @@
int size = node.getChildren().size();
DefaultNodePath path = new DefaultNodePath();
- JungleTreeEditor editor = tree.getTreeEditor();
+ JungleTreeEditor editor = tree.getJungleTreeEditor();
either = editor.addNewChildAt(path, size);
if (either.isA()) {
throw new IllegalStateException();
@@ -299,7 +298,7 @@
NodeEditor e = new NodeEditor() {
public Either edit(TreeNode node) {
- LoggingNode logNode = wrap(node, new DefaultOperationLog());
+ LoggingNode logNode = wrap(node, null, new DefaultOperationLog());
logNode = logNode.getAttributes().put("author", ByteBuffer.wrap(_author.getBytes())).b();
logNode = logNode.getAttributes().put("mes", ByteBuffer.wrap(_message.getBytes())).b();
logNode = logNode.getAttributes().put("key", ByteBuffer.wrap(_editKey.getBytes())).b();
@@ -308,7 +307,7 @@
}
@Override
- public LoggingNode wrap(TreeNode node, OperationLog op) {
+ public LoggingNode wrap(TreeNode node,TreeNode node1, OperationLog op) {
return new LoggingNode(node, op);
}
};
@@ -339,10 +338,10 @@
}
do {
- JungleTreeEditor editor = tree.getTreeEditor();
+ JungleTreeEditor editor = tree.getJungleTreeEditor();
NodeEditor e = new NodeEditor() {
public Either edit(TreeNode node) {
- LoggingNode logNode = wrap(node, new DefaultOperationLog());
+ LoggingNode logNode = wrap(node,null,new DefaultOperationLog());
System.out.println(new String(node.getAttributes().get("mes").array()));
logNode = logNode.getAttributes().put("author", ByteBuffer.wrap(_author.getBytes())).b();
logNode = logNode.getAttributes().put("mes", ByteBuffer.wrap(_message.getBytes())).b();
@@ -353,7 +352,7 @@
}
@Override
- public LoggingNode wrap(TreeNode node, OperationLog op) {
+ public LoggingNode wrap(TreeNode node,TreeNode node1, OperationLog op) {
return new LoggingNode(node, op);
}
};
@@ -383,12 +382,12 @@
}
do {
- JungleTreeEditor editor = tree.getTreeEditor();
+ JungleTreeEditor editor = tree.getJungleTreeEditor();
NodeEditor e = new NodeEditor() {
String str;
public Either edit(TreeNode node) {
- LoggingNode logNode = wrap(node, new DefaultOperationLog());
+ LoggingNode logNode = wrap(node, null,new DefaultOperationLog());
str = "0";
int count = 0;
for (; logNode.getAttributes().get("mes" + String.valueOf(count)) != null; count++) {
@@ -400,7 +399,7 @@
}
@Override
- public LoggingNode wrap(TreeNode node, OperationLog op) {
+ public LoggingNode wrap(TreeNode node, TreeNode node1,OperationLog op) {
return new LoggingNode(node, op);
}
};
@@ -428,17 +427,17 @@
}
do {
- JungleTreeEditor editor = tree.getTreeEditor();
+ JungleTreeEditor editor = tree.getJungleTreeEditor();
NodeEditor e = new NodeEditor() {
public Either edit(TreeNode node) {
- LoggingNode logNode = wrap(node, new DefaultOperationLog());
+ LoggingNode logNode = wrap(node, null,new DefaultOperationLog());
logNode = logNode.getAttributes().put("mes" + id, ByteBuffer.wrap(_message.getBytes())).b();
logNode = logNode.getAttributes().put("timestamp" + id, tBuffer).b();
return DefaultEither.newB(logNode);
}
@Override
- public LoggingNode wrap(TreeNode node, OperationLog op) {
+ public LoggingNode wrap(TreeNode node,TreeNode node1, OperationLog op) {
return new LoggingNode(node, op);
}
};
@@ -467,7 +466,7 @@
}
do {
- JungleTreeEditor editor = tree.getTreeEditor();
+ JungleTreeEditor editor = tree.getJungleTreeEditor();
either = editor.deleteChildAt(path, id);
if (either.isA()) {
@@ -494,10 +493,10 @@
}
do {
- JungleTreeEditor editor = tree.getTreeEditor();
+ JungleTreeEditor editor = tree.getJungleTreeEditor();
NodeEditor e = new NodeEditor() {
public Either edit(TreeNode node) {
- LoggingNode logNode = wrap(node, new DefaultOperationLog());
+ LoggingNode logNode = wrap(node,null, new DefaultOperationLog());
logNode = logNode.getAttributes().delete("mes" + id).b();
logNode = logNode.getAttributes().delete("timestamp" + id).b();
int count = Integer.parseInt(id);
@@ -516,7 +515,7 @@
}
@Override
- public LoggingNode wrap(TreeNode node, OperationLog op) {
+ public LoggingNode wrap(TreeNode node, TreeNode node1,OperationLog op) {
return new LoggingNode(node, op);
}
};
@@ -541,10 +540,10 @@
DefaultNodePath path = new DefaultNodePath();
path = path.add(Integer.parseInt(_uuid));
- JungleTreeEditor editor = tree.getTreeEditor();
+ JungleTreeEditor editor = tree.getJungleTreeEditor();
NodeEditor e = new NodeEditor() {
public Either edit(TreeNode node) {
- LoggingNode logNode = wrap(node, new DefaultOperationLog());
+ LoggingNode logNode = wrap(node, null,new DefaultOperationLog());
logNode = logNode.getAttributes().put("author", ByteBuffer.wrap(_author.getBytes())).b();
logNode = logNode.getAttributes().put("mes", ByteBuffer.wrap(_message.getBytes())).b();
logNode = logNode.getAttributes().put("key", ByteBuffer.wrap(_editKey.getBytes())).b();
@@ -553,7 +552,7 @@
}
@Override
- public LoggingNode wrap(TreeNode node, OperationLog op) {
+ public LoggingNode wrap(TreeNode node, TreeNode node1,OperationLog op) {
return new LoggingNode(node, op);
}
};