diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 068f0a5..e322491 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,6 @@ - + + @@ -12,7 +13,8 @@ - + + @@ -25,7 +27,8 @@ - + + @@ -38,7 +41,8 @@ - + + @@ -51,7 +55,8 @@ - + + @@ -64,7 +69,11 @@ - + + uses + + + @@ -77,7 +86,8 @@ - + + @@ -90,7 +100,8 @@ - + + @@ -103,7 +114,8 @@ - + + diff --git a/src/main/java/org/gcube/datatransfer/resolver/services/GeoportalResolver.java b/src/main/java/org/gcube/datatransfer/resolver/services/GeoportalResolver.java index 97057d8..1a01614 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/services/GeoportalResolver.java +++ b/src/main/java/org/gcube/datatransfer/resolver/services/GeoportalResolver.java @@ -46,19 +46,19 @@ import com.google.common.cache.CacheLoader.InvalidCacheLoadException; * * Mar 23, 2023 */ -@Path("") +@Path("/") public class GeoportalResolver { public static final String GEO_DE = "geo-de"; public static final String GEO = "geo"; public static final String GEO_DV = "geo-dv"; - + private static final String QP_RESOLVE_AS = "res"; private static final String PATH_PROJECT_ID = "project_id"; private static final String PATH_USECASE_ID = "usecase_id"; private static final String PATH_VRE_NAME = "vre_name"; private static final String PATH_TARGET_APP = "targetAppId"; - + private static final Logger LOG = LoggerFactory.getLogger(GeoportalResolver.class); private static String helpURI = "https://wiki.gcube-system.org/gcube/URI_Resolver#Geoportal_Resolver"; @@ -85,7 +85,7 @@ public class GeoportalResolver { * @throws WebApplicationException the web application exception */ @GET - @Path(GEO+"/{vre_name}/{usecase_id}/{project_id}") + @Path(GEO + "/{vre_name}/{usecase_id}/{project_id}") public Response resolveGeoportal(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName, @PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID, @QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException { @@ -94,47 +94,47 @@ public class GeoportalResolver { } - /** - * Resolve geoportal DV. - * - * @param req the req - * @param vreName the vre name - * @param ucdID the ucd ID - * @param projectID the project ID - * @param resolveAs the resolve as - * @return the response - * @throws WebApplicationException the web application exception - */ - @GET - @Path(GEO_DV+"/{vre_name}/{usecase_id}/{project_id}") - public Response resolveGeoportalDV(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName, - @PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID, - @QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException { - String targetAppId = GEO_DV; - return genericGet(req, targetAppId, vreName, ucdID, projectID, resolveAs); - - } - - /** - * Resolve geoportal DE. - * - * @param req the req - * @param vreName the vre name - * @param ucdID the ucd ID - * @param projectID the project ID - * @param resolveAs the resolve as - * @return the response - * @throws WebApplicationException the web application exception - */ - @GET - @Path(GEO_DE+"/{vre_name}/{usecase_id}/{project_id}") - public Response resolveGeoportalDE(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName, - @PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID, - @QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException { - String targetAppId = GEO_DE; - return genericGet(req, targetAppId, vreName, ucdID, projectID, resolveAs); - - } +// /** +// * Resolve geoportal DV. +// * +// * @param req the req +// * @param vreName the vre name +// * @param ucdID the ucd ID +// * @param projectID the project ID +// * @param resolveAs the resolve as +// * @return the response +// * @throws WebApplicationException the web application exception +// */ +// @GET +// @Path(GEO_DV + "/{vre_name}/{usecase_id}/{project_id}") +// public Response resolveGeoportalDV(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName, +// @PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID, +// @QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException { +// String targetAppId = GEO_DV; +// return genericGet(req, targetAppId, vreName, ucdID, projectID, resolveAs); +// +// } +// +// /** +// * Resolve geoportal DE. +// * +// * @param req the req +// * @param vreName the vre name +// * @param ucdID the ucd ID +// * @param projectID the project ID +// * @param resolveAs the resolve as +// * @return the response +// * @throws WebApplicationException the web application exception +// */ +// @GET +// @Path(GEO_DE + "/{vre_name}/{usecase_id}/{project_id}") +// public Response resolveGeoportalDE(@Context HttpServletRequest req, @PathParam(PATH_VRE_NAME) String vreName, +// @PathParam(PATH_USECASE_ID) String ucdID, @PathParam(PATH_PROJECT_ID) String projectID, +// @QueryParam(QP_RESOLVE_AS) String resolveAs) throws WebApplicationException { +// String targetAppId = GEO_DE; +// return genericGet(req, targetAppId, vreName, ucdID, projectID, resolveAs); +// +// } /** * Create a Catalogue Link. @@ -148,45 +148,48 @@ public class GeoportalResolver { @Path(GEO) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.TEXT_PLAIN) - public Response postGeoportal(@Context HttpServletRequest req, GeoportalRequest jsonRequest) throws WebApplicationException { + public Response postGeoportal(@Context HttpServletRequest req, GeoportalRequest jsonRequest) + throws WebApplicationException { LOG.info(this.getClass().getSimpleName() + " POST starts..."); String targetAppId = GEO; return genericPost(req, jsonRequest, targetAppId); } - /** - * Post geoportal DV. - * - * @param req the req - * @param jsonRequest the json request - * @return the response - * @throws WebApplicationException the web application exception - */ - @Path(GEO_DV) - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.TEXT_PLAIN) - public Response postGeoportalDV(@Context HttpServletRequest req, GeoportalRequest jsonRequest) throws WebApplicationException { - LOG.info(this.getClass().getSimpleName() + " POST starts..."); - String targetAppId = GEO_DV; - return genericPost(req, jsonRequest, targetAppId); - } - - /** - * Post geoportal DE. - * - * @param req the req - * @param jsonRequest the json request - * @return the response - * @throws WebApplicationException the web application exception - */ - @Path(GEO_DE) - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.TEXT_PLAIN) - public Response postGeoportalDE(@Context HttpServletRequest req, GeoportalRequest jsonRequest) throws WebApplicationException { - LOG.info(this.getClass().getSimpleName() + " POST starts..."); - String targetAppId = GEO_DE; - return genericPost(req, jsonRequest, targetAppId); - } +// /** +// * Post geoportal DV. +// * +// * @param req the req +// * @param jsonRequest the json request +// * @return the response +// * @throws WebApplicationException the web application exception +// */ +// @Path(GEO_DV) +// @Consumes(MediaType.APPLICATION_JSON) +// @Produces(MediaType.TEXT_PLAIN) +// public Response postGeoportalDV(@Context HttpServletRequest req, GeoportalRequest jsonRequest) +// throws WebApplicationException { +// LOG.info(this.getClass().getSimpleName() + " POST starts..."); +// String targetAppId = GEO_DV; +// return genericPost(req, jsonRequest, targetAppId); +// } +// +// /** +// * Post geoportal DE. +// * +// * @param req the req +// * @param jsonRequest the json request +// * @return the response +// * @throws WebApplicationException the web application exception +// */ +// @Path(GEO_DE) +// @Consumes(MediaType.APPLICATION_JSON) +// @Produces(MediaType.TEXT_PLAIN) +// public Response postGeoportalDE(@Context HttpServletRequest req, GeoportalRequest jsonRequest) +// throws WebApplicationException { +// LOG.info(this.getClass().getSimpleName() + " POST starts..."); +// String targetAppId = GEO_DE; +// return genericPost(req, jsonRequest, targetAppId); +// } /** * Generic get.