use of org.sonar.db.ce.CeActivityDto in project sonarqube by SonarSource.
the class PurgeCeActivitiesTest method insertWithDate.
private void insertWithDate(String uuid, long date) {
CeQueueDto queueDto = new CeQueueDto();
queueDto.setUuid(uuid);
queueDto.setTaskType(CeTaskTypes.REPORT);
CeActivityDto dto = new CeActivityDto(queueDto);
dto.setStatus(CeActivityDto.Status.SUCCESS);
when(system2.now()).thenReturn(date);
dbTester.getDbClient().ceActivityDao().insert(dbTester.getSession(), dto);
dbTester.getSession().commit();
}
use of org.sonar.db.ce.CeActivityDto in project sonarqube by SonarSource.
the class CeQueueImpl method cancelImpl.
protected void cancelImpl(DbSession dbSession, CeQueueDto q) {
CeActivityDto activityDto = new CeActivityDto(q);
activityDto.setStatus(CeActivityDto.Status.CANCELED);
remove(dbSession, q, activityDto);
}
use of org.sonar.db.ce.CeActivityDto in project sonarqube by SonarSource.
the class ActivityAction method searchTaskByUuid.
private Optional<WsCe.Task> searchTaskByUuid(DbSession dbSession, ActivityWsRequest request) {
String textQuery = request.getQuery();
if (textQuery == null) {
return Optional.absent();
}
Optional<CeQueueDto> queue = dbClient.ceQueueDao().selectByUuid(dbSession, textQuery);
if (queue.isPresent()) {
return Optional.of(formatter.formatQueue(dbSession, queue.get()));
}
Optional<CeActivityDto> activity = dbClient.ceActivityDao().selectByUuid(dbSession, textQuery);
if (activity.isPresent()) {
return Optional.of(formatter.formatActivity(dbSession, activity.get()));
}
return Optional.absent();
}
Aggregations