From 82e8674d2ceb0090af4ea5b1732a83df1f5eb4f7 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 23 Apr 2024 15:17:02 +0200 Subject: [PATCH] added javadoc to GeoportalExporter --- README.md | 6 ++-- .../resolver/services/GeoportalExporter.java | 28 +++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index fa871ef..e98a7cd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # gCube URI Resolver -The URI Resolver is a RESTful service which gives access via HTTP(s) to different gCube Resolver services and gCube Applications +The URI Resolver is a RESTful service which gives access via HTTP(s) to different gCube Resolver services and gCube Applications. + +The URI Resolver production service is available at [D4Science URI Resolver](https://data.d4science.org/) ## Built With @@ -11,7 +13,7 @@ The URI Resolver is a RESTful service which gives access via HTTP(s) to differen You can find the URI Resolver documentation at [URI Resolver Wiki Page](https://wiki.gcube-system.org/gcube/URI_Resolver) -The API documentation accessible by [links](https://wiki.gcube-system.org/gcube/URI_Resolver#Instances) is provided by [Enunciate](https://github.com/stoicflame/enunciate/) +The API documentation accessible by this [link](https://wiki.gcube-system.org/gcube/URI_Resolver#Instances) is provided by [Enunciate](https://github.com/stoicflame/enunciate/) ## Change log diff --git a/src/main/java/org/gcube/datatransfer/resolver/services/GeoportalExporter.java b/src/main/java/org/gcube/datatransfer/resolver/services/GeoportalExporter.java index 692a0cc..71949ed 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/services/GeoportalExporter.java +++ b/src/main/java/org/gcube/datatransfer/resolver/services/GeoportalExporter.java @@ -80,11 +80,13 @@ public class GeoportalExporter { * Export. * * @param req the req - * @param export_type the export type + * @param export_type the export type. Must be a value of the enum + * {#ACCEPTED_EXPORT_TYPE} * @param ucdID the ucd ID * @param projectID the project ID - * @param asURL the as URL - * @return the response + * @param asURL the as URL. If true returns the project exported as an URL + * in the response + * @return the response. Can be an URL or a Stream of the project exported. * @throws WebApplicationException the web application exception */ @GET @@ -141,8 +143,8 @@ public class GeoportalExporter { + " seems to be not configured in the context: " + context, this.getClass(), helpURI); } + // if the configuration exists in the context if (checked) { - if (getAsURL) { try { LOG.info("Serving request as getAsURL..."); @@ -219,11 +221,12 @@ public class GeoportalExporter { } /** - * Healthcheck. - * + * Healthcheck. Checks if the export facility is configured in the context (i.e. + * the scope read from input token). + * * @param req the req * @param export_type the export type - * @return the response + * @return an object of type {#GeoportalJsonResponse) that contains the response * @throws WebApplicationException the web application exception */ @GET @@ -275,11 +278,14 @@ public class GeoportalExporter { } /** - * View job. + * View job. Check the job export status. * * @param req the req - * @param jobCode the job code - * @return the response + * @param jobCode the job code. The job ID assigned by export facility that + * returns a waiting HTML page + * @return the response. It is a {#GeoportalJsonResponse} with the status of the + * job. An export job completed contains the URL of the project + * exported. * @throws WebApplicationException the web application exception */ @GET @@ -307,7 +313,7 @@ public class GeoportalExporter { if (fetchedPDF == null) { theJson.setState(Status.NOT_FOUND.getReasonPhrase()); - theJson.setMessage("No job found with id: "+jobCode); + theJson.setMessage("No job found with id: " + jobCode); try { jsonReponse = responseToString(theJson); LOG.info("viewJob returning not found: " + jsonReponse);