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'
|
||||||
id 'java-library'
|
id 'java-library'
|
||||||
}
|
}
|
||||||
version = "1.2.0"
|
version = "1.2.2"
|
||||||
group = 'org.bdware.sc.controlproxy'
|
group = 'org.bdware.sc.controlproxy'
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
@ -38,6 +38,9 @@ public class TopologyCollector {
|
|||||||
for (JsonElement je : routersArray) {
|
for (JsonElement je : routersArray) {
|
||||||
JsonObject node = new JsonObject();
|
JsonObject node = new JsonObject();
|
||||||
JsonObject from = je.getAsJsonObject();
|
JsonObject from = je.getAsJsonObject();
|
||||||
|
if (!from.get("doId").getAsString().startsWith(rootNode.get("doId").getAsString())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
node.add("name", from.get("name"));
|
node.add("name", from.get("name"));
|
||||||
node.add("doId", from.get("doId"));
|
node.add("doId", from.get("doId"));
|
||||||
node.addProperty("type", "Router");
|
node.addProperty("type", "Router");
|
||||||
@ -55,6 +58,9 @@ public class TopologyCollector {
|
|||||||
for (JsonElement je : routersArray) {
|
for (JsonElement je : routersArray) {
|
||||||
JsonObject node = new JsonObject();
|
JsonObject node = new JsonObject();
|
||||||
JsonObject from = je.getAsJsonObject();
|
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("doId", from.get("doId").getAsString() + "/SearchEngine");
|
||||||
node.addProperty("type", "SearchEngine");
|
node.addProperty("type", "SearchEngine");
|
||||||
node.addProperty("name", from.get("name").getAsString() + "搜索引擎");
|
node.addProperty("name", from.get("name").getAsString() + "搜索引擎");
|
||||||
@ -78,6 +84,7 @@ public class TopologyCollector {
|
|||||||
continue;
|
continue;
|
||||||
if (name.equals("SearchEngine") || name.equals("GateWay"))
|
if (name.equals("SearchEngine") || name.equals("GateWay"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
JsonObject node = new JsonObject();
|
JsonObject node = new JsonObject();
|
||||||
node.add("name", from.get("name"));
|
node.add("name", from.get("name"));
|
||||||
node.add("doId", from.get("doId"));
|
node.add("doId", from.get("doId"));
|
||||||
@ -110,6 +117,9 @@ public class TopologyCollector {
|
|||||||
ContractResult nextRouters = executeContract(RepoProxy.router, "listLRS", new JsonPrimitive("a"));
|
ContractResult nextRouters = executeContract(RepoProxy.router, "listLRS", new JsonPrimitive("a"));
|
||||||
JsonArray routersArray = nextRouters.result.getAsJsonObject().get("data").getAsJsonArray();
|
JsonArray routersArray = nextRouters.result.getAsJsonObject().get("data").getAsJsonArray();
|
||||||
for (JsonElement je : routersArray) {
|
for (JsonElement je : routersArray) {
|
||||||
|
if (!je.getAsJsonObject().get("doId").getAsString().startsWith(points.get(0).get("doId").getAsString())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
String nextControlProxy = je.getAsJsonObject().get("doId").getAsString() + "/ControlProxy";
|
String nextControlProxy = je.getAsJsonObject().get("doId").getAsString() + "/ControlProxy";
|
||||||
ContractResult cr = executeContract(RepoProxy.router, "resolveTest", new JsonPrimitive(nextControlProxy));
|
ContractResult cr = executeContract(RepoProxy.router, "resolveTest", new JsonPrimitive(nextControlProxy));
|
||||||
|
@ -134,6 +134,7 @@ contract ControlProxy {
|
|||||||
//总体拓扑图
|
//总体拓扑图
|
||||||
//@范博
|
//@范博
|
||||||
export function getAllTopology2() {
|
export function getAllTopology2() {
|
||||||
|
return getAllTopology(2);
|
||||||
var nodeList = [];
|
var nodeList = [];
|
||||||
nodeList.push({
|
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"]
|
"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