Added exception InvalidCacheLoadException

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@174935 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-12-17 14:52:31 +00:00
parent e02272d874
commit d679109b0e
4 changed files with 14 additions and 6 deletions

View File

@ -20,6 +20,8 @@ import org.gcube.datatransfer.resolver.services.error.ExceptionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
/**
* The Class AnalyticsGetResolver.
@ -65,7 +67,7 @@ public class AnalyticsGetResolver {
//CHECKING IF THE INPUT VRE NAME IS REGISTRED IN THE INFRASTRUCTURE...
try{
fullScope = LoadingVREsScopeCache.get(vreName);
}catch(ExecutionException e){
}catch(ExecutionException | InvalidCacheLoadException e){
logger.error("Error on getting the fullscope from cache for vreName "+vreName, e);
throw ExceptionManager.wrongParameterException(req, "Error on getting full scope for the VRE name "+vreName+". Is it registered as VRE in the D4Science Infrastructure System?", this.getClass(), helpURI);
}

View File

@ -29,6 +29,8 @@ import org.gcube.smartgears.utils.InnerMethodName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
import eu.trentorise.opendata.jackan.model.CkanDataset;
/**
@ -174,9 +176,9 @@ public class CatalogueResolver {
String fullScope = "";
try{
fullScope = LoadingVREsScopeCache.get(vreName);
}catch(ExecutionException e){
}catch(ExecutionException | InvalidCacheLoadException e){
logger.error("Error on getting the fullscope from cache for vreName "+vreName, e);
throw ExceptionManager.wrongParameterException(req, "Error on getting full scope for the VRE name "+vreName+". Is it registered as VRE in the D4Science Infrastructure System?", CatalogueResolver.class, helpURI);
throw ExceptionManager.wrongParameterException(req, "Error on getting full scope for the VRE name '"+vreName+"'. Is it registered as VRE in the D4Science Infrastructure System?", CatalogueResolver.class, helpURI);
}
logger.info("Read fullScope: "+fullScope + " for VRE_NAME: "+vreName +" from cache created by: "+GetAllInfrastructureVREs.class.getSimpleName());

View File

@ -29,6 +29,8 @@ import org.gcube.datatransfer.resolver.services.error.ExceptionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
/**
@ -120,7 +122,7 @@ public class GisResolver {
String gisViewerPortletUrl = null;
try{
gisViewerPortletUrl = LoadingGisViewerApplicationURLCache.get(scope);
}catch(ExecutionException e){
}catch(ExecutionException | InvalidCacheLoadException e){
logger.error("Error on getting the GisViewer Applicaton URL from cache for scope "+scope, e);
throw ExceptionManager.wrongParameterException(req, "Error on getting the GisViewer Applicaton URL from cache for scope "+scope+".\nIs the Application Profile with APPID "+UriResolverSmartGearManagerInit.getGisViewerProfile().getAppId()+" registered for this scope: "+scope+"?", this.getClass(), help);
}
@ -196,7 +198,7 @@ public class GisResolver {
GeonetworkInstance gi = null;
try {
gi = LoadingGeonetworkInstanceCache.get(scope);
}catch(ExecutionException e){
}catch(ExecutionException | InvalidCacheLoadException e){
logger.error("Error on getting the Geonetwork Instance from cache for scope "+scope, e);
throw ExceptionManager.wrongParameterException(req, "Error on getting the Geonetwork Instance from cache for scope "+scope+". Is it registered for this scope: "+scope+"?", this.getClass(), help);
}

View File

@ -20,6 +20,8 @@ import org.gcube.datatransfer.resolver.services.error.ExceptionManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
/**
* The Class KnimeGetResolver.
@ -62,7 +64,7 @@ public class KnimeGetResolver {
String fullScope = "";
try{
fullScope = LoadingVREsScopeCache.get(vreName);
}catch(ExecutionException e){
}catch(ExecutionException | InvalidCacheLoadException e){
logger.error("Error on getting the fullscope from cache for vreName "+vreName, e);
throw ExceptionManager.wrongParameterException(req, "Error on getting full scope for the VRE name "+vreName+". Is it registered as VRE in the D4Science Infrastructure System?", this.getClass(), helpURI);
}