This commit is contained in:
Fabio Sinibaldi 2019-05-20 13:12:03 +00:00
parent 310ea7be51
commit b50eb7a437
1 changed files with 16 additions and 12 deletions

View File

@ -59,7 +59,7 @@ public class ISUtils {
return client.submit(query); return client.submit(query);
} }
public static List<ServiceEndpoint> queryForServiceEndpointsByName(String category, String name){ public static List<ServiceEndpoint> queryForServiceEndpointsByName(String category, String name){
log.debug("Querying for Service Endpoints [category : {} , name : {}, currentScope : {} ]",category,name,ContextUtils.getCurrentScope()); log.debug("Querying for Service Endpoints [category : {} , name : {}, currentScope : {} ]",category,name,ContextUtils.getCurrentScope());
@ -105,18 +105,22 @@ public class ISUtils {
public static Map<String,String> loadConfiguration(){ public static Map<String,String> loadConfiguration(){
HashMap<String,String> toReturn=new HashMap<>(); HashMap<String,String> toReturn=new HashMap<>();
String confXML= ISUtils.queryForGenericResources("gcat-feeder", "configuration").get(0).profile().bodyAsString(); try {
confXML=confXML.replaceAll(" ", ""); String confXML= ISUtils.queryForGenericResources("gcat-feeder", "configuration").get(0).profile().bodyAsString();
confXML=confXML.replaceAll(" ", "");
Document xml = convertStringToDocument(confXML); Document xml = convertStringToDocument(confXML);
Node user = xml.getFirstChild(); Node user = xml.getFirstChild();
NodeList childs = user.getChildNodes(); NodeList childs = user.getChildNodes();
Node child; Node child;
for (int i = 0; i < childs.getLength(); i++) { for (int i = 0; i < childs.getLength(); i++) {
child = childs.item(i); child = childs.item(i);
System.out.println(child.getNodeName()); System.out.println(child.getNodeName());
System.out.println(child.getTextContent()); System.out.println(child.getTextContent());
toReturn.put(child.getNodeName(), child.getTextContent()); toReturn.put(child.getNodeName(), child.getTextContent());
}
}catch(Throwable t) {
log.warn("Unable to load IS configuration",t);
} }
return toReturn; return toReturn;
} }