From 08838cb6d64de782505f3bbb7141ddef5f2d1cf0 Mon Sep 17 00:00:00 2001 From: lucio Date: Mon, 25 Jul 2022 11:00:44 +0200 Subject: [PATCH] removed vos from frontpage --- .../resource/FrontPageResource.java | 31 +------------------ .../request/RequestAccounting.java | 4 --- .../application/request/RequestValidator.java | 5 +-- src/main/resources/META-INF/frontpage.html | 2 +- 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/src/main/java/org/gcube/smartgears/extensions/resource/FrontPageResource.java b/src/main/java/org/gcube/smartgears/extensions/resource/FrontPageResource.java index 2e3101c..6fa5b37 100644 --- a/src/main/java/org/gcube/smartgears/extensions/resource/FrontPageResource.java +++ b/src/main/java/org/gcube/smartgears/extensions/resource/FrontPageResource.java @@ -91,37 +91,8 @@ public class FrontPageResource extends ApiResource { values.put("version", context().configuration().version()); String infrastructure = context().container().configuration().infrastructure(); - StringBuilder voValue = new StringBuilder(); - - Set vos = new HashSet(); - - //pre-process - for (String scope : context().container().configuration().authorizationProvider().getContexts()) { - ContextBean bean = new ContextBean(scope); - switch (bean.type()) { - case INFRASTRUCTURE: - infrastructure = bean.name(); - break; - case VO: - vos.add(bean.name()); - break; - case VRE: - vos.add(bean.enclosingScope().name()); - infrastructure=bean.enclosingScope().enclosingScope().name(); - } - } - - //build vo value - int i = 0; - int max = vos.size()-1; - for (String vo : vos) { - String voPrefix = i == 0 ? "" : (i==max?" and ":", "); - voValue.append(voPrefix+"" + vo + ""); - i++; - } - + values.put("infra", infrastructure); - values.put("vos", voValue.toString()); values.put("status", context().lifecycle().state().toString()); diff --git a/src/main/java/org/gcube/smartgears/handlers/application/request/RequestAccounting.java b/src/main/java/org/gcube/smartgears/handlers/application/request/RequestAccounting.java index f7ec851..a815151 100644 --- a/src/main/java/org/gcube/smartgears/handlers/application/request/RequestAccounting.java +++ b/src/main/java/org/gcube/smartgears/handlers/application/request/RequestAccounting.java @@ -2,8 +2,6 @@ package org.gcube.smartgears.handlers.application.request; import java.util.concurrent.TimeUnit; -import javax.xml.bind.annotation.XmlRootElement; - import org.gcube.accounting.datamodel.UsageRecord.OperationResult; import org.gcube.accounting.datamodel.usagerecords.ServiceUsageRecord; import org.gcube.accounting.persistence.AccountingPersistence; @@ -21,7 +19,6 @@ import org.slf4j.LoggerFactory; import io.micrometer.core.instrument.Metrics; -@XmlRootElement(name = Constants.request_accounting) public class RequestAccounting extends RequestHandler { private static Logger log = LoggerFactory.getLogger(RequestAccounting.class); @@ -47,7 +44,6 @@ public class RequestAccounting extends RequestHandler { if (calledMethod.isEmpty()) calledMethod = "/"; calledMethod= e.request().getMethod()+" "+calledMethod; - InnerMethodName.instance.set(calledMethod); } diff --git a/src/main/java/org/gcube/smartgears/handlers/application/request/RequestValidator.java b/src/main/java/org/gcube/smartgears/handlers/application/request/RequestValidator.java index fb2339c..e8df27a 100644 --- a/src/main/java/org/gcube/smartgears/handlers/application/request/RequestValidator.java +++ b/src/main/java/org/gcube/smartgears/handlers/application/request/RequestValidator.java @@ -7,8 +7,6 @@ import static org.gcube.smartgears.handlers.application.request.RequestError.inv import java.util.Set; -import javax.xml.bind.annotation.XmlRootElement; - import org.gcube.common.security.ContextBean; import org.gcube.common.security.ContextBean.Type; import org.gcube.common.security.providers.SecretManagerProvider; @@ -25,7 +23,6 @@ import org.gcube.smartgears.handlers.application.ResponseEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@XmlRootElement(name = Constants.request_validation) public class RequestValidator extends RequestHandler { private static Logger log = LoggerFactory.getLogger(RequestValidator.class); @@ -119,7 +116,7 @@ public class RequestValidator extends RequestHandler { } private void validatePolicy(RequestEvent call){ - //TODO: must be re-think + //TODO: must be rethought } private Secret getSecret(RequestEvent call){ diff --git a/src/main/resources/META-INF/frontpage.html b/src/main/resources/META-INF/frontpage.html index 2b587fb..70eaf93 100644 --- a/src/main/resources/META-INF/frontpage.html +++ b/src/main/resources/META-INF/frontpage.html @@ -104,7 +104,7 @@

Welcome to ${name},

-

a resource of the ${infra} infrastructure shared in ${vos} VOs.

+

a resource of the ${infra} infrastructure

The resource is ${status}.