use of com.ds.retl.rest.vo.topology.TopologyRealStatusVO in project main by JohnPeng739.
the class TopologyManageResource method getTopologyRealStatus.
@Path("topologies/realStatus")
@GET
public DataVO<List<TopologyRealStatusVO>> getTopologyRealStatus(@QueryParam("topologyIds") String topologyIds) {
if (StringUtils.isBlank(topologyIds)) {
return new DataVO<>(new UserInterfaceErrorException(UserInterfaceErrors.SYSTEM_ILLEGAL_PARAM));
}
try {
String[] ids = topologyIds.split(",");
JSONArray topologies = stormClient.getToptologies();
List<TopologyRealStatusVO> list = new ArrayList<>();
if (topologies != null && topologies.size() > 0) {
for (String id : ids) {
for (int index = 0; index < topologies.size(); index++) {
JSONObject item = topologies.getJSONObject(index);
if (item == null) {
continue;
}
if (id.equals(item.getString("id"))) {
list.add(new TopologyRealStatusVO(item));
}
}
}
}
return new DataVO<>(list);
} catch (UserInterfaceErrorException ex) {
return new DataVO<>(ex);
}
}
Aggregations