diff options
Diffstat (limited to 'adaptors')
68 files changed, 487 insertions, 439 deletions
diff --git a/adaptors/aai-service/installer/pom.xml b/adaptors/aai-service/installer/pom.xml index f94485ac5..22667f017 100755 --- a/adaptors/aai-service/installer/pom.xml +++ b/adaptors/aai-service/installer/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/aai-service/pom.xml b/adaptors/aai-service/pom.xml index 25f0e5d4c..fdebd90c1 100755 --- a/adaptors/aai-service/pom.xml +++ b/adaptors/aai-service/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/aai-service/provider/pom.xml b/adaptors/aai-service/provider/pom.xml index 8b6eade1c..d9bbb0e64 100755 --- a/adaptors/aai-service/provider/pom.xml +++ b/adaptors/aai-service/provider/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> @@ -36,6 +36,7 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> + <version>3.12.4</version> <scope>test</scope> </dependency> <dependency> diff --git a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java index d3f79db8d..3ededcc54 100755 --- a/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java +++ b/adaptors/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java @@ -52,6 +52,7 @@ import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocketFactory; import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.ObjectUtils; import org.onap.ccsdk.sli.adaptors.aai.AAIService.TransactionIdTracker; import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; import org.onap.ccsdk.sli.adaptors.aai.data.ErrorResponse; @@ -160,8 +161,9 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface { } catch (Exception ex) { LOG.error("AAIResource", ex); } - - ctx.init(kmf.getKeyManagers(), null, null); + if (ObjectUtils.anyNotNull(kmf)) { + ctx.init(kmf.getKeyManagers(), null, null); + } CTX = ctx; LOG.debug("SSLContext created"); diff --git a/adaptors/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java b/adaptors/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java index 66d34a8b8..0edb9d3f6 100755 --- a/adaptors/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java +++ b/adaptors/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfTest.java @@ -2,8 +2,8 @@ * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ - * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights - * reserved. + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2022 Samsung Electronics Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,6 +48,7 @@ import org.onap.ccsdk.sli.adaptors.aai.AAIClient; import org.onap.ccsdk.sli.adaptors.aai.AAIRequest; import org.onap.ccsdk.sli.adaptors.aai.AAIService; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; import org.onap.aai.inventory.v25.GenericVnf; import org.slf4j.Logger; @@ -106,13 +107,8 @@ public class GenericVnfTest { QueryStatus resp = client.save("generic-vnf", false, false, "generic-vnf.vnf-id = '"+uuid+"'", data, "aaidata", ctx); assertNotNull(ctx); - - } - catch (Throwable e) - { - - } - ; + } + catch (SvcLogicException ignored) { }; } @Test diff --git a/adaptors/ansible-adaptor/ansible-adaptor-bundle/pom.xml b/adaptors/ansible-adaptor/ansible-adaptor-bundle/pom.xml index 05dddb3e4..e444ede97 100644 --- a/adaptors/ansible-adaptor/ansible-adaptor-bundle/pom.xml +++ b/adaptors/ansible-adaptor/ansible-adaptor-bundle/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/ansible-adaptor/ansible-adaptor-installer/pom.xml b/adaptors/ansible-adaptor/ansible-adaptor-installer/pom.xml index 005b3fdcd..9432b65bb 100644 --- a/adaptors/ansible-adaptor/ansible-adaptor-installer/pom.xml +++ b/adaptors/ansible-adaptor/ansible-adaptor-installer/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/ansible-adaptor/pom.xml b/adaptors/ansible-adaptor/pom.xml index 261931f36..d0b5ef0e1 100644 --- a/adaptors/ansible-adaptor/pom.xml +++ b/adaptors/ansible-adaptor/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/artifacts/pom.xml b/adaptors/artifacts/pom.xml index e24a3b0e1..7ab4ff229 100755 --- a/adaptors/artifacts/pom.xml +++ b/adaptors/artifacts/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/base/http/installer/pom.xml b/adaptors/base/http/installer/pom.xml index b0791ddc3..858670f0e 100644 --- a/adaptors/base/http/installer/pom.xml +++ b/adaptors/base/http/installer/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/base/http/pom.xml b/adaptors/base/http/pom.xml index dc84db7ce..5f9d0cc57 100644 --- a/adaptors/base/http/pom.xml +++ b/adaptors/base/http/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/base/http/provider/pom.xml b/adaptors/base/http/provider/pom.xml index 2b1b8b1f1..5ee3b0005 100644 --- a/adaptors/base/http/provider/pom.xml +++ b/adaptors/base/http/provider/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/base/pom.xml b/adaptors/base/pom.xml index d5ebb3feb..6df1a7fe1 100644 --- a/adaptors/base/pom.xml +++ b/adaptors/base/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/chef-adaptor/chef-adaptor-bundle/pom.xml b/adaptors/chef-adaptor/chef-adaptor-bundle/pom.xml index 070cb3dac..c40cd1fb7 100644 --- a/adaptors/chef-adaptor/chef-adaptor-bundle/pom.xml +++ b/adaptors/chef-adaptor/chef-adaptor-bundle/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/chef-adaptor/chef-adaptor-installer/pom.xml b/adaptors/chef-adaptor/chef-adaptor-installer/pom.xml index 114cafb3c..eb336c8f4 100644 --- a/adaptors/chef-adaptor/chef-adaptor-installer/pom.xml +++ b/adaptors/chef-adaptor/chef-adaptor-installer/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/chef-adaptor/pom.xml b/adaptors/chef-adaptor/pom.xml index 5c4c84f81..75b2aeaa0 100644 --- a/adaptors/chef-adaptor/pom.xml +++ b/adaptors/chef-adaptor/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-aai-service/pom.xml b/adaptors/features/ccsdk-aai-service/pom.xml index aa79e1050..1ad093972 100644 --- a/adaptors/features/ccsdk-aai-service/pom.xml +++ b/adaptors/features/ccsdk-aai-service/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-ansible-adaptor/pom.xml b/adaptors/features/ccsdk-ansible-adaptor/pom.xml index 586291bf4..1e73ac46f 100644 --- a/adaptors/features/ccsdk-ansible-adaptor/pom.xml +++ b/adaptors/features/ccsdk-ansible-adaptor/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-base-http/pom.xml b/adaptors/features/ccsdk-base-http/pom.xml index 4570a81c5..e21e4e741 100644 --- a/adaptors/features/ccsdk-base-http/pom.xml +++ b/adaptors/features/ccsdk-base-http/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-chef-adaptor/pom.xml b/adaptors/features/ccsdk-chef-adaptor/pom.xml index 61f7abb85..b23788520 100644 --- a/adaptors/features/ccsdk-chef-adaptor/pom.xml +++ b/adaptors/features/ccsdk-chef-adaptor/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-iaas-adaptor/pom.xml b/adaptors/features/ccsdk-iaas-adaptor/pom.xml index 1ed6ce373..606fa4aa7 100644 --- a/adaptors/features/ccsdk-iaas-adaptor/pom.xml +++ b/adaptors/features/ccsdk-iaas-adaptor/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-mdsal-resource/pom.xml b/adaptors/features/ccsdk-mdsal-resource/pom.xml index c81b4148d..68d2e26bf 100644 --- a/adaptors/features/ccsdk-mdsal-resource/pom.xml +++ b/adaptors/features/ccsdk-mdsal-resource/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-messagerouter-consumer/pom.xml b/adaptors/features/ccsdk-messagerouter-consumer/pom.xml index 7465d5631..de5a58440 100755 --- a/adaptors/features/ccsdk-messagerouter-consumer/pom.xml +++ b/adaptors/features/ccsdk-messagerouter-consumer/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> </parent> <groupId>org.onap.ccsdk.sli.adaptors.messagerouter</groupId> diff --git a/adaptors/features/ccsdk-messagerouter-publisher/pom.xml b/adaptors/features/ccsdk-messagerouter-publisher/pom.xml index 79f2dfab3..25cab88c4 100755 --- a/adaptors/features/ccsdk-messagerouter-publisher/pom.xml +++ b/adaptors/features/ccsdk-messagerouter-publisher/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> </parent> <groupId>org.onap.ccsdk.sli.adaptors.messagerouter</groupId> diff --git a/adaptors/features/ccsdk-netbox-client/pom.xml b/adaptors/features/ccsdk-netbox-client/pom.xml index 14a8cf1bc..01801766f 100644 --- a/adaptors/features/ccsdk-netbox-client/pom.xml +++ b/adaptors/features/ccsdk-netbox-client/pom.xml @@ -20,7 +20,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-netconf-adaptor/pom.xml b/adaptors/features/ccsdk-netconf-adaptor/pom.xml index d96e41fb8..78e99bc33 100644 --- a/adaptors/features/ccsdk-netconf-adaptor/pom.xml +++ b/adaptors/features/ccsdk-netconf-adaptor/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-resource-assignment/pom.xml b/adaptors/features/ccsdk-resource-assignment/pom.xml index 8318f4ddc..414718090 100644 --- a/adaptors/features/ccsdk-resource-assignment/pom.xml +++ b/adaptors/features/ccsdk-resource-assignment/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-rest-adaptor/pom.xml b/adaptors/features/ccsdk-rest-adaptor/pom.xml index 56bb6d903..9b4666e42 100644 --- a/adaptors/features/ccsdk-rest-adaptor/pom.xml +++ b/adaptors/features/ccsdk-rest-adaptor/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-saltstack-adaptor/pom.xml b/adaptors/features/ccsdk-saltstack-adaptor/pom.xml index 7fd8b92e0..3f523ed62 100644 --- a/adaptors/features/ccsdk-saltstack-adaptor/pom.xml +++ b/adaptors/features/ccsdk-saltstack-adaptor/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-sli-adaptors-all/pom.xml b/adaptors/features/ccsdk-sli-adaptors-all/pom.xml index 5fc317a1a..36e2eef12 100644 --- a/adaptors/features/ccsdk-sli-adaptors-all/pom.xml +++ b/adaptors/features/ccsdk-sli-adaptors-all/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-sql-resource/pom.xml b/adaptors/features/ccsdk-sql-resource/pom.xml index 629d230a6..f3c742b20 100644 --- a/adaptors/features/ccsdk-sql-resource/pom.xml +++ b/adaptors/features/ccsdk-sql-resource/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/ccsdk-ssh-adaptor/pom.xml b/adaptors/features/ccsdk-ssh-adaptor/pom.xml index 9ff654573..02110e604 100644 --- a/adaptors/features/ccsdk-ssh-adaptor/pom.xml +++ b/adaptors/features/ccsdk-ssh-adaptor/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>single-feature-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/features-sli-adaptors/pom.xml b/adaptors/features/features-sli-adaptors/pom.xml index a7ddcc628..5ac24a4c8 100644 --- a/adaptors/features/features-sli-adaptors/pom.xml +++ b/adaptors/features/features-sli-adaptors/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>feature-repo-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/installer/pom.xml b/adaptors/features/installer/pom.xml index f62e7520d..a691aeb88 100755 --- a/adaptors/features/installer/pom.xml +++ b/adaptors/features/installer/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/features/pom.xml b/adaptors/features/pom.xml index c946b52d8..5ca4efc5d 100755 --- a/adaptors/features/pom.xml +++ b/adaptors/features/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/iaas-adaptor/iaas-adaptor-bundle/pom.xml b/adaptors/iaas-adaptor/iaas-adaptor-bundle/pom.xml index 38391b965..a2a413bfd 100644 --- a/adaptors/iaas-adaptor/iaas-adaptor-bundle/pom.xml +++ b/adaptors/iaas-adaptor/iaas-adaptor-bundle/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/iaas-adaptor/iaas-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/openstack/heat/model/TestProperties.java b/adaptors/iaas-adaptor/iaas-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/openstack/heat/model/TestProperties.java index 84abf12a0..70fbb753a 100644 --- a/adaptors/iaas-adaptor/iaas-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/openstack/heat/model/TestProperties.java +++ b/adaptors/iaas-adaptor/iaas-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/openstack/heat/model/TestProperties.java @@ -3,6 +3,7 @@ * ONAP : APPC * ================================================================================ * Copyright 2018 TechMahindra +* Copyright (C) 2022 Samsung Electronics *================================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +37,6 @@ public class TestProperties { @Test public void testGetSize() { properties.setSize(123); - assertNotNull(properties.getSize()); assertEquals(properties.getSize(),123); } diff --git a/adaptors/iaas-adaptor/iaas-adaptor-installer/pom.xml b/adaptors/iaas-adaptor/iaas-adaptor-installer/pom.xml index aa9c8824c..e8745b2bd 100644 --- a/adaptors/iaas-adaptor/iaas-adaptor-installer/pom.xml +++ b/adaptors/iaas-adaptor/iaas-adaptor-installer/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/iaas-adaptor/pom.xml b/adaptors/iaas-adaptor/pom.xml index aea164795..c5cb4fd86 100644 --- a/adaptors/iaas-adaptor/pom.xml +++ b/adaptors/iaas-adaptor/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/mdsal-resource/installer/pom.xml b/adaptors/mdsal-resource/installer/pom.xml index 396340863..88c3883be 100755 --- a/adaptors/mdsal-resource/installer/pom.xml +++ b/adaptors/mdsal-resource/installer/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/mdsal-resource/pom.xml b/adaptors/mdsal-resource/pom.xml index a10f2ea04..8f2857b0a 100755 --- a/adaptors/mdsal-resource/pom.xml +++ b/adaptors/mdsal-resource/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/mdsal-resource/provider/pom.xml b/adaptors/mdsal-resource/provider/pom.xml index 1f28d722d..d202c77ea 100755 --- a/adaptors/mdsal-resource/provider/pom.xml +++ b/adaptors/mdsal-resource/provider/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestRestService.java b/adaptors/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestRestService.java new file mode 100644 index 000000000..c907a2ac0 --- /dev/null +++ b/adaptors/mdsal-resource/provider/src/test/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/TestRestService.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : CCSDK + * ================================================================================ + * Copyright (C) 2022 Samsung Electronics + * ============================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.sli.adaptors.resource.mdsal; + +import org.apache.commons.codec.binary.Base64; +import org.junit.Assert; +import org.junit.Test; + +import java.lang.reflect.Method; +import java.net.HttpURLConnection; + +public class TestRestService { + @Test + public void testGetRestConnection() throws Exception { + RestService service = new RestService("HTTP", "1.1.1.1", "80", + "user", "pass", "JSON", "JSON"); + Method method = RestService.class.getDeclaredMethod("getRestConnection", String.class, String.class); + method.setAccessible(true); + String url = "http" + "://" + "1.1.1.1" + ":" + "80" + "/" + "urlString"; + HttpURLConnection urlConn = (HttpURLConnection) method.invoke(service, + url, "GET"); + String authStr = "user" + ":" + "pass"; + String encodedAuthStr = new String(Base64.encodeBase64(authStr.getBytes())); + Assert.assertEquals("GET", urlConn.getRequestMethod()); + Assert.assertEquals(url, urlConn.getURL().toString()); + Assert.assertEquals("application/json", urlConn.getRequestProperty("Accept")); + Assert.assertEquals("Basic " + encodedAuthStr, urlConn.getRequestProperty("Authentication")); + } +} diff --git a/adaptors/message-router/pom.xml b/adaptors/message-router/pom.xml index 2efae62b1..7413b5dfa 100755 --- a/adaptors/message-router/pom.xml +++ b/adaptors/message-router/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/netbox-client/installer/pom.xml b/adaptors/netbox-client/installer/pom.xml index 27c66651f..a5f568437 100755 --- a/adaptors/netbox-client/installer/pom.xml +++ b/adaptors/netbox-client/installer/pom.xml @@ -20,7 +20,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/netbox-client/pom.xml b/adaptors/netbox-client/pom.xml index c39646179..d1469527d 100644 --- a/adaptors/netbox-client/pom.xml +++ b/adaptors/netbox-client/pom.xml @@ -20,7 +20,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/netbox-client/provider/pom.xml b/adaptors/netbox-client/provider/pom.xml index a6e52462d..701071459 100644 --- a/adaptors/netbox-client/provider/pom.xml +++ b/adaptors/netbox-client/provider/pom.xml @@ -20,7 +20,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/netconf-adaptor/netconf-adaptor-bundle/pom.xml b/adaptors/netconf-adaptor/netconf-adaptor-bundle/pom.xml index bb712583a..103fe7798 100644 --- a/adaptors/netconf-adaptor/netconf-adaptor-bundle/pom.xml +++ b/adaptors/netconf-adaptor/netconf-adaptor-bundle/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/netconf-adaptor/netconf-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/netconf/odlconnector/NetconfClientRestconfImpl.java b/adaptors/netconf-adaptor/netconf-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/netconf/odlconnector/NetconfClientRestconfImpl.java index 41590edce..714867148 100644 --- a/adaptors/netconf-adaptor/netconf-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/netconf/odlconnector/NetconfClientRestconfImpl.java +++ b/adaptors/netconf-adaptor/netconf-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/netconf/odlconnector/NetconfClientRestconfImpl.java @@ -1,246 +1,249 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ================================================================================ - * Modifications Copyright (C) 2019 Ericsson - * ============================================================================= - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END========================================================= - */ - -package org.onap.ccsdk.sli.adaptors.netconf.odlconnector; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import java.util.Properties; -import org.apache.http.HttpStatus; -import org.onap.ccsdk.sli.adaptors.netconf.HttpClient; -import org.onap.ccsdk.sli.adaptors.netconf.NetconfAdaptorConstants; -import org.onap.ccsdk.sli.adaptors.netconf.NetconfClient; -import org.onap.ccsdk.sli.adaptors.netconf.NetconfClientRestconf; -import org.onap.ccsdk.sli.adaptors.netconf.NetconfConnectionDetails; -import org.onap.ccsdk.sli.core.sli.SvcLogicException; - -public class NetconfClientRestconfImpl implements NetconfClient, NetconfClientRestconf { - - private final EELFLogger logger = EELFManager.getInstance().getLogger(NetconfClientRestconfImpl.class); - - private NetconfConnectionDetails connectionDetails; - private final String appFormat = "application/json"; - - public NetconfClientRestconfImpl(){ - //constructor - } - - //restconf client impl - - @SuppressWarnings("deprecation") - @Override - public void configure(String configuration, String deviceMountPointName, String moduleName, String nodeName) throws SvcLogicException { - - logger.info("Configuring device " + deviceMountPointName + " with configuration " + configuration); - - int httpCode = HttpClient.putMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT, - getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), configuration, appFormat); - - if (httpCode != HttpStatus.SC_OK) { - logger.error("Configuration request failed. throwing Exception !"); - throw new SvcLogicException("Error configuring node :" + nodeName + ", of Module :" + moduleName + - ", in device :" + deviceMountPointName); - } - } - - @Override - public void connect(String deviceMountPointName, String payload) throws SvcLogicException{ - - logger.info("Connecting device " + deviceMountPointName); - - int httpCode = HttpClient.postMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT, - getConnectPath(), payload, appFormat); - - if(httpCode != HttpStatus.SC_NO_CONTENT){ - logger.error("Connect request failed with code " + httpCode + ". throwing Exception !"); - throw new SvcLogicException("Error connecting device :" + deviceMountPointName); - } - } - - @Override - public boolean checkConnection(String deviceMountPointName) throws SvcLogicException { - logger.info("Checking device " + deviceMountPointName + " connectivity"); - - String result = HttpClient.getMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, - NetconfAdaptorConstants.CONTROLLER_PORT, getCheckConnectivityPath(deviceMountPointName), appFormat); - - return result != null; - } - - @Override - public void disconnect(String deviceMountPointName) throws SvcLogicException { - logger.info("Disconnecting " + deviceMountPointName); - - int httpCode = HttpClient.deleteMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT, - getDisconnectPath(deviceMountPointName), appFormat); - - if(httpCode != HttpStatus.SC_OK){ - logger.error("Disconnection of device " + deviceMountPointName + " failed!"); - throw new SvcLogicException("Disconnection of device " + deviceMountPointName + " failed!"); - } - } - - @Override - public String getConfiguration(String deviceMountPointName, String moduleName, String nodeName) throws SvcLogicException{ - logger.info("Getting configuration of device " + deviceMountPointName); - - String result = HttpClient.getMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT, - getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), appFormat); - - if (result == null) { - logger.error("Configuration request failed. throwing Exception !"); - throw new SvcLogicException("Error getting configuration of node :" + nodeName + ", of Module :" + moduleName + - ", in device :" + deviceMountPointName); - } - - return result; - } - - //netconf client impl - - @Override - public void connect(NetconfConnectionDetails connectionDetails) throws SvcLogicException { - if(connectionDetails == null){ - throw new SvcLogicException("Invalid connection details - null value"); - } - this.connectionDetails = connectionDetails; - this.connect(connectionDetails.getHost(), getPayload()); - } - - @Override - public String exchangeMessage(String message) throws SvcLogicException { - // TODO implement - return null; - } - - @Override - public void configure(String configuration) throws SvcLogicException { - if(connectionDetails == null){ - throw new SvcLogicException("Invalid connection details - null value"); - } - - Properties props = connectionDetails.getAdditionalProperties(); - if(props == null || !props.containsKey("module.name") || !props.containsKey("node.name")) { - throw new SvcLogicException("Invalid properties!"); - } - - String moduleName = props.getProperty("module.name"); - String nodeName = props.getProperty("node.name"); - String deviceMountPointName = connectionDetails.getHost(); - - int httpCode = HttpClient.putMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT, - getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), configuration, "application/xml"); - - if (httpCode != HttpStatus.SC_OK) { - logger.error("Configuration request failed. throwing Exception !"); - throw new SvcLogicException("Error configuring node :" + nodeName + ", of Module :" + moduleName + - ", in device :" + deviceMountPointName); - } - } - - @Override - public String getConfiguration() throws SvcLogicException { - if(connectionDetails == null){ - throw new SvcLogicException("Invalid connection details - null value"); - } - - Properties props = connectionDetails.getAdditionalProperties(); - if(props == null || !props.containsKey("module.name") || !props.containsKey("node.name")) { - throw new SvcLogicException("Invalid properties!"); - } - - return this.getConfiguration(connectionDetails.getHost(), props.getProperty("module.name"), - props.getProperty("node.name")); - } - - @Override - public void disconnect() throws SvcLogicException { - if(connectionDetails == null){ - throw new SvcLogicException("Invalid connection details - null value"); - } - this.disconnect(connectionDetails.getHost()); - } - - //private methods - private String getModuleConfigurePath(String deviceMountPointName, String moduleName, String nodeName){ - - String deviceSpecificPath = deviceMountPointName + "/yang-ext:mount/" + moduleName + ":" + nodeName; - - return NetconfAdaptorConstants.CONFIGURE_PATH + deviceSpecificPath; - } - - private String getConnectPath(){ - - return NetconfAdaptorConstants.CONNECT_PATH; - } - - private String getCheckConnectivityPath(String deviceMountPointName) { - return NetconfAdaptorConstants.CHECK_CONNECTION_PATH + deviceMountPointName; - } - - private String getDisconnectPath(String deviceMountPointName) { - return NetconfAdaptorConstants.DISCONNECT_PATH + deviceMountPointName; - } - - private String getPayload() { - return "{\n" + - " \"config:module\":\n" + - " {\n" + - " \"type\":\"odl-sal-netconf-connector-cfg:sal-netconf-connector\",\n" + - " \"netconf-northbound-ssh\\odl-sal-netconf-connector-cfg:name\":"+connectionDetails.getHost()+",\n" + - " \"odl-sal-netconf-connector-cfg:address\":"+connectionDetails.getHost()+",\n" + - " \"odl-sal-netconf-connector-cfg:port\":"+connectionDetails.getPort()+",\n" + - " \"odl-sal-netconf-connector-cfg:username\":"+connectionDetails.getUsername()+",\n" + - " \"odl-sal-netconf-connector-cfg:password\":"+connectionDetails.getPassword()+",\n" + - " \"tcp-only\":\"false\",\n" + - " \"odl-sal-netconf-connector-cfg:event-executor\":\n" + - " {\n" + - " \"type\":\"netty:netty-event-executor\",\n" + - " \"name\":\"global-event-executor\"\n" + - " },\n" + - " \"odl-sal-netconf-connector-cfg:binding-registry\":\n" + - " {\n" + - " \"type\":\"opendaylight-md-sal-binding:binding-broker-osgi-registry\",\n" + - " \"name\":\"binding-osgi-broker\"\n" + - " },\n" + - " \"odl-sal-netconf-connector-cfg:dom-registry\":\n" + - " {\n" + - " \"type\":\"opendaylight-md-sal-dom:dom-broker-osgi-registry\",\n" + - " \"name\":\"dom-broker\"\n" + - " },\n" + - " \"odl-sal-netconf-connector-cfg:client-dispatcher\":\n" + - " {\n" + - " \"type\":\"odl-netconf-cfg:netconf-client-dispatcher\",\n" + - " \"name\":\"global-netconf-dispatcher\"\n" + - " },\n" + - " \"odl-sal-netconf-connector-cfg:processing-executor\":\n" + - " {\n" + - " \"type\":\"threadpool:threadpool\",\n" + - " \"name\":\"global-netconf-processing-executor\"\n" + - " }\n" + - " }\n" + - "}"; - } -} +/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications Copyright (C) 2019 Ericsson
+ * =============================================================================
+ * Modifications Copyright (C) 2022 Samsung Electronics
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.ccsdk.sli.adaptors.netconf.odlconnector;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import java.util.Properties;
+import org.apache.http.HttpStatus;
+import org.onap.ccsdk.sli.adaptors.netconf.HttpClient;
+import org.onap.ccsdk.sli.adaptors.netconf.NetconfAdaptorConstants;
+import org.onap.ccsdk.sli.adaptors.netconf.NetconfClient;
+import org.onap.ccsdk.sli.adaptors.netconf.NetconfClientRestconf;
+import org.onap.ccsdk.sli.adaptors.netconf.NetconfConnectionDetails;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+
+public class NetconfClientRestconfImpl implements NetconfClient, NetconfClientRestconf {
+
+ private final EELFLogger logger = EELFManager.getInstance().getLogger(NetconfClientRestconfImpl.class);
+
+ private NetconfConnectionDetails connectionDetails;
+ private final String appFormat = "application/json";
+
+ public NetconfClientRestconfImpl(){
+ //constructor
+ }
+
+ //restconf client impl
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void configure(String configuration, String deviceMountPointName, String moduleName, String nodeName) throws SvcLogicException {
+
+ logger.info("Configuring device " + deviceMountPointName + " with configuration " + configuration);
+
+ int httpCode = HttpClient.putMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT,
+ getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), configuration, appFormat);
+
+ if (httpCode != HttpStatus.SC_OK) {
+ logger.error("Configuration request failed. throwing Exception !");
+ throw new SvcLogicException("Error configuring node :" + nodeName + ", of Module :" + moduleName +
+ ", in device :" + deviceMountPointName);
+ }
+ }
+
+ @Override
+ public void connect(String deviceMountPointName, String payload) throws SvcLogicException{
+
+ logger.info("Connecting device " + deviceMountPointName);
+
+ int httpCode = HttpClient.postMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT,
+ getConnectPath(), payload, appFormat);
+
+ if(httpCode != HttpStatus.SC_NO_CONTENT){
+ logger.error("Connect request failed with code " + httpCode + ". throwing Exception !");
+ throw new SvcLogicException("Error connecting device :" + deviceMountPointName);
+ }
+ }
+
+ @Override
+ public boolean checkConnection(String deviceMountPointName) throws SvcLogicException {
+ logger.info("Checking device " + deviceMountPointName + " connectivity");
+
+ String result = HttpClient.getMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP,
+ NetconfAdaptorConstants.CONTROLLER_PORT, getCheckConnectivityPath(deviceMountPointName), appFormat);
+
+ return result != null;
+ }
+
+ @Override
+ public void disconnect(String deviceMountPointName) throws SvcLogicException {
+ logger.info("Disconnecting " + deviceMountPointName);
+
+ int httpCode = HttpClient.deleteMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT,
+ getDisconnectPath(deviceMountPointName), appFormat);
+
+ if(httpCode != HttpStatus.SC_OK){
+ logger.error("Disconnection of device " + deviceMountPointName + " failed!");
+ throw new SvcLogicException("Disconnection of device " + deviceMountPointName + " failed!");
+ }
+ }
+
+ @Override
+ public String getConfiguration(String deviceMountPointName, String moduleName, String nodeName) throws SvcLogicException{
+ logger.info("Getting configuration of device " + deviceMountPointName);
+
+ String result = HttpClient.getMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT,
+ getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), appFormat);
+
+ if (result == null) {
+ logger.error("Configuration request failed. throwing Exception !");
+ throw new SvcLogicException("Error getting configuration of node :" + nodeName + ", of Module :" + moduleName +
+ ", in device :" + deviceMountPointName);
+ }
+
+ return result;
+ }
+
+ //netconf client impl
+
+ @Override
+ public void connect(NetconfConnectionDetails connectionDetails) throws SvcLogicException {
+ if(connectionDetails == null){
+ throw new SvcLogicException("Invalid connection details - null value");
+ }
+ this.connectionDetails = connectionDetails;
+ this.connect(connectionDetails.getHost(), getPayload());
+ }
+
+ @Override
+ public String exchangeMessage(String message) throws SvcLogicException {
+ // TODO implement
+ return null;
+ }
+
+ @Override
+ public void configure(String configuration) throws SvcLogicException {
+ if(connectionDetails == null){
+ throw new SvcLogicException("Invalid connection details - null value");
+ }
+
+ Properties props = connectionDetails.getAdditionalProperties();
+ if(props == null || !props.containsKey("module.name") || !props.containsKey("node.name")) {
+ throw new SvcLogicException("Invalid properties!");
+ }
+
+ String moduleName = props.getProperty("module.name");
+ String nodeName = props.getProperty("node.name");
+ String deviceMountPointName = connectionDetails.getHost();
+
+ int httpCode = HttpClient.putMethod(NetconfAdaptorConstants.PROTOCOL, NetconfAdaptorConstants.CONTROLLER_IP, NetconfAdaptorConstants.CONTROLLER_PORT,
+ getModuleConfigurePath(deviceMountPointName, moduleName, nodeName), configuration, "application/xml");
+
+ if (httpCode != HttpStatus.SC_OK) {
+ logger.error("Configuration request failed. throwing Exception !");
+ throw new SvcLogicException("Error configuring node :" + nodeName + ", of Module :" + moduleName +
+ ", in device :" + deviceMountPointName);
+ }
+ }
+
+ @Override
+ public String getConfiguration() throws SvcLogicException {
+ if(connectionDetails == null){
+ throw new SvcLogicException("Invalid connection details - null value");
+ }
+
+ Properties props = connectionDetails.getAdditionalProperties();
+ if(props == null || !props.containsKey("module.name") || !props.containsKey("node.name")) {
+ throw new SvcLogicException("Invalid properties!");
+ }
+
+ return this.getConfiguration(connectionDetails.getHost(), props.getProperty("module.name"),
+ props.getProperty("node.name"));
+ }
+
+ @Override
+ public void disconnect() throws SvcLogicException {
+ if(connectionDetails == null){
+ throw new SvcLogicException("Invalid connection details - null value");
+ }
+ this.disconnect(connectionDetails.getHost());
+ }
+
+ //private methods
+ private String getModuleConfigurePath(String deviceMountPointName, String moduleName, String nodeName){
+
+ String deviceSpecificPath = deviceMountPointName + "/yang-ext:mount/" + moduleName + ":" + nodeName;
+
+ return NetconfAdaptorConstants.CONFIGURE_PATH + deviceSpecificPath;
+ }
+
+ private String getConnectPath(){
+
+ return NetconfAdaptorConstants.CONNECT_PATH;
+ }
+
+ private String getCheckConnectivityPath(String deviceMountPointName) {
+ return NetconfAdaptorConstants.CHECK_CONNECTION_PATH + deviceMountPointName;
+ }
+
+ private String getDisconnectPath(String deviceMountPointName) {
+ return NetconfAdaptorConstants.DISCONNECT_PATH + deviceMountPointName;
+ }
+
+ private static final String newLineConst = " {\n";
+ private String getPayload() {
+ return "{\n" +
+ " \"config:module\":\n" +
+ " {\n" +
+ " \"type\":\"odl-sal-netconf-connector-cfg:sal-netconf-connector\",\n" +
+ " \"netconf-northbound-ssh\\odl-sal-netconf-connector-cfg:name\":"+connectionDetails.getHost()+",\n" +
+ " \"odl-sal-netconf-connector-cfg:address\":"+connectionDetails.getHost()+",\n" +
+ " \"odl-sal-netconf-connector-cfg:port\":"+connectionDetails.getPort()+",\n" +
+ " \"odl-sal-netconf-connector-cfg:username\":"+connectionDetails.getUsername()+",\n" +
+ " \"odl-sal-netconf-connector-cfg:password\":"+connectionDetails.getPassword()+",\n" +
+ " \"tcp-only\":\"false\",\n" +
+ " \"odl-sal-netconf-connector-cfg:event-executor\":\n" +
+ newLineConst +
+ " \"type\":\"netty:netty-event-executor\",\n" +
+ " \"name\":\"global-event-executor\"\n" +
+ " },\n" +
+ " \"odl-sal-netconf-connector-cfg:binding-registry\":\n" +
+ newLineConst +
+ " \"type\":\"opendaylight-md-sal-binding:binding-broker-osgi-registry\",\n" +
+ " \"name\":\"binding-osgi-broker\"\n" +
+ " },\n" +
+ " \"odl-sal-netconf-connector-cfg:dom-registry\":\n" +
+ newLineConst +
+ " \"type\":\"opendaylight-md-sal-dom:dom-broker-osgi-registry\",\n" +
+ " \"name\":\"dom-broker\"\n" +
+ " },\n" +
+ " \"odl-sal-netconf-connector-cfg:client-dispatcher\":\n" +
+ newLineConst +
+ " \"type\":\"odl-netconf-cfg:netconf-client-dispatcher\",\n" +
+ " \"name\":\"global-netconf-dispatcher\"\n" +
+ " },\n" +
+ " \"odl-sal-netconf-connector-cfg:processing-executor\":\n" +
+ newLineConst+
+ " \"type\":\"threadpool:threadpool\",\n" +
+ " \"name\":\"global-netconf-processing-executor\"\n" +
+ " }\n" +
+ " }\n" +
+ "}";
+ }
+}
diff --git a/adaptors/netconf-adaptor/netconf-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/netconf/NetconfConnectionDetailsTest.java b/adaptors/netconf-adaptor/netconf-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/netconf/NetconfConnectionDetailsTest.java index 2d0bea92c..544b149b4 100644 --- a/adaptors/netconf-adaptor/netconf-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/netconf/NetconfConnectionDetailsTest.java +++ b/adaptors/netconf-adaptor/netconf-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/netconf/NetconfConnectionDetailsTest.java @@ -1,118 +1,117 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : APPC -* ================================================================================ -* Copyright 2018 TechMahindra -* ================================================================================ -* Modifications Copyright (C) 2019 Ericsson -*================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============LICENSE_END========================================================= -*/ -package org.onap.ccsdk.sli.adaptors.netconf; - -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -public class NetconfConnectionDetailsTest { - private NetconfConnectionDetails netconfConnectionDetails; - private List<String> capabilities; - private Properties additionalProperties; - - @Before - public void SetUp() { - netconfConnectionDetails = new NetconfConnectionDetails(); - } - - @Test - public void testGetHost() { - netconfConnectionDetails.setHost("host1"); - Assert.assertNotNull(netconfConnectionDetails.getHost()); - Assert.assertEquals("host1", netconfConnectionDetails.getHost()); - } - - @Test - public void testGetPort() { - netconfConnectionDetails.setPort(123); - Assert.assertNotNull(netconfConnectionDetails.getPort()); - Assert.assertEquals(123, netconfConnectionDetails.getPort()); - } - - @Test - public void testGetUsername() { - netconfConnectionDetails.setUsername("ABC"); - Assert.assertNotNull(netconfConnectionDetails.getUsername()); - Assert.assertEquals("ABC", netconfConnectionDetails.getUsername()); - } - - @Test - public void testGetPassword() { - netconfConnectionDetails.setPassword("pass1"); - Assert.assertNotNull(netconfConnectionDetails.getPassword()); - Assert.assertEquals("pass1", netconfConnectionDetails.getPassword()); - } - - @Test - public void testNullCapabilities() { - capabilities = new ArrayList<String>(); - Assert.assertNull(netconfConnectionDetails.getCapabilities()); - } - - @Test - public void testCapabilitiesWithValues() { - capabilities = new ArrayList<String>(); - capabilities.add("capabilities1"); - capabilities.add("capabilities2"); - netconfConnectionDetails.setCapabilities(capabilities); - Assert.assertTrue(capabilities.contains("capabilities2")); - } - - @Test - public void testCapabilities_Size() { - capabilities = new ArrayList<String>(); - capabilities.add("capabilities1"); - capabilities.add("capabilities2"); - netconfConnectionDetails.setCapabilities(capabilities); - Assert.assertEquals(2, capabilities.size()); - } - - @Test - public void testAdditionalProperties() { - additionalProperties = new Properties(); - Assert.assertNull(netconfConnectionDetails.getAdditionalProperties()); - } - - @Test - public void testAdditionalPropertiesWithValues() { - additionalProperties = new Properties(); - additionalProperties.put("A", "a"); - additionalProperties.put("B", "b"); - netconfConnectionDetails.setAdditionalProperties(additionalProperties); - Assert.assertEquals("a", netconfConnectionDetails.getAdditionalProperties().get("A")); - } - - @Test - public void testAdditionalProperties_Size() { - additionalProperties = new Properties(); - additionalProperties.put("A", "a"); - additionalProperties.put("B", "b"); - additionalProperties.put("C", "c"); - netconfConnectionDetails.setAdditionalProperties(additionalProperties); - Assert.assertNotNull(netconfConnectionDetails.getAdditionalProperties()); - Assert.assertEquals(3, additionalProperties.size()); - } -} +/*
+* ============LICENSE_START=======================================================
+* ONAP : APPC
+* ================================================================================
+* Copyright 2018 TechMahindra
+* ================================================================================
+* Modifications Copyright (C) 2019 Ericsson
+*=================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+package org.onap.ccsdk.sli.adaptors.netconf;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class NetconfConnectionDetailsTest {
+ private NetconfConnectionDetails netconfConnectionDetails;
+ private List<String> capabilities;
+ private Properties additionalProperties;
+
+ @Before
+ public void SetUp() {
+ netconfConnectionDetails = new NetconfConnectionDetails();
+ }
+
+ @Test
+ public void testGetHost() {
+ netconfConnectionDetails.setHost("host1");
+ Assert.assertNotNull(netconfConnectionDetails.getHost());
+ Assert.assertEquals("host1", netconfConnectionDetails.getHost());
+ }
+
+ @Test
+ public void testGetPort() {
+ netconfConnectionDetails.setPort(123);
+ Assert.assertEquals(123, netconfConnectionDetails.getPort());
+ }
+
+ @Test
+ public void testGetUsername() {
+ netconfConnectionDetails.setUsername("ABC");
+ Assert.assertNotNull(netconfConnectionDetails.getUsername());
+ Assert.assertEquals("ABC", netconfConnectionDetails.getUsername());
+ }
+
+ @Test
+ public void testGetPassword() {
+ netconfConnectionDetails.setPassword("pass1");
+ Assert.assertNotNull(netconfConnectionDetails.getPassword());
+ Assert.assertEquals("pass1", netconfConnectionDetails.getPassword());
+ }
+
+ @Test
+ public void testNullCapabilities() {
+ capabilities = new ArrayList<String>();
+ Assert.assertNull(netconfConnectionDetails.getCapabilities());
+ }
+
+ @Test
+ public void testCapabilitiesWithValues() {
+ capabilities = new ArrayList<String>();
+ capabilities.add("capabilities1");
+ capabilities.add("capabilities2");
+ netconfConnectionDetails.setCapabilities(capabilities);
+ Assert.assertTrue(capabilities.contains("capabilities2"));
+ }
+
+ @Test
+ public void testCapabilities_Size() {
+ capabilities = new ArrayList<String>();
+ capabilities.add("capabilities1");
+ capabilities.add("capabilities2");
+ netconfConnectionDetails.setCapabilities(capabilities);
+ Assert.assertEquals(2, capabilities.size());
+ }
+
+ @Test
+ public void testAdditionalProperties() {
+ additionalProperties = new Properties();
+ Assert.assertNull(netconfConnectionDetails.getAdditionalProperties());
+ }
+
+ @Test
+ public void testAdditionalPropertiesWithValues() {
+ additionalProperties = new Properties();
+ additionalProperties.put("A", "a");
+ additionalProperties.put("B", "b");
+ netconfConnectionDetails.setAdditionalProperties(additionalProperties);
+ Assert.assertEquals("a", netconfConnectionDetails.getAdditionalProperties().get("A"));
+ }
+
+ @Test
+ public void testAdditionalProperties_Size() {
+ additionalProperties = new Properties();
+ additionalProperties.put("A", "a");
+ additionalProperties.put("B", "b");
+ additionalProperties.put("C", "c");
+ netconfConnectionDetails.setAdditionalProperties(additionalProperties);
+ Assert.assertNotNull(netconfConnectionDetails.getAdditionalProperties());
+ Assert.assertEquals(3, additionalProperties.size());
+ }
+}
diff --git a/adaptors/netconf-adaptor/netconf-adaptor-installer/pom.xml b/adaptors/netconf-adaptor/netconf-adaptor-installer/pom.xml index 0a261d70c..e1e9f1d09 100644 --- a/adaptors/netconf-adaptor/netconf-adaptor-installer/pom.xml +++ b/adaptors/netconf-adaptor/netconf-adaptor-installer/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/netconf-adaptor/pom.xml b/adaptors/netconf-adaptor/pom.xml index be2b11b67..f5bb78891 100644 --- a/adaptors/netconf-adaptor/pom.xml +++ b/adaptors/netconf-adaptor/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/pom.xml b/adaptors/pom.xml index 99b52cf17..07cb4a5f1 100755 --- a/adaptors/pom.xml +++ b/adaptors/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> </parent> <groupId>org.onap.ccsdk.sli.adaptors</groupId> diff --git a/adaptors/resource-assignment/installer/pom.xml b/adaptors/resource-assignment/installer/pom.xml index 98b3219c9..e65f9cdb2 100755 --- a/adaptors/resource-assignment/installer/pom.xml +++ b/adaptors/resource-assignment/installer/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/resource-assignment/pom.xml b/adaptors/resource-assignment/pom.xml index f9a62562a..ba7d457bc 100755 --- a/adaptors/resource-assignment/pom.xml +++ b/adaptors/resource-assignment/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/resource-assignment/provider/pom.xml b/adaptors/resource-assignment/provider/pom.xml index 94b77fc5a..121d6993e 100755 --- a/adaptors/resource-assignment/provider/pom.xml +++ b/adaptors/resource-assignment/provider/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/rest-adaptor/pom.xml b/adaptors/rest-adaptor/pom.xml index 31d72ac9f..52595b695 100644 --- a/adaptors/rest-adaptor/pom.xml +++ b/adaptors/rest-adaptor/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/rest-adaptor/rest-adaptor-bundle/pom.xml b/adaptors/rest-adaptor/rest-adaptor-bundle/pom.xml index 5cd0f7dfc..75f178583 100644 --- a/adaptors/rest-adaptor/rest-adaptor-bundle/pom.xml +++ b/adaptors/rest-adaptor/rest-adaptor-bundle/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/rest-adaptor/rest-adaptor-installer/pom.xml b/adaptors/rest-adaptor/rest-adaptor-installer/pom.xml index b3d9f38d8..be127466a 100644 --- a/adaptors/rest-adaptor/rest-adaptor-installer/pom.xml +++ b/adaptors/rest-adaptor/rest-adaptor-installer/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/saltstack-adaptor/pom.xml b/adaptors/saltstack-adaptor/pom.xml index 7e05bafe6..e3657bfc8 100644 --- a/adaptors/saltstack-adaptor/pom.xml +++ b/adaptors/saltstack-adaptor/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/saltstack-adaptor/saltstack-adaptor-installer/pom.xml b/adaptors/saltstack-adaptor/saltstack-adaptor-installer/pom.xml index 8e008431f..4d1480917 100644 --- a/adaptors/saltstack-adaptor/saltstack-adaptor-installer/pom.xml +++ b/adaptors/saltstack-adaptor/saltstack-adaptor-installer/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/saltstack-adaptor/saltstack-adaptor-provider/pom.xml b/adaptors/saltstack-adaptor/saltstack-adaptor-provider/pom.xml index bee015081..e14a825be 100644 --- a/adaptors/saltstack-adaptor/saltstack-adaptor-provider/pom.xml +++ b/adaptors/saltstack-adaptor/saltstack-adaptor-provider/pom.xml @@ -17,7 +17,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/sql-resource/installer/pom.xml b/adaptors/sql-resource/installer/pom.xml index be3ea52a3..5e26d3aa0 100755 --- a/adaptors/sql-resource/installer/pom.xml +++ b/adaptors/sql-resource/installer/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/sql-resource/pom.xml b/adaptors/sql-resource/pom.xml index 7c4ff64b1..7756c74be 100755 --- a/adaptors/sql-resource/pom.xml +++ b/adaptors/sql-resource/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/sql-resource/provider/pom.xml b/adaptors/sql-resource/provider/pom.xml index 851c4302e..2d702a26f 100755 --- a/adaptors/sql-resource/provider/pom.xml +++ b/adaptors/sql-resource/provider/pom.xml @@ -5,7 +5,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/ssh-adaptor/pom.xml b/adaptors/ssh-adaptor/pom.xml index 7672d6ec4..c7ff83b81 100644 --- a/adaptors/ssh-adaptor/pom.xml +++ b/adaptors/ssh-adaptor/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>odlparent-lite</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/ssh-adaptor/ssh-adaptor-bundle/pom.xml b/adaptors/ssh-adaptor/ssh-adaptor-bundle/pom.xml index 4894b9146..52a9cac28 100644 --- a/adaptors/ssh-adaptor/ssh-adaptor-bundle/pom.xml +++ b/adaptors/ssh-adaptor/ssh-adaptor-bundle/pom.xml @@ -28,7 +28,7 @@ <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> - <version>2.3.3</version> + <version>2.4.1</version> <relativePath/> </parent> diff --git a/adaptors/ssh-adaptor/ssh-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/ssh/sshd/SshAdaptorTest.java b/adaptors/ssh-adaptor/ssh-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/ssh/sshd/SshAdaptorTest.java index fecb42fc2..038a6aaf4 100644 --- a/adaptors/ssh-adaptor/ssh-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/ssh/sshd/SshAdaptorTest.java +++ b/adaptors/ssh-adaptor/ssh-adaptor-bundle/src/test/java/org/onap/ccsdk/sli/adaptors/ssh/sshd/SshAdaptorTest.java @@ -32,11 +32,11 @@ import java.net.BindException; import java.nio.file.Paths; import java.util.Collections; import org.apache.sshd.common.util.OsUtils; +import org.apache.sshd.scp.server.ScpCommandFactory; import org.apache.sshd.server.SshServer; import org.apache.sshd.server.ServerFactoryManager; import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider; -import org.apache.sshd.server.scp.ScpCommandFactory; -import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory; +import org.apache.sshd.sftp.server.SftpSubsystemFactory; import org.hamcrest.CoreMatchers; import org.junit.After; import org.junit.Assert; |