|
@ -1,12 +1,18 @@
|
|
|
package com.yihu.hos.broker.controllers;
|
|
|
|
|
|
import com.yihu.hos.broker.services.camel.ESBCamelService;
|
|
|
import com.yihu.hos.broker.services.camel.SystemCamelContext;
|
|
|
import com.yihu.hos.web.framework.model.Result;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.camel.Route;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* Created by lingfeng on 2016/8/4.
|
|
|
*/
|
|
@ -78,4 +84,18 @@ public class ESBCamelController {
|
|
|
@RequestParam String routeId) {
|
|
|
return esbCamelService.getRouteStatus(routeId);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/allFlow/status", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "所有服务流程运行状态", produces = "application/json", notes = "查看所有服务流程的运行状态,运行中/停止")
|
|
|
public Map<String,String > allFlowStatus() {
|
|
|
List<Route> routes = SystemCamelContext.getContext().getRoutes();
|
|
|
Map<String,String > map = new HashMap<>();
|
|
|
for (Route route : routes){
|
|
|
System.out.println("routId: "+route.getId() + " : " +SystemCamelContext.getContext().getRouteStatus(route.getId()));
|
|
|
map.put(route.getId(),SystemCamelContext.getContext().getRouteStatus(route.getId()).name());
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|