From ad0c2e2e67930b0e488edd9f9cf7320d73d5eccd Mon Sep 17 00:00:00 2001 From: lucio Date: Tue, 4 Apr 2023 09:30:03 +0200 Subject: [PATCH] updated --- pom.xml | 19 +++++++++++-------- .../ApplicationProfileBuilder.java | 8 ++++---- .../container/ContainerProfileBuilder.java | 16 ++++++++-------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index ff19a00..33db744 100644 --- a/pom.xml +++ b/pom.xml @@ -6,19 +6,16 @@ legacy-is-publisher-connector 1.0.0-SNAPSHOT Legacy is publisher - scm:git:https://code-repo.d4science.org/gCubeSystem/legacy-is-publisher-connector scm:git:https://code-repo.d4science.org/gCubeSystem/legacy-is-publisher-connector https://code-repo.d4science.org/gCubeSystem/legacy-is-publisher-connector - maven-parent org.gcube.tools 1.1.0 - @@ -30,7 +27,6 @@ - org.slf4j @@ -52,11 +48,9 @@ org.gcube.resources.discovery ic-client - org.gcube.resources common-gcore-resources - [1.0.0,2.0.0-SNAPSHOT) javax.servlet @@ -64,7 +58,16 @@ 4.0.1 provided - + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + com.sun.xml.ws + rt + 2.3.3 + - \ No newline at end of file diff --git a/src/main/java/org/gcube/common/core/publisher/is/legacy/application/ApplicationProfileBuilder.java b/src/main/java/org/gcube/common/core/publisher/is/legacy/application/ApplicationProfileBuilder.java index 04db9b9..718d812 100644 --- a/src/main/java/org/gcube/common/core/publisher/is/legacy/application/ApplicationProfileBuilder.java +++ b/src/main/java/org/gcube/common/core/publisher/is/legacy/application/ApplicationProfileBuilder.java @@ -39,9 +39,9 @@ public class ApplicationProfileBuilder { endpoint.profile() .description(configuration.description()) .serviceName(configuration.name()) - .serviceClass(configuration.serviceClass()) + .serviceClass(configuration.group()) .version(configuration.version()) - .serviceId(configuration.name() + configuration.serviceClass() + configuration.version()) + .serviceId(configuration.name() + configuration.group() + configuration.version()) .ghnId(context.container().id()); endpoint.profile().newDeploymentData() @@ -53,8 +53,8 @@ public class ApplicationProfileBuilder { endpoint.profile().endpoints().clear(); String baseAddress; - if (configuration.proxyAddress()!=null){ - ProxyAddress proxy = configuration.proxyAddress(); + if (configuration.proxable() && container.proxy()!=null){ + ProxyAddress proxy = container.proxy(); String protocol = proxy.getProtocol(); String port = proxy.getPort()!=null?":"+proxy.getPort():""; diff --git a/src/main/java/org/gcube/common/core/publisher/is/legacy/container/ContainerProfileBuilder.java b/src/main/java/org/gcube/common/core/publisher/is/legacy/container/ContainerProfileBuilder.java index 4b7f7cc..87bdecb 100644 --- a/src/main/java/org/gcube/common/core/publisher/is/legacy/container/ContainerProfileBuilder.java +++ b/src/main/java/org/gcube/common/core/publisher/is/legacy/container/ContainerProfileBuilder.java @@ -21,8 +21,8 @@ import org.gcube.common.resources.gcore.HostingNode.Profile.NodeDescription.GHNT import org.gcube.common.resources.gcore.HostingNode.Profile.NodeDescription.Processor; import org.gcube.common.resources.gcore.HostingNode.Profile.NodeDescription.Variable; import org.gcube.common.resources.gcore.utils.Group; +import org.gcube.smartgears.configuration.SmartgearsConfiguration; import org.gcube.smartgears.configuration.container.ContainerConfiguration; -import org.gcube.smartgears.configuration.library.SmartGearsConfiguration; import org.gcube.smartgears.context.container.ContainerContext; import org.gcube.smartgears.provider.ProviderFactory; import org.slf4j.Logger; @@ -84,7 +84,7 @@ public class ContainerProfileBuilder { processors.add().bogomips(new BigDecimal(map.get("bogomips"))) .clockSpeedMhz(new BigDecimal(map.get("cpu_MHz"))).family(map.get("cpu_family")) .modelName(map.get("model_name")).model(map.get("model")).vendor(map.get("vendor_id")) - .cacheL1(new Integer(map.get("cache_size"))).cacheL1D(0).cacheL1I(0).cacheL2(0); + .cacheL1(Integer.parseInt(map.get("cache_size"))).cacheL1D(0).cacheL1I(0).cacheL2(0); addVariablesTo(node); @@ -194,7 +194,7 @@ public class ContainerProfileBuilder { private long getFreeSpace() { long free = 0; try { - free = context.configuration().persistence().getFreeSpace()/1024; + free = context.persistenceWriter().getFreeSpace()/1024; } catch (Exception ioe) { log.warn("unable to detect the free space on the disk", ioe); } @@ -275,8 +275,8 @@ public class ContainerProfileBuilder { variables.add().keyAndValue("Java", System.getProperty("java.version")); - SmartGearsConfiguration config = ProviderFactory.provider().smartgearsConfiguration(); - variables.add().keyAndValue("SmartGears",config.version()); + SmartgearsConfiguration config = ProviderFactory.provider().smartgearsConfiguration(); + variables.add().keyAndValue("SmartGears",config.getVersion()); variables.add().keyAndValue("ghn-update-interval-in-secs", String.valueOf(cfg.publicationFrequency())); @@ -315,9 +315,9 @@ public class ContainerProfileBuilder { Pattern p = Pattern.compile("^(.*?)\\s{1}(.*?)\\s{1}(.*?)\\s{1}(.*)$"); Matcher matcher = p.matcher(content.toString()); if ((matcher.matches()) && (matcher.groupCount() > 3)) { - result.put("1min", new Double(matcher.group(1))); - result.put("5mins", new Double(matcher.group(2))); - result.put("15mins", new Double(matcher.group(3).split("\\s")[0])); + result.put("1min", Double.valueOf(matcher.group(1))); + result.put("5mins", Double.valueOf(matcher.group(2))); + result.put("15mins", Double.valueOf(matcher.group(3).split("\\s")[0])); } } } catch (Exception ioe) {