コード例 #1
0
  /**
   * Workflow Monitoring History 목록을 조회한다.
   *
   * @param clusterName 클러스터명
   * @param startDate 시작 날짜
   * @param endDate 마지막 날짜
   * @param status 워크플로우 작업 상태
   * @param workflowName 워크플로우명
   * @param jobType 워크플로우 작업 타입
   * @param page 페이지
   * @param start 시작 페이지
   * @param limit 조회 제한 개수
   * @param node 히스토리 목록이 속한 상위 노드 정보
   * @return Workflow History List
   */
  @RequestMapping(value = "/workflows", method = RequestMethod.GET)
  @ResponseStatus(HttpStatus.OK)
  public Response getWorkflows(
      @RequestParam(defaultValue = "") String clusterName,
      @RequestParam(defaultValue = "") String startDate,
      @RequestParam(defaultValue = "") String endDate,
      @RequestParam(defaultValue = "") String status,
      @RequestParam(defaultValue = "") String workflowName,
      @RequestParam(defaultValue = "") String jobType,
      @RequestParam(defaultValue = "0") int page,
      @RequestParam(defaultValue = "0") int start,
      @RequestParam(defaultValue = "16") int limit,
      @RequestParam(defaultValue = "") String node) {

    Response response = new Response();
    EngineService engineService = getEngineService(clusterName);
    WorkflowHistoryRemoteService workflowHistoryRemoteService =
        engineService.getWorkflowHistoryRemoteService();
    int level = SessionUtils.getLevel();
    String username = level == 1 ? "" : SessionUtils.getUsername();

    ArrayList<Map> arrayList = new ArrayList<>();

    List<WorkflowHistory> workflowHistories =
        workflowHistoryRemoteService.selectByCondition(
            startDate, endDate, start, limit, username, workflowName, status, "");
    for (WorkflowHistory workflowHistory : workflowHistories) {
      Map map = getNodeForWorkflow(workflowHistory, node);
      arrayList.add(map);
    }
    int total =
        workflowHistoryRemoteService.selectTotalCountByUsername(
            startDate, endDate, start, limit, username, workflowName, status, "");
    response.setTotal(total);

    response.setLimit(arrayList.size());
    response.getList().addAll(arrayList);
    response.setSuccess(true);
    return response;
  }
コード例 #2
0
  @RequestMapping(value = "/task/list", method = RequestMethod.GET)
  @ResponseStatus(HttpStatus.OK)
  public Response getTasksOfJob(
      @RequestParam(defaultValue = "") String clusterName,
      @RequestParam(defaultValue = "") String sort,
      @RequestParam(defaultValue = "DESC") String dir,
      @RequestParam(defaultValue = "0") int page,
      @RequestParam(defaultValue = "0") int start,
      @RequestParam(defaultValue = "16") int limit,
      @RequestParam(defaultValue = "") String orderby,
      @RequestParam(defaultValue = "") String identifier) {

    EngineService engineService = getEngineService(clusterName);

    Response response = new Response();
    List<TaskHistory> taskHistories =
        engineService.getTaskHistoryRemoteService().selectByIdentifier(identifier);

    response.setLimit(taskHistories.size());
    response.getList().addAll(taskHistories);
    response.setSuccess(true);
    return response;
  }