Computer computer = Jenkins.getInstance().getComputer(slaveName);
if (!(computer instanceof PBSSlaveComputer)) {
throw new RuntimeException(String.format("%s is not a PBS Slave!", computer.getName()));
}
PBSSlaveComputer pbsSlaveComputer = (PBSSlaveComputer) computer;
TraceJob traceJob = new TraceJob(jobId, numberOfDays);
PBSJob pbsJob = null;
try {
pbsJob = pbsSlaveComputer.getChannel().call(traceJob);
request.setAttribute("output", pbsJob.getOut());
request.setAttribute("error", pbsJob.getErr());
request.getView(this, "index.jelly").forward(request, response);
} catch (InterruptedException e) {