use of org.apache.jena.fuseki.async.AsyncPool in project jena by apache.
the class ActionTasks method execGet.
private void execGet(HttpAction action, String name) {
if (name == null)
log.info(format("[%d] Tasks", action.id));
else
log.info(format("[%d] Task %s", action.id, name));
JsonValue responseBody = null;
if (name == null) {
JsonBuilder builder = new JsonBuilder();
builder.startArray();
for (AsyncPool pool : pools) {
for (AsyncTask aTask : pool.tasks()) {
//builder.value(aTask.getTaskId()) ;
descOneTask(builder, aTask);
}
}
builder.finishArray();
responseBody = builder.build();
} else {
for (AsyncPool pool : pools) {
// Assumes first is only.
AsyncTask aTask = pool.getTask(name);
if (aTask != null) {
JsonBuilder builder = new JsonBuilder();
descOneTask(builder, aTask);
responseBody = builder.build();
}
}
}
if (responseBody == null)
ServletOps.errorNotFound("Task '" + name + "' not found");
ServletOps.setNoCache(action);
ServletOps.sendJsonReponse(action, responseBody);
}
Aggregations