use of com.ds.retl.dal.entity.Topology in project main by JohnPeng739.
the class TopologyManageResource method saveTopology.
/**
* 保存输入的拓扑配置信息
*
* @param userCode 操作用户代码
* @param topologyId 拓扑关键字ID,如果是新增,则为null
* @param topologyConfigJsonStr 计算拓扑配置信息
* @return 保存成功返回提交的拓扑对象,否则返回错误信息。
*/
@Path("topology/save")
@POST
public DataVO<TopologyVO> saveTopology(@QueryParam("userCode") String userCode, @QueryParam("topologyId") String topologyId, String topologyConfigJsonStr) {
sessionDataStore.setCurrentUserCode(userCode);
try {
Topology topology = topologyManageService.save(topologyId, topologyConfigJsonStr);
TopologyVO topologyVO = new TopologyVO();
TopologyVO.transform(topology, topologyVO);
sessionDataStore.removeCurrentUserCode();
return new DataVO<>(topologyVO);
} catch (UserInterfaceErrorException ex) {
return new DataVO<>(ex);
}
}
use of com.ds.retl.dal.entity.Topology in project main by JohnPeng739.
the class TopologyManageResource method killTopology.
/**
* 杀死集群中的计算拓扑
*
* @param userCode 操作用户代码
* @param topologyId 拓扑关键字ID
* @return 操作成功后的拓扑对象
*/
@Path("topology/kill")
@GET
public DataVO<TopologyVO> killTopology(@QueryParam("userCode") String userCode, @QueryParam("topologyId") String topologyId) {
sessionDataStore.setCurrentUserCode(userCode);
try {
Topology topology = topologyManageService.kill(topologyId);
TopologyVO topologyVO = new TopologyVO();
TopologyVO.transform(topology, topologyVO);
sessionDataStore.removeCurrentUserCode();
return new DataVO<>(topologyVO);
} catch (UserInterfaceErrorException ex) {
return new DataVO<>(ex);
}
}
use of com.ds.retl.dal.entity.Topology in project main by JohnPeng739.
the class TopologyManageResource method getTopology.
/**
* 根据拓扑数据库ID获取拓扑信息
*
* @param topologyId 关键字ID,不是集群中的ID
* @return 拓扑值对象
*/
@Path("topology")
@GET
public DataVO<TopologyVO> getTopology(@QueryParam("topologyId") String topologyId) {
try {
Topology topology = accessor.getById(topologyId, Topology.class);
TopologyVO vo = new TopologyVO();
TopologyVO.transform(topology, vo);
return new DataVO<>(vo);
} catch (EntityAccessException ex) {
if (logger.isErrorEnabled()) {
logger.error(ex);
}
return new DataVO<>(new UserInterfaceErrorException(UserInterfaceErrors.DB_OPERATE_FAIL));
}
}
Aggregations