use of com.alibaba.otter.manager.web.common.model.SeniorCanal in project otter by alibaba.
the class CanalList 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 = canalService.getCount(condition);
Paginator paginator = new Paginator();
paginator.setItems(count);
paginator.setPage(pageIndex);
condition.put("offset", paginator.getOffset());
condition.put("length", paginator.getLength());
List<Canal> canals = canalService.listByCondition(condition);
List<SeniorCanal> seniorCanals = new ArrayList<SeniorCanal>();
for (Canal canal : canals) {
SeniorCanal seniorCanal = new SeniorCanal();
seniorCanal.setId(canal.getId());
seniorCanal.setName(canal.getName());
seniorCanal.setStatus(canal.getStatus());
seniorCanal.setDesc(canal.getDesc());
seniorCanal.setCanalParameter(canal.getCanalParameter());
seniorCanal.setGmtCreate(canal.getGmtCreate());
seniorCanal.setGmtModified(canal.getGmtModified());
List<Pipeline> pipelines = pipelineService.listByDestinationWithoutOther(canal.getName());
seniorCanal.setPipelines(pipelines);
seniorCanal.setUsed(!pipelines.isEmpty());
seniorCanals.add(seniorCanal);
}
context.put("seniorCanals", seniorCanals);
context.put("paginator", paginator);
context.put("searchKey", searchKey);
}
use of com.alibaba.otter.manager.web.common.model.SeniorCanal in project otter by alibaba.
the class SelectCanal 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 ("请输入关键字(目前支持Canal的名字,参数搜索)".equals(searchKey)) {
searchKey = "";
}
condition.put("searchKey", searchKey);
int count = canalService.getCount(condition);
Paginator paginator = new Paginator();
paginator.setItems(count);
paginator.setPage(pageIndex);
condition.put("offset", paginator.getOffset());
condition.put("length", paginator.getLength());
List<Canal> canals = canalService.listByCondition(condition);
List<SeniorCanal> seniorCanals = new ArrayList<SeniorCanal>();
for (Canal canal : canals) {
SeniorCanal seniorCanal = new SeniorCanal();
seniorCanal.setId(canal.getId());
seniorCanal.setName(canal.getName());
seniorCanal.setStatus(canal.getStatus());
seniorCanal.setDesc(canal.getDesc());
seniorCanal.setCanalParameter(canal.getCanalParameter());
seniorCanal.setUsed(false);
seniorCanal.setGmtCreate(canal.getGmtCreate());
seniorCanal.setGmtModified(canal.getGmtModified());
seniorCanals.add(seniorCanal);
}
context.put("seniorCanals", seniorCanals);
context.put("paginator", paginator);
context.put("searchKey", searchKey);
}
Aggregations