Added a patch in oder to avoid full scope null read from hash vrename-fullscope loaded at init time from Application Profile ResourceCatalogue

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@144111 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2017-02-22 13:19:04 +00:00
parent 75136b39ab
commit 97c40f9216
1 changed files with 20 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public class CatalogueResolver extends HttpServlet{
throw new ServletException(CatalogueResolver.class.getName() +" cannot work without set the Environment Variable: "+ENV_SCOPE);
appPrCatResolver = new ApplicationProfileReaderForCatalogueResolver(scopeToEncDecr, true);
logger.info("Reosurce for Catalogue Resolver: "+appPrCatResolver);
logger.info("Resource read for CatalogueResolver: "+appPrCatResolver);
return scopeToEncDecr;
}
@ -166,7 +166,14 @@ public class CatalogueResolver extends HttpServlet{
appPrCatResolver = new ApplicationProfileReaderForCatalogueResolver(scopeToEncDecr, true);
String fullScope = appPrCatResolver.getHashVreNameScope().get(scope);
logger.debug("Read fullScope: "+fullScope + " for VRE_NAME: "+scope +" from Map and overring it");
if(fullScope==null){
logger.debug("FullScope is null for VRE_NAME: "+scope+" into Application Profile: "+ApplicationProfileReaderForCatalogueResolver.RESOURCE_NAME+", reading profile again");
appPrCatResolver = new ApplicationProfileReaderForCatalogueResolver(scopeToEncDecr, true);
fullScope = appPrCatResolver.getHashVreNameScope().get(scope);
}
logger.debug("Read fullScope: "+fullScope + " for VRE_NAME: "+scope +" into Application Profile "+ApplicationProfileReaderForCatalogueResolver.RESOURCE_NAME);
cer.addParameterToRequest(CatalogueRequestParameter.GCUBE_SCOPE.getKey(), fullScope);
scope = fullScope;
}
@ -453,4 +460,15 @@ public class CatalogueResolver extends HttpServlet{
return s;
}
}
public static void main(String[] args) {
try{
String scope = "d4science.research";
ApplicationProfileReaderForCatalogueResolver appPrCatResolver = new ApplicationProfileReaderForCatalogueResolver(scope, true);
logger.info("Reosurce for Catalogue Resolver: "+appPrCatResolver);
}catch(Exception e){
e.printStackTrace();
}
}
}