From 0e571e0963c3672da1c3f19136d71fbe020bdb79 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Thu, 15 Nov 2018 11:18:03 +0000 Subject: [PATCH] Added SmartGear Init implementing ApplicationManager git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@174158 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 17 +-- .../resolver/SingleFileStreamingOutput.java | 27 +++- .../datatransfer/resolver/UriResolver.java | 6 +- ...LoadingGeoExplorerApplicationURLCache.java | 4 +- .../LoadingGisViewerApplicationURLCache.java | 6 +- .../caches/LoadingVREsScopeCache.java | 6 +- .../ResourceCatalogueCodes.java | 2 +- .../GeonetworkRequestFilterParameters.java | 4 +- .../UriResolverServletContextListener.java | 65 ++++++++++ .../UriResolverSmartGearInit.java} | 115 +++++++++--------- .../resolver/services/CatalogueResolver.java | 2 +- .../resolver/services/GeonetworkResolver.java | 4 +- .../resolver/services/StorageIDResolver.java | 1 - src/test/java/rest/TestResolvers.java | 3 +- 14 files changed, 168 insertions(+), 94 deletions(-) rename src/main/java/org/gcube/datatransfer/resolver/{ => catalogue}/ResourceCatalogueCodes.java (97%) rename src/main/java/org/gcube/datatransfer/resolver/{ => gis/geonetwork}/GeonetworkRequestFilterParameters.java (77%) create mode 100644 src/main/java/org/gcube/datatransfer/resolver/init/UriResolverServletContextListener.java rename src/main/java/org/gcube/datatransfer/resolver/{listeners/UriResolverStartupListener.java => init/UriResolverSmartGearInit.java} (52%) diff --git a/pom.xml b/pom.xml index 2f52c47..5df753c 100644 --- a/pom.xml +++ b/pom.xml @@ -54,13 +54,6 @@ common-authorization - - - - - - - org.gcube.contentmanagement storage-manager-wrapper @@ -103,11 +96,11 @@ - - - - - + + + + + javax.ws.rs javax.ws.rs-api diff --git a/src/main/java/org/gcube/datatransfer/resolver/SingleFileStreamingOutput.java b/src/main/java/org/gcube/datatransfer/resolver/SingleFileStreamingOutput.java index f01e374..eb4d92d 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/SingleFileStreamingOutput.java +++ b/src/main/java/org/gcube/datatransfer/resolver/SingleFileStreamingOutput.java @@ -10,6 +10,14 @@ import javax.ws.rs.core.StreamingOutput; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + + +/** + * The Class SingleFileStreamingOutput. + * + * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) + * Nov 15, 2018 + */ public class SingleFileStreamingOutput implements StreamingOutput { private static final Logger log = LoggerFactory.getLogger(SingleFileStreamingOutput.class); @@ -17,6 +25,11 @@ public class SingleFileStreamingOutput implements StreamingOutput { InputStream streamToWrite; + /** + * Instantiates a new single file streaming output. + * + * @param streamToWrite the stream to write + */ public SingleFileStreamingOutput(InputStream streamToWrite) { super(); this.streamToWrite = streamToWrite; @@ -24,9 +37,10 @@ public class SingleFileStreamingOutput implements StreamingOutput { /** * Overriding the write method to write request data directly to Jersey outputStream . - * @param outputStream - * @throws IOException - * @throws WebApplicationException + * + * @param outputStream the output stream + * @throws IOException Signals that an I/O exception has occurred. + * @throws WebApplicationException the web application exception */ @Override public void write(OutputStream outputStream) throws IOException, WebApplicationException { @@ -35,6 +49,13 @@ public class SingleFileStreamingOutput implements StreamingOutput { log.debug("StreamOutput written"); } + /** + * Copy. + * + * @param in the in + * @param out the out + * @throws IOException Signals that an I/O exception has occurred. + */ private void copy(InputStream in, OutputStream out) throws IOException { byte[] buffer = new byte[2048]; int readcount = 0; diff --git a/src/main/java/org/gcube/datatransfer/resolver/UriResolver.java b/src/main/java/org/gcube/datatransfer/resolver/UriResolver.java index bf9bea2..ead17a3 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/UriResolver.java +++ b/src/main/java/org/gcube/datatransfer/resolver/UriResolver.java @@ -2,6 +2,8 @@ package org.gcube.datatransfer.resolver; import javax.ws.rs.Path; +import org.gcube.datatransfer.resolver.requesthandler.TokenSetter; +import org.gcube.datatransfer.resolver.services.CatalogueResolver; import org.glassfish.jersey.server.ResourceConfig; @Path("uri-resolver") @@ -9,9 +11,7 @@ public class UriResolver extends ResourceConfig { public UriResolver() { // Register all resources present under the package. - packages("org.gcube.datatransfer.resolver.services","org.gcube.datatransfer.resolver.requesthandler"); -// register(JspMvcFeature.class); -// property(MvcFeature.TEMPLATE_BASE_PATH, "/WEB-INF/jsp"); + packages(CatalogueResolver.class.getPackage().getName(), TokenSetter.class.getPackage().getName()); } } diff --git a/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingGeoExplorerApplicationURLCache.java b/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingGeoExplorerApplicationURLCache.java index 3f3d271..731872a 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingGeoExplorerApplicationURLCache.java +++ b/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingGeoExplorerApplicationURLCache.java @@ -7,7 +7,7 @@ package org.gcube.datatransfer.resolver.caches; import java.util.concurrent.TimeUnit; import org.gcube.datatransfer.resolver.applicationprofile.ApplicationProfileReader; -import org.gcube.datatransfer.resolver.listeners.UriResolverStartupListener; +import org.gcube.datatransfer.resolver.init.UriResolverSmartGearInit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,7 +80,7 @@ public class LoadingGeoExplorerApplicationURLCache { if (scope == null || scope.isEmpty()) logger.warn("Scope is null or ermpty, skipping loadGisViewerApplicationURL"); - ApplicationProfileReader reader = new ApplicationProfileReader(scope, UriResolverStartupListener.getGeoExplorerProfile().getGenericResource(), UriResolverStartupListener.getGeoExplorerProfile().getAppId(), false); + ApplicationProfileReader reader = new ApplicationProfileReader(scope, UriResolverSmartGearInit.getGeoExplorerProfile().getGenericResource(), UriResolverSmartGearInit.getGeoExplorerProfile().getAppId(), false); String url = reader.getApplicationProfile().getUrl(); logger.info("With scope "+scope+" loaded the GeoExplorer Application URL "+url); return url; diff --git a/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingGisViewerApplicationURLCache.java b/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingGisViewerApplicationURLCache.java index c1472cb..bbe093b 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingGisViewerApplicationURLCache.java +++ b/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingGisViewerApplicationURLCache.java @@ -7,7 +7,7 @@ package org.gcube.datatransfer.resolver.caches; import java.util.concurrent.TimeUnit; import org.gcube.datatransfer.resolver.applicationprofile.ApplicationProfileReader; -import org.gcube.datatransfer.resolver.listeners.UriResolverStartupListener; +import org.gcube.datatransfer.resolver.init.UriResolverSmartGearInit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,10 +80,10 @@ public class LoadingGisViewerApplicationURLCache { if (scope == null || scope.isEmpty()) logger.warn("Scope is null or ermpty, skipping loadGisViewerApplicationURL"); - ApplicationProfileReader reader = new ApplicationProfileReader(scope, UriResolverStartupListener.getGisViewerProfile().getGenericResource(), UriResolverStartupListener.getGisViewerProfile().getAppId(), false); + ApplicationProfileReader reader = new ApplicationProfileReader(scope, UriResolverSmartGearInit.getGisViewerProfile().getGenericResource(), UriResolverSmartGearInit.getGisViewerProfile().getAppId(), false); if(reader.getApplicationProfile()==null){ - logger.error("NO Appllication Profile "+UriResolverStartupListener.getGisViewerProfile().getAppId()+" found in the scope: "+scope+", returning null!"); + logger.error("NO Appllication Profile "+UriResolverSmartGearInit.getGisViewerProfile().getAppId()+" found in the scope: "+scope+", returning null!"); return null; } String url = reader.getApplicationProfile().getUrl(); diff --git a/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingVREsScopeCache.java b/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingVREsScopeCache.java index 33c638b..699a4ae 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingVREsScopeCache.java +++ b/src/main/java/org/gcube/datatransfer/resolver/caches/LoadingVREsScopeCache.java @@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit; import org.gcube.common.scope.api.ScopeProvider; import org.gcube.datatransfer.resolver.catalogue.resource.GetAllInfrastructureVREs; -import org.gcube.datatransfer.resolver.listeners.UriResolverStartupListener; +import org.gcube.datatransfer.resolver.init.UriResolverSmartGearInit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,8 +76,8 @@ public class LoadingVREsScopeCache { try{ //POPULATE THE CACHE READING THE RESOURCE "CATALOGUE-RESOLVER" logger.info("Trying to pre-populate VRE Names to Scope cache"); - ScopeProvider.instance.set(UriResolverStartupListener.getRootContextScope()); - Map map = GetAllInfrastructureVREs.loadMapOFVreNameToScope(UriResolverStartupListener.getRootContextScope()); + ScopeProvider.instance.set(UriResolverSmartGearInit.getRootContextScope()); + Map map = GetAllInfrastructureVREs.loadMapOFVreNameToScope(UriResolverSmartGearInit.getRootContextScope()); vresNameToScope.asMap().putAll(map); logger.info("Cache populated with: "+vresNameToScope.asMap().toString()); //logger.info("Pre-Loaded CatalogueApplicationProfiles cache is: "+catalogueApplicationProfiles.asMap().toString()); diff --git a/src/main/java/org/gcube/datatransfer/resolver/ResourceCatalogueCodes.java b/src/main/java/org/gcube/datatransfer/resolver/catalogue/ResourceCatalogueCodes.java similarity index 97% rename from src/main/java/org/gcube/datatransfer/resolver/ResourceCatalogueCodes.java rename to src/main/java/org/gcube/datatransfer/resolver/catalogue/ResourceCatalogueCodes.java index daf88ff..d81c0f9 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/ResourceCatalogueCodes.java +++ b/src/main/java/org/gcube/datatransfer/resolver/catalogue/ResourceCatalogueCodes.java @@ -1,7 +1,7 @@ /** * */ -package org.gcube.datatransfer.resolver; +package org.gcube.datatransfer.resolver.catalogue; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/gcube/datatransfer/resolver/GeonetworkRequestFilterParameters.java b/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/GeonetworkRequestFilterParameters.java similarity index 77% rename from src/main/java/org/gcube/datatransfer/resolver/GeonetworkRequestFilterParameters.java rename to src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/GeonetworkRequestFilterParameters.java index 763e5cf..e20c9fd 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/GeonetworkRequestFilterParameters.java +++ b/src/main/java/org/gcube/datatransfer/resolver/gis/geonetwork/GeonetworkRequestFilterParameters.java @@ -1,7 +1,7 @@ /** * */ -package org.gcube.datatransfer.resolver; +package org.gcube.datatransfer.resolver.gis.geonetwork; /** @@ -14,6 +14,4 @@ public interface GeonetworkRequestFilterParameters { public static enum MODE {HARVEST, VRE}; public static enum VISIBILITY {PUB, PRV}; public static String REQUEST_DELIMITIER = "/$$"; - - public static String OWNER_PARAM = "OWNER"; } diff --git a/src/main/java/org/gcube/datatransfer/resolver/init/UriResolverServletContextListener.java b/src/main/java/org/gcube/datatransfer/resolver/init/UriResolverServletContextListener.java new file mode 100644 index 0000000..540e0e1 --- /dev/null +++ b/src/main/java/org/gcube/datatransfer/resolver/init/UriResolverServletContextListener.java @@ -0,0 +1,65 @@ +/** + * + */ +package org.gcube.datatransfer.resolver.init; + +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import javax.servlet.annotation.WebListener; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * The listener interface for receiving uriResolverServletContext events. + * The class that is interested in processing a uriResolverServletContext + * event implements this interface, and the object created + * with that class is registered with a component using the + * component's addUriResolverServletContextListener method. When + * the uriResolverServletContext event occurs, that object's appropriate + * method is invoked. + * + * @see UriResolverServletContextEvent + */ +@WebListener +public class UriResolverServletContextListener implements ServletContextListener { + + private static Logger log = LoggerFactory.getLogger(UriResolverServletContextListener.class); + + + private static ServletContext servletContext; + + /* (non-Javadoc) + * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) + */ + @Override + public void contextInitialized(ServletContextEvent event) { + + servletContext = event.getServletContext(); + log.info("Context Initialized at context path: "+servletContext.getContextPath()); + } + + /* (non-Javadoc) + * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) + */ + @Override + public void contextDestroyed(ServletContextEvent event) { + // Perform action during application's shutdown + } + + + /** + * Gets the servlet context. + * + * @return the servlet context + */ + public static ServletContext getServletContext() { + + return servletContext; + } + + + +} \ No newline at end of file diff --git a/src/main/java/org/gcube/datatransfer/resolver/listeners/UriResolverStartupListener.java b/src/main/java/org/gcube/datatransfer/resolver/init/UriResolverSmartGearInit.java similarity index 52% rename from src/main/java/org/gcube/datatransfer/resolver/listeners/UriResolverStartupListener.java rename to src/main/java/org/gcube/datatransfer/resolver/init/UriResolverSmartGearInit.java index 7144f14..39ddce7 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/listeners/UriResolverStartupListener.java +++ b/src/main/java/org/gcube/datatransfer/resolver/init/UriResolverSmartGearInit.java @@ -1,7 +1,7 @@ /** * */ -package org.gcube.datatransfer.resolver.listeners; +package org.gcube.datatransfer.resolver.init; import java.io.File; import java.io.FileInputStream; @@ -10,40 +10,30 @@ import java.io.IOException; import java.util.Properties; import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; import javax.servlet.ServletException; -import javax.servlet.annotation.WebListener; +import org.gcube.common.scope.api.ScopeProvider; +import org.gcube.common.scope.impl.ScopeBean; +import org.gcube.common.scope.impl.ScopeBean.Type; import org.gcube.datatransfer.resolver.caches.LoadingGeonetworkInstanceCache; import org.gcube.datatransfer.resolver.caches.LoadingGisViewerApplicationURLCache; import org.gcube.datatransfer.resolver.caches.LoadingVREsScopeCache; import org.gcube.datatransfer.resolver.gis.property.ApplicationProfilePropertyReader; import org.gcube.datatransfer.resolver.gis.property.PropertyFileNotFoundException; -import org.gcube.smartgears.ContextProvider; -import org.gcube.smartgears.configuration.container.ContainerConfiguration; -import org.gcube.smartgears.context.application.ApplicationContext; -import org.gcube.smartgears.context.container.ContainerContext; +import org.gcube.smartgears.ApplicationManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * The listener interface for receiving startup events. - * The class that is interested in processing a startup - * event implements this interface, and the object created - * with that class is registered with a component using the - * component's addStartupListener method. When - * the startup event occurs, that object's appropriate - * method is invoked. + * The Class UriResolverSmartGearInit. * - * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it - * Nov 2, 2018 + * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) + * Nov 15, 2018 */ -@WebListener -public class UriResolverStartupListener implements ServletContextListener { +public class UriResolverSmartGearInit implements ApplicationManager { - private static Logger logger = LoggerFactory.getLogger(UriResolverStartupListener.class); + private static Logger logger = LoggerFactory.getLogger(UriResolverSmartGearInit.class); public static final String GIS_VIEWER_GENERIC_RESOURCE_GCUBE_APPS_PROPERTIES = "gisviewerappgenericresource.properties"; public static final String GEO_EXPLORER_GENERIC_RESOURCE_GCUBE_APPS_PROPERTIES = "geoexplorerappgenericresource.properties"; @@ -53,57 +43,67 @@ public class UriResolverStartupListener implements ServletContextListener { public static final String ENV_SCOPE = "SCOPE"; //Environment Variable - private static String rootContextScope = null; private static ApplicationProfilePropertyReader gisViewerProfile; private static ApplicationProfilePropertyReader geoExplorerProfile; - /* (non-Javadoc) - * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) - */ - @Override - public void contextInitialized(ServletContextEvent event) { - try { - rootContextScope = loadScopeFromEnvironment(); - ApplicationContext ctx = ContextProvider.get(); - ContainerContext container = ctx.container(); - logger.info("Is ContainerContext null? "+(container==null)); - ContainerConfiguration contConfiguration = container.configuration(); - logger.info("Is ContainerConfiguration null? "+(contConfiguration==null)); + /* (non-Javadoc) + * @see org.gcube.smartgears.ApplicationManager#onInit() + */ + @Override + public void onInit() { - String rootScope = ctx.container().configuration().infrastructure(); - logger.info("Is infrastructure null? "+(rootScope==null)); + try { - logger.info("The ContextProvider read the infrastructure name: "+rootScope); + if(rootContextScope==null){ + logger.info("The RootContextScope is null, getting it from ScopeProvider"); + String scope = ScopeProvider.instance.get(); + ScopeBean theScopeBean = new ScopeBean(scope); + logger.info("The ScopeBean is: "+theScopeBean.toString()); + if(theScopeBean.is(Type.INFRASTRUCTURE)){ + rootContextScope = theScopeBean.name(); + rootContextScope = rootContextScope.startsWith("/")?rootContextScope:"/"+rootContextScope; + logger.info("The RootContextScope has value: "+rootContextScope); + } + }else{ + + //THE ROOT SCOPE has been initialized + + gisViewerProfile = loadApplicationProfile(UriResolverServletContextListener.getServletContext(), GIS_VIEWER_GENERIC_RESOURCE_GCUBE_APPS_PROPERTIES); + geoExplorerProfile = loadApplicationProfile(UriResolverServletContextListener.getServletContext(), GEO_EXPLORER_GENERIC_RESOURCE_GCUBE_APPS_PROPERTIES); + //init the caches + new LoadingGeonetworkInstanceCache(); + new LoadingGisViewerApplicationURLCache(); + new LoadingVREsScopeCache(); + //new LoadingCatalogueApplicationProfilesCache(); + + logger.info("Context initialized with: "); + logger.info("Scope: "+rootContextScope); + logger.info("GisViewerProfile [ID: "+gisViewerProfile.getAppId() + ", Generic Resource Type: "+gisViewerProfile.getGenericResource()+"]"); + logger.info("GeoExplorerProfile [ID: "+geoExplorerProfile. getAppId() + ", Generic Resource Type: "+geoExplorerProfile.getGenericResource()+"]"); + + } } catch (Exception e) { // logger.error(e.getMessage(), e); } - gisViewerProfile = loadApplicationProfile(event.getServletContext(), GIS_VIEWER_GENERIC_RESOURCE_GCUBE_APPS_PROPERTIES); - geoExplorerProfile = loadApplicationProfile(event.getServletContext(), GEO_EXPLORER_GENERIC_RESOURCE_GCUBE_APPS_PROPERTIES); - //init the caches - new LoadingGeonetworkInstanceCache(); - new LoadingGisViewerApplicationURLCache(); - new LoadingVREsScopeCache(); - //new LoadingCatalogueApplicationProfilesCache(); - - logger.info("Context initialized with: "); - logger.info("Scope: "+rootContextScope); - logger.info("GisViewerProfile [ID: "+gisViewerProfile.getAppId() + ", Generic Resource Type: "+gisViewerProfile.getGenericResource()+"]"); - logger.info("GeoExplorerProfile [ID: "+geoExplorerProfile. getAppId() + ", Generic Resource Type: "+geoExplorerProfile.getGenericResource()+"]"); } - /* (non-Javadoc) - * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) - */ - @Override - public void contextDestroyed(ServletContextEvent event) { - // Perform action during application's shutdown - } + + /* (non-Javadoc) + * @see org.gcube.smartgears.ApplicationManager#onShutdown() + */ + @Override + public void onShutdown() { + + // TODO Auto-generated method stub + + } + /** * Gets the currency. @@ -143,7 +143,7 @@ public class UriResolverStartupListener implements ServletContextListener { String scopeFromEnv = System.getenv(ENV_SCOPE); if(scopeFromEnv == null || scopeFromEnv.isEmpty()) - throw new ServletException(UriResolverStartupListener.class.getName() +" cannot read scope from Environment Variable: "+ENV_SCOPE+", It is null or empty"); + throw new ServletException(UriResolverServletContextListener.class.getName() +" cannot read scope from Environment Variable: "+ENV_SCOPE+", It is null or empty"); logger.info("Read scope: "+scopeFromEnv+" from Environment Variable: "+ENV_SCOPE); return scopeFromEnv; @@ -183,5 +183,4 @@ public class UriResolverStartupListener implements ServletContextListener { } - -} \ No newline at end of file +} diff --git a/src/main/java/org/gcube/datatransfer/resolver/services/CatalogueResolver.java b/src/main/java/org/gcube/datatransfer/resolver/services/CatalogueResolver.java index c769bf1..6ac4fc8 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/services/CatalogueResolver.java +++ b/src/main/java/org/gcube/datatransfer/resolver/services/CatalogueResolver.java @@ -17,9 +17,9 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import org.gcube.common.scope.api.ScopeProvider; -import org.gcube.datatransfer.resolver.ResourceCatalogueCodes; import org.gcube.datatransfer.resolver.caches.LoadingVREsScopeCache; import org.gcube.datatransfer.resolver.catalogue.CatalogueRequest; +import org.gcube.datatransfer.resolver.catalogue.ResourceCatalogueCodes; import org.gcube.datatransfer.resolver.catalogue.resource.CkanCatalogueConfigurationsReader; import org.gcube.datatransfer.resolver.catalogue.resource.GatewayCKANCatalogueReference; import org.gcube.datatransfer.resolver.catalogue.resource.GetAllInfrastructureVREs; diff --git a/src/main/java/org/gcube/datatransfer/resolver/services/GeonetworkResolver.java b/src/main/java/org/gcube/datatransfer/resolver/services/GeonetworkResolver.java index 1eb2c11..7509333 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/services/GeonetworkResolver.java +++ b/src/main/java/org/gcube/datatransfer/resolver/services/GeonetworkResolver.java @@ -26,8 +26,6 @@ import javax.ws.rs.core.StreamingOutput; import org.apache.commons.io.IOUtils; import org.gcube.common.scope.api.ScopeProvider; -import org.gcube.datatransfer.resolver.GeonetworkRequestFilterParameters.MODE; -import org.gcube.datatransfer.resolver.GeonetworkRequestFilterParameters.VISIBILITY; import org.gcube.datatransfer.resolver.SingleFileStreamingOutput; import org.gcube.datatransfer.resolver.gis.GeonetworkAccessParameter; import org.gcube.datatransfer.resolver.gis.GeonetworkInstance; @@ -35,6 +33,8 @@ import org.gcube.datatransfer.resolver.gis.GeonetworkServiceInterface; import org.gcube.datatransfer.resolver.gis.exception.GeonetworkInstanceException; import org.gcube.datatransfer.resolver.gis.geonetwork.FilterGetRecords; import org.gcube.datatransfer.resolver.gis.geonetwork.GNAuthentication; +import org.gcube.datatransfer.resolver.gis.geonetwork.GeonetworkRequestFilterParameters.MODE; +import org.gcube.datatransfer.resolver.gis.geonetwork.GeonetworkRequestFilterParameters.VISIBILITY; import org.gcube.datatransfer.resolver.gis.geonetwork.ReusableInputStream; import org.gcube.datatransfer.resolver.services.error.ExceptionManager; import org.gcube.datatransfer.resolver.services.exceptions.InternalServerException; diff --git a/src/main/java/org/gcube/datatransfer/resolver/services/StorageIDResolver.java b/src/main/java/org/gcube/datatransfer/resolver/services/StorageIDResolver.java index f272a20..399e554 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/services/StorageIDResolver.java +++ b/src/main/java/org/gcube/datatransfer/resolver/services/StorageIDResolver.java @@ -62,7 +62,6 @@ public class StorageIDResolver { */ @GET @Path("{storage-id}") - //@Path("{storage-id}") public Response getStorageId(@Context HttpServletRequest httpRequest, @PathParam(STORAGE_ID) String storageId, @QueryParam(ConstantsResolver.QUERY_PARAM_FILE_NAME) String fileName, @QueryParam(ConstantsResolver.QUERY_PARAM_CONTENT_TYPE) String contentType, @QueryParam(ConstantsResolver.QUERY_PARAM_VALIDATION) Boolean validation) { logger.info(this.getClass().getSimpleName()+" GET starts..."); //Checking mandatory parameter storageId diff --git a/src/test/java/rest/TestResolvers.java b/src/test/java/rest/TestResolvers.java index 01760f3..08c2fe1 100644 --- a/src/test/java/rest/TestResolvers.java +++ b/src/test/java/rest/TestResolvers.java @@ -19,7 +19,6 @@ import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; import org.apache.http.HttpStatus; import org.gcube.datatransfer.resolver.util.HTTPCallsUtils; -import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -254,7 +253,7 @@ public class TestResolvers { * * @throws Exception the exception */ - @Test + //Test public void testCatalogueResolverCreatePubrivatItemURL() throws Exception{ String entityName = "dynamic_reporting";