if (refresh) {
String sval = params.get("refresh").getFirst();
refreshTime = Integer.parseInt(sval);
if (refreshTime < 10)
refreshTime = 10;
exchange.getResponseHeaders().add(new HttpString("Refresh"), Integer.toString(refreshTime));
}
boolean cmd = params.containsKey("Cmd");
boolean range = params.containsKey("Range");
if (cmd) {
String scmd = params.get("Cmd").getFirst();
if (scmd.equals("INFO")) {
processInfo(exchange);
return;
} else if (scmd.equals("DUMP")) {
processDump(exchange);
return;
} else if (scmd.equals("ENABLE-APP") && range) {
String srange = params.get("Range").getFirst();
Map<String, String[]> mparams = buildMap(params);
if (srange.equals("NODE")) {
processNodeCmd(exchange, mparams, Status.ENABLED);
}
if (srange.equals("DOMAIN")) {
boolean domain = params.containsKey("Domain");
if (domain) {
String sdomain = params.get("Domain").getFirst();
processDomainCmd(exchange, sdomain, Status.ENABLED);
}
}
if (srange.equals("CONTEXT")) {
processCmd(exchange, mparams, Status.ENABLED);
}
} else if (scmd.equals("DISABLE-APP") && range) {
String srange = params.get("Range").getFirst();
Map<String, String[]> mparams = buildMap(params);
if (srange.equals("NODE")) {
processNodeCmd(exchange, mparams, Status.DISABLED);
}
if (srange.equals("DOMAIN")) {
boolean domain = params.containsKey("Domain");
if (domain) {
String sdomain = params.get("Domain").getFirst();
processDomainCmd(exchange, sdomain, Status.DISABLED);
}
}
if (srange.equals("CONTEXT")) {
processCmd(exchange, mparams, Status.DISABLED);
}
}
}
}
}
}
exchange.setResponseCode(200);
exchange.getResponseHeaders().add(new HttpString("Content-Type"), "text/html; charset=ISO-8859-1");
Sender resp = exchange.getResponseSender();
StringBuilder buf = new StringBuilder();
buf.append("<html><head>\n<title>Mod_cluster Status</title>\n</head><body>\n");
buf.append("<h1>" + MOD_CLUSTER_EXPOSED_VERSION + "</h1>");