From 6a26e00f19c9781ef37462907633b52850d42d9b Mon Sep 17 00:00:00 2001 From: "roberto.cirillo" Date: Wed, 20 Mar 2019 16:24:03 +0000 Subject: [PATCH] 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 --- distro/changelog.xml | 4 +++ pom.xml | 2 +- .../storageclient/wrapper/Configuration.java | 33 +++++++++++++++---- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/distro/changelog.xml b/distro/changelog.xml index 6dd793c..b7f6766 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,4 +1,8 @@ + + Added HomeLibrary wrapper configuration for the new preproduction infrastructure + Added new Costants class for Junit package + Constants definition moved on storage-manager-core Castants class Added new Costants class for Junit package diff --git a/pom.xml b/pom.xml index 3f7bbd9..c94da3d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.gcube.contentmanagement storage-manager-wrapper - 2.5.1-SNAPSHOT + 2.5.3-SNAPSHOT scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId} scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/${project.artifactId} diff --git a/src/main/java/org/gcube/contentmanager/storageclient/wrapper/Configuration.java b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/Configuration.java index 64a005d..fcc9637 100644 --- a/src/main/java/org/gcube/contentmanager/storageclient/wrapper/Configuration.java +++ b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/Configuration.java @@ -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); + } } }