* Return safemode state, instrumentation, configuration, osEnv or javaSysProps
*/
@SuppressWarnings("unchecked")
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String resource = getResourceName(request);
Instrumentation instr = Services.get().get(InstrumentationService.class).get();
if (resource.equals(RestConstants.ADMIN_STATUS_RESOURCE)) {
JSONObject json = new JSONObject();
populateOozieMode(json);
//json.put(JsonTags.SYSTEM_SAFE_MODE, getOozeMode());
sendJsonResponse(response, HttpServletResponse.SC_OK, json);
}
else if (resource.equals(RestConstants.ADMIN_OS_ENV_RESOURCE)) {
JSONObject json = new JSONObject();
json.putAll(instr.getOSEnv());
sendJsonResponse(response, HttpServletResponse.SC_OK, json);
}
else if (resource.equals(RestConstants.ADMIN_JAVA_SYS_PROPS_RESOURCE)) {
JSONObject json = new JSONObject();
json.putAll(instr.getJavaSystemProperties());
sendJsonResponse(response, HttpServletResponse.SC_OK, json);
}
else if (resource.equals(RestConstants.ADMIN_CONFIG_RESOURCE)) {
JSONObject json = new JSONObject();
json.putAll(instr.getConfiguration());
sendJsonResponse(response, HttpServletResponse.SC_OK, json);
}
else if (resource.equals(RestConstants.ADMIN_INSTRUMENTATION_RESOURCE)) {
sendJsonResponse(response, HttpServletResponse.SC_OK, instrToJson(instr));
}