コード例 #1
0
  @RequestMapping("node-list-get")
  public RestfulResponse getNodeList(NodeRequest request) {
    RestfulResponse response = new RestfulResponse();

    List<Node> nodes = registryService.getOnlineNodes(request);

    response.setSuccess(true);
    response.setResults(CollectionUtils.sizeOf(nodes));
    response.setRows(nodes);

    return response;
  }
コード例 #2
0
 @RequestMapping("node-onoffline-log-get")
 public RestfulResponse delNodeGroup(NodeOnOfflineLogRequest request) {
   RestfulResponse response = new RestfulResponse();
   Long results = nodeOnOfflineLogRepo.count(request);
   response.setResults(results.intValue());
   if (results > 0) {
     List<NodeOnOfflineLog> rows = nodeOnOfflineLogRepo.select(request);
     response.setRows(rows);
   } else {
     response.setRows(new ArrayList<Object>(0));
   }
   response.setSuccess(true);
   return response;
 }
コード例 #3
0
  @RequestMapping("node-group-get")
  public RestfulResponse getNodeGroup(NodeGroupRequest request) {
    RestfulResponse response = new RestfulResponse();
    NodeGroupGetRequest nodeGroupGetRequest = new NodeGroupGetRequest();
    nodeGroupGetRequest.setNodeGroup(request.getNodeGroup());
    nodeGroupGetRequest.setNodeType(request.getNodeType());
    PageResponse<NodeGroupPo> pageResponse =
        application.getNodeGroupStore().getNodeGroup(nodeGroupGetRequest);

    response.setResults(pageResponse.getResults());
    response.setRows(pageResponse.getRows());
    response.setSuccess(true);
    return response;
  }
コード例 #4
0
 @RequestMapping("/monitor/monitor-data-get")
 public RestfulResponse taskTrackerMonitorInfoGet(MonitorDataRequest request) {
   RestfulResponse response = new RestfulResponse();
   if (request.getNodeType() == null) {
     response.setSuccess(false);
     response.setMsg("nodeType can not be null.");
     return response;
   }
   if (request.getStartTime() == null || request.getEndTime() == null) {
     response.setSuccess(false);
     response.setMsg("Search time range must be input.");
     return response;
   }
   List<? extends AbstractMonitorDataPo> rows = monitorDataService.queryMonitorDataSum(request);
   response.setSuccess(true);
   response.setRows(rows);
   response.setResults(CollectionUtils.sizeOf(rows));
   return response;
 }