use of com.walmartlabs.concord.server.process.queue.ProcessFilter in project concord by walmartlabs.
the class UserActivityResource method activity.
@GET
@Path("/activity")
@Produces(MediaType.APPLICATION_JSON)
@WithTimer
public UserActivityResponse activity(@QueryParam("maxProjectsPerOrg") @DefaultValue("5") int maxProjectsPerOrg, @QueryParam("maxOwnProcesses") @DefaultValue("5") int maxOwnProcesses) {
UserPrincipal user = UserPrincipal.assertCurrent();
Set<UUID> orgIds = userDao.getOrgIds(user.getId());
OffsetDateTime t = startOfDay();
Map<String, List<ProjectProcesses>> orgProcesses = processStatsDao.processByOrgs(maxProjectsPerOrg, orgIds, ORG_VISIBLE_STATUSES, t);
Map<String, Integer> stats = processStatsDao.getCountByStatuses(orgIds, t, user.getId());
ProcessFilter filter = ProcessFilter.builder().initiator(user.getUsername()).orgIds(orgIds).includeWithoutProject(true).limit(maxOwnProcesses).build();
List<ProcessEntry> lastProcesses = processDao.list(filter);
return new UserActivityResponse(stats, orgProcesses, lastProcesses);
}
use of com.walmartlabs.concord.server.process.queue.ProcessFilter in project concord by walmartlabs.
the class ProjectProcessResource method list.
@GET
@ApiOperation("List processes for the specified project")
@Path("/{orgName}/project/{projectName}/process")
@Produces(MediaType.APPLICATION_JSON)
@WithTimer
@Deprecated
public List<ProcessEntry> list(@ApiParam @PathParam("orgName") @ConcordKey String orgName, @ApiParam @PathParam("projectName") @ConcordKey String projectName, @ApiParam @QueryParam("status") ProcessStatus processStatus, @ApiParam @QueryParam("afterCreatedAt") OffsetDateTimeParam afterCreatedAt, @ApiParam @QueryParam("beforeCreatedAt") OffsetDateTimeParam beforeCreatedAt, @ApiParam @QueryParam("limit") @DefaultValue(DEFAULT_LIST_LIMIT) int limit, @ApiParam @QueryParam("offset") @DefaultValue("0") int offset) {
OrganizationEntry org = orgManager.assertAccess(orgName, false);
UUID projectId = projectDao.getId(org.getId(), projectName);
if (projectId == null) {
throw new ConcordApplicationException("Project not found: " + projectName, Response.Status.NOT_FOUND);
}
ProcessFilter filter = ProcessFilter.builder().projectId(projectId).status(processStatus).afterCreatedAt(unwrap(afterCreatedAt)).beforeCreatedAt(unwrap(beforeCreatedAt)).limit(limit).offset(offset).build();
return queueDao.list(filter);
}
Aggregations