update to version 2.5.3

Added wrapper for HomeLibrary configuration related to the new preproduction infrastructure

git-svn-id: https://svn.research-infrastructures.eu/public/d4science/gcube/branches/content-management/storage-manager-wrapper/2.5@178634 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Roberto Cirillo 2019-03-20 16:24:03 +00:00
parent f9362747c6
commit 6a26e00f19
3 changed files with 32 additions and 7 deletions

View File

@ -1,4 +1,8 @@
<ReleaseNotes>
<Changeset component="org.gcube.content-management.storage-manager-wrapper.2-5-1" date="2019-03-20">
<Change>Added HomeLibrary wrapper configuration for the new preproduction infrastructure</Change>
<Change>Added new Costants class for Junit package</Change>
</Changeset>
<Changeset component="org.gcube.content-management.storage-manager-wrapper.2-5-1" date="2018-10-11">
<Change>Constants definition moved on storage-manager-core Castants class</Change>
<Change>Added new Costants class for Junit package</Change>

View File

@ -8,7 +8,7 @@
</parent>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-wrapper</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>2.5.3-SNAPSHOT</version>
<scm>
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId}</connection>
<developerConnection>scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId}</developerConnection>

View File

@ -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);
}
}
}