Add REST endpoint to list tasks

GET /config/server/tasks/ lists the task from the background work
queues.

The implementation of the SSH show-queue command was adapted so that
is uses the new REST endpoint to get the information about the tasks.
This avoids code duplication.

Change-Id: Iad0a94e8ed1395033aa7dbfe5fae0557601c3526
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2014-06-10 22:55:13 +02:00
parent d00285e4ab
commit 49098b8717
6 changed files with 338 additions and 168 deletions

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.server.config;
import static com.google.gerrit.server.config.CapabilityResource.CAPABILITY_KIND;
import static com.google.gerrit.server.config.ConfigResource.CONFIG_KIND;
import static com.google.gerrit.server.config.TaskResource.TASK_KIND;
import static com.google.gerrit.server.config.TopMenuResource.TOP_MENU_KIND;
import com.google.gerrit.extensions.registration.DynamicMap;
@@ -26,8 +27,10 @@ public class Module extends RestApiModule {
protected void configure() {
DynamicMap.mapOf(binder(), CAPABILITY_KIND);
DynamicMap.mapOf(binder(), CONFIG_KIND);
DynamicMap.mapOf(binder(), TASK_KIND);
DynamicMap.mapOf(binder(), TOP_MENU_KIND);
child(CONFIG_KIND, "capabilities").to(CapabilitiesCollection.class);
child(CONFIG_KIND, "tasks").to(TasksCollection.class);
child(CONFIG_KIND, "top-menus").to(TopMenuCollection.class);
get(CONFIG_KIND, "version").to(GetVersion.class);
get(CONFIG_KIND, "preferences").to(GetPreferences.class);