Search in sources :

Example 1 with TaskResource

use of com.google.gerrit.server.config.TaskResource in project gerrit by GerritCodeReview.

the class KillCommand method run.

@Override
protected void run() {
    ConfigResource cfgRsrc = new ConfigResource();
    for (String id : taskIds) {
        try {
            TaskResource taskRsrc = tasksCollection.parse(cfgRsrc, IdString.fromDecoded(id));
            deleteTask.apply(taskRsrc, null);
        } catch (AuthException | ResourceNotFoundException | PermissionBackendException e) {
            stderr.print("kill: " + id + ": No such task\n");
        }
    }
}
Also used : TaskResource(com.google.gerrit.server.config.TaskResource) AuthException(com.google.gerrit.extensions.restapi.AuthException) PermissionBackendException(com.google.gerrit.server.permissions.PermissionBackendException) IdString(com.google.gerrit.extensions.restapi.IdString) ResourceNotFoundException(com.google.gerrit.extensions.restapi.ResourceNotFoundException) ConfigResource(com.google.gerrit.server.config.ConfigResource)

Aggregations

AuthException (com.google.gerrit.extensions.restapi.AuthException)1 IdString (com.google.gerrit.extensions.restapi.IdString)1 ResourceNotFoundException (com.google.gerrit.extensions.restapi.ResourceNotFoundException)1 ConfigResource (com.google.gerrit.server.config.ConfigResource)1 TaskResource (com.google.gerrit.server.config.TaskResource)1 PermissionBackendException (com.google.gerrit.server.permissions.PermissionBackendException)1