forked from iod/ControlProxy
getAllTopology: grep cross-domain routers
This commit is contained in:
parent
e063cb0105
commit
1eb2950c41
@ -14,7 +14,7 @@ plugins {
|
||||
id 'java'
|
||||
id 'java-library'
|
||||
}
|
||||
version = "1.2.0"
|
||||
version = "1.2.2"
|
||||
group = 'org.bdware.sc.controlproxy'
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
|
@ -38,6 +38,9 @@ public class TopologyCollector {
|
||||
for (JsonElement je : routersArray) {
|
||||
JsonObject node = new JsonObject();
|
||||
JsonObject from = je.getAsJsonObject();
|
||||
if (!from.get("doId").getAsString().startsWith(rootNode.get("doId").getAsString())) {
|
||||
continue;
|
||||
}
|
||||
node.add("name", from.get("name"));
|
||||
node.add("doId", from.get("doId"));
|
||||
node.addProperty("type", "Router");
|
||||
@ -55,6 +58,9 @@ public class TopologyCollector {
|
||||
for (JsonElement je : routersArray) {
|
||||
JsonObject node = new JsonObject();
|
||||
JsonObject from = je.getAsJsonObject();
|
||||
if (!from.get("doId").getAsString().startsWith(rootNode.get("doId").getAsString())) {
|
||||
continue;
|
||||
}
|
||||
node.addProperty("doId", from.get("doId").getAsString() + "/SearchEngine");
|
||||
node.addProperty("type", "SearchEngine");
|
||||
node.addProperty("name", from.get("name").getAsString() + "搜索引擎");
|
||||
@ -78,6 +84,7 @@ public class TopologyCollector {
|
||||
continue;
|
||||
if (name.equals("SearchEngine") || name.equals("GateWay"))
|
||||
continue;
|
||||
|
||||
JsonObject node = new JsonObject();
|
||||
node.add("name", from.get("name"));
|
||||
node.add("doId", from.get("doId"));
|
||||
@ -110,6 +117,9 @@ public class TopologyCollector {
|
||||
ContractResult nextRouters = executeContract(RepoProxy.router, "listLRS", new JsonPrimitive("a"));
|
||||
JsonArray routersArray = nextRouters.result.getAsJsonObject().get("data").getAsJsonArray();
|
||||
for (JsonElement je : routersArray) {
|
||||
if (!je.getAsJsonObject().get("doId").getAsString().startsWith(points.get(0).get("doId").getAsString())) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
String nextControlProxy = je.getAsJsonObject().get("doId").getAsString() + "/ControlProxy";
|
||||
ContractResult cr = executeContract(RepoProxy.router, "resolveTest", new JsonPrimitive(nextControlProxy));
|
||||
|
@ -134,6 +134,7 @@ contract ControlProxy {
|
||||
//总体拓扑图
|
||||
//@范博
|
||||
export function getAllTopology2() {
|
||||
return getAllTopology(2);
|
||||
var nodeList = [];
|
||||
nodeList.push({
|
||||
"name":"小店区仓库", "doId":"bdware.ss.ab/Repo1", "type":"Repo", "previousNode":["bdware.ss/Gateway1", "bdware.ss/Gateway2", "bdware.ss.ab/Repo2", "bdware.ss.zz/SearchEngine"]
|
||||
|
Loading…
Reference in New Issue
Block a user