diff --git a/src/main/java/org/gcube/vremanagement/App.java b/src/main/java/org/gcube/vremanagement/App.java index 7ef91c4..33b0fb0 100755 --- a/src/main/java/org/gcube/vremanagement/App.java +++ b/src/main/java/org/gcube/vremanagement/App.java @@ -47,9 +47,13 @@ public class App { }*/ // methods to query and print information //xmlManager.getGatewaysInfo(); - xmlManager.getVosInfo("D4Science.org Detached Gateway"); - //xmlManager.findVo("D4Science.org Detached Gateway", "gCubeApps"); - xmlManager.findVre("D4Science.org Detached Gateway", "D4OS", "CNROutreach"); + //xmlManager.getVosInfo("AGINFRAPlus Detached Gateway"); + //xmlManager.getVosInfo("PARTHENOS Detached Gateway"); + //xmlManager.getVosInfo("BlueBridge Gateway"); + // xmlManager.getVosInfo("D4Science.org Detached Gateway"); + // xmlManager.getVosInfo("EOSC-Secretariat Detached Gateway"); + // xmlManager.findVo("BlueBridge Gateway", "FARM"); + //xmlManager.findVre("D4Science.org Detached Gateway", "D4OS", "CNROutreach"); } -} \ No newline at end of file +} diff --git a/src/main/java/org/gcube/vremanagement/XmlManager.java b/src/main/java/org/gcube/vremanagement/XmlManager.java index 841efce..7deb0b4 100755 --- a/src/main/java/org/gcube/vremanagement/XmlManager.java +++ b/src/main/java/org/gcube/vremanagement/XmlManager.java @@ -12,6 +12,7 @@ import java.util.stream.Collectors; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +import org.apache.commons.collections.bag.SynchronizedSortedBag; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -34,19 +35,94 @@ public class XmlManager implements VreRemPubInterface { DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(xmlFile); doc.getDocumentElement().normalize(); - NodeList gatewayNodes = doc.getElementsByTagName("gateways"); - - NodeList gatewayList = gatewayNodes.item(0).getChildNodes(); + NodeList gatewayList = doc.getElementsByTagName("gateways"); + //NodeList gatewayList = gatewayNodes.item(0).getChildNodes(); - for (int i = 0; i < gatewayList.getLength(); i++) { - Node gatewayNode = gatewayList.item(i); + //iterate over gateways child + for(int k =0; k new ArrayList<>()).add(gateway); + //break; } + } + + } + } + } catch (Exception e) { e.printStackTrace(); } @@ -208,8 +293,10 @@ public class XmlManager implements VreRemPubInterface { Gateway gatewayItem = gatewaysMap.get(_gateway); boolean found = false; ArrayList vosList = gatewayItem.getVosList(); + System.out.println("VO LIST length:"+ vosList.size()); if (vosList != null) { for (Vos vos : vosList) { + System.out.println("VO: "+vos.getName()); if (vos.getName().equals(_vo)) { found = true; System.out.println("VO info for " + _vo + " in " + _gateway + ":");