if (!(r instanceof DarkstarRunner)) {
throw new RunnerException("Only Darkstar runner supported");
}
DarkstarRunner dr = (DarkstarRunner) r;
if (action.equalsIgnoreCase("snapshot")) {
if (nameParam == null) {
throw new RunnerException("Name is required");
}
dr.createSnapshot(nameParam);
} else if (action.equalsIgnoreCase("setwfsname")) {
if (nameParam == null) {
throw new RunnerException("Name is required");
}
dr.setWFSName(nameParam);
} else if (action.equalsIgnoreCase("coldstart")) {
dr.forceColdstart();
} else {
throw new RunnerException("Unkown action " + action);
}
ResponseBuilder rb = Response.ok();