use of com.alibaba.otter.manager.web.common.model.SeniorNode in project otter by alibaba.
the class NodeList method execute.
public void execute(@Param("pageIndex") int pageIndex, @Param("searchKey") String searchKey, Context context) throws Exception {
@SuppressWarnings("unchecked") Map<String, Object> condition = new HashMap<String, Object>();
if ("请输入关键字(目前支持Node的ID、名字搜索)".equals(searchKey)) {
searchKey = "";
}
condition.put("searchKey", searchKey);
int count = nodeService.getCount(condition);
Paginator paginator = new Paginator();
paginator.setItems(count);
paginator.setPage(pageIndex);
condition.put("offset", paginator.getOffset());
condition.put("length", paginator.getLength());
List<Node> nodes = nodeService.listByCondition(condition);
List<SeniorNode> seniorNodes = new ArrayList<SeniorNode>();
for (Node node : nodes) {
SeniorNode seniorNode = new SeniorNode();
seniorNode.setId(node.getId());
seniorNode.setIp(node.getIp());
seniorNode.setName(node.getName());
seniorNode.setPort(node.getPort());
seniorNode.setDescription(node.getDescription());
seniorNode.setStatus(node.getStatus());
seniorNode.setParameters(node.getParameters());
seniorNode.setGmtCreate(node.getGmtCreate());
seniorNode.setGmtModified(node.getGmtModified());
seniorNode.setUsed(pipelineService.hasRelation(node.getId()));
seniorNodes.add(seniorNode);
}
context.put("seniorNodes", seniorNodes);
context.put("paginator", paginator);
context.put("searchKey", searchKey);
}
Aggregations