|
|
|
@ -50,6 +50,7 @@ public class Configuration {
|
|
|
|
|
private static final String HOME_LIBRARY_SERVICE_NAME_PROD="home-library";
|
|
|
|
|
private static final String HL_CONTEXT = "/d4science.research-infrastructures.eu";
|
|
|
|
|
private static final String HL_CONTEXT_DEV = "/gcube";
|
|
|
|
|
private static final String HL_CONTEXT_PRE = "/pred4s";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -80,15 +81,19 @@ public class Configuration {
|
|
|
|
|
// ISClientConnector isclient=getISClient();
|
|
|
|
|
String currentScope=ScopeProvider.instance.get();
|
|
|
|
|
logger.debug("Scope found on ScopeProvider instance is "+currentScope);
|
|
|
|
|
|
|
|
|
|
/*COMMENTED THE FOLLOWING LINES 20181214*/
|
|
|
|
|
|
|
|
|
|
if(RRScope == null){
|
|
|
|
|
if(new ScopeBean(currentScope).is(Type.VRE)){
|
|
|
|
|
logger.debug("If ScopeProvider scope is VRE scope RR scope became VO scope");
|
|
|
|
|
RRScope=new ScopeBean(currentScope).enclosingScope().toString();
|
|
|
|
|
}else{
|
|
|
|
|
logger.debug("If ScopeProvider scope is not a VRE scope RR scope is ScopeProvider scope");
|
|
|
|
|
// if(new ScopeBean(currentScope).is(Type.VRE)){
|
|
|
|
|
// logger.debug("If ScopeProvider scope is VRE scope RR scope became VO scope");
|
|
|
|
|
// RRScope=new ScopeBean(currentScope).enclosingScope().toString();
|
|
|
|
|
// }else{
|
|
|
|
|
// logger.debug("If ScopeProvider scope is not a VRE scope RR scope is ScopeProvider scope");
|
|
|
|
|
RRScope=currentScope;
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*END*/
|
|
|
|
|
logger.debug("RuntimeResource scope "+RRScope);
|
|
|
|
|
ServiceEndpoint resource=getISClient().getStorageEndpoint(RRScope);
|
|
|
|
|
if(resource ==null )
|
|
|
|
@ -166,6 +171,8 @@ public class Configuration {
|
|
|
|
|
String context=null;
|
|
|
|
|
if (scope.startsWith("/gcube"))
|
|
|
|
|
context= HL_CONTEXT_DEV;
|
|
|
|
|
else if(scope.startsWith("/pred4s"))
|
|
|
|
|
context=HL_CONTEXT_PRE;
|
|
|
|
|
else if(scope.startsWith("/d4science.research-infrastructures.eu"))
|
|
|
|
|
context=HL_CONTEXT;
|
|
|
|
|
else{
|
|
|
|
@ -205,6 +212,20 @@ public class Configuration {
|
|
|
|
|
logger.debug("multiple collection discovered");
|
|
|
|
|
engine.setDbNames(dbNames);
|
|
|
|
|
}
|
|
|
|
|
// added db check also on volatile are
|
|
|
|
|
}else if((getMemoryType().equals(MemoryType.VOLATILE.toString()))){
|
|
|
|
|
dbString=getISClient().retrievePropertyValue(DB_PROPERTY_NAME, currentScope);
|
|
|
|
|
if(dbString!=null){
|
|
|
|
|
if (dbString.contains(DB_STRING_SEPARATOR)){
|
|
|
|
|
logger.debug("more than one collection read from ServiceEnpoint");
|
|
|
|
|
dbNames=dbString.split(DB_STRING_SEPARATOR);
|
|
|
|
|
}else{
|
|
|
|
|
dbNames= new String[]{dbString};
|
|
|
|
|
}
|
|
|
|
|
if (dbNames.length > 1)
|
|
|
|
|
logger.debug("multiple collection discovered");
|
|
|
|
|
engine.setDbNames(dbNames);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|