}
String jobIdString = doomedHistory.getJobId().toString();
int resourceId = doomedHistory.getResource().getId();
CancelResults results = null;
AgentClient agent = null;
boolean canceled = false;
try {
agent = agentManager.getAgentClient(subjectManager.getOverlord(), resourceId);
// since this method is usually called by the UI, we want to quickly determine if we can even talk to the agent
if (agent.pingService(5000L)) {
results = agent.getOperationAgentService().cancelOperation(jobIdString);
InterruptedState interruptedState = results.getInterruptedState();
switch (interruptedState) {
case FINISHED: {