From 23cadb7e585822daa649be68f5c57c18fb1e20ea Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Wed, 15 Sep 2021 19:06:48 +0200 Subject: [PATCH] fixed pom --- pom.xml | 6 +- .../org/gcube/portal/ddas/BrokerResponse.java | 63 +++++++++++++++++++ .../org/gcube/portal/ddas/DdasVREService.java | 7 ++- 3 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 src/main/java/org/gcube/portal/ddas/BrokerResponse.java diff --git a/pom.xml b/pom.xml index 1a07ed2..b26f218 100644 --- a/pom.xml +++ b/pom.xml @@ -9,11 +9,11 @@ 4.0.0 + org.gcube.portal.bc.ddas DDAS-VRE-Servlet - - war 1.0.0-SNAPSHOT + war scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git @@ -21,7 +21,7 @@ DDAS-VRE-Servlet Webapp - .... + This component is a servlet responding to the push performed by Blue-Cloud Data Discovery and Access Service to move data downlaods onto the VRE 1.8 6.2.5 diff --git a/src/main/java/org/gcube/portal/ddas/BrokerResponse.java b/src/main/java/org/gcube/portal/ddas/BrokerResponse.java new file mode 100644 index 0000000..50990fd --- /dev/null +++ b/src/main/java/org/gcube/portal/ddas/BrokerResponse.java @@ -0,0 +1,63 @@ +package org.gcube.portal.ddas; + +import java.net.URL; +import java.time.Instant; + +public class BrokerResponse { + private int status; + private String message; + private long timeStamp; + private URL vreConfirmUrl; + + public BrokerResponse() { + } + + public BrokerResponse(int status, String message, URL vreConfirmUrl) { + super(); + this.status = status; + this.message = message; + this.vreConfirmUrl = vreConfirmUrl; + Instant instant = Instant.now(); + this.timeStamp = instant.toEpochMilli(); + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public long getTimeStamp() { + return timeStamp; + } + + public void setTimeStamp(long timeStamp) { + this.timeStamp = timeStamp; + } + + public URL getVreConfirmUrl() { + return vreConfirmUrl; + } + + public void setVreConfirmUrl(URL vreConfirmUrl) { + this.vreConfirmUrl = vreConfirmUrl; + } + + @Override + public String toString() { + return "BrokerResponse [status=" + status + ", message=" + message + ", timeStamp=" + timeStamp + + ", vreConfirmUrl=" + vreConfirmUrl + "]"; + } + + +} diff --git a/src/main/java/org/gcube/portal/ddas/DdasVREService.java b/src/main/java/org/gcube/portal/ddas/DdasVREService.java index 618d047..4d7a65b 100644 --- a/src/main/java/org/gcube/portal/ddas/DdasVREService.java +++ b/src/main/java/org/gcube/portal/ddas/DdasVREService.java @@ -84,7 +84,12 @@ public class DdasVREService extends HttpServlet { response.getWriter().write(toReturn); } - + /** + * the method writes the request JSON in the memcached for @see CACHE_SECONDS_EXPIRATION seconds + * @param requestId + * @param jsonObject + * @return true if the operations is successful + */ private boolean authorizeRequest(String requestId,JsonObject jsonObject) { OperationFuture writeOp = null; try {