|
@@ -12,14 +12,20 @@ import java.nio.MappedByteBuffer;
|
|
|
import java.nio.channels.FileChannel;
|
|
import java.nio.channels.FileChannel;
|
|
|
import java.nio.channels.FileChannel.MapMode;
|
|
import java.nio.channels.FileChannel.MapMode;
|
|
|
import java.nio.channels.FileLock;
|
|
import java.nio.channels.FileLock;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Matcher;
|
|
|
|
|
|
|
|
|
|
+import org.apache.commons.io.FileUtils;
|
|
|
|
|
+import org.apache.commons.io.FilenameUtils;
|
|
|
|
|
+import org.apache.commons.lang3.BooleanUtils;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
+import org.eclipse.jetty.deploy.App;
|
|
|
|
|
+import org.eclipse.jetty.deploy.DeploymentManager;
|
|
|
|
|
+import org.quartz.Scheduler;
|
|
|
|
|
+
|
|
|
import com.x.base.core.project.config.ApplicationServer;
|
|
import com.x.base.core.project.config.ApplicationServer;
|
|
|
import com.x.base.core.project.config.CenterServer;
|
|
import com.x.base.core.project.config.CenterServer;
|
|
|
import com.x.base.core.project.config.Config;
|
|
import com.x.base.core.project.config.Config;
|
|
@@ -28,39 +34,15 @@ import com.x.base.core.project.config.StorageServer;
|
|
|
import com.x.base.core.project.config.WebServer;
|
|
import com.x.base.core.project.config.WebServer;
|
|
|
import com.x.base.core.project.tools.DefaultCharset;
|
|
import com.x.base.core.project.tools.DefaultCharset;
|
|
|
import com.x.base.core.project.tools.StringTools;
|
|
import com.x.base.core.project.tools.StringTools;
|
|
|
-import com.x.server.console.action.ActionCompactData;
|
|
|
|
|
import com.x.server.console.action.ActionConfig;
|
|
import com.x.server.console.action.ActionConfig;
|
|
|
import com.x.server.console.action.ActionCreateEncryptKey;
|
|
import com.x.server.console.action.ActionCreateEncryptKey;
|
|
|
-import com.x.server.console.action.ActionDebugDetailDisplay;
|
|
|
|
|
-import com.x.server.console.action.ActionDumpData;
|
|
|
|
|
-import com.x.server.console.action.ActionDumpStorage;
|
|
|
|
|
-import com.x.server.console.action.ActionEraseContentBbs;
|
|
|
|
|
-import com.x.server.console.action.ActionEraseContentCms;
|
|
|
|
|
-import com.x.server.console.action.ActionEraseContentLog;
|
|
|
|
|
-import com.x.server.console.action.ActionEraseContentProcessPlatform;
|
|
|
|
|
-import com.x.server.console.action.ActionHeapDump;
|
|
|
|
|
-import com.x.server.console.action.ActionRestoreData;
|
|
|
|
|
-import com.x.server.console.action.ActionRestoreStorage;
|
|
|
|
|
|
|
+import com.x.server.console.action.ActionDebugDesignDetail;
|
|
|
import com.x.server.console.action.ActionSetPassword;
|
|
import com.x.server.console.action.ActionSetPassword;
|
|
|
-import com.x.server.console.action.ActionShowCpu;
|
|
|
|
|
-import com.x.server.console.action.ActionShowHttpThread;
|
|
|
|
|
-import com.x.server.console.action.ActionShowMemory;
|
|
|
|
|
-import com.x.server.console.action.ActionShowOs;
|
|
|
|
|
-import com.x.server.console.action.ActionShowThread;
|
|
|
|
|
-import com.x.server.console.action.ActionStack;
|
|
|
|
|
import com.x.server.console.action.ActionUpdateFile;
|
|
import com.x.server.console.action.ActionUpdateFile;
|
|
|
import com.x.server.console.action.ActionVersion;
|
|
import com.x.server.console.action.ActionVersion;
|
|
|
import com.x.server.console.log.LogTools;
|
|
import com.x.server.console.log.LogTools;
|
|
|
import com.x.server.console.server.Servers;
|
|
import com.x.server.console.server.Servers;
|
|
|
|
|
|
|
|
-import org.apache.commons.io.FileUtils;
|
|
|
|
|
-import org.apache.commons.io.FilenameUtils;
|
|
|
|
|
-import org.apache.commons.lang3.BooleanUtils;
|
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
-import org.eclipse.jetty.deploy.App;
|
|
|
|
|
-import org.eclipse.jetty.deploy.DeploymentManager;
|
|
|
|
|
-import org.quartz.Scheduler;
|
|
|
|
|
-
|
|
|
|
|
public class Main {
|
|
public class Main {
|
|
|
|
|
|
|
|
private static final String MANIFEST_FILENAME = "manifest.cfg";
|
|
private static final String MANIFEST_FILENAME = "manifest.cfg";
|
|
@@ -82,8 +64,8 @@ public class Main {
|
|
|
throw new Exception("无法找到当前节点,请检查config/node_{name}.json与local/node.cfg文件内容中的名称是否一致.");
|
|
throw new Exception("无法找到当前节点,请检查config/node_{name}.json与local/node.cfg文件内容中的名称是否一致.");
|
|
|
}
|
|
}
|
|
|
final LinkedBlockingQueue<String> commandQueue = new LinkedBlockingQueue<>();
|
|
final LinkedBlockingQueue<String> commandQueue = new LinkedBlockingQueue<>();
|
|
|
-// try (PipedInputStream pipedInput = new PipedInputStream();
|
|
|
|
|
-// PipedOutputStream pipedOutput = new PipedOutputStream(pipedInput)) {
|
|
|
|
|
|
|
+ // try (PipedInputStream pipedInput = new PipedInputStream();
|
|
|
|
|
+ // PipedOutputStream pipedOutput = new PipedOutputStream(pipedInput)) {
|
|
|
new Thread() {
|
|
new Thread() {
|
|
|
/* 文件中的命令输出到解析器 */
|
|
/* 文件中的命令输出到解析器 */
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -160,152 +142,110 @@ public class Main {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- matcher = CommandFactory.show_os_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- showOs(matcher.group(1), matcher.group(2));
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- matcher = CommandFactory.show_cpu_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- showCpu(matcher.group(1), matcher.group(2));
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- matcher = CommandFactory.stack_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- stack(matcher.group(1), matcher.group(2), matcher.group(3));
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- matcher = CommandFactory.heapDump_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- heapDump(matcher.group(1));
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- matcher = CommandFactory.show_memory_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- showMemory(matcher.group(1), matcher.group(2));
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- matcher = CommandFactory.show_thread_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- showThread(matcher.group(1), matcher.group(2));
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- matcher = CommandFactory.show_http_thread_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- showHttpThread(matcher.group(1), matcher.group(2));
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
matcher = CommandFactory.start_pattern.matcher(cmd);
|
|
matcher = CommandFactory.start_pattern.matcher(cmd);
|
|
|
if (matcher.find()) {
|
|
if (matcher.find()) {
|
|
|
switch (matcher.group(1)) {
|
|
switch (matcher.group(1)) {
|
|
|
- case "application":
|
|
|
|
|
- startApplicationServer();
|
|
|
|
|
- break;
|
|
|
|
|
- case "center":
|
|
|
|
|
- startCenterServer();
|
|
|
|
|
- break;
|
|
|
|
|
- case "web":
|
|
|
|
|
- startWebServer();
|
|
|
|
|
- break;
|
|
|
|
|
- case "storage":
|
|
|
|
|
- startStorageServer();
|
|
|
|
|
- break;
|
|
|
|
|
- case "data":
|
|
|
|
|
- startDataServer();
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- startAll();
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ case "application":
|
|
|
|
|
+ startApplicationServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "center":
|
|
|
|
|
+ startCenterServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "web":
|
|
|
|
|
+ startWebServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "storage":
|
|
|
|
|
+ startStorageServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "data":
|
|
|
|
|
+ startDataServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ startAll();
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
matcher = CommandFactory.stop_pattern.matcher(cmd);
|
|
matcher = CommandFactory.stop_pattern.matcher(cmd);
|
|
|
if (matcher.find()) {
|
|
if (matcher.find()) {
|
|
|
switch (matcher.group(1)) {
|
|
switch (matcher.group(1)) {
|
|
|
- case "application":
|
|
|
|
|
- stopApplicationServer();
|
|
|
|
|
- break;
|
|
|
|
|
- case "center":
|
|
|
|
|
- stopCenterServer();
|
|
|
|
|
- break;
|
|
|
|
|
- case "web":
|
|
|
|
|
- stopWebServer();
|
|
|
|
|
- break;
|
|
|
|
|
- case "storage":
|
|
|
|
|
- stopStorageServer();
|
|
|
|
|
- break;
|
|
|
|
|
- case "data":
|
|
|
|
|
- stopDataServer();
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- stopAll();
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- matcher = CommandFactory.dump_path_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- switch (matcher.group(1)) {
|
|
|
|
|
- case "data":
|
|
|
|
|
- dumpData(matcher.group(2), matcher.group(3));
|
|
|
|
|
- break;
|
|
|
|
|
- case "storage":
|
|
|
|
|
- dumpStorage(matcher.group(2), matcher.group(3));
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- matcher = CommandFactory.dump_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- switch (matcher.group(1)) {
|
|
|
|
|
- case "data":
|
|
|
|
|
- dumpData("", matcher.group(2));
|
|
|
|
|
- break;
|
|
|
|
|
- case "storage":
|
|
|
|
|
- dumpStorage("", matcher.group(2));
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- matcher = CommandFactory.restore_path_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- switch (matcher.group(1)) {
|
|
|
|
|
- case "data":
|
|
|
|
|
- resotreDataPath(matcher.group(2), matcher.group(3));
|
|
|
|
|
- break;
|
|
|
|
|
- case "storage":
|
|
|
|
|
- resotreStoragePath(matcher.group(2), matcher.group(3));
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- matcher = CommandFactory.restore_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- switch (matcher.group(1)) {
|
|
|
|
|
- case "data":
|
|
|
|
|
- resotreData(matcher.group(2), matcher.group(3));
|
|
|
|
|
- break;
|
|
|
|
|
- case "storage":
|
|
|
|
|
- resotreStorage(matcher.group(2), matcher.group(3));
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ case "application":
|
|
|
|
|
+ stopApplicationServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "center":
|
|
|
|
|
+ stopCenterServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "web":
|
|
|
|
|
+ stopWebServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "storage":
|
|
|
|
|
+ stopStorageServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "data":
|
|
|
|
|
+ stopDataServer();
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ stopAll();
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
+ // matcher = CommandFactory.dump_path_pattern.matcher(cmd);
|
|
|
|
|
+ // if (matcher.find()) {
|
|
|
|
|
+ // switch (matcher.group(1)) {
|
|
|
|
|
+ // case "data":
|
|
|
|
|
+ // dumpData(matcher.group(2), matcher.group(3));
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // case "storage":
|
|
|
|
|
+ // dumpStorage(matcher.group(2), matcher.group(3));
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // default:
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // continue;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // matcher = CommandFactory.dump_pattern.matcher(cmd);
|
|
|
|
|
+ // if (matcher.find()) {
|
|
|
|
|
+ // switch (matcher.group(1)) {
|
|
|
|
|
+ // case "data":
|
|
|
|
|
+ // dumpData("", matcher.group(2));
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // case "storage":
|
|
|
|
|
+ // dumpStorage("", matcher.group(2));
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // default:
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // continue;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // matcher = CommandFactory.restore_path_pattern.matcher(cmd);
|
|
|
|
|
+ // if (matcher.find()) {
|
|
|
|
|
+ // switch (matcher.group(1)) {
|
|
|
|
|
+ // case "data":
|
|
|
|
|
+ // resotreDataPath(matcher.group(2), matcher.group(3));
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // case "storage":
|
|
|
|
|
+ // resotreStoragePath(matcher.group(2), matcher.group(3));
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // default:
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // continue;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // matcher = CommandFactory.restore_pattern.matcher(cmd);
|
|
|
|
|
+ // if (matcher.find()) {
|
|
|
|
|
+ // switch (matcher.group(1)) {
|
|
|
|
|
+ // case "data":
|
|
|
|
|
+ // resotreData(matcher.group(2), matcher.group(3));
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // case "storage":
|
|
|
|
|
+ // resotreStorage(matcher.group(2), matcher.group(3));
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // default:
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // continue;
|
|
|
|
|
+ // }
|
|
|
matcher = CommandFactory.help_pattern.matcher(cmd);
|
|
matcher = CommandFactory.help_pattern.matcher(cmd);
|
|
|
if (matcher.find()) {
|
|
if (matcher.find()) {
|
|
|
CommandFactory.printHelp();
|
|
CommandFactory.printHelp();
|
|
@@ -338,43 +278,15 @@ public class Main {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- matcher = CommandFactory.erase_content_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- switch (matcher.group(1)) {
|
|
|
|
|
- case "pp":
|
|
|
|
|
- eraseContentProcessPlatform(matcher.group(2));
|
|
|
|
|
- break;
|
|
|
|
|
- case "cms":
|
|
|
|
|
- eraseContentCms(matcher.group(2));
|
|
|
|
|
- break;
|
|
|
|
|
- case "log":
|
|
|
|
|
- eraseContentLog(matcher.group(2));
|
|
|
|
|
- break;
|
|
|
|
|
- case "bbs":
|
|
|
|
|
- eraseContentBbs(matcher.group(2));
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- matcher = CommandFactory.compact_data_pattern.matcher(cmd);
|
|
|
|
|
- if (matcher.find()) {
|
|
|
|
|
- compactData(matcher.group(1));
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
matcher = CommandFactory.create_encrypt_key_pattern.matcher(cmd);
|
|
matcher = CommandFactory.create_encrypt_key_pattern.matcher(cmd);
|
|
|
if (matcher.find()) {
|
|
if (matcher.find()) {
|
|
|
createEncryptKey(matcher.group(1));
|
|
createEncryptKey(matcher.group(1));
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- matcher = CommandFactory.debugDetailDisplay_pattern.matcher(cmd);
|
|
|
|
|
|
|
+ matcher = CommandFactory.debugDesignDetail_pattern.matcher(cmd);
|
|
|
if (matcher.find()) {
|
|
if (matcher.find()) {
|
|
|
- debugDetailDisplay(cmd);
|
|
|
|
|
|
|
+ debugDesignDetail(cmd);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -405,51 +317,8 @@ public class Main {
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- private static boolean showOs(String interval, String repeat) {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionShowOs().execute(Integer.parseInt(interval, 10), Integer.parseInt(repeat, 10));
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean showCpu(String interval, String repeat) {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionShowCpu().execute(Integer.parseInt(interval, 10), Integer.parseInt(repeat, 10));
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean showMemory(String interval, String repeat) {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionShowMemory().execute(Integer.parseInt(interval, 10), Integer.parseInt(repeat, 10));
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean showThread(String interval, String repeat) {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionShowThread().execute(Integer.parseInt(interval, 10), Integer.parseInt(repeat, 10));
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean showHttpThread(String interval, String repeat) {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionShowHttpThread().execute(Integer.parseInt(interval, 10), Integer.parseInt(repeat, 10));
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
private static boolean createEncryptKey(String password) {
|
|
private static boolean createEncryptKey(String password) {
|
|
|
try {
|
|
try {
|
|
@@ -682,82 +551,81 @@ public class Main {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static boolean dumpData(String path, String password) {
|
|
|
|
|
- try {
|
|
|
|
|
- return (new ActionDumpData()).execute(path, password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean dumpStorage(String path, String password) {
|
|
|
|
|
- try {
|
|
|
|
|
- return (new ActionDumpStorage()).execute(path, password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static void resotreData(String dateString, String password) {
|
|
|
|
|
- try {
|
|
|
|
|
- SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
- Date date = format.parse(dateString);
|
|
|
|
|
- File file = new File(Config.base(), "local/dump/dumpData_" + format.format(date));
|
|
|
|
|
- if (file.exists() && file.isDirectory()) {
|
|
|
|
|
- (new ActionRestoreData()).execute(date, password);
|
|
|
|
|
- } else {
|
|
|
|
|
- System.out.println("directory " + file.getAbsolutePath() + " not existed.");
|
|
|
|
|
- }
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static void resotreDataPath(String path, String password) {
|
|
|
|
|
- try {
|
|
|
|
|
- (new ActionRestoreData()).execute(path, password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static void resotreStorage(String dateString, String password) {
|
|
|
|
|
- try {
|
|
|
|
|
- SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
- Date date = format.parse(dateString);
|
|
|
|
|
- File file = new File(Config.base(), "local/dump/dumpStorage_" + format.format(date));
|
|
|
|
|
- if (file.exists() && file.isDirectory()) {
|
|
|
|
|
- ActionRestoreStorage restoreStorage = new ActionRestoreStorage();
|
|
|
|
|
- restoreStorage.execute(date, password);
|
|
|
|
|
- } else {
|
|
|
|
|
- System.out.println("directory " + file.getAbsolutePath() + " not existed.");
|
|
|
|
|
- }
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- private static void debugDetailDisplay(String cmd) {
|
|
|
|
|
|
|
+// private static boolean dumpData(String path, String password) {
|
|
|
|
|
+// try {
|
|
|
|
|
+// return (new ActionDumpData()).execute(path, password);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+// return true;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// private static boolean dumpStorage(String path, String password) {
|
|
|
|
|
+// try {
|
|
|
|
|
+// return (new ActionDumpStorage()).execute(path, password);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+// return true;
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// private static void resotreData(String dateString, String password) {
|
|
|
|
|
+// try {
|
|
|
|
|
+// SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
+// Date date = format.parse(dateString);
|
|
|
|
|
+// File file = new File(Config.base(), "local/dump/dumpData_" + format.format(date));
|
|
|
|
|
+// if (file.exists() && file.isDirectory()) {
|
|
|
|
|
+// (new ActionRestoreData()).execute(date, password);
|
|
|
|
|
+// } else {
|
|
|
|
|
+// System.out.println("directory " + file.getAbsolutePath() + " not existed.");
|
|
|
|
|
+// }
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// private static void resotreDataPath(String path, String password) {
|
|
|
|
|
+// try {
|
|
|
|
|
+// (new ActionRestoreData()).execute(path, password);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// private static void resotreStorage(String dateString, String password) {
|
|
|
|
|
+// try {
|
|
|
|
|
+// SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
+// Date date = format.parse(dateString);
|
|
|
|
|
+// File file = new File(Config.base(), "local/dump/dumpStorage_" + format.format(date));
|
|
|
|
|
+// if (file.exists() && file.isDirectory()) {
|
|
|
|
|
+// ActionRestoreStorage restoreStorage = new ActionRestoreStorage();
|
|
|
|
|
+// restoreStorage.execute(date, password);
|
|
|
|
|
+// } else {
|
|
|
|
|
+// System.out.println("directory " + file.getAbsolutePath() + " not existed.");
|
|
|
|
|
+// }
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ private static void debugDesignDetail(String cmd) {
|
|
|
try {
|
|
try {
|
|
|
String[] args = StringTools.translateCommandline(cmd);
|
|
String[] args = StringTools.translateCommandline(cmd);
|
|
|
args = Arrays.copyOfRange(args, 1, args.length);
|
|
args = Arrays.copyOfRange(args, 1, args.length);
|
|
|
- ActionDebugDetailDisplay action = new ActionDebugDetailDisplay();
|
|
|
|
|
- action.execute(args);
|
|
|
|
|
|
|
+ ActionDebugDesignDetail action = new ActionDebugDesignDetail();
|
|
|
|
|
+ action.execute(args);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static void resotreStoragePath(String path, String password) {
|
|
|
|
|
- try {
|
|
|
|
|
- new ActionRestoreStorage().execute(path, password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// private static void resotreStoragePath(String path, String password) {
|
|
|
|
|
+// try {
|
|
|
|
|
+// new ActionRestoreStorage().execute(path, password);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
private static void createTempClassesDirectory(String base) throws Exception {
|
|
private static void createTempClassesDirectory(String base) throws Exception {
|
|
|
File local_temp_classes_dir = new File(base, "local/temp/classes");
|
|
File local_temp_classes_dir = new File(base, "local/temp/classes");
|
|
@@ -914,67 +782,15 @@ public class Main {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static boolean compactData(String password) throws Exception {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionCompactData().execute(password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean eraseContentProcessPlatform(String password) throws Exception {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionEraseContentProcessPlatform().execute(password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// private static boolean compactData(String password) throws Exception {
|
|
|
|
|
+// try {
|
|
|
|
|
+// return new ActionCompactData().execute(password);
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+// return false;
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
- private static boolean eraseContentCms(String password) throws Exception {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionEraseContentCms().execute(password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean eraseContentBbs(String password) throws Exception {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionEraseContentBbs().execute(password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean eraseContentLog(String password) throws Exception {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionEraseContentLog().execute(password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean stack(String count, String interval, String password) {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionStack().execute(Integer.parseInt(count, 10), Integer.parseInt(interval, 10), password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static boolean heapDump(String password) {
|
|
|
|
|
- try {
|
|
|
|
|
- return new ActionHeapDump().execute(password);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|