@@ -36,22 +36,18 @@ import org.sonar.server.ws.WsUtils; | |||
import org.sonarqube.ws.Common; | |||
import org.sonarqube.ws.WsCe; | |||
/** | |||
* GET api/ce/activity | |||
* <p>Get the past executed tasks</p> | |||
*/ | |||
public class CeActivityWsAction implements CeWsAction { | |||
public class ActivityWsAction implements CeWsAction { | |||
private static final String PARAM_COMPONENT_ID = "componentId"; | |||
private static final String PARAM_COMPONENT_UUID = "componentId"; | |||
private static final String PARAM_TYPE = "type"; | |||
private static final String PARAM_STATUS = "status"; | |||
private static final String PARAM_ONLY_CURRENTS = "onlyCurrents"; | |||
private final UserSession userSession; | |||
private final DbClient dbClient; | |||
private final CeWsTaskFormatter formatter; | |||
private final TaskFormatter formatter; | |||
public CeActivityWsAction(UserSession userSession, DbClient dbClient, CeWsTaskFormatter formatter) { | |||
public ActivityWsAction(UserSession userSession, DbClient dbClient, TaskFormatter formatter) { | |||
this.userSession = userSession; | |||
this.dbClient = dbClient; | |||
this.formatter = formatter; | |||
@@ -61,9 +57,9 @@ public class CeActivityWsAction implements CeWsAction { | |||
public void define(WebService.NewController controller) { | |||
WebService.NewAction action = controller.createAction("activity") | |||
.setInternal(true) | |||
.setResponseExample(getClass().getResource("CeActivityWsAction/example.json")) | |||
.setResponseExample(getClass().getResource("activity-example.json")) | |||
.setHandler(this); | |||
action.createParam(PARAM_COMPONENT_ID) | |||
action.createParam(PARAM_COMPONENT_UUID) | |||
.setDescription("Optional id of the component (project) to filter on") | |||
.setExampleValue(Uuids.UUID_EXAMPLE_03); | |||
action.createParam(PARAM_STATUS) | |||
@@ -111,12 +107,12 @@ public class CeActivityWsAction implements CeWsAction { | |||
query.setStatus(CeActivityDto.Status.valueOf(status)); | |||
} | |||
String componentId = wsRequest.param(PARAM_COMPONENT_ID); | |||
if (componentId == null) { | |||
String componentUuid = wsRequest.param(PARAM_COMPONENT_UUID); | |||
if (componentUuid == null) { | |||
userSession.checkGlobalPermission(UserRole.ADMIN); | |||
} else { | |||
userSession.checkProjectUuidPermission(UserRole.ADMIN, componentId); | |||
query.setComponentUuid(componentId); | |||
userSession.checkProjectUuidPermission(UserRole.USER, componentUuid); | |||
query.setComponentUuid(componentUuid); | |||
} | |||
return query; | |||
} |
@@ -28,7 +28,7 @@ import org.sonar.server.computation.CeQueue; | |||
import org.sonar.server.exceptions.BadRequestException; | |||
import org.sonar.server.user.UserSession; | |||
public class CeCancelWsAction implements CeWsAction { | |||
public class CancelWsAction implements CeWsAction { | |||
public static final String PARAM_TASK_ID = "id"; | |||
public static final String PARAM_ALL = "all"; | |||
@@ -36,7 +36,7 @@ public class CeCancelWsAction implements CeWsAction { | |||
private final UserSession userSession; | |||
private final CeQueue queue; | |||
public CeCancelWsAction(UserSession userSession, CeQueue queue) { | |||
public CancelWsAction(UserSession userSession, CeQueue queue) { | |||
this.userSession = userSession; | |||
this.queue = queue; | |||
} |
@@ -31,19 +31,15 @@ import org.sonar.server.user.UserSession; | |||
import org.sonar.server.ws.WsUtils; | |||
import org.sonarqube.ws.WsCe; | |||
/** | |||
* GET api/ce/queue | |||
* <p>Get the status of the queue</p> | |||
*/ | |||
public class CeQueueWsAction implements CeWsAction { | |||
public static final String PARAM_COMPONENT_ID = "componentId"; | |||
public static final String PARAM_COMPONENT_UUID = "componentId"; | |||
private final UserSession userSession; | |||
private final DbClient dbClient; | |||
private final CeWsTaskFormatter formatter; | |||
private final TaskFormatter formatter; | |||
public CeQueueWsAction(UserSession userSession, DbClient dbClient, CeWsTaskFormatter formatter) { | |||
public CeQueueWsAction(UserSession userSession, DbClient dbClient, TaskFormatter formatter) { | |||
this.userSession = userSession; | |||
this.dbClient = dbClient; | |||
this.formatter = formatter; | |||
@@ -54,15 +50,15 @@ public class CeQueueWsAction implements CeWsAction { | |||
WebService.NewAction action = controller.createAction("queue") | |||
.setDescription("Gets the tasks of the Compute Engine queue") | |||
.setInternal(true) | |||
.setResponseExample(getClass().getResource("CeQueueWsAction/example.json")) | |||
.setResponseExample(getClass().getResource("queue-example.json")) | |||
.setHandler(this); | |||
action.createParam(PARAM_COMPONENT_ID); | |||
action.createParam(PARAM_COMPONENT_UUID); | |||
} | |||
@Override | |||
public void handle(Request wsRequest, Response wsResponse) throws Exception { | |||
String componentUuid = wsRequest.param(PARAM_COMPONENT_ID); | |||
String componentUuid = wsRequest.param(PARAM_COMPONENT_UUID); | |||
DbSession dbSession = dbClient.openSession(false); | |||
try { |
@@ -0,0 +1,38 @@ | |||
/* | |||
* SonarQube, open source software quality management tool. | |||
* Copyright (C) 2008-2014 SonarSource | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* SonarQube is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* SonarQube is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.ws; | |||
import org.sonar.core.platform.Module; | |||
public class CeWsModule extends Module { | |||
@Override | |||
protected void configureModule() { | |||
add( | |||
ActivityWsAction.class, | |||
CancelWsAction.class, | |||
CeQueueWsAction.class, | |||
CeWs.class, | |||
IsQueueEmptyWs.class, | |||
ProjectWsAction.class, | |||
SubmitWsAction.class, | |||
TaskFormatter.class, | |||
TaskWsAction.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/* | |||
* SonarQube, open source software quality management tool. | |||
* Copyright (C) 2008-2014 SonarSource | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* SonarQube is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* SonarQube is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.ws; | |||
import java.util.List; | |||
import org.apache.ibatis.session.RowBounds; | |||
import org.sonar.api.server.ws.Request; | |||
import org.sonar.api.server.ws.Response; | |||
import org.sonar.api.server.ws.WebService; | |||
import org.sonar.api.web.UserRole; | |||
import org.sonar.core.util.Uuids; | |||
import org.sonar.db.DbClient; | |||
import org.sonar.db.DbSession; | |||
import org.sonar.db.ce.CeActivityDto; | |||
import org.sonar.db.ce.CeActivityQuery; | |||
import org.sonar.db.ce.CeQueueDto; | |||
import org.sonar.server.user.UserSession; | |||
import org.sonar.server.ws.WsUtils; | |||
import static org.sonarqube.ws.WsCe.ProjectResponse; | |||
public class ProjectWsAction implements CeWsAction { | |||
public static final String PARAM_COMPONENT_UUID = "componentId"; | |||
private final UserSession userSession; | |||
private final DbClient dbClient; | |||
private final TaskFormatter formatter; | |||
public ProjectWsAction(UserSession userSession, DbClient dbClient, TaskFormatter formatter) { | |||
this.userSession = userSession; | |||
this.dbClient = dbClient; | |||
this.formatter = formatter; | |||
} | |||
@Override | |||
public void define(WebService.NewController controller) { | |||
WebService.NewAction action = controller.createAction("project") | |||
.setDescription("Get the pending and last executed tasks of a given project") | |||
.setInternal(true) | |||
.setResponseExample(getClass().getResource("project-example.json")) | |||
.setHandler(this); | |||
action.createParam(PARAM_COMPONENT_UUID) | |||
.setRequired(true) | |||
.setExampleValue(Uuids.UUID_EXAMPLE_01); | |||
} | |||
@Override | |||
public void handle(Request wsRequest, Response wsResponse) throws Exception { | |||
String componentUuid = wsRequest.mandatoryParam(PARAM_COMPONENT_UUID); | |||
userSession.checkProjectUuidPermission(UserRole.USER, componentUuid); | |||
DbSession dbSession = dbClient.openSession(false); | |||
try { | |||
List<CeQueueDto> queueDtos = dbClient.ceQueueDao().selectByComponentUuid(dbSession, componentUuid); | |||
CeActivityQuery activityQuery = new CeActivityQuery() | |||
.setComponentUuid(componentUuid) | |||
.setOnlyCurrents(true); | |||
List<CeActivityDto> activityDtos = dbClient.ceActivityDao().selectByQuery(dbSession, activityQuery, new RowBounds(0, 1)); | |||
ProjectResponse.Builder wsResponseBuilder = ProjectResponse.newBuilder(); | |||
wsResponseBuilder.addAllQueue(formatter.formatQueue(dbSession, queueDtos)); | |||
if (activityDtos.size() == 1) { | |||
wsResponseBuilder.setCurrent(formatter.formatActivity(dbSession, activityDtos.get(0))); | |||
} | |||
WsUtils.writeProtobuf(wsResponseBuilder.build(), wsRequest, wsResponse); | |||
} finally { | |||
dbClient.closeSession(dbSession); | |||
} | |||
} | |||
} |
@@ -29,11 +29,7 @@ import org.sonar.server.computation.ReportSubmitter; | |||
import org.sonar.server.ws.WsUtils; | |||
import org.sonarqube.ws.WsCe; | |||
/** | |||
* POST api/ce/submit | |||
* <p>Submits an analysis report to the queue of Compute Engine</p> | |||
*/ | |||
public class CeSubmitWsAction implements CeWsAction { | |||
public class SubmitWsAction implements CeWsAction { | |||
public static final String PARAM_PROJECT_KEY = "projectKey"; | |||
public static final String PARAM_PROJECT_BRANCH = "projectBranch"; | |||
@@ -42,7 +38,7 @@ public class CeSubmitWsAction implements CeWsAction { | |||
private final ReportSubmitter reportSubmitter; | |||
public CeSubmitWsAction(ReportSubmitter reportSubmitter) { | |||
public SubmitWsAction(ReportSubmitter reportSubmitter) { | |||
this.reportSubmitter = reportSubmitter; | |||
} | |||
@@ -53,7 +49,7 @@ public class CeSubmitWsAction implements CeWsAction { | |||
.setPost(true) | |||
.setInternal(true) | |||
.setHandler(this) | |||
.setResponseExample(getClass().getResource("CeSubmitWsAction/example.json")); | |||
.setResponseExample(getClass().getResource("submit-example.json")); | |||
action | |||
.createParam(PARAM_PROJECT_KEY) |
@@ -35,11 +35,11 @@ import org.sonar.db.ce.CeQueueDto; | |||
import org.sonar.db.component.ComponentDto; | |||
import org.sonarqube.ws.WsCe; | |||
public class CeWsTaskFormatter { | |||
public class TaskFormatter { | |||
private final DbClient dbClient; | |||
public CeWsTaskFormatter(DbClient dbClient) { | |||
public TaskFormatter(DbClient dbClient) { | |||
this.dbClient = dbClient; | |||
} | |||
@@ -100,7 +100,7 @@ public class CeWsTaskFormatter { | |||
if (dto.getSubmitterLogin() != null) { | |||
builder.setSubmitterLogin(dto.getSubmitterLogin()); | |||
} | |||
builder.setSubmittedAt(DateUtils.formatDateTime(new Date(dto.getCreatedAt()))); | |||
builder.setSubmittedAt(DateUtils.formatDateTime(new Date(dto.getSubmittedAt()))); | |||
if (dto.getStartedAt() != null) { | |||
builder.setStartedAt(DateUtils.formatDateTime(new Date(dto.getStartedAt()))); | |||
} | |||
@@ -113,7 +113,7 @@ public class CeWsTaskFormatter { | |||
return builder.build(); | |||
} | |||
private void buildComponent(WsCe.Task.Builder builder, @Nullable ComponentDto componentDto) { | |||
private static void buildComponent(WsCe.Task.Builder builder, @Nullable ComponentDto componentDto) { | |||
if (componentDto != null) { | |||
builder.setComponentKey(componentDto.getKey()); | |||
builder.setComponentName(componentDto.name()); |
@@ -34,16 +34,16 @@ import org.sonar.server.user.UserSession; | |||
import org.sonar.server.ws.WsUtils; | |||
import org.sonarqube.ws.WsCe; | |||
public class CeTaskWsAction implements CeWsAction { | |||
public class TaskWsAction implements CeWsAction { | |||
public static final String ACTION = "task"; | |||
public static final String PARAM_TASK_ID = "id"; | |||
public static final String PARAM_TASK_UUID = "id"; | |||
private final DbClient dbClient; | |||
private final CeWsTaskFormatter wsTaskFormatter; | |||
private final TaskFormatter wsTaskFormatter; | |||
private final UserSession userSession; | |||
public CeTaskWsAction(DbClient dbClient, CeWsTaskFormatter wsTaskFormatter, UserSession userSession) { | |||
public TaskWsAction(DbClient dbClient, TaskFormatter wsTaskFormatter, UserSession userSession) { | |||
this.dbClient = dbClient; | |||
this.wsTaskFormatter = wsTaskFormatter; | |||
this.userSession = userSession; | |||
@@ -57,7 +57,7 @@ public class CeTaskWsAction implements CeWsAction { | |||
.setHandler(this); | |||
action | |||
.createParam(PARAM_TASK_ID) | |||
.createParam(PARAM_TASK_UUID) | |||
.setRequired(true) | |||
.setDescription("Id of task") | |||
.setExampleValue(Uuids.UUID_EXAMPLE_01); | |||
@@ -67,15 +67,15 @@ public class CeTaskWsAction implements CeWsAction { | |||
public void handle(Request wsRequest, Response wsResponse) throws Exception { | |||
userSession.checkGlobalPermission(UserRole.ADMIN); | |||
String taskId = wsRequest.mandatoryParam(PARAM_TASK_ID); | |||
String taskUuid = wsRequest.mandatoryParam(PARAM_TASK_UUID); | |||
DbSession dbSession = dbClient.openSession(false); | |||
try { | |||
WsCe.TaskResponse.Builder wsTaskResponse = WsCe.TaskResponse.newBuilder(); | |||
Optional<CeQueueDto> queueDto = dbClient.ceQueueDao().selectByUuid(dbSession, taskId); | |||
Optional<CeQueueDto> queueDto = dbClient.ceQueueDao().selectByUuid(dbSession, taskUuid); | |||
if (queueDto.isPresent()) { | |||
wsTaskResponse.setTask(wsTaskFormatter.formatQueue(dbSession, queueDto.get())); | |||
} else { | |||
Optional<CeActivityDto> activityDto = dbClient.ceActivityDao().selectByUuid(dbSession, taskId); | |||
Optional<CeActivityDto> activityDto = dbClient.ceActivityDao().selectByUuid(dbSession, taskUuid); | |||
if (activityDto.isPresent()) { | |||
wsTaskResponse.setTask(wsTaskFormatter.formatActivity(dbSession, activityDto.get())); | |||
} else { |
@@ -64,8 +64,8 @@ import org.sonar.server.component.DefaultRubyComponentService; | |||
import org.sonar.server.component.ws.ComponentsWs; | |||
import org.sonar.server.component.ws.EventsWs; | |||
import org.sonar.server.component.ws.ResourcesWs; | |||
import org.sonar.server.computation.CeQueueImpl; | |||
import org.sonar.server.computation.CeQueueCleaner; | |||
import org.sonar.server.computation.CeQueueImpl; | |||
import org.sonar.server.computation.CeQueueInitializer; | |||
import org.sonar.server.computation.CleanReportQueueListener; | |||
import org.sonar.server.computation.ComputeEngineProcessingModule; | |||
@@ -73,14 +73,7 @@ import org.sonar.server.computation.ReportFiles; | |||
import org.sonar.server.computation.ReportSubmitter; | |||
import org.sonar.server.computation.monitoring.CEQueueStatusImpl; | |||
import org.sonar.server.computation.monitoring.ComputeEngineQueueMonitor; | |||
import org.sonar.server.computation.ws.CeActivityWsAction; | |||
import org.sonar.server.computation.ws.CeCancelWsAction; | |||
import org.sonar.server.computation.ws.CeQueueWsAction; | |||
import org.sonar.server.computation.ws.CeSubmitWsAction; | |||
import org.sonar.server.computation.ws.CeTaskWsAction; | |||
import org.sonar.server.computation.ws.CeWs; | |||
import org.sonar.server.computation.ws.CeWsTaskFormatter; | |||
import org.sonar.server.computation.ws.IsQueueEmptyWs; | |||
import org.sonar.server.computation.ws.CeWsModule; | |||
import org.sonar.server.config.ws.PropertiesWs; | |||
import org.sonar.server.dashboard.template.GlobalDefaultDashboard; | |||
import org.sonar.server.dashboard.template.ProjectDefaultDashboard; | |||
@@ -724,14 +717,7 @@ public class PlatformLevel4 extends PlatformLevel { | |||
CleanReportQueueListener.class, | |||
ReportFiles.class, | |||
ComputeEngineProcessingModule.class, | |||
CeWs.class, | |||
CeWsTaskFormatter.class, | |||
CeTaskWsAction.class, | |||
CeSubmitWsAction.class, | |||
CeActivityWsAction.class, | |||
CeCancelWsAction.class, | |||
CeQueueWsAction.class, | |||
IsQueueEmptyWs.class, | |||
CeWsModule.class, | |||
DefaultPeriodCleaner.class, | |||
ProjectCleaner.class, | |||
ProjectSettingsFactory.class, |
@@ -0,0 +1,25 @@ | |||
{ | |||
"queue": [ | |||
{ | |||
"id": "AU_w84A6gAS1Hm6h4_ih", | |||
"type": "REPORT", | |||
"componentId": "AU_w74XMgAS1Hm6h4-Y-", | |||
"componentKey": "com.github.kevinsawicki:http-request-parent", | |||
"componentName": "HttpRequest", | |||
"status": "PENDING", | |||
"submittedAt": "2015-09-21T19:28:54+0200" | |||
} | |||
], | |||
"current": { | |||
"id": "AU_w8LDjgAS1Hm6h4-aY", | |||
"type": "REPORT", | |||
"componentId": "AU_w74XMgAS1Hm6h4-Y-", | |||
"componentKey": "com.github.kevinsawicki:http-request-parent", | |||
"componentName": "HttpRequest", | |||
"status": "SUCCESS", | |||
"submittedAt": "2015-09-21T19:25:49+0200", | |||
"startedAt": "2015-09-21T19:25:57+0200", | |||
"finishedAt": "2015-09-21T19:25:58+0200", | |||
"executionTimeMs": 1371 | |||
} | |||
} |
@@ -40,7 +40,7 @@ import org.sonarqube.ws.WsCe; | |||
import static java.util.Arrays.asList; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
public class CeActivityWsActionTest { | |||
public class ActivityWsActionTest { | |||
@Rule | |||
public UserSessionRule userSession = UserSessionRule.standalone(); | |||
@@ -48,8 +48,8 @@ public class CeActivityWsActionTest { | |||
@Rule | |||
public DbTester dbTester = DbTester.create(System2.INSTANCE); | |||
CeWsTaskFormatter formatter = new CeWsTaskFormatter(dbTester.getDbClient()); | |||
CeActivityWsAction underTest = new CeActivityWsAction(userSession, dbTester.getDbClient(), formatter); | |||
TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient()); | |||
ActivityWsAction underTest = new ActivityWsAction(userSession, dbTester.getDbClient(), formatter); | |||
WsActionTester tester = new WsActionTester(underTest); | |||
@Test | |||
@@ -142,7 +142,7 @@ public class CeActivityWsActionTest { | |||
@Test | |||
public void get_project_activity() { | |||
userSession.addProjectUuidPermissions(UserRole.ADMIN, "PROJECT_1"); | |||
userSession.addProjectUuidPermissions(UserRole.USER, "PROJECT_1"); | |||
insert("T1", "PROJECT_1", CeActivityDto.Status.SUCCESS); | |||
insert("T2", "PROJECT_2", CeActivityDto.Status.FAILED); | |||
@@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock; | |||
import static org.mockito.Mockito.verify; | |||
import static org.mockito.Mockito.verifyZeroInteractions; | |||
public class CeCancelWsActionTest { | |||
public class CancelWsActionTest { | |||
@Rule | |||
public UserSessionRule userSession = UserSessionRule.standalone(); | |||
@@ -43,7 +43,7 @@ public class CeCancelWsActionTest { | |||
public DbTester dbTester = DbTester.create(System2.INSTANCE); | |||
CeQueue queue = mock(CeQueue.class); | |||
CeCancelWsAction underTest = new CeCancelWsAction(userSession, queue); | |||
CancelWsAction underTest = new CancelWsAction(userSession, queue); | |||
WsActionTester tester = new WsActionTester(underTest); | |||
@Test |
@@ -0,0 +1,35 @@ | |||
/* | |||
* SonarQube, open source software quality management tool. | |||
* Copyright (C) 2008-2014 SonarSource | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* SonarQube is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* SonarQube is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.ws; | |||
import org.junit.Test; | |||
import org.sonar.core.platform.ComponentContainer; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
public class CeWsModuleTest { | |||
@Test | |||
public void verify_count_of_added_components() { | |||
ComponentContainer container = new ComponentContainer(); | |||
new CeWsModule().configure(container); | |||
assertThat(container.size()).isEqualTo(9 + 2 /* injected by ComponentContainer */); | |||
} | |||
} |
@@ -31,7 +31,7 @@ public class CeWsTest { | |||
@Test | |||
public void define() throws Exception { | |||
CeWsAction wsAction = new CeSubmitWsAction(mock(ReportSubmitter.class)); | |||
CeWsAction wsAction = new SubmitWsAction(mock(ReportSubmitter.class)); | |||
CeWs ws = new CeWs(wsAction); | |||
WebService.Context context = mock(WebService.Context.class, Mockito.RETURNS_DEEP_STUBS); |
@@ -0,0 +1,111 @@ | |||
/* | |||
* SonarQube, open source software quality management tool. | |||
* Copyright (C) 2008-2014 SonarSource | |||
* mailto:contact AT sonarsource DOT com | |||
* | |||
* SonarQube is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU Lesser General Public | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or (at your option) any later version. | |||
* | |||
* SonarQube is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public License | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
package org.sonar.server.computation.ws; | |||
import org.junit.Rule; | |||
import org.junit.Test; | |||
import org.sonar.api.utils.System2; | |||
import org.sonar.api.web.UserRole; | |||
import org.sonar.core.util.Protobuf; | |||
import org.sonar.db.DbTester; | |||
import org.sonar.db.ce.CeActivityDto; | |||
import org.sonar.db.ce.CeQueueDto; | |||
import org.sonar.db.ce.CeTaskTypes; | |||
import org.sonar.server.plugins.MimeTypes; | |||
import org.sonar.server.tester.UserSessionRule; | |||
import org.sonar.server.ws.TestResponse; | |||
import org.sonar.server.ws.WsActionTester; | |||
import org.sonarqube.ws.WsCe; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
public class ProjectWsActionTest { | |||
@Rule | |||
public UserSessionRule userSession = UserSessionRule.standalone(); | |||
@Rule | |||
public DbTester dbTester = DbTester.create(System2.INSTANCE); | |||
TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient()); | |||
ProjectWsAction underTest = new ProjectWsAction(userSession, dbTester.getDbClient(), formatter); | |||
WsActionTester tester = new WsActionTester(underTest); | |||
@Test | |||
public void empty_queue_and_empty_activity() { | |||
userSession.addProjectUuidPermissions(UserRole.USER, "PROJECT_1"); | |||
TestResponse wsResponse = tester.newRequest() | |||
.setParam("componentId", "PROJECT_1") | |||
.setMediaType(MimeTypes.PROTOBUF) | |||
.execute(); | |||
WsCe.ProjectResponse response = Protobuf.read(wsResponse.getInputStream(), WsCe.ProjectResponse.PARSER); | |||
assertThat(response.getQueueCount()).isEqualTo(0); | |||
assertThat(response.hasCurrent()).isFalse(); | |||
} | |||
@Test | |||
public void project_tasks() { | |||
userSession.addProjectUuidPermissions(UserRole.USER, "PROJECT_1"); | |||
insertActivity("T1", "PROJECT_1", CeActivityDto.Status.SUCCESS); | |||
insertActivity("T2", "PROJECT_2", CeActivityDto.Status.FAILED); | |||
insertActivity("T3", "PROJECT_1", CeActivityDto.Status.FAILED); | |||
insertQueue("T4", "PROJECT_1", CeQueueDto.Status.IN_PROGRESS); | |||
insertQueue("T5", "PROJECT_1", CeQueueDto.Status.PENDING); | |||
TestResponse wsResponse = tester.newRequest() | |||
.setParam("componentId", "PROJECT_1") | |||
.setMediaType(MimeTypes.PROTOBUF) | |||
.execute(); | |||
WsCe.ProjectResponse response = Protobuf.read(wsResponse.getInputStream(), WsCe.ProjectResponse.PARSER); | |||
assertThat(response.getQueueCount()).isEqualTo(2); | |||
assertThat(response.getQueue(0).getId()).isEqualTo("T4"); | |||
assertThat(response.getQueue(1).getId()).isEqualTo("T5"); | |||
// T3 is the latest task executed on PROJECT_1 | |||
assertThat(response.hasCurrent()).isTrue(); | |||
assertThat(response.getCurrent().getId()).isEqualTo("T3"); | |||
} | |||
private CeQueueDto insertQueue(String taskUuid, String componentUuid, CeQueueDto.Status status) { | |||
CeQueueDto queueDto = new CeQueueDto(); | |||
queueDto.setTaskType(CeTaskTypes.REPORT); | |||
queueDto.setComponentUuid(componentUuid); | |||
queueDto.setUuid(taskUuid); | |||
queueDto.setStatus(status); | |||
dbTester.getDbClient().ceQueueDao().insert(dbTester.getSession(), queueDto); | |||
dbTester.getSession().commit(); | |||
return queueDto; | |||
} | |||
private CeActivityDto insertActivity(String taskUuid, String componentUuid, CeActivityDto.Status status) { | |||
CeQueueDto queueDto = new CeQueueDto(); | |||
queueDto.setTaskType(CeTaskTypes.REPORT); | |||
queueDto.setComponentUuid(componentUuid); | |||
queueDto.setUuid(taskUuid); | |||
CeActivityDto activityDto = new CeActivityDto(queueDto); | |||
activityDto.setStatus(status); | |||
activityDto.setExecutionTimeMs(500L); | |||
dbTester.getDbClient().ceActivityDao().insert(dbTester.getSession(), activityDto); | |||
dbTester.getSession().commit(); | |||
return activityDto; | |||
} | |||
} |
@@ -35,7 +35,7 @@ import org.sonarqube.ws.WsCe; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
public class CeQueueWsActionTest { | |||
public class QueueWsActionTest { | |||
@Rule | |||
public UserSessionRule userSession = UserSessionRule.standalone(); | |||
@@ -43,7 +43,7 @@ public class CeQueueWsActionTest { | |||
@Rule | |||
public DbTester dbTester = DbTester.create(System2.INSTANCE); | |||
CeWsTaskFormatter formatter = new CeWsTaskFormatter(dbTester.getDbClient()); | |||
TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient()); | |||
CeQueueWsAction underTest = new CeQueueWsAction(userSession, dbTester.getDbClient(), formatter); | |||
WsActionTester tester = new WsActionTester(underTest); | |||
@@ -39,10 +39,10 @@ import static org.mockito.Mockito.mock; | |||
import static org.mockito.Mockito.verify; | |||
import static org.mockito.Mockito.when; | |||
public class CeSubmitWsActionTest { | |||
public class SubmitWsActionTest { | |||
ReportSubmitter reportSubmitter = mock(ReportSubmitter.class); | |||
CeSubmitWsAction underTest = new CeSubmitWsAction(reportSubmitter); | |||
SubmitWsAction underTest = new SubmitWsAction(reportSubmitter); | |||
WsActionTester tester = new WsActionTester(underTest); | |||
@Test |
@@ -38,7 +38,7 @@ import org.sonarqube.ws.WsCe; | |||
import static org.assertj.core.api.Assertions.assertThat; | |||
public class CeTaskWsActionTest { | |||
public class TaskWsActionTest { | |||
@Rule | |||
public UserSessionRule userSession = UserSessionRule.standalone(); | |||
@@ -46,8 +46,8 @@ public class CeTaskWsActionTest { | |||
@Rule | |||
public DbTester dbTester = DbTester.create(System2.INSTANCE); | |||
CeWsTaskFormatter formatter = new CeWsTaskFormatter(dbTester.getDbClient()); | |||
CeTaskWsAction underTest = new CeTaskWsAction(dbTester.getDbClient(), formatter, userSession); | |||
TaskFormatter formatter = new TaskFormatter(dbTester.getDbClient()); | |||
TaskWsAction underTest = new TaskWsAction(dbTester.getDbClient(), formatter, userSession); | |||
WsActionTester tester = new WsActionTester(underTest); | |||
@Test |
@@ -47,16 +47,16 @@ | |||
from ce_activity ca | |||
<where> | |||
<if test="query.onlyCurrents"> | |||
ca.is_last=${_true} | |||
and ca.is_last=${_true} | |||
</if> | |||
<if test="query.componentUuid != null"> | |||
ca.component_uuid=#{query.componentUuid} | |||
and ca.component_uuid=#{query.componentUuid} | |||
</if> | |||
<if test="query.status != null"> | |||
ca.status=#{query.status} | |||
and ca.status=#{query.status} | |||
</if> | |||
<if test="query.type != null"> | |||
ca.task_type=#{query.type} | |||
and ca.task_type=#{query.type} | |||
</if> | |||
</where> | |||
order by ca.id desc |
@@ -108,6 +108,11 @@ public class CeActivityDaoTest { | |||
query = new CeActivityQuery().setType("views"); | |||
dtos = underTest.selectByQuery(db.getSession(), query, new RowBounds(0, 10)); | |||
assertThat(dtos).extracting("uuid").containsExactly("TASK_4"); | |||
// select by multiple conditions | |||
query = new CeActivityQuery().setType(REPORT).setOnlyCurrents(true).setComponentUuid("PROJECT_1"); | |||
dtos = underTest.selectByQuery(db.getSession(), query, new RowBounds(0, 10)); | |||
assertThat(dtos).extracting("uuid").containsExactly("TASK_2"); | |||
} | |||
@Test |
@@ -2822,6 +2822,879 @@ public final class WsCe { | |||
} | |||
public interface ProjectResponseOrBuilder extends | |||
// @@protoc_insertion_point(interface_extends:sonarqube.ws.ce.ProjectResponse) | |||
com.google.protobuf.MessageOrBuilder { | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
java.util.List<org.sonarqube.ws.WsCe.Task> | |||
getQueueList(); | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
org.sonarqube.ws.WsCe.Task getQueue(int index); | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
int getQueueCount(); | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
java.util.List<? extends org.sonarqube.ws.WsCe.TaskOrBuilder> | |||
getQueueOrBuilderList(); | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
org.sonarqube.ws.WsCe.TaskOrBuilder getQueueOrBuilder( | |||
int index); | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
boolean hasCurrent(); | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
org.sonarqube.ws.WsCe.Task getCurrent(); | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
org.sonarqube.ws.WsCe.TaskOrBuilder getCurrentOrBuilder(); | |||
} | |||
/** | |||
* Protobuf type {@code sonarqube.ws.ce.ProjectResponse} | |||
* | |||
* <pre> | |||
* GET api/ce/project | |||
* </pre> | |||
*/ | |||
public static final class ProjectResponse extends | |||
com.google.protobuf.GeneratedMessage implements | |||
// @@protoc_insertion_point(message_implements:sonarqube.ws.ce.ProjectResponse) | |||
ProjectResponseOrBuilder { | |||
// Use ProjectResponse.newBuilder() to construct. | |||
private ProjectResponse(com.google.protobuf.GeneratedMessage.Builder builder) { | |||
super(builder); | |||
} | |||
private ProjectResponse() { | |||
queue_ = java.util.Collections.emptyList(); | |||
} | |||
@java.lang.Override | |||
public final com.google.protobuf.UnknownFieldSet | |||
getUnknownFields() { | |||
return this.unknownFields; | |||
} | |||
private ProjectResponse( | |||
com.google.protobuf.CodedInputStream input, | |||
com.google.protobuf.ExtensionRegistryLite extensionRegistry) { | |||
this(); | |||
int mutable_bitField0_ = 0; | |||
com.google.protobuf.UnknownFieldSet.Builder unknownFields = | |||
com.google.protobuf.UnknownFieldSet.newBuilder(); | |||
try { | |||
boolean done = false; | |||
while (!done) { | |||
int tag = input.readTag(); | |||
switch (tag) { | |||
case 0: | |||
done = true; | |||
break; | |||
default: { | |||
if (!parseUnknownField(input, unknownFields, | |||
extensionRegistry, tag)) { | |||
done = true; | |||
} | |||
break; | |||
} | |||
case 10: { | |||
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { | |||
queue_ = new java.util.ArrayList<org.sonarqube.ws.WsCe.Task>(); | |||
mutable_bitField0_ |= 0x00000001; | |||
} | |||
queue_.add(input.readMessage(org.sonarqube.ws.WsCe.Task.PARSER, extensionRegistry)); | |||
break; | |||
} | |||
case 18: { | |||
org.sonarqube.ws.WsCe.Task.Builder subBuilder = null; | |||
if (((bitField0_ & 0x00000001) == 0x00000001)) { | |||
subBuilder = current_.toBuilder(); | |||
} | |||
current_ = input.readMessage(org.sonarqube.ws.WsCe.Task.PARSER, extensionRegistry); | |||
if (subBuilder != null) { | |||
subBuilder.mergeFrom(current_); | |||
current_ = subBuilder.buildPartial(); | |||
} | |||
bitField0_ |= 0x00000001; | |||
break; | |||
} | |||
} | |||
} | |||
} catch (com.google.protobuf.InvalidProtocolBufferException e) { | |||
throw new RuntimeException(e.setUnfinishedMessage(this)); | |||
} catch (java.io.IOException e) { | |||
throw new RuntimeException( | |||
new com.google.protobuf.InvalidProtocolBufferException( | |||
e.getMessage()).setUnfinishedMessage(this)); | |||
} finally { | |||
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { | |||
queue_ = java.util.Collections.unmodifiableList(queue_); | |||
} | |||
this.unknownFields = unknownFields.build(); | |||
makeExtensionsImmutable(); | |||
} | |||
} | |||
public static final com.google.protobuf.Descriptors.Descriptor | |||
getDescriptor() { | |||
return org.sonarqube.ws.WsCe.internal_static_sonarqube_ws_ce_ProjectResponse_descriptor; | |||
} | |||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable | |||
internalGetFieldAccessorTable() { | |||
return org.sonarqube.ws.WsCe.internal_static_sonarqube_ws_ce_ProjectResponse_fieldAccessorTable | |||
.ensureFieldAccessorsInitialized( | |||
org.sonarqube.ws.WsCe.ProjectResponse.class, org.sonarqube.ws.WsCe.ProjectResponse.Builder.class); | |||
} | |||
private int bitField0_; | |||
public static final int QUEUE_FIELD_NUMBER = 1; | |||
private java.util.List<org.sonarqube.ws.WsCe.Task> queue_; | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public java.util.List<org.sonarqube.ws.WsCe.Task> getQueueList() { | |||
return queue_; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public java.util.List<? extends org.sonarqube.ws.WsCe.TaskOrBuilder> | |||
getQueueOrBuilderList() { | |||
return queue_; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public int getQueueCount() { | |||
return queue_.size(); | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.Task getQueue(int index) { | |||
return queue_.get(index); | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.TaskOrBuilder getQueueOrBuilder( | |||
int index) { | |||
return queue_.get(index); | |||
} | |||
public static final int CURRENT_FIELD_NUMBER = 2; | |||
private org.sonarqube.ws.WsCe.Task current_; | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public boolean hasCurrent() { | |||
return ((bitField0_ & 0x00000001) == 0x00000001); | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.Task getCurrent() { | |||
return current_ == null ? org.sonarqube.ws.WsCe.Task.getDefaultInstance() : current_; | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.TaskOrBuilder getCurrentOrBuilder() { | |||
return current_ == null ? org.sonarqube.ws.WsCe.Task.getDefaultInstance() : current_; | |||
} | |||
private byte memoizedIsInitialized = -1; | |||
public final boolean isInitialized() { | |||
byte isInitialized = memoizedIsInitialized; | |||
if (isInitialized == 1) return true; | |||
if (isInitialized == 0) return false; | |||
memoizedIsInitialized = 1; | |||
return true; | |||
} | |||
public void writeTo(com.google.protobuf.CodedOutputStream output) | |||
throws java.io.IOException { | |||
for (int i = 0; i < queue_.size(); i++) { | |||
output.writeMessage(1, queue_.get(i)); | |||
} | |||
if (((bitField0_ & 0x00000001) == 0x00000001)) { | |||
output.writeMessage(2, getCurrent()); | |||
} | |||
unknownFields.writeTo(output); | |||
} | |||
private int memoizedSerializedSize = -1; | |||
public int getSerializedSize() { | |||
int size = memoizedSerializedSize; | |||
if (size != -1) return size; | |||
size = 0; | |||
for (int i = 0; i < queue_.size(); i++) { | |||
size += com.google.protobuf.CodedOutputStream | |||
.computeMessageSize(1, queue_.get(i)); | |||
} | |||
if (((bitField0_ & 0x00000001) == 0x00000001)) { | |||
size += com.google.protobuf.CodedOutputStream | |||
.computeMessageSize(2, getCurrent()); | |||
} | |||
size += unknownFields.getSerializedSize(); | |||
memoizedSerializedSize = size; | |||
return size; | |||
} | |||
private static final long serialVersionUID = 0L; | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseFrom( | |||
com.google.protobuf.ByteString data) | |||
throws com.google.protobuf.InvalidProtocolBufferException { | |||
return PARSER.parseFrom(data); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseFrom( | |||
com.google.protobuf.ByteString data, | |||
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |||
throws com.google.protobuf.InvalidProtocolBufferException { | |||
return PARSER.parseFrom(data, extensionRegistry); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseFrom(byte[] data) | |||
throws com.google.protobuf.InvalidProtocolBufferException { | |||
return PARSER.parseFrom(data); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseFrom( | |||
byte[] data, | |||
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |||
throws com.google.protobuf.InvalidProtocolBufferException { | |||
return PARSER.parseFrom(data, extensionRegistry); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseFrom(java.io.InputStream input) | |||
throws java.io.IOException { | |||
return PARSER.parseFrom(input); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseFrom( | |||
java.io.InputStream input, | |||
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |||
throws java.io.IOException { | |||
return PARSER.parseFrom(input, extensionRegistry); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseDelimitedFrom(java.io.InputStream input) | |||
throws java.io.IOException { | |||
return PARSER.parseDelimitedFrom(input); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseDelimitedFrom( | |||
java.io.InputStream input, | |||
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |||
throws java.io.IOException { | |||
return PARSER.parseDelimitedFrom(input, extensionRegistry); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseFrom( | |||
com.google.protobuf.CodedInputStream input) | |||
throws java.io.IOException { | |||
return PARSER.parseFrom(input); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse parseFrom( | |||
com.google.protobuf.CodedInputStream input, | |||
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |||
throws java.io.IOException { | |||
return PARSER.parseFrom(input, extensionRegistry); | |||
} | |||
public Builder newBuilderForType() { return newBuilder(); } | |||
public static Builder newBuilder() { | |||
return DEFAULT_INSTANCE.toBuilder(); | |||
} | |||
public static Builder newBuilder(org.sonarqube.ws.WsCe.ProjectResponse prototype) { | |||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); | |||
} | |||
public Builder toBuilder() { | |||
return this == DEFAULT_INSTANCE | |||
? new Builder() : new Builder().mergeFrom(this); | |||
} | |||
@java.lang.Override | |||
protected Builder newBuilderForType( | |||
com.google.protobuf.GeneratedMessage.BuilderParent parent) { | |||
Builder builder = new Builder(parent); | |||
return builder; | |||
} | |||
/** | |||
* Protobuf type {@code sonarqube.ws.ce.ProjectResponse} | |||
* | |||
* <pre> | |||
* GET api/ce/project | |||
* </pre> | |||
*/ | |||
public static final class Builder extends | |||
com.google.protobuf.GeneratedMessage.Builder<Builder> implements | |||
// @@protoc_insertion_point(builder_implements:sonarqube.ws.ce.ProjectResponse) | |||
org.sonarqube.ws.WsCe.ProjectResponseOrBuilder { | |||
public static final com.google.protobuf.Descriptors.Descriptor | |||
getDescriptor() { | |||
return org.sonarqube.ws.WsCe.internal_static_sonarqube_ws_ce_ProjectResponse_descriptor; | |||
} | |||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable | |||
internalGetFieldAccessorTable() { | |||
return org.sonarqube.ws.WsCe.internal_static_sonarqube_ws_ce_ProjectResponse_fieldAccessorTable | |||
.ensureFieldAccessorsInitialized( | |||
org.sonarqube.ws.WsCe.ProjectResponse.class, org.sonarqube.ws.WsCe.ProjectResponse.Builder.class); | |||
} | |||
// Construct using org.sonarqube.ws.WsCe.ProjectResponse.newBuilder() | |||
private Builder() { | |||
maybeForceBuilderInitialization(); | |||
} | |||
private Builder( | |||
com.google.protobuf.GeneratedMessage.BuilderParent parent) { | |||
super(parent); | |||
maybeForceBuilderInitialization(); | |||
} | |||
private void maybeForceBuilderInitialization() { | |||
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { | |||
getQueueFieldBuilder(); | |||
getCurrentFieldBuilder(); | |||
} | |||
} | |||
public Builder clear() { | |||
super.clear(); | |||
if (queueBuilder_ == null) { | |||
queue_ = java.util.Collections.emptyList(); | |||
bitField0_ = (bitField0_ & ~0x00000001); | |||
} else { | |||
queueBuilder_.clear(); | |||
} | |||
if (currentBuilder_ == null) { | |||
current_ = null; | |||
} else { | |||
currentBuilder_.clear(); | |||
} | |||
bitField0_ = (bitField0_ & ~0x00000002); | |||
return this; | |||
} | |||
public com.google.protobuf.Descriptors.Descriptor | |||
getDescriptorForType() { | |||
return org.sonarqube.ws.WsCe.internal_static_sonarqube_ws_ce_ProjectResponse_descriptor; | |||
} | |||
public org.sonarqube.ws.WsCe.ProjectResponse getDefaultInstanceForType() { | |||
return org.sonarqube.ws.WsCe.ProjectResponse.getDefaultInstance(); | |||
} | |||
public org.sonarqube.ws.WsCe.ProjectResponse build() { | |||
org.sonarqube.ws.WsCe.ProjectResponse result = buildPartial(); | |||
if (!result.isInitialized()) { | |||
throw newUninitializedMessageException(result); | |||
} | |||
return result; | |||
} | |||
public org.sonarqube.ws.WsCe.ProjectResponse buildPartial() { | |||
org.sonarqube.ws.WsCe.ProjectResponse result = new org.sonarqube.ws.WsCe.ProjectResponse(this); | |||
int from_bitField0_ = bitField0_; | |||
int to_bitField0_ = 0; | |||
if (queueBuilder_ == null) { | |||
if (((bitField0_ & 0x00000001) == 0x00000001)) { | |||
queue_ = java.util.Collections.unmodifiableList(queue_); | |||
bitField0_ = (bitField0_ & ~0x00000001); | |||
} | |||
result.queue_ = queue_; | |||
} else { | |||
result.queue_ = queueBuilder_.build(); | |||
} | |||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) { | |||
to_bitField0_ |= 0x00000001; | |||
} | |||
if (currentBuilder_ == null) { | |||
result.current_ = current_; | |||
} else { | |||
result.current_ = currentBuilder_.build(); | |||
} | |||
result.bitField0_ = to_bitField0_; | |||
onBuilt(); | |||
return result; | |||
} | |||
public Builder mergeFrom(com.google.protobuf.Message other) { | |||
if (other instanceof org.sonarqube.ws.WsCe.ProjectResponse) { | |||
return mergeFrom((org.sonarqube.ws.WsCe.ProjectResponse)other); | |||
} else { | |||
super.mergeFrom(other); | |||
return this; | |||
} | |||
} | |||
public Builder mergeFrom(org.sonarqube.ws.WsCe.ProjectResponse other) { | |||
if (other == org.sonarqube.ws.WsCe.ProjectResponse.getDefaultInstance()) return this; | |||
if (queueBuilder_ == null) { | |||
if (!other.queue_.isEmpty()) { | |||
if (queue_.isEmpty()) { | |||
queue_ = other.queue_; | |||
bitField0_ = (bitField0_ & ~0x00000001); | |||
} else { | |||
ensureQueueIsMutable(); | |||
queue_.addAll(other.queue_); | |||
} | |||
onChanged(); | |||
} | |||
} else { | |||
if (!other.queue_.isEmpty()) { | |||
if (queueBuilder_.isEmpty()) { | |||
queueBuilder_.dispose(); | |||
queueBuilder_ = null; | |||
queue_ = other.queue_; | |||
bitField0_ = (bitField0_ & ~0x00000001); | |||
queueBuilder_ = | |||
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? | |||
getQueueFieldBuilder() : null; | |||
} else { | |||
queueBuilder_.addAllMessages(other.queue_); | |||
} | |||
} | |||
} | |||
if (other.hasCurrent()) { | |||
mergeCurrent(other.getCurrent()); | |||
} | |||
this.mergeUnknownFields(other.unknownFields); | |||
onChanged(); | |||
return this; | |||
} | |||
public final boolean isInitialized() { | |||
return true; | |||
} | |||
public Builder mergeFrom( | |||
com.google.protobuf.CodedInputStream input, | |||
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |||
throws java.io.IOException { | |||
org.sonarqube.ws.WsCe.ProjectResponse parsedMessage = null; | |||
try { | |||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); | |||
} catch (com.google.protobuf.InvalidProtocolBufferException e) { | |||
parsedMessage = (org.sonarqube.ws.WsCe.ProjectResponse) e.getUnfinishedMessage(); | |||
throw e; | |||
} finally { | |||
if (parsedMessage != null) { | |||
mergeFrom(parsedMessage); | |||
} | |||
} | |||
return this; | |||
} | |||
private int bitField0_; | |||
private java.util.List<org.sonarqube.ws.WsCe.Task> queue_ = | |||
java.util.Collections.emptyList(); | |||
private void ensureQueueIsMutable() { | |||
if (!((bitField0_ & 0x00000001) == 0x00000001)) { | |||
queue_ = new java.util.ArrayList<org.sonarqube.ws.WsCe.Task>(queue_); | |||
bitField0_ |= 0x00000001; | |||
} | |||
} | |||
private com.google.protobuf.RepeatedFieldBuilder< | |||
org.sonarqube.ws.WsCe.Task, org.sonarqube.ws.WsCe.Task.Builder, org.sonarqube.ws.WsCe.TaskOrBuilder> queueBuilder_; | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public java.util.List<org.sonarqube.ws.WsCe.Task> getQueueList() { | |||
if (queueBuilder_ == null) { | |||
return java.util.Collections.unmodifiableList(queue_); | |||
} else { | |||
return queueBuilder_.getMessageList(); | |||
} | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public int getQueueCount() { | |||
if (queueBuilder_ == null) { | |||
return queue_.size(); | |||
} else { | |||
return queueBuilder_.getCount(); | |||
} | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.Task getQueue(int index) { | |||
if (queueBuilder_ == null) { | |||
return queue_.get(index); | |||
} else { | |||
return queueBuilder_.getMessage(index); | |||
} | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public Builder setQueue( | |||
int index, org.sonarqube.ws.WsCe.Task value) { | |||
if (queueBuilder_ == null) { | |||
if (value == null) { | |||
throw new NullPointerException(); | |||
} | |||
ensureQueueIsMutable(); | |||
queue_.set(index, value); | |||
onChanged(); | |||
} else { | |||
queueBuilder_.setMessage(index, value); | |||
} | |||
return this; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public Builder setQueue( | |||
int index, org.sonarqube.ws.WsCe.Task.Builder builderForValue) { | |||
if (queueBuilder_ == null) { | |||
ensureQueueIsMutable(); | |||
queue_.set(index, builderForValue.build()); | |||
onChanged(); | |||
} else { | |||
queueBuilder_.setMessage(index, builderForValue.build()); | |||
} | |||
return this; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public Builder addQueue(org.sonarqube.ws.WsCe.Task value) { | |||
if (queueBuilder_ == null) { | |||
if (value == null) { | |||
throw new NullPointerException(); | |||
} | |||
ensureQueueIsMutable(); | |||
queue_.add(value); | |||
onChanged(); | |||
} else { | |||
queueBuilder_.addMessage(value); | |||
} | |||
return this; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public Builder addQueue( | |||
int index, org.sonarqube.ws.WsCe.Task value) { | |||
if (queueBuilder_ == null) { | |||
if (value == null) { | |||
throw new NullPointerException(); | |||
} | |||
ensureQueueIsMutable(); | |||
queue_.add(index, value); | |||
onChanged(); | |||
} else { | |||
queueBuilder_.addMessage(index, value); | |||
} | |||
return this; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public Builder addQueue( | |||
org.sonarqube.ws.WsCe.Task.Builder builderForValue) { | |||
if (queueBuilder_ == null) { | |||
ensureQueueIsMutable(); | |||
queue_.add(builderForValue.build()); | |||
onChanged(); | |||
} else { | |||
queueBuilder_.addMessage(builderForValue.build()); | |||
} | |||
return this; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public Builder addQueue( | |||
int index, org.sonarqube.ws.WsCe.Task.Builder builderForValue) { | |||
if (queueBuilder_ == null) { | |||
ensureQueueIsMutable(); | |||
queue_.add(index, builderForValue.build()); | |||
onChanged(); | |||
} else { | |||
queueBuilder_.addMessage(index, builderForValue.build()); | |||
} | |||
return this; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public Builder addAllQueue( | |||
java.lang.Iterable<? extends org.sonarqube.ws.WsCe.Task> values) { | |||
if (queueBuilder_ == null) { | |||
ensureQueueIsMutable(); | |||
com.google.protobuf.AbstractMessageLite.Builder.addAll( | |||
values, queue_); | |||
onChanged(); | |||
} else { | |||
queueBuilder_.addAllMessages(values); | |||
} | |||
return this; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public Builder clearQueue() { | |||
if (queueBuilder_ == null) { | |||
queue_ = java.util.Collections.emptyList(); | |||
bitField0_ = (bitField0_ & ~0x00000001); | |||
onChanged(); | |||
} else { | |||
queueBuilder_.clear(); | |||
} | |||
return this; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public Builder removeQueue(int index) { | |||
if (queueBuilder_ == null) { | |||
ensureQueueIsMutable(); | |||
queue_.remove(index); | |||
onChanged(); | |||
} else { | |||
queueBuilder_.remove(index); | |||
} | |||
return this; | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.Task.Builder getQueueBuilder( | |||
int index) { | |||
return getQueueFieldBuilder().getBuilder(index); | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.TaskOrBuilder getQueueOrBuilder( | |||
int index) { | |||
if (queueBuilder_ == null) { | |||
return queue_.get(index); } else { | |||
return queueBuilder_.getMessageOrBuilder(index); | |||
} | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public java.util.List<? extends org.sonarqube.ws.WsCe.TaskOrBuilder> | |||
getQueueOrBuilderList() { | |||
if (queueBuilder_ != null) { | |||
return queueBuilder_.getMessageOrBuilderList(); | |||
} else { | |||
return java.util.Collections.unmodifiableList(queue_); | |||
} | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.Task.Builder addQueueBuilder() { | |||
return getQueueFieldBuilder().addBuilder( | |||
org.sonarqube.ws.WsCe.Task.getDefaultInstance()); | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.Task.Builder addQueueBuilder( | |||
int index) { | |||
return getQueueFieldBuilder().addBuilder( | |||
index, org.sonarqube.ws.WsCe.Task.getDefaultInstance()); | |||
} | |||
/** | |||
* <code>repeated .sonarqube.ws.ce.Task queue = 1;</code> | |||
*/ | |||
public java.util.List<org.sonarqube.ws.WsCe.Task.Builder> | |||
getQueueBuilderList() { | |||
return getQueueFieldBuilder().getBuilderList(); | |||
} | |||
private com.google.protobuf.RepeatedFieldBuilder< | |||
org.sonarqube.ws.WsCe.Task, org.sonarqube.ws.WsCe.Task.Builder, org.sonarqube.ws.WsCe.TaskOrBuilder> | |||
getQueueFieldBuilder() { | |||
if (queueBuilder_ == null) { | |||
queueBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< | |||
org.sonarqube.ws.WsCe.Task, org.sonarqube.ws.WsCe.Task.Builder, org.sonarqube.ws.WsCe.TaskOrBuilder>( | |||
queue_, | |||
((bitField0_ & 0x00000001) == 0x00000001), | |||
getParentForChildren(), | |||
isClean()); | |||
queue_ = null; | |||
} | |||
return queueBuilder_; | |||
} | |||
private org.sonarqube.ws.WsCe.Task current_ = null; | |||
private com.google.protobuf.SingleFieldBuilder< | |||
org.sonarqube.ws.WsCe.Task, org.sonarqube.ws.WsCe.Task.Builder, org.sonarqube.ws.WsCe.TaskOrBuilder> currentBuilder_; | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public boolean hasCurrent() { | |||
return ((bitField0_ & 0x00000002) == 0x00000002); | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.Task getCurrent() { | |||
if (currentBuilder_ == null) { | |||
return current_ == null ? org.sonarqube.ws.WsCe.Task.getDefaultInstance() : current_; | |||
} else { | |||
return currentBuilder_.getMessage(); | |||
} | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public Builder setCurrent(org.sonarqube.ws.WsCe.Task value) { | |||
if (currentBuilder_ == null) { | |||
if (value == null) { | |||
throw new NullPointerException(); | |||
} | |||
current_ = value; | |||
onChanged(); | |||
} else { | |||
currentBuilder_.setMessage(value); | |||
} | |||
bitField0_ |= 0x00000002; | |||
return this; | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public Builder setCurrent( | |||
org.sonarqube.ws.WsCe.Task.Builder builderForValue) { | |||
if (currentBuilder_ == null) { | |||
current_ = builderForValue.build(); | |||
onChanged(); | |||
} else { | |||
currentBuilder_.setMessage(builderForValue.build()); | |||
} | |||
bitField0_ |= 0x00000002; | |||
return this; | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public Builder mergeCurrent(org.sonarqube.ws.WsCe.Task value) { | |||
if (currentBuilder_ == null) { | |||
if (((bitField0_ & 0x00000002) == 0x00000002) && | |||
current_ != null && | |||
current_ != org.sonarqube.ws.WsCe.Task.getDefaultInstance()) { | |||
current_ = | |||
org.sonarqube.ws.WsCe.Task.newBuilder(current_).mergeFrom(value).buildPartial(); | |||
} else { | |||
current_ = value; | |||
} | |||
onChanged(); | |||
} else { | |||
currentBuilder_.mergeFrom(value); | |||
} | |||
bitField0_ |= 0x00000002; | |||
return this; | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public Builder clearCurrent() { | |||
if (currentBuilder_ == null) { | |||
current_ = null; | |||
onChanged(); | |||
} else { | |||
currentBuilder_.clear(); | |||
} | |||
bitField0_ = (bitField0_ & ~0x00000002); | |||
return this; | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.Task.Builder getCurrentBuilder() { | |||
bitField0_ |= 0x00000002; | |||
onChanged(); | |||
return getCurrentFieldBuilder().getBuilder(); | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
public org.sonarqube.ws.WsCe.TaskOrBuilder getCurrentOrBuilder() { | |||
if (currentBuilder_ != null) { | |||
return currentBuilder_.getMessageOrBuilder(); | |||
} else { | |||
return current_ == null ? | |||
org.sonarqube.ws.WsCe.Task.getDefaultInstance() : current_; | |||
} | |||
} | |||
/** | |||
* <code>optional .sonarqube.ws.ce.Task current = 2;</code> | |||
*/ | |||
private com.google.protobuf.SingleFieldBuilder< | |||
org.sonarqube.ws.WsCe.Task, org.sonarqube.ws.WsCe.Task.Builder, org.sonarqube.ws.WsCe.TaskOrBuilder> | |||
getCurrentFieldBuilder() { | |||
if (currentBuilder_ == null) { | |||
currentBuilder_ = new com.google.protobuf.SingleFieldBuilder< | |||
org.sonarqube.ws.WsCe.Task, org.sonarqube.ws.WsCe.Task.Builder, org.sonarqube.ws.WsCe.TaskOrBuilder>( | |||
getCurrent(), | |||
getParentForChildren(), | |||
isClean()); | |||
current_ = null; | |||
} | |||
return currentBuilder_; | |||
} | |||
// @@protoc_insertion_point(builder_scope:sonarqube.ws.ce.ProjectResponse) | |||
} | |||
// @@protoc_insertion_point(class_scope:sonarqube.ws.ce.ProjectResponse) | |||
private static final org.sonarqube.ws.WsCe.ProjectResponse DEFAULT_INSTANCE; | |||
static { | |||
DEFAULT_INSTANCE = new org.sonarqube.ws.WsCe.ProjectResponse(); | |||
} | |||
public static org.sonarqube.ws.WsCe.ProjectResponse getDefaultInstance() { | |||
return DEFAULT_INSTANCE; | |||
} | |||
public static final com.google.protobuf.Parser<ProjectResponse> PARSER = | |||
new com.google.protobuf.AbstractParser<ProjectResponse>() { | |||
public ProjectResponse parsePartialFrom( | |||
com.google.protobuf.CodedInputStream input, | |||
com.google.protobuf.ExtensionRegistryLite extensionRegistry) | |||
throws com.google.protobuf.InvalidProtocolBufferException { | |||
try { | |||
return new ProjectResponse(input, extensionRegistry); | |||
} catch (RuntimeException e) { | |||
if (e.getCause() instanceof | |||
com.google.protobuf.InvalidProtocolBufferException) { | |||
throw (com.google.protobuf.InvalidProtocolBufferException) | |||
e.getCause(); | |||
} | |||
throw e; | |||
} | |||
} | |||
}; | |||
@java.lang.Override | |||
public com.google.protobuf.Parser<ProjectResponse> getParserForType() { | |||
return PARSER; | |||
} | |||
public org.sonarqube.ws.WsCe.ProjectResponse getDefaultInstanceForType() { | |||
return DEFAULT_INSTANCE; | |||
} | |||
} | |||
public interface TaskOrBuilder extends | |||
// @@protoc_insertion_point(interface_extends:sonarqube.ws.ce.Task) | |||
com.google.protobuf.MessageOrBuilder { | |||
@@ -4815,6 +5688,11 @@ public final class WsCe { | |||
private static | |||
com.google.protobuf.GeneratedMessage.FieldAccessorTable | |||
internal_static_sonarqube_ws_ce_ActivityResponse_fieldAccessorTable; | |||
private static com.google.protobuf.Descriptors.Descriptor | |||
internal_static_sonarqube_ws_ce_ProjectResponse_descriptor; | |||
private static | |||
com.google.protobuf.GeneratedMessage.FieldAccessorTable | |||
internal_static_sonarqube_ws_ce_ProjectResponse_fieldAccessorTable; | |||
private static com.google.protobuf.Descriptors.Descriptor | |||
internal_static_sonarqube_ws_ce_Task_descriptor; | |||
private static | |||
@@ -4836,17 +5714,19 @@ public final class WsCe { | |||
"eueResponse\022$\n\005tasks\030\001 \003(\0132\025.sonarqube.w" + | |||
"s.ce.Task\"f\n\020ActivityResponse\022,\n\006paging\030" + | |||
"\001 \001(\0132\034.sonarqube.ws.commons.Paging\022$\n\005t" + | |||
"asks\030\002 \003(\0132\025.sonarqube.ws.ce.Task\"\224\002\n\004Ta" + | |||
"sk\022\n\n\002id\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\023\n\013componen" + | |||
"tId\030\003 \001(\t\022\024\n\014componentKey\030\004 \001(\t\022\025\n\rcompo", | |||
"nentName\030\005 \001(\t\022+\n\006status\030\006 \001(\0162\033.sonarqu" + | |||
"be.ws.ce.TaskStatus\022\023\n\013submittedAt\030\007 \001(\t" + | |||
"\022\026\n\016submitterLogin\030\010 \001(\t\022\021\n\tstartedAt\030\t " + | |||
"\001(\t\022\022\n\nfinishedAt\030\n \001(\t\022\026\n\016isLastFinishe" + | |||
"d\030\013 \001(\010\022\027\n\017executionTimeMs\030\014 \001(\003*Q\n\nTask" + | |||
"Status\022\013\n\007PENDING\020\000\022\017\n\013IN_PROGRESS\020\001\022\013\n\007" + | |||
"SUCCESS\020\002\022\n\n\006FAILED\020\003\022\014\n\010CANCELED\020\004B\032\n\020o" + | |||
"rg.sonarqube.wsB\004WsCeH\001" | |||
"asks\030\002 \003(\0132\025.sonarqube.ws.ce.Task\"_\n\017Pro" + | |||
"jectResponse\022$\n\005queue\030\001 \003(\0132\025.sonarqube." + | |||
"ws.ce.Task\022&\n\007current\030\002 \001(\0132\025.sonarqube.", | |||
"ws.ce.Task\"\224\002\n\004Task\022\n\n\002id\030\001 \001(\t\022\014\n\004type\030" + | |||
"\002 \001(\t\022\023\n\013componentId\030\003 \001(\t\022\024\n\014componentK" + | |||
"ey\030\004 \001(\t\022\025\n\rcomponentName\030\005 \001(\t\022+\n\006statu" + | |||
"s\030\006 \001(\0162\033.sonarqube.ws.ce.TaskStatus\022\023\n\013" + | |||
"submittedAt\030\007 \001(\t\022\026\n\016submitterLogin\030\010 \001(" + | |||
"\t\022\021\n\tstartedAt\030\t \001(\t\022\022\n\nfinishedAt\030\n \001(\t" + | |||
"\022\026\n\016isLastFinished\030\013 \001(\010\022\027\n\017executionTim" + | |||
"eMs\030\014 \001(\003*Q\n\nTaskStatus\022\013\n\007PENDING\020\000\022\017\n\013" + | |||
"IN_PROGRESS\020\001\022\013\n\007SUCCESS\020\002\022\n\n\006FAILED\020\003\022\014" + | |||
"\n\010CANCELED\020\004B\032\n\020org.sonarqube.wsB\004WsCeH\001" | |||
}; | |||
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = | |||
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { | |||
@@ -4885,8 +5765,14 @@ public final class WsCe { | |||
com.google.protobuf.GeneratedMessage.FieldAccessorTable( | |||
internal_static_sonarqube_ws_ce_ActivityResponse_descriptor, | |||
new java.lang.String[] { "Paging", "Tasks", }); | |||
internal_static_sonarqube_ws_ce_Task_descriptor = | |||
internal_static_sonarqube_ws_ce_ProjectResponse_descriptor = | |||
getDescriptor().getMessageTypes().get(4); | |||
internal_static_sonarqube_ws_ce_ProjectResponse_fieldAccessorTable = new | |||
com.google.protobuf.GeneratedMessage.FieldAccessorTable( | |||
internal_static_sonarqube_ws_ce_ProjectResponse_descriptor, | |||
new java.lang.String[] { "Queue", "Current", }); | |||
internal_static_sonarqube_ws_ce_Task_descriptor = | |||
getDescriptor().getMessageTypes().get(5); | |||
internal_static_sonarqube_ws_ce_Task_fieldAccessorTable = new | |||
com.google.protobuf.GeneratedMessage.FieldAccessorTable( | |||
internal_static_sonarqube_ws_ce_Task_descriptor, |
@@ -48,6 +48,12 @@ message ActivityResponse { | |||
repeated Task tasks = 2; | |||
} | |||
// GET api/ce/project | |||
message ProjectResponse { | |||
repeated Task queue = 1; | |||
optional Task current = 2; | |||
} | |||
message Task { | |||
optional string id = 1; | |||
optional string type = 2; |