comparison src/alice/jungle/transaction/NetworkDefaultJungleTreeEditor.java @ 91:2c7b3f2b2ee1

Removed serverName field
author one
date Mon, 11 Nov 2013 19:22:47 +0900
parents 29127ac788a6
children e95faa202b4f
comparison
equal deleted inserted replaced
90:eef737ab3b2c 91:2c7b3f2b2ee1
31 private final TransactionManager<T> txManager; 31 private final TransactionManager<T> txManager;
32 private final T root; 32 private final T root;
33 private final String treeName; 33 private final String treeName;
34 private final TreeEditor editor; 34 private final TreeEditor editor;
35 private final TreeOperationLog log; 35 private final TreeOperationLog log;
36 private final String updaterName; 36 private final String uuid;
37 37
38 public NetworkDefaultJungleTreeEditor(String _updaterName, String _treeName, T _root,TransactionManager<T> _txManager,TreeEditor _editor) 38 public NetworkDefaultJungleTreeEditor(String _uuid, String _treeName, T _root,TransactionManager<T> _txManager,TreeEditor _editor)
39 { 39 {
40 this(_updaterName, _treeName, _root,_txManager,_editor,new DefaultTreeOperationLog()); 40 this(_uuid, _treeName, _root,_txManager,_editor,new DefaultTreeOperationLog());
41 } 41 }
42 42
43 public NetworkDefaultJungleTreeEditor(String _updaterName, String _treeName, T _root,TransactionManager<T> _txManager,TreeEditor _editor, TreeOperationLog _log) 43 public NetworkDefaultJungleTreeEditor(String _uuid, String _treeName, T _root,TransactionManager<T> _txManager,TreeEditor _editor, TreeOperationLog _log)
44 { 44 {
45 updaterName = _updaterName; 45 uuid = _uuid;
46 treeName = _treeName; 46 treeName = _treeName;
47 root = _root; 47 root = _root;
48 txManager = _txManager; 48 txManager = _txManager;
49 editor = _editor; 49 editor = _editor;
50 log = _log; 50 log = _log;
70 70
71 Iterable<TreeOperation> iterable = new IterableConverter<TreeOperation,NodeOperation>(newLog,converter); 71 Iterable<TreeOperation> iterable = new IterableConverter<TreeOperation,NodeOperation>(newLog,converter);
72 DefaultTreeOperationLog treeOperationLog = new DefaultTreeOperationLog(iterable,newLog.length()); 72 DefaultTreeOperationLog treeOperationLog = new DefaultTreeOperationLog(iterable,newLog.length());
73 TreeOperationLog newTreeOpLog = log.append(treeOperationLog); 73 TreeOperationLog newTreeOpLog = log.append(treeOperationLog);
74 74
75 JungleTreeEditor newEditor = new NetworkDefaultJungleTreeEditor<T>(updaterName, treeName, newNode,txManager,editor,newTreeOpLog); 75 JungleTreeEditor newEditor = new NetworkDefaultJungleTreeEditor<T>(uuid, treeName, newNode,txManager,editor,newTreeOpLog);
76 return DefaultEither.newB(newEditor); 76 return DefaultEither.newB(newEditor);
77 } 77 }
78 78
79 @Override 79 @Override
80 public Either<Error,JungleTreeEditor> addNewChildAt(NodePath _path, int _pos) 80 public Either<Error,JungleTreeEditor> addNewChildAt(NodePath _path, int _pos)
117 if(either.isA()){ 117 if(either.isA()){
118 return DefaultEither.newA(either.a()); 118 return DefaultEither.newA(either.a());
119 } 119 }
120 120
121 TransactionManager<T> newTxManager = either.b(); 121 TransactionManager<T> newTxManager = either.b();
122 JungleTreeEditor newTreeEditor = new NetworkDefaultJungleTreeEditor<T>(updaterName, treeName, root,newTxManager,editor); 122 JungleTreeEditor newTreeEditor = new NetworkDefaultJungleTreeEditor<T>(uuid, treeName, root,newTxManager,editor);
123 123
124 return DefaultEither.newB(newTreeEditor); 124 return DefaultEither.newB(newTreeEditor);
125 } 125 }
126 126
127 @Override 127 @Override
149 public String getTreeName() { 149 public String getTreeName() {
150 return treeName; 150 return treeName;
151 } 151 }
152 152
153 public String getUpdaterName() { 153 public String getUpdaterName() {
154 return updaterName; 154 return uuid;
155 } 155 }
156 156
157 } 157 }