}
private void doGet(org.apache.cassandra.net.http.HttpRequest httpRequest, HttpWriteResponse httpResponse)
{
boolean fServeSummary = true;
HTMLFormatter formatter = new HTMLFormatter();
String query = httpRequest.getQuery();
/*
* we do not care about the path for most requests except those
* from the load balancer
*/
String path = httpRequest.getPath();
/* for the health checks, just return the string only */
if(path.contains(LB_HEALTH_CHECK))
{
httpResponse.println(handleLBHealthCheck());
return;
}
formatter.startBody(true, getJSFunctions(), true, true);
formatter.appendLine("<h1><font color=\"white\"> Cluster map </font></h1>");
StringBuilder sbResult = new StringBuilder();
do
{
if(query.contains(DETAILS))
{
fServeSummary = false;
sbResult.append(handleNodeDetails());
break;
}
else if(query.contains(LOADME))
{
sbResult.append(handleLoadMe());
break;
}
else if(query.contains(KILLME))
{
sbResult.append(handleKillMe());
break;
}
else if(query.contains(COMPACTME))
{
sbResult.append(handleCompactMe());
break;
}
}
while(false);
//formatter.appendLine("<br>-------END DEBUG INFO-------<br><br>");
if(fServeSummary)
{
formatter.appendLine(handlePageDisplay(null, null, null));
}
formatter.appendLine("<br>");
if(sbResult.toString() != null)
{
formatter.appendLine(sbResult.toString());
}
formatter.endBody();
httpResponse.println(formatter.toString());
}