diff src/alice/jungle/codesegment/LogUpdateCodeSegment.java @ 50:459b50f1a6ee

add ChildLogCheckCodeSegment.
author one
date Fri, 12 Jul 2013 20:39:02 +0900
parents a89c3539bff2
children 9e782b4eb06e
line wrap: on
line diff
--- a/src/alice/jungle/codesegment/LogUpdateCodeSegment.java	Fri Jul 12 19:56:12 2013 +0900
+++ b/src/alice/jungle/codesegment/LogUpdateCodeSegment.java	Fri Jul 12 20:39:02 2013 +0900
@@ -18,15 +18,15 @@
 	
 	public Receiver arg1 = ids.create(CommandType.PEEK);
 	public Receiver host = ids.create(CommandType.PEEK);
-	public String location = "local";
 	
 	public LogUpdateCodeSegment() {
-		host.setKey("host",0);
+		arg1.setKey("parent", "log");
+		host.setKey("host");
 	}
 	
-	public LogUpdateCodeSegment(String _location) {
-		location = _location;
-		host.setKey("local","host",0);
+	public LogUpdateCodeSegment(int index) {
+		arg1.setKey("parent", "log", index);
+		host.setKey("host");
 	}
 	
 	public void run() {
@@ -34,11 +34,7 @@
 		String h = host.asString();
 		DefaultTreeOperationLogContainer container = arg1.asClass(DefaultTreeOperationLogContainer.class);
 		if(updaterIsMe(h, container)) {
-			LogUpdateCodeSegment updateCS = new LogUpdateCodeSegment();
-			updateCS.arg1.setKey(location, "log", index+1);
-			if(location.equals("local") && !iAmRootNode(h)) {
-				ods.put("parent", "log", container);
-			}
+			new LogUpdateCodeSegment(index+1);
 			return;
 		}
 		DefaultTreeOperationLog log = null;
@@ -58,24 +54,11 @@
 		if(either.isA()) {
 			throw new IllegalStateException();			
 		}
-		if(location.equals("local")) {
-			NetworkDefaultJungleTreeEditor nEditor = (NetworkDefaultJungleTreeEditor) editor;
-			container.setRevision(Long.parseLong(nEditor.getRevision()));
-			container.setUpdaterName(nEditor.getUpdaterName());
-		}
 		ods.put("log", container);
-		LogUpdateCodeSegment updateCS = new LogUpdateCodeSegment();
-		updateCS.arg1.setKey(location, "log", index+1);
+		new LogUpdateCodeSegment(index+1);
 	}
 	
 	private boolean updaterIsMe(String host, DefaultTreeOperationLogContainer container) {
 		return host.equals(container.getServerName());
 	}
-	
-	private boolean iAmRootNode(String h) {
-		return h.equals("node0");
-	}
-	
-	
-	
 }