|
|
|
@ -58,7 +58,7 @@ import org.xml.sax.SAXException;
|
|
|
|
|
public class ContextManager {
|
|
|
|
|
private static final Map<String, ScopeBean> CONTEXTS = new LinkedHashMap<String, ScopeBean>();
|
|
|
|
|
private static String confFile = null;
|
|
|
|
|
private static final String LOG_PREFIX = "[SCOPE-MGR]";
|
|
|
|
|
private static final String LOG_PREFIX = "[CONTEXT-MGR]";
|
|
|
|
|
private static final String GEN_RESOURCE_TYPE = "INFRASTRUCTURE";
|
|
|
|
|
private static final String GEN_RESOURCE_NAME = "VirtualOrganisation";
|
|
|
|
|
|
|
|
|
@ -104,7 +104,7 @@ public class ContextManager {
|
|
|
|
|
public static LinkedHashMap<String, ScopeBean> readContexts() throws Exception {
|
|
|
|
|
LinkedHashMap<String, ScopeBean> toReturn = new LinkedHashMap<String, ScopeBean>();
|
|
|
|
|
String scopeXML = readInfraVoFromIS();
|
|
|
|
|
System.out.println("**** readContexts()");
|
|
|
|
|
ServerConsole.info(LOG_PREFIX, "**** readContexts()");
|
|
|
|
|
Document scopeDocument = getDocumentGivenXML(scopeXML);
|
|
|
|
|
NodeList voElements = scopeDocument.getElementsByTagName("vo");
|
|
|
|
|
ServerConsole.debug("voElements="+ voElements.getLength());
|
|
|
|
@ -136,15 +136,21 @@ public class ContextManager {
|
|
|
|
|
public static LinkedHashMap<String, D4SEnvironment> readContextsWithUUIDs() throws Exception {
|
|
|
|
|
LinkedHashMap<String, D4SEnvironment> toReturn = new LinkedHashMap<String, D4SEnvironment>();
|
|
|
|
|
String scopeXML = readInfraVoFromIS();
|
|
|
|
|
System.out.println("**** readContexts()");
|
|
|
|
|
ServerConsole.info(LOG_PREFIX, "**** readContexts()");
|
|
|
|
|
Document scopeDocument = getDocumentGivenXML(scopeXML);
|
|
|
|
|
NodeList voElements = scopeDocument.getElementsByTagName("vo");
|
|
|
|
|
ServerConsole.debug("voElements="+ voElements.getLength());
|
|
|
|
|
for (int i = 0; i < voElements.getLength(); i++) {
|
|
|
|
|
NodeList voDetails = voElements.item(i).getChildNodes();
|
|
|
|
|
String voString = voDetails.item(2).getFirstChild().getNodeValue();
|
|
|
|
|
String voID = "non-existing-vo-id";
|
|
|
|
|
try {
|
|
|
|
|
voID = voDetails.item(3).getFirstChild().getNodeValue();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ServerConsole.error("Exception raised while trying reading VO ID from GenericResource having name: " + GEN_RESOURCE_NAME, e);
|
|
|
|
|
}
|
|
|
|
|
ScopeBean vo = new ScopeBean(voString);
|
|
|
|
|
D4SEnvironment voWrapper = new D4SEnvironment(vo, "uuid-not-exisiting-for-vos");
|
|
|
|
|
D4SEnvironment voWrapper = new D4SEnvironment(vo, voID);
|
|
|
|
|
toReturn.put(vo.toString(), voWrapper);
|
|
|
|
|
try {
|
|
|
|
|
for (GenericResource resVRE : getVREResourcesFromVO(vo)) {
|
|
|
|
|