LMCL 1.4.4 - Nexus auth support 35/6535/1 3.0.3
authorjustin14 <justin.early@est.tech>
Wed, 26 Feb 2020 18:46:45 +0000 (10:46 -0800)
committerjustin14 <justin.early@est.tech>
Wed, 26 Feb 2020 18:46:45 +0000 (10:46 -0800)
- LicenseAsset support NexusArtifactClient

Change-Id: I15920c2b8f8d738f19853d6c7718a44f3b53cbe6
Issue-Id: ACUMOS-3960
Signed-off-by: justin14 <justin.early@est.tech>
acumos-fgw-client/pom.xml
docs/release-notes.rst
gateway/pom.xml
gateway/src/main/java/org/acumos/federation/gateway/Clients.java

index 3ecfe7e..0384829 100644 (file)
@@ -27,7 +27,7 @@ limitations under the License.
        </parent>
        <groupId>org.acumos.federation</groupId>
        <artifactId>acumos-fgw-client</artifactId>
-       <version>3.0.2-SNAPSHOT</version>
+       <version>3.0.3-SNAPSHOT</version>
        <name>Federation Gateway Client</name>
        <properties>
                <!-- dependency versions -->
index fa02470..873e516 100644 (file)
@@ -23,6 +23,10 @@ Federation Gateway Release Notes
 This server is available as a Docker image in a Docker registry at the Linux Foundation.
 The image name is "federation-gateway" and the tag is a version string as shown below.
 
+Version 3.0.3, 2020-02-26
+-------------------------
+* LicenseAsset support NexusArtifactClient - `ACUMOS-3960 <https://jira.acumos.org/browse/ACUMOS-3960>`_
+
 Version 3.0.2, 2019-11-04
 -------------------------
 * Don't re-tag imported docker images unless the tag is different (`ACUMOS-3670 <https://jira.acumos.org/browse/ACUMOS-3670>`_)
index e4c71c3..1c771ff 100644 (file)
@@ -27,7 +27,7 @@
        </parent>
        <groupId>org.acumos.federation</groupId>
        <artifactId>gateway</artifactId>
-       <version>3.0.2-SNAPSHOT</version>
+       <version>3.0.3-SNAPSHOT</version>
        <name>Federation Gateway</name>
        <description>Federated Acumos Interface for inter-acumos communication</description>
        <properties>
                <dependency>
                        <groupId>org.acumos.license-manager</groupId>
                        <artifactId>license-manager-client-library</artifactId>
-                       <version>1.4.1</version>
+                       <version>1.4.4</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.acumos.acumos-nexus-client</groupId>
+                       <artifactId>acumos-nexus-client</artifactId>
+                       <version>2.2.1</version>
                </dependency>
                <!-- Compile time only dependencies -->
                <dependency>
index a3a2b98..e72f10c 100644 (file)
@@ -35,6 +35,8 @@ import org.acumos.federation.client.FederationClient;
 import org.acumos.securityverification.service.ISecurityVerificationClientService;
 import org.acumos.securityverification.service.SecurityVerificationClientServiceImpl;
 import org.acumos.licensemanager.client.rtu.LicenseAsset;
+import org.acumos.nexus.client.NexusArtifactClient;
+import org.acumos.nexus.client.RepositoryLocation;
 
 /**
  * Defines all beans used to access outside services.
@@ -78,6 +80,7 @@ public class Clients {
 
        private ICommonDataServiceRestClient cdsClient;
        private NexusClient nexusClient;
+       private NexusArtifactClient nexusArtifactClient;
        private ISecurityVerificationClientService svClient;
        private LicenseAsset lmClient;
 
@@ -114,6 +117,19 @@ public class Clients {
                return nexusClient;
        }
 
+       public synchronized NexusArtifactClient getNexusArtifactClient() {
+               if (nexusArtifactClient == null) {
+                       RepositoryLocation repositoryLocation = new RepositoryLocation();
+                       repositoryLocation.setId("1");
+                       repositoryLocation.setUrl(nexusConfig.getUrl());
+                       repositoryLocation.setUsername(nexusConfig.getUsername());
+                       repositoryLocation.setPassword(nexusConfig.getPassword());
+                       // TODO http proxy setup? asking this should be automatic based on https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html
+                       nexusArtifactClient = new NexusArtifactClient(repositoryLocation);
+               }
+               return nexusArtifactClient;
+       }
+
        public synchronized DockerClient getDockerClient() {
                /*
                 * For some reason, the DockerClient seems to go stale,
@@ -154,7 +170,7 @@ public class Clients {
 
        public synchronized LicenseAsset getLMClient() {
                if (lmClient == null) {
-                       lmClient = new LicenseAsset(getCDSClient(), lmConfig.getUrl(), nexusConfig.getUrl().replaceAll("/*$", "") + "/");
+                       lmClient = new LicenseAsset(getCDSClient(), lmConfig.getUrl(), getNexusArtifactClient());
                }
                return lmClient;
        }