diff options
Diffstat (limited to 'adapters/etsi-sol003-adapter')
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/pom.xml | 4 | ||||
-rwxr-xr-x | adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsisol003adapter/Application.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmAdapterApplication.java) | 16 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsisol003adapter/EtsiSol003AdapterBasicHttpSecurityConfigurer.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmBasicHttpSecurityConfigurer.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/CommonConstants.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/common/CommonConstants.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/VnfmAdapterUrlProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/common/VnfmAdapterUrlProvider.java) | 10 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/configuration/MessageConverterConfiguration.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/common/configuration/MessageConverterConfiguration.java) | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/AuthorizationServerConfig.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/AuthorizationServerConfig.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2AccessTokenAdapter.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2AccessTokenAdapter.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2ResourceServer.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2ResourceServer.java) | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2AccessTokenAdapter.java | 51 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/LifeCycleManagementConstants.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/LifeCycleManagementConstants.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/NvfmAdapterUtils.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/NvfmAdapterUtils.java) | 26 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/AbstractServiceProviderConfiguration.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/SdcPackageProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java) | 16 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiClientProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiClientProvider.java) | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiHelper.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java) | 10 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiPropertiesImpl.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiPropertiesImpl.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java) | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProviderImpl.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java) | 10 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/OamIpAddressSource.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/OamIpAddressSource.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vim/model/AccessInfo.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/AccessInfo.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vim/model/InterfaceInfo.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/InterfaceInfo.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vim/model/VimCredentials.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/VimCredentials.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmHelper.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHelper.java) | 42 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProvider.java) | 18 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java) | 10 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderImpl.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java) | 32 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmUrlProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmUrlProvider.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/jobmanagement/JobManager.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java) | 28 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/jobmanagement/VnfmOperation.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/VnfmOperation.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/lifecycle/LifecycleManager.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java) | 50 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/notificationhandling/NotificationHandler.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java) | 30 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterController.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterController.java) | 23 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantController.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantController.java) | 22 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnContoller.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnContoller.java) | 32 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/JobNotFoundException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/JobNotFoundException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/TenantNotFoundException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/TenantNotFoundException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/VnfNotFoundException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfNotFoundException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/VnfmNotFoundException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmNotFoundException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/VnfmRequestFailureException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmRequestFailureException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/AuthorizationServerConfig.java | 55 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2ResourceServer.java | 52 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java) | 67 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/HealthCheckTest.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/HealthCheckTest.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantControllerTest.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantControllerTest.java) | 22 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnControllerTest.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java) | 44 | ||||
-rwxr-xr-x | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/TestApplication.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/TestApplication.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/pom.xml | 16 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/etsisol003adapter.yaml (renamed from adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/vnfmadapter.yaml) | 0 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/pom.xml | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java | 154 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/pom.xml (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/pom.xml) | 8 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/ConversionServiceConfiguration.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/ConversionServiceConfiguration.java) | 16 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/PackageManagementConstants.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/PackageManagementConstants.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/AbstractCacheServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/AbstractCacheServiceProvider.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/CacheManagerConfiguration.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheManagerConfiguration.java) | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/CacheNotFoundException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheNotFoundException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/PkgmCacheServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProvider.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/PkgmCacheServiceProviderImpl.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProviderImpl.java) | 13 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java) | 21 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java) | 14 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java) | 15 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/VnfPkgInfoConverter.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/VnfPkgInfoConverter.java) | 26 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java) | 56 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/AbstractServiceProviderConfiguration.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java) | 13 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java) | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProvider.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java) | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java) | 26 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java) | 8 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogUrlProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogUrlProvider.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java) | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/EtsiSubscriptionNotificationController.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationController.java) | 59 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementController.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementController.java) | 12 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementSubscriptionController.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionController.java) | 12 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/AuthenticationTypeNotSupportedException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/AuthenticationTypeNotSupportedException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/ConversionFailedException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/ConversionFailedException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/EtsiCatalogManagerBadRequestException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerBadRequestException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/EtsiCatalogManagerRequestFailureException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerRequestFailureException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/InternalServerErrorException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/InternalServerErrorException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/NotificationTypeNotSupportedException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/NotificationTypeNotSupportedException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/SubscriptionNotFoundException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/SubscriptionNotFoundException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/VnfPkgBadRequestException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgBadRequestException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/VnfPkgConflictException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgConflictException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/VnfPkgNotFoundException.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgNotFoundException.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/AbstractNotificationServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java) | 4 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/BasicAuthNotificationServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/NotificationManager.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationManager.java) | 24 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/NotificationServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProvider.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/NotificationServiceProviderFactory.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProviderFactory.java) | 6 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/OAuthNotificationServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java) | 9 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/OAuthTokenResponse.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthTokenResponse.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/SubscriptionManager.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/SubscriptionManager.java) | 44 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/TlsNotificationServiceProvider.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/TlsNotificationServiceProvider.java) | 12 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/EtsiSubscriptionNotificationControllerTest.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java) | 149 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementControllerTest.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java) | 24 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementSubscriptionControllerTest.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionControllerTest.java) | 50 | ||||
-rwxr-xr-x | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/TestApplication.java (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/TestApplication.java) | 2 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/resources/application.yaml (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/application.yaml) | 0 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/resources/requests/SubscriptionRequest.json (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/requests/SubscriptionRequest.json) | 0 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-api/pom.xml (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/pom.xml) | 15 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-api/src/main/resources/ETSI-Catalog-Notification-API.json (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/ETSI-Catalog-Notification-API.json) | 0 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-api/src/main/resources/SOL003-VNFPackageManagement-API.json (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/SOL003-VNFPackageManagement-API.json) | 0 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-ext-clients/pom.xml (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/pom.xml) | 15 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-ext-clients/src/main/resources/ETSI-Catalog-API.json (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/ETSI-Catalog-API.json) | 0 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-ext-clients/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json) | 0 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/etsi-sol003-pkgm/pom.xml (renamed from adapters/etsi-sol003-adapter/etsi-sol003-package-management/pom.xml) | 8 | ||||
-rw-r--r-- | adapters/etsi-sol003-adapter/pom.xml | 2 |
111 files changed, 699 insertions, 960 deletions
diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/pom.xml index acf4790308..f1f8bb5a70 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/pom.xml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/pom.xml @@ -15,7 +15,7 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> - <mainClass>org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication</mainClass> + <mainClass>org.onap.so.adapters.etsisol003adapter.Application</mainClass> </configuration> <executions> <execution> @@ -79,7 +79,7 @@ </dependency> <dependency> <groupId>org.onap.so.adapters</groupId> - <artifactId>etsi-sol003-package-management-adapter</artifactId> + <artifactId>etsi-sol003-pkgm-adapter</artifactId> <version>${project.version}</version> </dependency> </dependencies> diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmAdapterApplication.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsisol003adapter/Application.java index 405bf896ef..261d2244d7 100755 --- a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmAdapterApplication.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsisol003adapter/Application.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsisol003adapter; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.rest.VnfmAdapterController; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.EtsiSol003AdapterController; import org.slf4j.Logger; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -30,10 +30,10 @@ import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.cache.annotation.EnableCaching; /** - * The spring boot application for the VNFM (Virtual Network Function Manager) Adapter. + * The spring boot application for the ETSI SOL003 Adapter. * <p> - * The VNFM Adapter receives requests through its REST API {@link VnfmAdapterController} which it adapts into ETSI - * SOL003 compliant LCM (Life Cycle Management) calls towards an ETSI compliant VNFM. + * The ETSI SOL003 Adapter receives requests through its REST API {@link EtsiSol003AdapterController} which it adapts + * into ETSI SOL003 compliant LCM (Life Cycle Management) calls towards an ETSI compliant VNFM. * * @see <a href= "https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.05.01_60/gs_nfv-sol003v020501p.pdf">ETSI * SOL003 v2.5.1</a> @@ -41,8 +41,8 @@ import org.springframework.cache.annotation.EnableCaching; @EnableCaching @SpringBootApplication(scanBasePackages = {"org.onap.so"}) @EnableAutoConfiguration(exclude = {JacksonAutoConfiguration.class}) -public class VnfmAdapterApplication { - private static final Logger logger = getLogger(VnfmAdapterApplication.class); +public class Application { + private static final Logger logger = getLogger(Application.class); /** * Entry point for the Spring boot application @@ -50,7 +50,7 @@ public class VnfmAdapterApplication { * @param args arguments for the application */ public static void main(final String[] args) { - new SpringApplication(VnfmAdapterApplication.class).run(args); + new SpringApplication(Application.class).run(args); logger.info("VnfmAdapterApplication started!"); } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmBasicHttpSecurityConfigurer.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsisol003adapter/EtsiSol003AdapterBasicHttpSecurityConfigurer.java index da1b396aac..618b4f6116 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/vnfmadapter/VnfmBasicHttpSecurityConfigurer.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-application/src/main/java/org/onap/so/adapters/etsisol003adapter/EtsiSol003AdapterBasicHttpSecurityConfigurer.java @@ -20,9 +20,9 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsisol003adapter; -import org.onap.so.adapters.vnfmadapter.common.CommonConstants; +import org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants; import org.onap.so.security.HttpSecurityConfigurer; import org.onap.so.security.SoUserCredentialConfiguration; import org.springframework.beans.factory.annotation.Autowired; @@ -39,7 +39,7 @@ import org.springframework.util.StringUtils; */ @Primary @Component -public class VnfmBasicHttpSecurityConfigurer implements HttpSecurityConfigurer { +public class EtsiSol003AdapterBasicHttpSecurityConfigurer implements HttpSecurityConfigurer { @Autowired private SoUserCredentialConfiguration soUserCredentialConfiguration; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/common/CommonConstants.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/CommonConstants.java index 963bd512da..dbe4dac321 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/common/CommonConstants.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/CommonConstants.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.common; +package org.onap.so.adapters.etsi.sol003.adapter.common; /** * VNFM Adapter Common constants diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/common/VnfmAdapterUrlProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/VnfmAdapterUrlProvider.java index 99611ad3db..855b5a454f 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/common/VnfmAdapterUrlProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/VnfmAdapterUrlProvider.java @@ -17,12 +17,12 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.common; +package org.onap.so.adapters.etsi.sol003.adapter.common; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.BASE_URL; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.OPERATION_NOTIFICATION_ENDPOINT; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.OPERATION_NOTIFICATION_ENDPOINT; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; import static org.slf4j.LoggerFactory.getLogger; import java.net.URI; import java.security.GeneralSecurityException; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/common/configuration/MessageConverterConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/configuration/MessageConverterConfiguration.java index 6f3e0dafd5..25c37b9016 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/common/configuration/MessageConverterConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/common/configuration/MessageConverterConfiguration.java @@ -17,11 +17,11 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.common.configuration; +package org.onap.so.adapters.etsi.sol003.adapter.common.configuration; import java.util.ArrayList; import java.util.Collection; -import org.onap.so.adapters.vnfmadapter.oauth.OAuth2AccessTokenAdapter; +import org.onap.so.adapters.etsi.sol003.adapter.oauth.configuration.OAuth2AccessTokenAdapter; import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/AuthorizationServerConfig.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/AuthorizationServerConfig.java index 83534ff4bb..3a3287535e 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/AuthorizationServerConfig.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/AuthorizationServerConfig.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.oauth; +package org.onap.so.adapters.etsi.sol003.adapter.oauth.configuration; import org.onap.so.utils.CryptoUtils; import org.springframework.beans.factory.annotation.Value; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2AccessTokenAdapter.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2AccessTokenAdapter.java index 2f51406e23..4be5b8a86a 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2AccessTokenAdapter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2AccessTokenAdapter.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.oauth; +package org.onap.so.adapters.etsi.sol003.adapter.oauth.configuration; import com.google.gson.JsonArray; import com.google.gson.JsonElement; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2ResourceServer.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2ResourceServer.java index 9c871db79c..2dcfea4045 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2ResourceServer.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/etsi/sol003/adapter/oauth/configuration/OAuth2ResourceServer.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.oauth; +package org.onap.so.adapters.etsi.sol003.adapter.oauth.configuration; import javax.servlet.http.HttpServletRequest; -import org.onap.so.adapters.vnfmadapter.common.CommonConstants; +import org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2AccessTokenAdapter.java b/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2AccessTokenAdapter.java deleted file mode 100644 index 2f51406e23..0000000000 --- a/adapters/etsi-sol003-adapter/etsi-sol003-adapter-common/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2AccessTokenAdapter.java +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnfmadapter.oauth; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import java.lang.reflect.Type; -import org.springframework.security.oauth2.common.OAuth2AccessToken; - -public class OAuth2AccessTokenAdapter implements JsonSerializer<OAuth2AccessToken> { - - @Override - public JsonElement serialize(final OAuth2AccessToken src, final Type typeOfSrc, - final JsonSerializationContext context) { - final JsonObject obj = new JsonObject(); - obj.addProperty(OAuth2AccessToken.ACCESS_TOKEN, src.getValue()); - obj.addProperty(OAuth2AccessToken.TOKEN_TYPE, src.getTokenType()); - if (src.getRefreshToken() != null) { - obj.addProperty(OAuth2AccessToken.REFRESH_TOKEN, src.getRefreshToken().getValue()); - } - obj.addProperty(OAuth2AccessToken.EXPIRES_IN, src.getExpiresIn()); - final JsonArray scopeObj = new JsonArray(); - for (final String scope : src.getScope()) { - scopeObj.add(scope); - } - obj.add(OAuth2AccessToken.SCOPE, scopeObj); - - return obj; - } -} diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/LifeCycleManagementConstants.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/LifeCycleManagementConstants.java index c812863901..d9804072b7 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/LifeCycleManagementConstants.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/LifeCycleManagementConstants.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsisol003adapter.lcm; /** * ETSI SOL003 Life Cycle Management Adapter constants diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/NvfmAdapterUtils.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/NvfmAdapterUtils.java index db34cbf3f2..a46ad8ffd4 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/NvfmAdapterUtils.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/NvfmAdapterUtils.java @@ -18,33 +18,33 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsisol003adapter.lcm; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import org.slf4j.Logger; +import static org.slf4j.LoggerFactory.getLogger; import java.util.ArrayList; import java.util.Collection; -import static org.slf4j.LoggerFactory.getLogger; +import org.slf4j.Logger; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; public class NvfmAdapterUtils { private static Logger logger = getLogger(NvfmAdapterUtils.class); - public static JsonObject child(JsonObject parent, String name) { + public static JsonObject child(final JsonObject parent, final String name) { return childElement(parent, name).getAsJsonObject(); } - public static JsonElement childElement(JsonObject parent, String name) { - JsonElement child = parent.get(name); + public static JsonElement childElement(final JsonObject parent, final String name) { + final JsonElement child = parent.get(name); if (child == null) { throw abortOperation("Missing child " + name); } return child; } - public static Collection<JsonObject> children(JsonObject parent) { - ArrayList<JsonObject> childElements = new ArrayList<>(); - for (String childKey : parent.keySet()) { + public static Collection<JsonObject> children(final JsonObject parent) { + final ArrayList<JsonObject> childElements = new ArrayList<>(); + for (final String childKey : parent.keySet()) { if (parent.get(childKey).isJsonObject()) { childElements.add(parent.get(childKey).getAsJsonObject()); } @@ -52,12 +52,12 @@ public class NvfmAdapterUtils { return childElements; } - public static RuntimeException abortOperation(String msg, Exception e) { + public static RuntimeException abortOperation(final String msg, final Exception e) { logger.error(msg, e); return new RuntimeException(msg, e); } - public static RuntimeException abortOperation(String msg) { + public static RuntimeException abortOperation(final String msg) { logger.error(msg); return new RuntimeException(msg); } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/AbstractServiceProviderConfiguration.java index 8f6d853997..b9ce641096 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/AbstractServiceProviderConfiguration.java @@ -18,15 +18,15 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients; -import com.google.gson.Gson; import java.util.Iterator; -import org.onap.vnfmadapter.v1.JSON; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.JSON; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; +import com.google.gson.Gson; /** * A base class that can be extended by classes for configuring HttpRestServiceProvider classes. Provides common methods diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/SdcPackageProvider.java index 735e1f9d42..497de2874c 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/SdcPackageProvider.java @@ -20,7 +20,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients; import static com.google.common.base.Splitter.on; import static com.google.common.collect.Iterables.filter; @@ -28,15 +28,12 @@ import static com.google.common.io.ByteStreams.toByteArray; import static java.lang.String.format; import static org.apache.http.HttpHeaders.ACCEPT; import static org.apache.http.HttpHeaders.AUTHORIZATION; -import static org.onap.so.adapters.vnfmadapter.NvfmAdapterUtils.abortOperation; -import static org.onap.so.adapters.vnfmadapter.NvfmAdapterUtils.child; -import static org.onap.so.adapters.vnfmadapter.NvfmAdapterUtils.childElement; -import static org.onap.so.adapters.vnfmadapter.NvfmAdapterUtils.children; +import static org.onap.so.adapters.etsisol003adapter.lcm.NvfmAdapterUtils.abortOperation; +import static org.onap.so.adapters.etsisol003adapter.lcm.NvfmAdapterUtils.child; +import static org.onap.so.adapters.etsisol003adapter.lcm.NvfmAdapterUtils.childElement; +import static org.onap.so.adapters.etsisol003adapter.lcm.NvfmAdapterUtils.children; import static org.slf4j.LoggerFactory.getLogger; import static org.springframework.http.MediaType.APPLICATION_OCTET_STREAM_VALUE; -import com.google.common.io.ByteStreams; -import com.google.gson.Gson; -import com.google.gson.JsonObject; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -61,6 +58,9 @@ import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.yaml.snakeyaml.Yaml; +import com.google.common.io.ByteStreams; +import com.google.gson.Gson; +import com.google.gson.JsonObject; @Component public class SdcPackageProvider { diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiClientProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiClientProvider.java index 674314d9da..529be0eb2e 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiClientProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiClientProvider.java @@ -18,9 +18,9 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai; -import org.onap.so.client.aai.AAIResourcesClient; +import org.onap.aaiclient.client.aai.AAIResourcesClient; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiHelper.java index 6a7bc6b94b..958d2ebca8 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiHelper.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiHelper.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai; import java.util.Collections; import java.util.HashMap; @@ -32,10 +32,10 @@ import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.Vserver; -import org.onap.so.adapters.vnfmadapter.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.TenantNotFoundException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.TenantNotFoundException; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.VnfmNotFoundException; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.Tenant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiPropertiesImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiPropertiesImpl.java index cfaad3fd04..b3b22e239d 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiPropertiesImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiPropertiesImpl.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai; -import org.onap.so.client.aai.AAIProperties; -import org.onap.so.client.aai.AAIVersion; +import org.onap.aaiclient.client.aai.AAIProperties; +import org.onap.aaiclient.client.aai.AAIVersion; import org.onap.so.spring.SpringContextHelper; import org.springframework.context.ApplicationContext; import java.net.MalformedURLException; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProvider.java index d19190d88e..f527b6cd97 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai; import org.onap.aai.domain.yang.EsrSystemInfoList; import org.onap.aai.domain.yang.EsrVnfm; @@ -26,7 +26,7 @@ import org.onap.aai.domain.yang.EsrVnfmList; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.GenericVnfs; import org.onap.aai.domain.yang.Vserver; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.Tenant; /** * Provides methods for invoking REST calls to AAI. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProviderImpl.java index 6dc6020834..d9450b3472 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/AaiServiceProviderImpl.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai; import org.onap.aai.domain.yang.EsrSystemInfoList; import org.onap.aai.domain.yang.EsrVnfm; @@ -26,10 +26,10 @@ import org.onap.aai.domain.yang.EsrVnfmList; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.GenericVnfs; import org.onap.aai.domain.yang.Vserver; -import org.onap.so.client.aai.AAIObjectType; -import org.onap.so.client.aai.entities.uri.AAIUriFactory; -import org.onap.so.client.graphinventory.entities.uri.Depth; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.aaiclient.client.aai.AAIObjectType; +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; +import org.onap.aaiclient.client.graphinventory.entities.uri.Depth; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.Tenant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/OamIpAddressSource.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/OamIpAddressSource.java index 311c4de8bd..b81925241c 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/OamIpAddressSource.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/aai/OamIpAddressSource.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.aai; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai; /** * Represents the source of the value to use as the AAI OAM IP address of a VNF diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/AccessInfo.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vim/model/AccessInfo.java index 9ab7618ee3..139df248d4 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/AccessInfo.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vim/model/AccessInfo.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vim.model; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.vim.model; import java.util.Objects; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/InterfaceInfo.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vim/model/InterfaceInfo.java index ae28ea589c..9d4355a0c4 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/InterfaceInfo.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vim/model/InterfaceInfo.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vim.model; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.vim.model; import java.util.Objects; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/VimCredentials.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vim/model/VimCredentials.java index 63b00b4ef2..fd1a9078bb 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vim/model/VimCredentials.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vim/model/VimCredentials.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vim.model; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.vim.model; import java.util.Objects; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHelper.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmHelper.java index e9f8f2f5e4..9155261bd2 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHelper.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmHelper.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm; import java.security.GeneralSecurityException; import java.util.ArrayList; @@ -26,26 +26,26 @@ import java.util.List; import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; import org.onap.aai.domain.yang.EsrSystemInfo; -import org.onap.so.adapters.vnfmadapter.common.VnfmAdapterUrlProvider; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vim.model.AccessInfo; -import org.onap.so.adapters.vnfmadapter.extclients.vim.model.InterfaceInfo; -import org.onap.so.adapters.vnfmadapter.extclients.vim.model.VimCredentials; -import org.onap.so.adapters.vnfmadapter.grant.model.InlineResponse201VimConnections; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthenticationParamsBasic; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsAuthenticationParamsOauth2ClientCredentials; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsFilter; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsFilter.NotificationTypesEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.SubscriptionsFilterVnfInstanceSubscriptionFilter; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateExtVirtualLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.ExternalVirtualLink; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vim.model.AccessInfo; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vim.model.InterfaceInfo; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vim.model.VimCredentials; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InstantiateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.SubscriptionsAuthenticationParamsBasic; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.SubscriptionsAuthenticationParamsOauth2ClientCredentials; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.SubscriptionsFilter; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.SubscriptionsFilter.NotificationTypesEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.SubscriptionsFilterVnfInstanceSubscriptionFilter; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateExtVirtualLinks; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.VnfInstancesvnfInstanceIdinstantiateVimConnectionInfo; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.InlineResponse201VimConnections; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.ExternalVirtualLink; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.Tenant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProvider.java index cb8c7c4e56..a6c6740235 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProvider.java @@ -18,17 +18,17 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm; -import com.google.common.base.Optional; import org.onap.aai.domain.yang.EsrVnfm; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.CreateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse2001; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InstantiateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.TerminateVnfRequest; +import com.google.common.base.Optional; /** * Provides methods for invoking REST calls to a VNFM. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java index eaaa8d8544..e35dafb4ea 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderConfiguration.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm; import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; import java.io.IOException; @@ -39,7 +39,7 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContextBuilder; import org.onap.aai.domain.yang.EsrSystemInfo; import org.onap.aai.domain.yang.EsrVnfm; -import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.AbstractServiceProviderConfiguration; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.onap.so.rest.service.HttpRestServiceProvider; import org.onap.so.rest.service.HttpRestServiceProviderImpl; @@ -63,7 +63,7 @@ import org.springframework.web.client.RestTemplate; public class VnfmServiceProviderConfiguration extends AbstractServiceProviderConfiguration { private static final Logger logger = LoggerFactory.getLogger(VnfmServiceProviderConfiguration.class); - private Map<String, HttpRestServiceProvider> mapOfVnfmIdToHttpRestServiceProvider = new ConcurrentHashMap<>(); + private final Map<String, HttpRestServiceProvider> mapOfVnfmIdToHttpRestServiceProvider = new ConcurrentHashMap<>(); @Value("${http.client.ssl.trust-store:#{null}}") private Resource trustStore; @@ -82,7 +82,7 @@ public class VnfmServiceProviderConfiguration extends AbstractServiceProviderCon private String oauthEndpoint; @Qualifier(CONFIGURABLE_REST_TEMPLATE) - @Autowired() + @Autowired private RestTemplate defaultRestTemplate; public HttpRestServiceProvider getHttpRestServiceProvider(final EsrVnfm vnfm) { @@ -130,7 +130,7 @@ public class VnfmServiceProviderConfiguration extends AbstractServiceProviderCon SSLContext sslContext; try { if (keyStoreResource != null) { - KeyStore keystore = KeyStore.getInstance("pkcs12"); + final KeyStore keystore = KeyStore.getInstance("pkcs12"); keystore.load(keyStoreResource.getInputStream(), keyStorePassword.toCharArray()); sslContext = new SSLContextBuilder().loadTrustMaterial(trustStore.getURL(), trustStorePassword.toCharArray()) diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderImpl.java index d898de3ad0..6ad5c16e4c 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmServiceProviderImpl.java @@ -18,20 +18,19 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm; -import com.google.common.base.Optional; import org.onap.aai.domain.yang.EsrVnfm; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmRequestFailureException; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.CreateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse2001; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InstantiateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.TerminateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.VnfmRequestFailureException; import org.onap.so.rest.exceptions.RestProcessingException; import org.onap.so.rest.service.HttpRestServiceProvider; import org.slf4j.Logger; @@ -40,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import com.google.common.base.Optional; @Service public class VnfmServiceProviderImpl implements VnfmServiceProvider { @@ -50,7 +50,7 @@ public class VnfmServiceProviderImpl implements VnfmServiceProvider { @Autowired public VnfmServiceProviderImpl(final VnfmUrlProvider urlProvider, - VnfmServiceProviderConfiguration vnfmServiceProviderConfiguration) { + final VnfmServiceProviderConfiguration vnfmServiceProviderConfiguration) { this.vnfmServiceProviderConfiguration = vnfmServiceProviderConfiguration; this.urlProvider = urlProvider; } @@ -120,7 +120,7 @@ public class VnfmServiceProviderImpl implements VnfmServiceProvider { Void.class); } catch (final RestProcessingException restProcessingException) { if (restProcessingException.getStatusCode() == HttpStatus.CONFLICT.value()) { - InlineResponse201 vnf = getVnf(vnfm, vnfSelfLink).get(); + final InlineResponse201 vnf = getVnf(vnfm, vnfSelfLink).get(); if (vnf.getInstantiationState().equals(InstantiationStateEnum.NOT_INSTANTIATED)) { return JobManager.ALREADY_COMPLETED_OPERATION_ID; } else { @@ -171,8 +171,8 @@ public class VnfmServiceProviderImpl implements VnfmServiceProvider { } } - private void checkIfResponseIsAcceptable(ResponseEntity<Void> response, String vnfSelfLink, - TerminateVnfRequest terminateVnfRequest) { + private void checkIfResponseIsAcceptable(final ResponseEntity<Void> response, final String vnfSelfLink, + final TerminateVnfRequest terminateVnfRequest) { if (response == null) { final String errorMessage = "Terminate request to " + vnfSelfLink + ", response is null, " + "request: " + terminateVnfRequest; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmUrlProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmUrlProvider.java index 9c760b44b1..a9319c07fe 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmUrlProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/extclients/vnfm/VnfmUrlProvider.java @@ -18,14 +18,14 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm; import static org.slf4j.LoggerFactory.getLogger; import java.net.URI; import org.onap.aai.domain.yang.EsrSystemInfo; import org.onap.aai.domain.yang.EsrSystemInfoList; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.VnfmNotFoundException; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/jobmanagement/JobManager.java index 3de94ebe05..5ac0179176 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/jobmanagement/JobManager.java @@ -18,25 +18,25 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.jobmanagement; +package org.onap.so.adapters.etsisol003adapter.lcm.jobmanagement; import static org.slf4j.LoggerFactory.getLogger; -import com.google.common.base.Optional; -import com.google.common.collect.Maps; import java.util.Map; import java.util.UUID; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.JobNotFoundException; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.VnfmServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.JobNotFoundException; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.OperationEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.OperationStateEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.OperationStatusRetrievalStatusEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.QueryJobResponse; import org.onap.so.rest.exceptions.HttpResouceNotFoundException; -import org.onap.vnfmadapter.v1.model.OperationEnum; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; -import org.onap.vnfmadapter.v1.model.OperationStatusRetrievalStatusEnum; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import com.google.common.base.Optional; +import com.google.common.collect.Maps; /** * Manages jobs enabling the status of jobs to be queried. A job is associated with an operation on a VNFM. @@ -134,11 +134,11 @@ public class JobManager { final InlineResponse200 operationResponse) { switch (vnfmOperation.getNotificationStatus()) { case NOTIFICATION_PROCESSING_PENDING: - return org.onap.vnfmadapter.v1.model.OperationStateEnum.PROCESSING; + return org.onap.so.adapters.etsisol003adapter.lcm.v1.model.OperationStateEnum.PROCESSING; case NOTIFICATION_PROCEESING_SUCCESSFUL: - return org.onap.vnfmadapter.v1.model.OperationStateEnum.COMPLETED; + return org.onap.so.adapters.etsisol003adapter.lcm.v1.model.OperationStateEnum.COMPLETED; case NOTIFICATION_PROCESSING_FAILED: - return org.onap.vnfmadapter.v1.model.OperationStateEnum.FAILED; + return org.onap.so.adapters.etsisol003adapter.lcm.v1.model.OperationStateEnum.FAILED; default: if (operationResponse == null || operationResponse.getOperationState() == null) return null; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/VnfmOperation.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/jobmanagement/VnfmOperation.java index 3bfe48af12..8cb9197d44 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/VnfmOperation.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/jobmanagement/VnfmOperation.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.jobmanagement; +package org.onap.so.adapters.etsisol003adapter.lcm.jobmanagement; /** * Represents an operation on a VNFM. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/lifecycle/LifecycleManager.java index a885721b76..8ba56c5051 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/lifecycle/LifecycleManager.java @@ -18,36 +18,36 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.lifecycle; +package org.onap.so.adapters.etsisol003adapter.lcm.lifecycle; -import com.google.common.base.Optional; import java.util.Map; import org.onap.aai.domain.yang.EsrVnfm; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; -import org.onap.so.adapters.vnfmadapter.extclients.SdcPackageProvider; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource.OamIpAddressType; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmHelper; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest.TerminationTypeEnum; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfNotFoundException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmRequestFailureException; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.SdcPackageProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.OamIpAddressSource; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.OamIpAddressSource.OamIpAddressType; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.VnfmHelper; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.VnfmServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InstantiateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.TerminateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.TerminateVnfRequest.TerminationTypeEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.VnfNotFoundException; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.VnfmNotFoundException; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.VnfmRequestFailureException; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.DeleteVnfResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import com.google.common.base.Optional; /** * Manages lifecycle operations towards the VNFMs. @@ -82,7 +82,7 @@ public class LifecycleManager { * @return the response to the request */ public CreateVnfResponse createVnf(final String vnfIdInAai, final CreateVnfRequest request) { - GenericVnf genericVnf = getGenericVnfFromAai(vnfIdInAai); + final GenericVnf genericVnf = getGenericVnfFromAai(vnfIdInAai); EsrVnfm vnfm = aaiHelper.getAssignedVnfm(genericVnf); checkIfVnfAlreadyExistsInVnfm(vnfm, genericVnf); @@ -96,7 +96,7 @@ public class LifecycleManager { genericVnf.setSelflink(getSelfLink(vnfmResponse, vnfm)); - GenericVnf genericVnfPatch = new GenericVnf(); + final GenericVnf genericVnfPatch = new GenericVnf(); genericVnfPatch.setVnfId(genericVnf.getVnfId()); genericVnfPatch.setSelflink(genericVnf.getSelflink()); aaiServiceProvider.invokePatchGenericVnf(genericVnfPatch); @@ -155,8 +155,8 @@ public class LifecycleManager { private InlineResponse201 sendCreateRequestToVnfm(final CreateVnfRequest aaiRequest, final GenericVnf genericVnf, final String vnfIdInAai, final EsrVnfm vnfm) { logger.debug("Sending a create request to SVNFM " + aaiRequest); - final org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest vnfmRequest = - new org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest(); + final org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.CreateVnfRequest vnfmRequest = + new org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.CreateVnfRequest(); final String vnfdId = packageProvider.getVnfdId(genericVnf.getModelVersionId()); vnfmRequest.setVnfdId(vnfdId); diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/notificationhandling/NotificationHandler.java index 09722d4e32..f23fac8115 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/notificationhandling/NotificationHandler.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/notificationhandling/NotificationHandler.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.notificationhandling; +package org.onap.so.adapters.etsisol003adapter.lcm.notificationhandling; import static org.slf4j.LoggerFactory.getLogger; import java.util.HashMap; @@ -29,18 +29,18 @@ import org.json.JSONObject; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.Vserver; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource.OamIpAddressType; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider; -import org.onap.so.adapters.vnfmadapter.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; -import org.onap.so.adapters.vnfmadapter.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfLcmOperationOccurrenceNotification; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.OamIpAddressSource; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.OamIpAddressSource.OamIpAddressType; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.VnfmServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201VimConnectionInfo; +import org.onap.so.adapters.etsisol003adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; import org.slf4j.Logger; /** @@ -220,11 +220,11 @@ public class NotificationHandler implements Runnable { } } - private boolean deleteVnfIdentifierOnVnfm(GenericVnf genericVnf) { + private boolean deleteVnfIdentifierOnVnfm(final GenericVnf genericVnf) { try { vnfmServiceProvider.deleteVnf(aaiHelper.getAssignedVnfm(genericVnf), genericVnf.getSelflink()); return true; - } catch (Exception exception) { + } catch (final Exception exception) { logger.error("Exception deleting the identifier " + genericVnf.getSelflink() + " from the VNFM. The VNF has been terminated successfully but the identifier will remain on the VNFM.", exception); diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterController.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterController.java index 33ee88108d..70131c89a5 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterController.java @@ -18,19 +18,18 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.lcm.rest; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.BASE_URL; import javax.validation.Valid; import javax.ws.rs.core.MediaType; import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.onap.so.adapters.vnfmadapter.common.CommonConstants; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; -import org.onap.so.adapters.vnfmadapter.lifecycle.LifecycleManager; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; +import org.onap.so.adapters.etsisol003adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsisol003adapter.lcm.lifecycle.LifecycleManager; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.QueryJobResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; @@ -53,14 +52,14 @@ import io.swagger.annotations.ApiParam; @Controller @RequestMapping(value = BASE_URL, produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}, consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) -public class VnfmAdapterController { +public class EtsiSol003AdapterController { - private static final Logger logger = LoggerFactory.getLogger(VnfmAdapterController.class); + private static final Logger logger = LoggerFactory.getLogger(EtsiSol003AdapterController.class); private final LifecycleManager lifecycleManager; private final JobManager jobManager; @Autowired - VnfmAdapterController(final LifecycleManager lifecycleManager, final JobManager jobManager) { + EtsiSol003AdapterController(final LifecycleManager lifecycleManager, final JobManager jobManager) { this.lifecycleManager = lifecycleManager; this.jobManager = jobManager; } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantController.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantController.java index a485b1d18a..8a17b68fae 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantController.java @@ -18,22 +18,22 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.lcm.rest; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.BASE_URL; import java.util.ArrayList; import java.util.List; import java.util.UUID; import javax.ws.rs.core.MediaType; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmHelper; -import org.onap.so.adapters.vnfmadapter.grant.model.GrantRequest; -import org.onap.so.adapters.vnfmadapter.grant.model.GrantsAddResources; -import org.onap.so.adapters.vnfmadapter.grant.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.grant.model.InlineResponse201AddResources; -import org.onap.so.adapters.vnfmadapter.grant.model.InlineResponse201VimConnections; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.VnfmHelper; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantsAddResources; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.InlineResponse201AddResources; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.InlineResponse201VimConnections; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.Tenant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnContoller.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnContoller.java index 49bad20fb8..784fb8efa6 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnContoller.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnContoller.java @@ -18,27 +18,27 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.lcm.rest; -import static org.onap.so.adapters.vnfmadapter.LifeCycleManagementConstants.OPERATION_NOTIFICATION_ENDPOINT; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.BASE_URL; +import static org.onap.so.adapters.etsisol003adapter.lcm.LifeCycleManagementConstants.OPERATION_NOTIFICATION_ENDPOINT; import static org.slf4j.LoggerFactory.getLogger; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import javax.ws.rs.core.MediaType; import org.onap.aai.domain.yang.EsrVnfm; import org.onap.aai.domain.yang.GenericVnf; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmServiceProvider; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfIdentifierCreationNotification; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfIdentifierDeletionNotification; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfLcmOperationOccurrenceNotification; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.jobmanagement.JobManager; -import org.onap.so.adapters.vnfmadapter.notificationhandling.NotificationHandler; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.VnfmServiceProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.lcm.jobmanagement.JobManager; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfIdentifierCreationNotification; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfIdentifierDeletionNotification; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.notificationhandling.NotificationHandler; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -120,10 +120,10 @@ public class Sol003LcnContoller { private InlineResponse201 getVnfInstance( final VnfLcmOperationOccurrenceNotification vnfLcmOperationOccurrenceNotification) { - GenericVnf vnfInAai = aaiServiceProvider + final GenericVnf vnfInAai = aaiServiceProvider .invokeQueryGenericVnf(vnfLcmOperationOccurrenceNotification.getLinks().getVnfInstance().getHref()) .getGenericVnf().get(0); - EsrVnfm vnfm = aaiHelper.getAssignedVnfm(vnfInAai); + final EsrVnfm vnfm = aaiHelper.getAssignedVnfm(vnfInAai); return vnfmServiceProvider .getVnf(vnfm, vnfLcmOperationOccurrenceNotification.getLinks().getVnfInstance().getHref()).get(); } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/JobNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/JobNotFoundException.java index bc7c569231..2461631bc4 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/JobNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/JobNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/TenantNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/TenantNotFoundException.java index 215e68adcf..b7911c82e7 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/TenantNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/TenantNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions; /** * Exception for Tenant not found. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/VnfNotFoundException.java index 9b73293020..78232e2622 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/VnfNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/VnfmNotFoundException.java index 4e494c14c6..6720d0bd92 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/VnfmNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmRequestFailureException.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/VnfmRequestFailureException.java index 9f50a2cee1..10ada7ce18 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfmRequestFailureException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/exceptions/VnfmRequestFailureException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions; /** * Exception indicating a request to a VNFM failed. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/AuthorizationServerConfig.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/AuthorizationServerConfig.java deleted file mode 100644 index 7f71b2e9d6..0000000000 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/AuthorizationServerConfig.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnfmadapter.oauth; - -import org.onap.so.utils.CryptoUtils; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; -import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; -import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; - -@Configuration -@EnableAuthorizationServer -/** - * Configures the authorization server for oauth token based authentication. - */ -public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter { - - private static final int ONE_DAY = 60 * 60 * 24; - - @Value("${vnfmadapter.auth:E39823AAB2739CC654C4E92B52C05BC34149342D0A46451B00CA508C8EDC62242CE4E9DA9445D3C01A3F13}") - private String vnfmAdapterAuth; - - @Value("${mso.key}") - private String msoEncryptionKey; - - @Override - public void configure(final ClientDetailsServiceConfigurer clients) throws Exception { - final String[] decrypedAuth = CryptoUtils.decrypt(vnfmAdapterAuth, msoEncryptionKey).split(":"); - BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); - clients.inMemory().withClient(decrypedAuth[0]).secret(passwordEncoder.encode(decrypedAuth[1])) - .authorizedGrantTypes("client_credentials").scopes("write").accessTokenValiditySeconds(ONE_DAY) - .refreshTokenValiditySeconds(ONE_DAY); - } - -} diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2ResourceServer.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2ResourceServer.java deleted file mode 100644 index 23533e90df..0000000000 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/oauth/OAuth2ResourceServer.java +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnfmadapter.oauth; - -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.BASE_URL; -import javax.servlet.http.HttpServletRequest; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; -import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; -import org.springframework.security.web.util.matcher.RequestMatcher; - -@Configuration -@EnableResourceServer -/** - * Enforces oauth token based authentication when a token is provided in the request. - */ -public class OAuth2ResourceServer extends ResourceServerConfigurerAdapter { - - @Override - public void configure(final HttpSecurity http) throws Exception { - http.requestMatcher(new OAuth2ResourceServerRequestMatcher()).authorizeRequests() - .antMatchers(BASE_URL + "/grants/**", BASE_URL + "/lcn/**").authenticated(); - } - - private static class OAuth2ResourceServerRequestMatcher implements RequestMatcher { - @Override - public boolean matches(HttpServletRequest request) { - String auth = request.getHeader("Authorization"); - String uri = request.getRequestURI(); - return (auth != null && auth.startsWith("Bearer") && (uri.contains("/grants") || uri.contains("/lcn/"))); - } - } -} diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties index 86cc3f0a0e..bc6ef94f42 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/main/resources/META-INF/services/org.onap.so.client.RestProperties @@ -1 +1 @@ -org.onap.so.adapters.vnfmadapter.extclients.aai.AaiPropertiesImpl
\ No newline at end of file +org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiPropertiesImpl
\ No newline at end of file diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java index 9fbea38f65..eaf40b546f 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/EtsiSol003AdapterControllerTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.lcm.rest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -33,7 +33,6 @@ import static org.springframework.test.web.client.match.MockRestRequestMatchers. import static org.springframework.test.web.client.response.MockRestResponseCreators.withBadRequest; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; -import com.google.gson.Gson; import java.net.URI; import java.util.Optional; import org.hamcrest.BaseMatcher; @@ -52,25 +51,25 @@ import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; -import org.onap.so.adapters.vnfmadapter.extclients.SdcPackageProvider; -import org.onap.so.adapters.vnfmadapter.lcn.JSON; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201Links; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException; -import org.onap.so.client.aai.AAIResourcesClient; -import org.onap.so.client.aai.AAIVersion; -import org.onap.so.client.aai.entities.uri.AAIResourceUri; -import org.onap.vnfmadapter.v1.model.CreateVnfRequest; -import org.onap.vnfmadapter.v1.model.CreateVnfResponse; -import org.onap.vnfmadapter.v1.model.DeleteVnfResponse; -import org.onap.vnfmadapter.v1.model.OperationEnum; -import org.onap.vnfmadapter.v1.model.OperationStateEnum; -import org.onap.vnfmadapter.v1.model.QueryJobResponse; -import org.onap.vnfmadapter.v1.model.Tenant; +import org.onap.aaiclient.client.aai.AAIResourcesClient; +import org.onap.aaiclient.client.aai.AAIVersion; +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.SdcPackageProvider; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse2001; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201Links; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201LinksSelf; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.JSON; +import org.onap.so.adapters.etsisol003adapter.lcm.rest.exceptions.VnfmNotFoundException; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.CreateVnfRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.CreateVnfResponse; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.DeleteVnfResponse; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.OperationEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.OperationStateEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.QueryJobResponse; +import org.onap.so.adapters.etsisol003adapter.lcm.v1.model.Tenant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; @@ -89,12 +88,12 @@ import org.springframework.web.client.RestTemplate; import org.threeten.bp.LocalDateTime; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.ZoneOffset; +import com.google.gson.Gson; @RunWith(SpringRunner.class) @SpringBootTest(classes = TestApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") - -public class VnfmAdapterControllerTest { +public class EtsiSol003AdapterControllerTest { private static final OffsetDateTime JAN_1_2019_12_00 = OffsetDateTime.of(LocalDateTime.of(2019, 1, 1, 12, 0), ZoneOffset.UTC); @@ -118,7 +117,7 @@ public class VnfmAdapterControllerTest { SdcPackageProvider sdcPackageProvider; @Autowired - VnfmAdapterController controller; + EtsiSol003AdapterController controller; Gson gson = new JSON().getGson(); @Before @@ -152,14 +151,14 @@ public class VnfmAdapterControllerTest { .location(new URI("http://vnfm2:8080/vnf_lcm_op_occs/123456"))); final InlineResponse200 firstOperationQueryResponse = createOperationQueryResponse( - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE, - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING); + org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE, + org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING); mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_lcm_op_occs/123456")) .andRespond(withSuccess(gson.toJson(firstOperationQueryResponse), MediaType.APPLICATION_JSON)); final InlineResponse200 secondOperationQueryReponse = createOperationQueryResponse( - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE, - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED); + org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.INSTANTIATE, + org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED); mockRestServer.expect(requestTo("http://vnfm2:8080/vnf_lcm_op_occs/123456")) .andRespond(withSuccess(gson.toJson(secondOperationQueryReponse), MediaType.APPLICATION_JSON)); @@ -289,14 +288,14 @@ public class VnfmAdapterControllerTest { .location(new URI("http://vnfm1:8080/vnf_lcm_op_occs/1234567"))); final InlineResponse200 firstOperationQueryResponse = createOperationQueryResponse( - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE, - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING); + org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE, + org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.PROCESSING); mockRestServer.expect(requestTo("http://vnfm1:8080/vnf_lcm_op_occs/1234567")) .andRespond(withSuccess(gson.toJson(firstOperationQueryResponse), MediaType.APPLICATION_JSON)); final InlineResponse200 secondOperationQueryReponse = createOperationQueryResponse( - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE, - org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED); + org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum.TERMINATE, + org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum.COMPLETED); mockRestServer.expect(requestTo("http://vnfm1:8080/vnf_lcm_op_occs/1234567")) .andRespond(withSuccess(gson.toJson(secondOperationQueryReponse), MediaType.APPLICATION_JSON)); @@ -412,8 +411,8 @@ public class VnfmAdapterControllerTest { } private InlineResponse200 createOperationQueryResponse( - final org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationEnum operation, - final org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200.OperationStateEnum operationState) { + final org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationEnum operation, + final org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse200.OperationStateEnum operationState) { final InlineResponse200 response = new InlineResponse200(); response.setId("9876"); response.setOperation(operation); diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/HealthCheckTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/HealthCheckTest.java index 01749fa749..9fa16b5551 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/HealthCheckTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/HealthCheckTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.lcm.rest; import static org.junit.Assert.assertEquals; import java.net.URI; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantControllerTest.java index 5a2c5d0fc8..21e56617cd 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003GrantControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003GrantControllerTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.lcm.rest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -42,16 +42,16 @@ import org.onap.aai.domain.yang.GenericVnfs; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; -import org.onap.so.adapters.vnfmadapter.grant.model.GrantRequest; -import org.onap.so.adapters.vnfmadapter.grant.model.GrantRequest.OperationEnum; -import org.onap.so.adapters.vnfmadapter.grant.model.GrantsAddResources; -import org.onap.so.adapters.vnfmadapter.grant.model.GrantsAddResources.TypeEnum; -import org.onap.so.adapters.vnfmadapter.grant.model.GrantsLinks; -import org.onap.so.adapters.vnfmadapter.grant.model.GrantsLinksVnfLcmOpOcc; -import org.onap.so.adapters.vnfmadapter.grant.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.grant.model.InlineResponse201VimConnections; -import org.onap.so.client.aai.AAIResourcesClient; -import org.onap.so.client.aai.entities.uri.AAIResourceUri; +import org.onap.aaiclient.client.aai.AAIResourcesClient; +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantRequest; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantRequest.OperationEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantsAddResources; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantsAddResources.TypeEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantsLinks; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.GrantsLinksVnfLcmOpOcc; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.lcm.grant.model.InlineResponse201VimConnections; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnControllerTest.java index f44bf8778f..ab6ae83896 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/Sol003LcnControllerTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.lcm.rest; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.eq; @@ -53,25 +53,25 @@ import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; import org.onap.aai.domain.yang.Vserver; -import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource; -import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource.OamIpAddressType; -import org.onap.so.adapters.vnfmadapter.extclients.vim.model.AccessInfo; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201Links; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo; -import org.onap.so.adapters.vnfmadapter.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; -import org.onap.so.adapters.vnfmadapter.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum; -import org.onap.so.adapters.vnfmadapter.lcn.model.LcnVnfLcmOperationOccurrenceNotificationComputeResource; -import org.onap.so.adapters.vnfmadapter.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinks; -import org.onap.so.adapters.vnfmadapter.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfIdentifierCreationNotification; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfLcmOperationOccurrenceNotification; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum; -import org.onap.so.adapters.vnfmadapter.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; -import org.onap.so.client.aai.AAIResourcesClient; -import org.onap.so.client.aai.entities.uri.AAIResourceUri; +import org.onap.aaiclient.client.aai.AAIResourcesClient; +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.AaiHelper; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.OamIpAddressSource; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.aai.OamIpAddressSource.OamIpAddressType; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vim.model.AccessInfo; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201Links; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201LinksSelf; +import org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model.InlineResponse201VimConnectionInfo; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationComputeResource; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinks; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationLinksVnfInstance; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfIdentifierCreationNotification; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationEnum; +import org.onap.so.adapters.etsisol003adapter.lcm.lcn.model.VnfLcmOperationOccurrenceNotification.OperationStateEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; @@ -178,7 +178,7 @@ public class Sol003LcnControllerTest { doReturn(Optional.of(genericVnfs)).when(aaiResourcesClient).get(eq(GenericVnfs.class), MockitoHamcrest.argThat(new AaiResourceUriMatcher( "/network/generic-vnfs?selflink=http%3A%2F%2Fvnfm%3A8080%2Fvnfs%2FmyTestVnfIdOnVnfm"))); - EsrVnfm vnfm = new EsrVnfm(); + final EsrVnfm vnfm = new EsrVnfm(); vnfm.setVnfmId("vnfm1"); final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); vnfm.setEsrSystemInfoList(esrSystemInfoList); @@ -249,7 +249,7 @@ public class Sol003LcnControllerTest { doReturn(Optional.of(genericVnfs)).when(aaiResourcesClient).get(eq(GenericVnfs.class), MockitoHamcrest.argThat(new AaiResourceUriMatcher( "/network/generic-vnfs?selflink=http%3A%2F%2Fvnfm%3A8080%2Fvnfs%2FmyTestVnfIdOnVnfm"))); - EsrVnfm vnfm = new EsrVnfm(); + final EsrVnfm vnfm = new EsrVnfm(); vnfm.setVnfmId("vnfm1"); final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList(); vnfm.setEsrSystemInfoList(esrSystemInfoList); diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/TestApplication.java b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/TestApplication.java index 152d3136f1..b59bc025e8 100755 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/TestApplication.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/lcm/rest/TestApplication.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.lcm.rest; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/pom.xml index 26883d56f0..f6789575c6 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/pom.xml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/pom.xml @@ -21,12 +21,12 @@ <goal>generate</goal> </goals> <configuration> - <inputSpec>${basedir}/src/main/resources/vnfmadapter.yaml</inputSpec> + <inputSpec>${basedir}/src/main/resources/etsisol003adapter.yaml</inputSpec> <language>java</language> <library>retrofit2</library> - <output>${project.build.directory}/generated-sources/vnfmadapter</output> - <apiPackage>org.onap.vnfmadapter.v1.api</apiPackage> - <modelPackage>org.onap.vnfmadapter.v1.model</modelPackage> + <output>${project.build.directory}/generated-sources/etsisol003adapter</output> + <apiPackage>org.onap.so.adapters.etsisol003adapter.lcm.v1.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsisol003adapter.lcm.v1.model</modelPackage> <generateApiTests>false</generateApiTests> <generateModelTests>false</generateModelTests> <configOptions> @@ -48,8 +48,8 @@ <language>java</language> <library>okhttp-gson</library> <output>${project.build.directory}/generated-sources/sol003-vnf-lcn</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.lcn.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.lcn.model</modelPackage> + <apiPackage>org.onap.so.adapters.etsisol003adapter.lcm.lcn.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsisol003adapter.lcm.lcn.model</modelPackage> <generateApiTests>false</generateApiTests> <generateModelTests>false</generateModelTests> <configOptions> @@ -70,8 +70,8 @@ <language>java</language> <library>okhttp-gson</library> <output>${project.build.directory}/generated-sources/sol003-vnf-grant</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.grant.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.grant.model</modelPackage> + <apiPackage>org.onap.so.adapters.etsisol003adapter.lcm.grant.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsisol003adapter.lcm.grant.model</modelPackage> <generateApiTests>false</generateApiTests> <generateModelTests>false</generateModelTests> <configOptions> diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/vnfmadapter.yaml b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/etsisol003adapter.yaml index 9d0a5283af..9d0a5283af 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/vnfmadapter.yaml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-api/src/main/resources/etsisol003adapter.yaml diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/pom.xml index 5c89720ef4..5452b578a7 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/pom.xml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-lcm/etsi-sol003-lcm-ext-clients/pom.xml @@ -25,8 +25,8 @@ <language>java</language> <library>okhttp-gson</library> <output>${project.build.directory}/generated-sources/sol003-vnf-lcm</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.model</modelPackage> + <apiPackage>org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsisol003adapter.lcm.extclients.vnfm.model</modelPackage> <generateApiTests>false</generateApiTests> <generateModelTests>false</generateModelTests> <configOptions> diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java deleted file mode 100644 index eaaa8d8544..0000000000 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java +++ /dev/null @@ -1,154 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; - -import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; -import java.io.IOException; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; -import java.security.cert.CertificateException; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; -import javax.net.ssl.SSLContext; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.client.HttpClient; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.ssl.SSLContextBuilder; -import org.onap.aai.domain.yang.EsrSystemInfo; -import org.onap.aai.domain.yang.EsrVnfm; -import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration; -import org.onap.so.configuration.rest.BasicHttpHeadersProvider; -import org.onap.so.rest.service.HttpRestServiceProvider; -import org.onap.so.rest.service.HttpRestServiceProviderImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.io.Resource; -import org.springframework.http.client.BufferingClientHttpRequestFactory; -import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; -import org.springframework.security.oauth2.client.OAuth2RestTemplate; -import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails; -import org.springframework.web.client.RestTemplate; - -/** - * Configures the HttpRestServiceProvider for REST call to a VNFM. - */ -@Configuration -public class VnfmServiceProviderConfiguration extends AbstractServiceProviderConfiguration { - - private static final Logger logger = LoggerFactory.getLogger(VnfmServiceProviderConfiguration.class); - private Map<String, HttpRestServiceProvider> mapOfVnfmIdToHttpRestServiceProvider = new ConcurrentHashMap<>(); - - @Value("${http.client.ssl.trust-store:#{null}}") - private Resource trustStore; - @Value("${http.client.ssl.trust-store-password:#{null}}") - private String trustStorePassword; - - @Value("${server.ssl.key-store:#{null}}") - private Resource keyStoreResource; - @Value("${server.ssl.key--store-password:#{null}}") - private String keyStorePassword; - - /** - * This property is only intended to be temporary until the AAI schema is updated to support setting the endpoint - */ - @Value("${vnfmadapter.temp.vnfm.oauth.endpoint:#{null}}") - private String oauthEndpoint; - - @Qualifier(CONFIGURABLE_REST_TEMPLATE) - @Autowired() - private RestTemplate defaultRestTemplate; - - public HttpRestServiceProvider getHttpRestServiceProvider(final EsrVnfm vnfm) { - if (!mapOfVnfmIdToHttpRestServiceProvider.containsKey(vnfm.getVnfmId())) { - mapOfVnfmIdToHttpRestServiceProvider.put(vnfm.getVnfmId(), createHttpRestServiceProvider(vnfm)); - } - return mapOfVnfmIdToHttpRestServiceProvider.get(vnfm.getVnfmId()); - } - - private HttpRestServiceProvider createHttpRestServiceProvider(final EsrVnfm vnfm) { - final RestTemplate restTemplate = createRestTemplate(vnfm); - setGsonMessageConverter(restTemplate); - if (trustStore != null) { - setTrustStore(restTemplate); - } - return new HttpRestServiceProviderImpl(restTemplate, new BasicHttpHeadersProvider().getHttpHeaders()); - } - - private RestTemplate createRestTemplate(final EsrVnfm vnfm) { - if (vnfm != null) { - for (final EsrSystemInfo esrSystemInfo : vnfm.getEsrSystemInfoList().getEsrSystemInfo()) { - if (!StringUtils.isEmpty(esrSystemInfo.getUserName()) - && !StringUtils.isEmpty(esrSystemInfo.getPassword())) { - return createOAuth2RestTemplate(esrSystemInfo); - } - } - } - return defaultRestTemplate; - } - - private OAuth2RestTemplate createOAuth2RestTemplate(final EsrSystemInfo esrSystemInfo) { - logger.debug("Getting OAuth2RestTemplate ..."); - final ClientCredentialsResourceDetails resourceDetails = new ClientCredentialsResourceDetails(); - resourceDetails.setId(UUID.randomUUID().toString()); - resourceDetails.setClientId(esrSystemInfo.getUserName()); - resourceDetails.setClientSecret(esrSystemInfo.getPassword()); - resourceDetails.setAccessTokenUri( - oauthEndpoint == null ? esrSystemInfo.getServiceUrl().replace("vnflcm/v1", "oauth/token") - : oauthEndpoint); - resourceDetails.setGrantType("client_credentials"); - return new OAuth2RestTemplate(resourceDetails); - } - - private void setTrustStore(final RestTemplate restTemplate) { - SSLContext sslContext; - try { - if (keyStoreResource != null) { - KeyStore keystore = KeyStore.getInstance("pkcs12"); - keystore.load(keyStoreResource.getInputStream(), keyStorePassword.toCharArray()); - sslContext = - new SSLContextBuilder().loadTrustMaterial(trustStore.getURL(), trustStorePassword.toCharArray()) - .loadKeyMaterial(keystore, keyStorePassword.toCharArray()).build(); - } else { - sslContext = new SSLContextBuilder() - .loadTrustMaterial(trustStore.getURL(), trustStorePassword.toCharArray()).build(); - } - logger.info("Setting truststore: {}", trustStore.getURL()); - final SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext); - final HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); - final HttpComponentsClientHttpRequestFactory factory = - new HttpComponentsClientHttpRequestFactory(httpClient); - restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(factory)); - } catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException | CertificateException - | IOException | UnrecoverableKeyException exception) { - logger.error("Error reading truststore, TLS connection to VNFM will fail.", exception); - } - } - -} diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/pom.xml index f24ad64db4..250ac504c7 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/pom.xml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/pom.xml @@ -3,10 +3,10 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.so.adapters</groupId> - <artifactId>etsi-sol003-package-management</artifactId> + <artifactId>etsi-sol003-pkgm</artifactId> <version>1.6.0-SNAPSHOT</version> </parent> - <artifactId>etsi-sol003-package-management-adapter</artifactId> + <artifactId>etsi-sol003-pkgm-adapter</artifactId> <name>ETSI SOL003 VNF Package Management Adapter</name> <build> @@ -72,12 +72,12 @@ </dependency> <dependency> <groupId>org.onap.so.adapters</groupId> - <artifactId>etsi-sol003-package-management-api</artifactId> + <artifactId>etsi-sol003-pkgm-api</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.onap.so.adapters</groupId> - <artifactId>etsi-sol003-package-management-ext-clients</artifactId> + <artifactId>etsi-sol003-pkgm-ext-clients</artifactId> <version>${project.version}</version> </dependency> <dependency> diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/ConversionServiceConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/ConversionServiceConfiguration.java index fa9bc3e9c9..fd19d0e0a1 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/ConversionServiceConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/ConversionServiceConfiguration.java @@ -17,13 +17,13 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsisol003adapter.pkgm; -import org.onap.so.adapters.vnfmadapter.common.VnfmAdapterUrlProvider; -import org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003.PkgChangeNotificationConverter; -import org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003.PkgOnboardingNotificationConverter; -import org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003.VnfPkgInfoConverter; -import org.onap.so.adapters.vnfmadapter.converters.sol003.etsicatalog.PkgmSubscriptionRequestConverter; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsisol003adapter.pkgm.converters.etsicatalog.sol003.PkgChangeNotificationConverter; +import org.onap.so.adapters.etsisol003adapter.pkgm.converters.etsicatalog.sol003.PkgOnboardingNotificationConverter; +import org.onap.so.adapters.etsisol003adapter.pkgm.converters.etsicatalog.sol003.VnfPkgInfoConverter; +import org.onap.so.adapters.etsisol003adapter.pkgm.converters.sol003.etsicatalog.PkgmSubscriptionRequestConverter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.core.convert.ConversionService; @@ -47,8 +47,8 @@ public class ConversionServiceConfiguration { final DefaultConversionService service = new DefaultConversionService(); service.addConverter(new VnfPkgInfoConverter(vnfmAdapterUrlProvider)); service.addConverter(new PkgmSubscriptionRequestConverter()); - service.addConverter(new PkgChangeNotificationConverter()); - service.addConverter(new PkgOnboardingNotificationConverter()); + service.addConverter(new PkgChangeNotificationConverter(vnfmAdapterUrlProvider)); + service.addConverter(new PkgOnboardingNotificationConverter(vnfmAdapterUrlProvider)); return service; } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/PackageManagementConstants.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/PackageManagementConstants.java index cf3c6c5ac6..5922aab9ca 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/PackageManagementConstants.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/PackageManagementConstants.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter; +package org.onap.so.adapters.etsisol003adapter.pkgm; /** * ETSI SOL003 VNF Package Management Adapter constants diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/AbstractCacheServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/AbstractCacheServiceProvider.java index e1e9b2307e..6dd67faa9e 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/AbstractCacheServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/AbstractCacheServiceProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsisol003adapter.pkgm.cache; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheManagerConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/CacheManagerConfiguration.java index a2e1d76ad6..c184a25bef 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheManagerConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/CacheManagerConfiguration.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsisol003adapter.pkgm.cache; import java.util.Arrays; -import org.onap.so.adapters.vnfmadapter.PackageManagementConstants; +import org.onap.so.adapters.etsisol003adapter.pkgm.PackageManagementConstants; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.cache.concurrent.ConcurrentMapCache; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/CacheNotFoundException.java index edd5982ab1..6b2f4710da 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/CacheNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/CacheNotFoundException.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsisol003adapter.pkgm.cache; /** * Exception for failure to find the cache. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/PkgmCacheServiceProvider.java index 713d14b077..34ed1cfc0c 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/PkgmCacheServiceProvider.java @@ -18,11 +18,11 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsisol003adapter.pkgm.cache; import java.util.Map; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.PkgmSubscriptionRequest; /** * Interface which provides methods for communicating with the cache @@ -31,7 +31,7 @@ import org.onap.so.adapters.vnfmadapter.packagemanagement.model.PkgmSubscription * @author Gareth Roper (gareth.roper@est.tech) * */ -public interface PackageManagementCacheServiceProvider { +public interface PkgmCacheServiceProvider { /** * Checks cache if subscription request Id is already present. If not, it adds the subscription to the cache. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProviderImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/PkgmCacheServiceProviderImpl.java index 82438228ec..4811132e92 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/cache/PackageManagementCacheServiceProviderImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/cache/PkgmCacheServiceProviderImpl.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache; +package org.onap.so.adapters.etsisol003adapter.pkgm.cache; import java.util.Collections; import java.util.HashMap; @@ -26,8 +26,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; -import org.onap.so.adapters.vnfmadapter.PackageManagementConstants; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.pkgm.PackageManagementConstants; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.PkgmSubscriptionRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -42,13 +42,12 @@ import org.springframework.stereotype.Service; * @author Gareth Roper (gareth.roper@est.tech) */ @Service -public class PackageManagementCacheServiceProviderImpl extends AbstractCacheServiceProvider - implements PackageManagementCacheServiceProvider { +public class PkgmCacheServiceProviderImpl extends AbstractCacheServiceProvider implements PkgmCacheServiceProvider { - private static final Logger LOGGER = LoggerFactory.getLogger(PackageManagementCacheServiceProviderImpl.class); + private static final Logger LOGGER = LoggerFactory.getLogger(PkgmCacheServiceProviderImpl.class); @Autowired - public PackageManagementCacheServiceProviderImpl(final CacheManager cacheManager) { + public PkgmCacheServiceProviderImpl(final CacheManager cacheManager) { super(PackageManagementConstants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE, cacheManager); } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java index 221ec8d3a0..5f2ee1d5ab 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java @@ -18,11 +18,12 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; +package org.onap.so.adapters.etsisol003adapter.pkgm.converters.etsicatalog.sol003; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgmLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinks; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgmLinks; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinks; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.model.URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage; /** * A base class that can be extended by classes for converting Etsi Catalog Manager Pkg Notification classes. Provides @@ -32,18 +33,24 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notifi */ abstract public class AbstractPkgNotificationConverter { + private final VnfmAdapterUrlProvider vnfmAdapterUrlProvider; + + public AbstractPkgNotificationConverter(final VnfmAdapterUrlProvider vnfmAdapterUrlProvider) { + this.vnfmAdapterUrlProvider = vnfmAdapterUrlProvider; + } + protected URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinks convert( - final PkgmLinks pkgmLinks) { + final PkgmLinks pkgmLinks, final String vnfPkgId, final String subscriptionId) { final URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage linksVnfPackage = new URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage(); if (pkgmLinks.getVnfPackage() != null) { - linksVnfPackage.setHref(pkgmLinks.getVnfPackage().getHref()); + linksVnfPackage.setHref(vnfmAdapterUrlProvider.getVnfPackageUrl(vnfPkgId)); } final URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage linksSubscription = new URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinksVnfPackage(); if (pkgmLinks.getSubscription() != null) { - linksSubscription.setHref(pkgmLinks.getSubscription().getHref()); + linksSubscription.setHref(vnfmAdapterUrlProvider.getSubscriptionUriString(subscriptionId)); } final URIisprovidedbytheclientwhencreatingthesubscriptionVnfPackageOnboardingNotificationLinks links = diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java index 04b304e93b..5787d35b9a 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java @@ -18,11 +18,12 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; +package org.onap.so.adapters.etsisol003adapter.pkgm.converters.etsicatalog.sol003; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgChangeNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageChangeNotification; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgChangeNotification; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.model.VnfPackageChangeNotification; import org.slf4j.Logger; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Service; @@ -38,6 +39,10 @@ public class PkgChangeNotificationConverter extends AbstractPkgNotificationConve implements Converter<PkgChangeNotification, VnfPackageChangeNotification> { private static final Logger logger = getLogger(PkgChangeNotificationConverter.class); + public PkgChangeNotificationConverter(final VnfmAdapterUrlProvider vnfmAdapterUrlProvider) { + super(vnfmAdapterUrlProvider); + } + /** * Convert a {@link PkgChangeNotification} Object to an {@link VnfPackageChangeNotification} Object * @@ -71,7 +76,8 @@ public class PkgChangeNotificationConverter extends AbstractPkgNotificationConve .fromValue(pkgChangeNotification.getOperationalState().getValue())); } - vnfPackageChangeNotification.setLinks(convert((pkgChangeNotification.getLinks()))); + vnfPackageChangeNotification.setLinks(convert(pkgChangeNotification.getLinks(), + pkgChangeNotification.getVnfPkgId(), pkgChangeNotification.getSubscriptionId())); return vnfPackageChangeNotification; } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java index 9828972fd0..96a5d827e6 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java @@ -18,11 +18,12 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; +package org.onap.so.adapters.etsisol003adapter.pkgm.converters.etsicatalog.sol003; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgOnboardingNotification; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.model.VnfPackageOnboardingNotification; import org.slf4j.Logger; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Service; @@ -38,6 +39,11 @@ public class PkgOnboardingNotificationConverter extends AbstractPkgNotificationC implements Converter<PkgOnboardingNotification, VnfPackageOnboardingNotification> { private static final Logger logger = getLogger(PkgOnboardingNotificationConverter.class); + public PkgOnboardingNotificationConverter(final VnfmAdapterUrlProvider vnfmAdapterUrlProvider) { + super(vnfmAdapterUrlProvider); + } + + /** * Convert a {@link PkgOnboardingNotification} Object to an {@link VnfPackageOnboardingNotification} Object * @@ -61,7 +67,8 @@ public class PkgOnboardingNotificationConverter extends AbstractPkgNotificationC vnfPackageOnboardingNotification.setVnfPkgId(pkgOnboardingNotification.getVnfPkgId()); vnfPackageOnboardingNotification.setVnfdId(pkgOnboardingNotification.getVnfdId()); - vnfPackageOnboardingNotification.setLinks(convert((pkgOnboardingNotification.getLinks()))); + vnfPackageOnboardingNotification.setLinks(convert(pkgOnboardingNotification.getLinks(), + pkgOnboardingNotification.getVnfPkgId(), pkgOnboardingNotification.getSubscriptionId())); return vnfPackageOnboardingNotification; } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/VnfPkgInfoConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/VnfPkgInfoConverter.java index dc25a6fbea..0121cc5885 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/VnfPkgInfoConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/etsicatalog/sol003/VnfPkgInfoConverter.java @@ -18,22 +18,22 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003; +package org.onap.so.adapters.etsisol003adapter.pkgm.converters.etsicatalog.sol003; import java.util.ArrayList; import java.util.List; -import org.onap.so.adapters.vnfmadapter.common.VnfmAdapterUrlProvider; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.Checksum; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VNFPKGMLinkSerializer; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageArtifactInfo; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageSoftwareImageInfo; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPkgInfo; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.VnfPackagesAdditionalArtifacts; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.VnfPackagesChecksum; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.VnfPackagesLinks; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.VnfPackagesLinksSelf; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.VnfPackagesSoftwareImages; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.Checksum; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VNFPKGMLinkSerializer; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfPackageArtifactInfo; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfPackageSoftwareImageInfo; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfPkgInfo; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.InlineResponse2001; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.VnfPackagesAdditionalArtifacts; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.VnfPackagesChecksum; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.VnfPackagesLinks; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.VnfPackagesLinksSelf; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.VnfPackagesSoftwareImages; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.convert.converter.Converter; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java index 7defa4b278..f63ada9c75 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/converters/sol003/etsicatalog/PkgmSubscriptionRequestConverter.java @@ -18,22 +18,22 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.converters.sol003.etsicatalog; +package org.onap.so.adapters.etsisol003adapter.pkgm.converters.sol003.etsicatalog; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.Version; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfProducts; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfProductsProviders; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsFilter1; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsFilter1.NotificationTypesEnum; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsFilter1.OperationalStateEnum; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsFilter1.UsageStateEnum; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsFilterVersions; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsFilterVnfProducts; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsFilterVnfProductsFromProviders; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.Version; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfProducts; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfProductsProviders; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsFilter1; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsFilter1.NotificationTypesEnum; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsFilter1.OperationalStateEnum; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsFilter1.UsageStateEnum; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsFilterVersions; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsFilterVnfProducts; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsFilterVnfProductsFromProviders; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Service; @@ -46,13 +46,13 @@ import org.springframework.stereotype.Service; */ @Service public class PkgmSubscriptionRequestConverter implements - Converter<PkgmSubscriptionRequest, org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest> { + Converter<PkgmSubscriptionRequest, org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest> { @Override - public org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest convert( + public org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest convert( final PkgmSubscriptionRequest pkgmSubscriptionRequest) { - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest = - new org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest(); + final org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest = + new org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest(); etsiCatalogManagerSubscriptionRequest .setFilter(getPkgmNotificationsFilter(pkgmSubscriptionRequest.getFilter())); @@ -61,10 +61,10 @@ public class PkgmSubscriptionRequestConverter implements } - private org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter getPkgmNotificationsFilter( + private org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter getPkgmNotificationsFilter( final SubscriptionsFilter1 sol003SubscriptionsFilter) { - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter etsiCatalogManagerFilters = - new org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter(); + final org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter etsiCatalogManagerFilters = + new org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter(); if (sol003SubscriptionsFilter.getNotificationTypes() != null) { etsiCatalogManagerFilters.setNotificationTypes( @@ -87,14 +87,14 @@ public class PkgmSubscriptionRequestConverter implements } - private List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum> getUsageState( + private List<org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum> getUsageState( final List<UsageStateEnum> usageStates) { if (usageStates != null) { - final List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum> etsiCatalogUsageStates = + final List<org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum> etsiCatalogUsageStates = new ArrayList<>(); usageStates.stream().forEach(state -> { etsiCatalogUsageStates.add( - org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum + org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter.UsageStateEnum .fromValue(state.getValue())); }); return etsiCatalogUsageStates; @@ -103,14 +103,14 @@ public class PkgmSubscriptionRequestConverter implements } - private List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum> getOperationalState( + private List<org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum> getOperationalState( final List<OperationalStateEnum> operationalStates) { if (operationalStates != null) { - final List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum> etsiCatalogOperationalStates = + final List<org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum> etsiCatalogOperationalStates = new ArrayList<>(); operationalStates.forEach(state -> { etsiCatalogOperationalStates.add( - org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum + org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter.OperationalStateEnum .fromValue(state.getValue())); }); @@ -180,14 +180,14 @@ public class PkgmSubscriptionRequestConverter implements return Collections.emptyList(); } - private List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum> getPkgmNotificationsFilterNotificationTypes( + private List<org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum> getPkgmNotificationsFilterNotificationTypes( final List<NotificationTypesEnum> notificationTypes) { if (notificationTypes != null && !notificationTypes.isEmpty()) { - final List<org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum> etsiCatalogNotificationTypes = + final List<org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum> etsiCatalogNotificationTypes = new ArrayList<>(); notificationTypes.forEach(type -> etsiCatalogNotificationTypes.add( - org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum + org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter.NotificationTypesEnum .fromValue(type.getValue()))); return etsiCatalogNotificationTypes; } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/AbstractServiceProviderConfiguration.java index 7b6faf2876..f9da6981c8 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/AbstractServiceProviderConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/AbstractServiceProviderConfiguration.java @@ -18,14 +18,17 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients; +package org.onap.so.adapters.etsisol003adapter.pkgm.extclients; +import java.time.LocalDateTime; import java.util.Iterator; -import org.onap.so.adapters.vnfmadapter.packagemanagement.JSON; +import org.onap.so.adapters.etsisol003adapter.pkgm.JSON; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.EtsiSubscriptionNotificationController; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; +import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; /** @@ -35,6 +38,7 @@ import com.google.gson.Gson; * @author gareth.roper@est.tech */ public abstract class AbstractServiceProviderConfiguration { + private final JSON.OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new JSON.OffsetDateTimeTypeAdapter(); public void setGsonMessageConverter(final RestTemplate restTemplate) { final Iterator<HttpMessageConverter<?>> iterator = restTemplate.getMessageConverters().iterator(); @@ -43,7 +47,10 @@ public abstract class AbstractServiceProviderConfiguration { iterator.remove(); } } - final Gson gson = new JSON().getGson(); + final Gson gson = JSON.createGson().registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDateTime.class, + new EtsiSubscriptionNotificationController.LocalDateTimeTypeAdapter()) + .create(); restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson)); } } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java index 9e12b536c9..db3c24bd1c 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogPackageManagementServiceProvider.java @@ -17,10 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.InlineResponse2001; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.InlineResponse2001; /** * @author Waqas Ikram (waqas.ikram@est.tech) diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogServiceProvider.java index 61db82f38c..f11fc5c39a 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogServiceProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog; /** * Provides methods for invoking REST calls to the ETSI Catalog Manager. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java index fc44a6ec6f..5caeebe53d 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogServiceProviderConfiguration.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog; import java.io.IOException; import java.security.KeyManagementException; @@ -40,7 +40,7 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.ssl.SSLContextBuilder; import org.onap.logging.filter.spring.SpringClientPayloadFilter; -import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.AbstractServiceProviderConfiguration; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.onap.so.configuration.rest.HttpClientConnectionConfiguration; import org.onap.so.logging.jaxrs.filter.SOSpringClientFilter; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java index 6651bc136e..a4e5550061 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogServiceProviderImpl.java @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog; -import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_SERVICE_PROVIDER_BEAN; +import static org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_SERVICE_PROVIDER_BEAN; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.NsdmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPkgInfo; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.EtsiCatalogManagerBadRequestException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.EtsiCatalogManagerRequestFailureException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.SubscriptionNotFoundException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfPkgBadRequestException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfPkgConflictException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfPkgNotFoundException; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.NsdmSubscription; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscription; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfPkgInfo; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.InlineResponse2001; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.EtsiCatalogManagerBadRequestException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.EtsiCatalogManagerRequestFailureException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.SubscriptionNotFoundException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.VnfPkgBadRequestException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.VnfPkgConflictException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.VnfPkgNotFoundException; import org.onap.so.rest.exceptions.HttpResouceNotFoundException; import org.onap.so.rest.exceptions.InvalidRestRequestException; import org.onap.so.rest.exceptions.RestProcessingException; @@ -183,7 +183,7 @@ public class EtsiCatalogServiceProviderImpl implements EtsiCatalogServiceProvide @Override public Optional<PkgmSubscription> postSubscription( - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest) { + final org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest) { try { final ResponseEntity<PkgmSubscription> responseEntity = httpServiceProvider.postHttpRequest(etsiCatalogManagerSubscriptionRequest, diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java index ed04ad7746..d561f8734b 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogSubscriptionServiceProvider.java @@ -17,11 +17,11 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.NsdmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscription; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.NsdmSubscription; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscription; /** * @author Waqas Ikram (waqas.ikram@est.tech) @@ -35,7 +35,7 @@ public interface EtsiCatalogSubscriptionServiceProvider { * @return The ETSI Catalog Manager's PkgmSubscription object. */ Optional<PkgmSubscription> postSubscription( - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest); + final org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest); /** * Get the Subscription from ETSI Catalog. diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogUrlProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogUrlProvider.java index 3b4c4c3066..1725bf9fba 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/etsicatalog/EtsiCatalogUrlProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/etsicatalog/EtsiCatalogUrlProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog; +package org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog; import static org.slf4j.LoggerFactory.getLogger; import org.slf4j.Logger; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java index 9ed17e4379..568c3df48b 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/extclients/vnfm/VnfmHttpServiceProviderConfiguration.java @@ -17,10 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.extclients.vnfm; +package org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm; import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; -import org.onap.so.adapters.vnfmadapter.extclients.AbstractServiceProviderConfiguration; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.AbstractServiceProviderConfiguration; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.onap.so.rest.service.HttpRestServiceProvider; import org.onap.so.rest.service.HttpRestServiceProviderImpl; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationController.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/EtsiSubscriptionNotificationController.java index fe9b085095..2b4b486fa8 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/EtsiSubscriptionNotificationController.java @@ -18,18 +18,21 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; import static org.slf4j.LoggerFactory.getLogger; +import java.io.IOException; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.AbstractMap; import java.util.Map.Entry; import javax.ws.rs.core.MediaType; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgChangeNotification; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.NotificationManager; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.InternalServerErrorException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.NotificationTypeNotSupportedException; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgChangeNotification; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgOnboardingNotification; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.InternalServerErrorException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.NotificationTypeNotSupportedException; +import org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt.NotificationManager; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; @@ -42,6 +45,9 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; /** * This controller handles the ETSI Subscription Notification Endpoints. @@ -61,7 +67,7 @@ public class EtsiSubscriptionNotificationController { @Autowired public EtsiSubscriptionNotificationController(final NotificationManager notificationManager) { this.notificationManager = notificationManager; - this.gson = new GsonBuilder().create(); + this.gson = new GsonBuilder().registerTypeAdapter(LocalDateTime.class, new LocalDateTimeTypeAdapter()).create(); } @GetMapping(value = "/notification") @@ -72,15 +78,16 @@ public class EtsiSubscriptionNotificationController { /** * POST notification on to subscriber. - * + * * @param notification The notification to send. * @return Response Code: 204 No Content if Successful, ProblemDetails Object if not. */ @PostMapping(value = "/notification", consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) - public ResponseEntity<?> postSubscriptionNotification(@RequestBody final String notification) { - logger.info("Posting subscription notification \n{}", notification); + public ResponseEntity<?> postSubscriptionNotification(@RequestBody final Object notification) { + logger.info("Posting subscription notification class: {} \n{}", notification.getClass(), notification); + final String notificationString = gson.toJson(notification); - final Entry<String, Object> notificationObject = getNotificationObject(notification); + final Entry<String, Object> notificationObject = getNotificationObject(notificationString); if (notificationManager.processSubscriptionNotification(notificationObject.getValue(), notificationObject.getKey())) { logger.info("Notification Delivered Successfully"); @@ -92,6 +99,7 @@ public class EtsiSubscriptionNotificationController { } private Entry<String, Object> getNotificationObject(final String notification) { + logger.info("getNotificationObject() notification: {}", notification); final String notificationType = getNotificationType(notification); if (PkgOnboardingNotification.NotificationTypeEnum.VNFPACKAGEONBOARDINGNOTIFICATION.getValue() .equals(notificationType)) { @@ -118,6 +126,7 @@ public class EtsiSubscriptionNotificationController { private String getNotificationType(final String notification) { try { + logger.info("getNotificationType() notification: {}", notification); final JsonParser parser = new JsonParser(); final JsonObject element = (JsonObject) parser.parse(notification); return element.get("notificationType").getAsString(); @@ -128,4 +137,30 @@ public class EtsiSubscriptionNotificationController { "Unable to parse notification type in object \n" + notification); } + public static class LocalDateTimeTypeAdapter extends TypeAdapter<LocalDateTime> { + + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + @Override + public void write(final JsonWriter out, final LocalDateTime localDateTime) throws IOException { + if (localDateTime == null) { + out.nullValue(); + } else { + out.value(FORMATTER.format(localDateTime)); + } + } + + @Override + public LocalDateTime read(final JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + final String dateTime = in.nextString(); + return LocalDateTime.parse(dateTime, FORMATTER); + } + } + } + } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementController.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementController.java index 48d6a33082..6c1e5e5506 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementController.java @@ -18,16 +18,16 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest; -import static org.onap.so.adapters.vnfmadapter.PackageManagementConstants.APPLICATION_ZIP; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsisol003adapter.pkgm.PackageManagementConstants.APPLICATION_ZIP; import static org.slf4j.LoggerFactory.getLogger; import java.util.Optional; import javax.ws.rs.core.MediaType; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.InlineResponse2001; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.EtsiCatalogServiceProvider; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.InlineResponse2001; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionController.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementSubscriptionController.java index 75c72b6df3..7314f6aa2e 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionController.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementSubscriptionController.java @@ -18,19 +18,19 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; import static org.slf4j.LoggerFactory.getLogger; import java.net.URI; import java.security.GeneralSecurityException; import java.util.List; import java.util.Optional; import javax.ws.rs.core.MediaType; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.SubscriptionManager; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt.SubscriptionManager; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/AuthenticationTypeNotSupportedException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/AuthenticationTypeNotSupportedException.java index 303420f1e8..6e1330140f 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/AuthenticationTypeNotSupportedException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/AuthenticationTypeNotSupportedException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/ConversionFailedException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/ConversionFailedException.java index e19a53d1dc..9e9cb8e352 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/ConversionFailedException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/ConversionFailedException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerBadRequestException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/EtsiCatalogManagerBadRequestException.java index dbd098f7cd..7d9d5fc17a 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerBadRequestException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/EtsiCatalogManagerBadRequestException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerRequestFailureException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/EtsiCatalogManagerRequestFailureException.java index dbdc354f4e..a07732f3fa 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiCatalogManagerRequestFailureException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/EtsiCatalogManagerRequestFailureException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java index e8e1ce35b9..645ef96326 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/EtsiSubscriptionNotificationControllerExceptionHandler.java @@ -18,11 +18,11 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.rest.EtsiSubscriptionNotificationController; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.EtsiSubscriptionNotificationController; import org.onap.so.rest.exceptions.HttpResouceNotFoundException; import org.onap.so.rest.exceptions.InvalidRestRequestException; import org.onap.so.rest.exceptions.RestProcessingException; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/InternalServerErrorException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/InternalServerErrorException.java index 9b547d3c5a..9dd7f1b7b2 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/InternalServerErrorException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/InternalServerErrorException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/NotificationTypeNotSupportedException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/NotificationTypeNotSupportedException.java index dcc98864aa..7716037342 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/NotificationTypeNotSupportedException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/NotificationTypeNotSupportedException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java index 8091f35da6..9f97b4ae02 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/Sol003PackageManagementControllerExceptionHandler.java @@ -18,10 +18,10 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.rest.Sol003PackageManagementController; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.Sol003PackageManagementController; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/SubscriptionNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/SubscriptionNotFoundException.java index 58c2ef050d..af409e7399 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/SubscriptionNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/SubscriptionNotFoundException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgBadRequestException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/VnfPkgBadRequestException.java index 211131c2a4..5c318da89f 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgBadRequestException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/VnfPkgBadRequestException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgConflictException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/VnfPkgConflictException.java index f9aa2a0e21..7cb7a0c860 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgConflictException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/VnfPkgConflictException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgNotFoundException.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/VnfPkgNotFoundException.java index c15e7052ab..5ed4847173 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/rest/exceptions/VnfPkgNotFoundException.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/exceptions/VnfPkgNotFoundException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest.exceptions; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/AbstractNotificationServiceProvider.java index d6b7ae7201..b6ba1ede95 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/AbstractNotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/AbstractNotificationServiceProvider.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt; -import static org.onap.so.adapters.vnfmadapter.extclients.vnfm.VnfmHttpServiceProviderConfiguration.VNFM_ADAPTER_HTTP_SERVICE_PROVIDER_BEAN; +import static org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.VnfmHttpServiceProviderConfiguration.VNFM_ADAPTER_HTTP_SERVICE_PROVIDER_BEAN; import java.nio.charset.StandardCharsets; import org.apache.commons.codec.binary.Base64; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/BasicAuthNotificationServiceProvider.java index 4bed300a08..ffe8529c93 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/BasicAuthNotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/BasicAuthNotificationServiceProvider.java @@ -17,11 +17,11 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication.AuthTypeEnum; import org.onap.so.configuration.rest.HttpHeadersProvider; import org.onap.so.rest.service.HttpRestServiceProvider; import org.slf4j.Logger; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationManager.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/NotificationManager.java index ad85abe053..82b1a7d4c3 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationManager.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/NotificationManager.java @@ -18,22 +18,22 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt; import static org.slf4j.LoggerFactory.getLogger; import java.util.List; import java.util.Optional; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgChangeNotification; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageChangeNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.AuthenticationTypeNotSupportedException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.ConversionFailedException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.NotificationTypeNotSupportedException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.SubscriptionNotFoundException; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgChangeNotification; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgOnboardingNotification; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.model.VnfPackageChangeNotification; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.model.VnfPackageOnboardingNotification; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.AuthenticationTypeNotSupportedException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.ConversionFailedException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.NotificationTypeNotSupportedException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.SubscriptionNotFoundException; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.convert.ConversionService; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/NotificationServiceProvider.java index 87a293456f..2fc7e19eb6 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/NotificationServiceProvider.java @@ -17,10 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication.AuthTypeEnum; /** * Interface which lays out requirements for a Notification Service Provider diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProviderFactory.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/NotificationServiceProviderFactory.java index 256e6f4da5..2b8e818c9c 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/NotificationServiceProviderFactory.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/NotificationServiceProviderFactory.java @@ -17,14 +17,14 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt; import static org.slf4j.LoggerFactory.getLogger; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.AuthenticationTypeNotSupportedException; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.AuthenticationTypeNotSupportedException; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/OAuthNotificationServiceProvider.java index bbb41e8515..81dc743a22 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthNotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/OAuthNotificationServiceProvider.java @@ -17,12 +17,12 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.InternalServerErrorException; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.InternalServerErrorException; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.onap.so.configuration.rest.HttpHeadersProvider; import org.onap.so.rest.service.HttpRestServiceProvider; @@ -45,6 +45,7 @@ public class OAuthNotificationServiceProvider extends AbstractNotificationServic public boolean send(final Object notification, final SubscriptionsAuthentication subscriptionsAuthentication, final String callbackUri) { logger.info("Sending notification to uri: {}", callbackUri); + logger.info("Object: {}", notification); final String token = getAccessToken(subscriptionsAuthentication); if (token == null) { diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthTokenResponse.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/OAuthTokenResponse.java index 146641cc7c..3e6f7bde2b 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/OAuthTokenResponse.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/OAuthTokenResponse.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt; import java.io.Serializable; import javax.xml.bind.annotation.XmlElement; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/SubscriptionManager.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/SubscriptionManager.java index e45a175a2d..edae41525e 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/SubscriptionManager.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/SubscriptionManager.java @@ -18,9 +18,9 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt; -import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.SubscriptionAuthentication.AuthTypeEnum.BASIC; +import static org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.SubscriptionAuthentication.AuthTypeEnum.BASIC; import static org.slf4j.LoggerFactory.getLogger; import java.net.URI; import java.security.GeneralSecurityException; @@ -30,19 +30,19 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import org.apache.commons.lang3.tuple.ImmutablePair; -import org.onap.so.adapters.vnfmadapter.common.VnfmAdapterUrlProvider; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProvider; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.BasicAuth; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.NsdmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscription; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsLinks; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.VnfPackagesLinksSelf; -import org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement.cache.PackageManagementCacheServiceProvider; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.ConversionFailedException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.InternalServerErrorException; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.SubscriptionNotFoundException; +import org.onap.so.adapters.etsi.sol003.adapter.common.VnfmAdapterUrlProvider; +import org.onap.so.adapters.etsisol003adapter.pkgm.cache.PkgmCacheServiceProvider; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.EtsiCatalogServiceProvider; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.BasicAuth; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.NsdmSubscription; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscription; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsLinks; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.VnfPackagesLinksSelf; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.ConversionFailedException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.InternalServerErrorException; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.SubscriptionNotFoundException; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.convert.ConversionService; @@ -58,13 +58,13 @@ import org.springframework.stereotype.Service; public class SubscriptionManager { private static final Logger logger = getLogger(SubscriptionManager.class); - private final PackageManagementCacheServiceProvider packageManagementCacheServiceProvider; + private final PkgmCacheServiceProvider packageManagementCacheServiceProvider; private final ConversionService conversionService; private final EtsiCatalogServiceProvider etsiCatalogServiceProvider; private final VnfmAdapterUrlProvider vnfmAdapterUrlProvider; @Autowired - public SubscriptionManager(final PackageManagementCacheServiceProvider packageManagementCacheServiceProvider, + public SubscriptionManager(final PkgmCacheServiceProvider packageManagementCacheServiceProvider, final ConversionService conversionService, final EtsiCatalogServiceProvider etsiCatalogServiceProvider, final VnfmAdapterUrlProvider vnfmAdapterUrlProvider) { this.packageManagementCacheServiceProvider = packageManagementCacheServiceProvider; @@ -76,7 +76,7 @@ public class SubscriptionManager { public Optional<InlineResponse201> createSubscription(final PkgmSubscriptionRequest pkgmSubscriptionRequest) throws GeneralSecurityException { - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest = + final org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest = buildEtsiCatalogManagerPkgmSubscriptionRequest(pkgmSubscriptionRequest); final Optional<PkgmSubscription> optionalEtsiCatalogManagerSubscription = @@ -172,13 +172,13 @@ public class SubscriptionManager { .callbackUri(subscription.getCallbackUri()); } - private org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest buildEtsiCatalogManagerPkgmSubscriptionRequest( + private org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest buildEtsiCatalogManagerPkgmSubscriptionRequest( final PkgmSubscriptionRequest pkgmSubscriptionRequest) throws GeneralSecurityException { - final org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest; + final org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest etsiCatalogManagerSubscriptionRequest; try { etsiCatalogManagerSubscriptionRequest = conversionService.convert(pkgmSubscriptionRequest, - org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest.class); + org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest.class); } catch (final org.springframework.core.convert.ConversionException conversionException) { logger.error(conversionException.getMessage()); throw new ConversionFailedException( @@ -196,7 +196,7 @@ public class SubscriptionManager { final ImmutablePair<String, String> immutablePair = vnfmAdapterUrlProvider.getDecryptAuth(); if (!immutablePair.equals(ImmutablePair.nullPair())) { etsiCatalogManagerSubscriptionRequest.setAuthentication( - new org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.SubscriptionAuthentication() + new org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.SubscriptionAuthentication() .addAuthTypeItem(BASIC).paramsBasic(new BasicAuth().userName(immutablePair.getLeft()) .password(immutablePair.getRight()))); } diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/TlsNotificationServiceProvider.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/TlsNotificationServiceProvider.java index 5e922293d5..69ff5da3ec 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/packagemanagement/subscriptionmanagement/TlsNotificationServiceProvider.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/main/java/org/onap/so/adapters/etsisol003adapter/pkgm/subscriptionmgmt/TlsNotificationServiceProvider.java @@ -17,18 +17,18 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.packagemanagement.subscriptionmanagement; +package org.onap.so.adapters.etsisol003adapter.pkgm.subscriptionmgmt; import static org.slf4j.LoggerFactory.getLogger; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; -import org.onap.so.adapters.vnfmadapter.rest.exceptions.AuthenticationTypeNotSupportedException; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication.AuthTypeEnum; +import org.onap.so.adapters.etsisol003adapter.pkgm.rest.exceptions.AuthenticationTypeNotSupportedException; import org.slf4j.Logger; import org.springframework.stereotype.Service; -/* +/** + * * @author Waqas Ikram (waqas.ikram@est.tech) - * * @author Andrew Lamb (andrew.a.lamb@est.tech) */ @Service diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/EtsiSubscriptionNotificationControllerTest.java index 1d3cf73729..efe6891f1e 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/EtsiSubscriptionNotificationControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/EtsiSubscriptionNotificationControllerTest.java @@ -18,11 +18,11 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_CONTROLLER_BASE_URL; import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE; import static org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_CLASS; import static org.springframework.test.web.client.match.MockRestRequestMatchers.header; @@ -32,6 +32,7 @@ import static org.springframework.test.web.client.match.MockRestRequestMatchers. import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; import java.net.URI; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -39,23 +40,25 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.so.adapters.vnfmadapter.PackageManagementConstants; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.NOTIFICATIONLINKSERIALIZER; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgChangeNotification; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgOnboardingNotification; -import org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model.PkgmLinks; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthenticationParamsBasic; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthenticationParamsOauth2ClientCredentials; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageChangeNotification; -import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.NOTIFICATIONLINKSERIALIZER; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgChangeNotification; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgOnboardingNotification; +import org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model.PkgmLinks; +import org.onap.so.adapters.etsisol003adapter.pkgm.JSON; +import org.onap.so.adapters.etsisol003adapter.pkgm.PackageManagementConstants; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.model.VnfPackageChangeNotification; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.model.VnfPackageOnboardingNotification; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthenticationParamsBasic; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthenticationParamsOauth2ClientCredentials; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; @@ -64,16 +67,13 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.web.client.RestTemplate; -import org.threeten.bp.LocalDateTime; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneOffset; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; /** * @author Andrew Lamb (andrew.a.lamb@est.tech) @@ -101,20 +101,23 @@ public class EtsiSubscriptionNotificationControllerTest { private static final String EXPECTED_OAUTH_AUTHORIZATION = "Bearer " + TOKEN; private static final String NOTIFICATION_ID = "NOTIFICATION_ID"; private static final String SUBSCRIPTION_ID = "SUBSCRIPTION_ID"; - private static final OffsetDateTime TIMESTAMP = - OffsetDateTime.of(LocalDateTime.of(2020, 1, 1, 1, 1, 1, 1), ZoneOffset.ofHours(1)); + private static final String TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG = "2020-01-01 01:01:01"; + private static final java.time.LocalDateTime TIMESTAMP = java.time.LocalDateTime.of(2020, 1, 1, 1, 1, 1, 1); private static final String VNFPKG_ID = UUID.randomUUID().toString(); private static final String VNFD_ID = UUID.randomUUID().toString(); + private static final String EXPECTED_VNF_PACKAGE_HREF = + "https://so-vnfm-adapter.onap:30406/so/vnfm-adapter/v1/vnfpkgm/v1/vnf_packages/" + VNFPKG_ID; + private static final String EXPECTED_SUBSCRIPTION_HREF = + "https://so-vnfm-adapter.onap:30406/so/vnfm-adapter/v1/vnfpkgm/v1/subscriptions/" + SUBSCRIPTION_ID; + private BasicHttpHeadersProvider basicHttpHeadersProvider; - private final Gson gson = new GsonBuilder().create();; @Autowired @Qualifier(CONFIGURABLE_REST_TEMPLATE) private RestTemplate restTemplate; private MockRestServiceServer mockRestServiceServer; - @Autowired private TestRestTemplate testRestTemplate; @Autowired @@ -127,8 +130,14 @@ public class EtsiSubscriptionNotificationControllerTest { basicHttpHeadersProvider = new BasicHttpHeadersProvider(); cache = cacheServiceProvider.getCache(PackageManagementConstants.PACKAGE_MANAGEMENT_SUBSCRIPTION_CACHE); cache.clear(); + + final Gson gson = JSON.createGson().registerTypeAdapter(LocalDateTime.class, + new EtsiSubscriptionNotificationController.LocalDateTimeTypeAdapter()).create(); + testRestTemplate = new TestRestTemplate( + new RestTemplateBuilder().additionalMessageConverters(new GsonHttpMessageConverter(gson))); } + @After public void tearDown() { mockRestServiceServer.reset(); @@ -147,7 +156,6 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) @@ -155,13 +163,13 @@ public class EtsiSubscriptionNotificationControllerTest { .value(VnfPackageOnboardingNotification.NotificationTypeEnum.VNFPACKAGEONBOARDINGNOTIFICATION .toString())) .andExpect(jsonPath("$.subscriptionId").value(SUBSCRIPTION_ID)) - .andExpect(jsonPath("$.timeStamp").value(TIMESTAMP.toString())) - .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID.toString())) - .andExpect(jsonPath("$.vnfdId").value(VNFD_ID.toString())) - .andExpect(jsonPath("$._links").value(buildPkgmLinks())) + .andExpect(jsonPath("$.timeStamp").value(TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG)) + .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID)).andExpect(jsonPath("$.vnfdId").value(VNFD_ID)) + .andExpect(jsonPath("$._links") + .value(buildPkgmLinks(EXPECTED_VNF_PACKAGE_HREF, EXPECTED_SUBSCRIPTION_HREF))) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)).andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); } @@ -169,8 +177,7 @@ public class EtsiSubscriptionNotificationControllerTest { @Test public void testOnboardingNotificationNotSentOnToVnfmCallbackUri_SubscriptionRequestNotInCache_Fail() { final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -188,12 +195,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.BAD_REQUEST)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -211,12 +217,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.MOVED_PERMANENTLY)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -233,12 +238,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.NOT_FOUND)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -256,12 +260,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -280,24 +283,23 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) .andExpect(jsonPath("$.notificationType").value( VnfPackageChangeNotification.NotificationTypeEnum.VNFPACKAGECHANGENOTIFICATION.getValue())) .andExpect(jsonPath("$.subscriptionId").value(SUBSCRIPTION_ID)) - .andExpect(jsonPath("$.timeStamp").value(TIMESTAMP.toString())) - .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID.toString())) - .andExpect(jsonPath("$.vnfdId").value(VNFD_ID.toString())) + .andExpect(jsonPath("$.timeStamp").value(TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG)) + .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID)).andExpect(jsonPath("$.vnfdId").value(VNFD_ID)) .andExpect( jsonPath("$.changeType").value(PkgChangeNotification.ChangeTypeEnum.OP_STATE_CHANGE.toString())) .andExpect(jsonPath("$.operationalState") .value(PkgChangeNotification.OperationalStateEnum.ENABLED.toString())) - .andExpect(jsonPath("$._links").value(buildPkgmLinks())) + .andExpect(jsonPath("$._links") + .value(buildPkgmLinks(EXPECTED_VNF_PACKAGE_HREF, EXPECTED_SUBSCRIPTION_HREF))) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)).andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); } @@ -305,8 +307,7 @@ public class EtsiSubscriptionNotificationControllerTest { @Test public void testChangeNotificationNotSentOnToVnfmCallbackUri_SubscriptionRequestNotInCache_Fail() { final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -324,12 +325,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.BAD_REQUEST)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -347,12 +347,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.NOT_FOUND)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -370,12 +369,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andRespond(withStatus(HttpStatus.INTERNAL_SERVER_ERROR)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -394,7 +392,6 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgOnboardingNotification notification = buildPkgOnboardingNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(jsonPath("$.id").value(NOTIFICATION_ID)) @@ -402,13 +399,13 @@ public class EtsiSubscriptionNotificationControllerTest { .value(VnfPackageOnboardingNotification.NotificationTypeEnum.VNFPACKAGEONBOARDINGNOTIFICATION .toString())) .andExpect(jsonPath("$.subscriptionId").value(SUBSCRIPTION_ID)) - .andExpect(jsonPath("$.timeStamp").value(TIMESTAMP.toString())) - .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID.toString())) - .andExpect(jsonPath("$.vnfdId").value(VNFD_ID.toString())) - .andExpect(jsonPath("$._links").value(buildPkgmLinks())) + .andExpect(jsonPath("$.timeStamp").value(TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG)) + .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID)).andExpect(jsonPath("$.vnfdId").value(VNFD_ID)) + .andExpect(jsonPath("$._links") + .value(buildPkgmLinks(EXPECTED_VNF_PACKAGE_HREF, EXPECTED_SUBSCRIPTION_HREF))) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)).andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); } @@ -419,13 +416,12 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.BASIC); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(CALLBACK_URI)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)) .andRespond(withStatus(HttpStatus.UNAUTHORIZED)); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -443,7 +439,6 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.OAUTH2_CLIENT_CREDENTIALS); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(TOKEN_ENDPOINT)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)) @@ -455,16 +450,17 @@ public class EtsiSubscriptionNotificationControllerTest { .andExpect(jsonPath("$.notificationType").value( VnfPackageChangeNotification.NotificationTypeEnum.VNFPACKAGECHANGENOTIFICATION.toString())) .andExpect(jsonPath("$.subscriptionId").value(SUBSCRIPTION_ID)) - .andExpect(jsonPath("$.timeStamp").value(TIMESTAMP.toString())) - .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID.toString())) - .andExpect(jsonPath("$.vnfdId").value(VNFD_ID.toString())) + .andExpect(jsonPath("$.timeStamp").value(TIME_STAMP_STRING_EXPECTED_FROM_ETSI_CATALOG)) + .andExpect(jsonPath("$.vnfPkgId").value(VNFPKG_ID)).andExpect(jsonPath("$.vnfdId").value(VNFD_ID)) .andExpect( jsonPath("$.changeType").value(PkgChangeNotification.ChangeTypeEnum.OP_STATE_CHANGE.toString())) .andExpect(jsonPath("$.operationalState") .value(PkgChangeNotification.OperationalStateEnum.ENABLED.toString())) - .andExpect(jsonPath("$._links").value(buildPkgmLinks())).andRespond(withSuccess()); + .andExpect(jsonPath("$._links") + .value(buildPkgmLinks(EXPECTED_VNF_PACKAGE_HREF, EXPECTED_SUBSCRIPTION_HREF))) + .andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); } @@ -475,12 +471,11 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.OAUTH2_CLIENT_CREDENTIALS); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); mockRestServiceServer.expect(requestTo(TOKEN_ENDPOINT)).andExpect(method(HttpMethod.POST)) .andExpect(header("Authorization", EXPECTED_BASIC_AUTHORIZATION)).andRespond(withSuccess()); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -497,9 +492,8 @@ public class EtsiSubscriptionNotificationControllerTest { buildPkgmSubscriptionRequest(SubscriptionsAuthentication.AuthTypeEnum.TLS_CERT); cache.put(SUBSCRIPTION_ID, subscriptionRequest); final PkgChangeNotification notification = buildPkgChangeNotification(); - final String notificationString = gson.toJson(notification); - final ResponseEntity<?> response = sendHttpPost(notificationString); + final ResponseEntity<?> response = sendHttpPost(notification); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); assertTrue(response.getBody() instanceof ProblemDetails); @@ -539,17 +533,12 @@ public class EtsiSubscriptionNotificationControllerTest { } private PkgmLinks buildPkgmLinks() { - final PkgmLinks pkgmLinks = new PkgmLinks(); - - final NOTIFICATIONLINKSERIALIZER subscriptionLinkSerializer = new NOTIFICATIONLINKSERIALIZER(); - subscriptionLinkSerializer.setHref("subscription_href"); - pkgmLinks.setSubscription(subscriptionLinkSerializer); - - final NOTIFICATIONLINKSERIALIZER vnfPackageLinkSerializer = new NOTIFICATIONLINKSERIALIZER(); - vnfPackageLinkSerializer.setHref("vnf_package_href"); - pkgmLinks.setVnfPackage(vnfPackageLinkSerializer); + return buildPkgmLinks("vnf_package_href", "subscription_href"); + } - return pkgmLinks; + private PkgmLinks buildPkgmLinks(final String vnfPkgHref, final String subscriptionHref) { + return new PkgmLinks().vnfPackage(new NOTIFICATIONLINKSERIALIZER().href(vnfPkgHref)) + .subscription(new NOTIFICATIONLINKSERIALIZER().href(subscriptionHref)); } private PkgmSubscriptionRequest buildPkgmSubscriptionRequest( diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementControllerTest.java index 9ea0c1d880..10e4ea3a58 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementControllerTest.java @@ -18,14 +18,14 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; -import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN; import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; @@ -37,15 +37,15 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.Checksum; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.UriLink; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VNFPKGMLinkSerializer; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageArtifactInfo; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPackageSoftwareImageInfo; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfPkgInfo; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.InlineResponse2001; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.VnfPackagesLinks; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.Checksum; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.UriLink; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VNFPKGMLinkSerializer; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfPackageArtifactInfo; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfPackageSoftwareImageInfo; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfPkgInfo; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.InlineResponse2001; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.VnfPackagesLinks; import org.onap.so.configuration.rest.BasicHttpHeadersProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionControllerTest.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementSubscriptionControllerTest.java index b8eb73b2c8..65be6a87f0 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementSubscriptionControllerTest.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/Sol003PackageManagementSubscriptionControllerTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; @@ -27,9 +27,9 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL; -import static org.onap.so.adapters.vnfmadapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; -import static org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.ETSI_SUBSCRIPTION_NOTIFICATION_BASE_URL; +import static org.onap.so.adapters.etsi.sol003.adapter.common.CommonConstants.PACKAGE_MANAGEMENT_BASE_URL; +import static org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.EtsiCatalogServiceProviderConfiguration.ETSI_CATALOG_REST_TEMPLATE_BEAN; import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus; @@ -48,25 +48,25 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.so.adapters.vnfmadapter.PackageManagementConstants; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.BasicAuth; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.LinkSelf; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.NsdmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmNotificationsFilter; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscription; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.ProblemDetails; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.SubscriptionAuthentication; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.Version; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfProducts; -import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.VnfProductsProviders; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.InlineResponse2002; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.InlineResponse201; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.PkgmSubscriptionRequest; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsAuthentication; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsFilter1; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsFilterVnfProductsFromProviders; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.SubscriptionsLinks; -import org.onap.so.adapters.vnfmadapter.packagemanagement.model.VnfPackagesLinksSelf; +import org.onap.so.adapters.etsisol003adapter.pkgm.PackageManagementConstants; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.BasicAuth; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.LinkSelf; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.NsdmSubscription; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmNotificationsFilter; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscription; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.ProblemDetails; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.SubscriptionAuthentication; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.Version; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfProducts; +import org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.VnfProductsProviders; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.InlineResponse2002; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.InlineResponse201; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.PkgmSubscriptionRequest; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsAuthentication; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsFilter1; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsFilterVnfProductsFromProviders; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.SubscriptionsLinks; +import org.onap.so.adapters.etsisol003adapter.pkgm.model.VnfPackagesLinksSelf; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; @@ -324,8 +324,8 @@ public class Sol003PackageManagementSubscriptionControllerTest { } - private org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest getEtsiCatalogPkgmSubscriptionRequest() { - return new org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model.PkgmSubscriptionRequest() + private org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest getEtsiCatalogPkgmSubscriptionRequest() { + return new org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model.PkgmSubscriptionRequest() .filter(new PkgmNotificationsFilter() .addNotificationTypesItem( PkgmNotificationsFilter.NotificationTypesEnum.VNFPACKAGEONBOARDINGNOTIFICATION) diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/TestApplication.java b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/TestApplication.java index 152d3136f1..33535523d6 100755 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/TestApplication.java +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/java/org/onap/so/adapters/etsisol003adapter/pkgm/rest/TestApplication.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.adapters.vnfmadapter.rest; +package org.onap.so.adapters.etsisol003adapter.pkgm.rest; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/application.yaml b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/resources/application.yaml index cdb6662191..cdb6662191 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/application.yaml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/resources/application.yaml diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/requests/SubscriptionRequest.json b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/resources/requests/SubscriptionRequest.json index c38466f8e5..c38466f8e5 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-adapter/src/test/resources/requests/SubscriptionRequest.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-adapter/src/test/resources/requests/SubscriptionRequest.json diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-api/pom.xml index 57620f1eb2..884419c550 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/pom.xml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-api/pom.xml @@ -3,10 +3,10 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.so.adapters</groupId> - <artifactId>etsi-sol003-package-management</artifactId> + <artifactId>etsi-sol003-pkgm</artifactId> <version>1.6.0-SNAPSHOT</version> </parent> - <artifactId>etsi-sol003-package-management-api</artifactId> + <artifactId>etsi-sol003-pkgm-api</artifactId> <name>ETSI SOL003 VNF Package Management Adapter API</name> <build> <plugins> @@ -25,8 +25,8 @@ <language>java</language> <library>okhttp-gson</library> <output>${project.build.directory}/generated-sources/etsicatalog/notification</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.etsicatalog.notification.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.etsicatalog.notification.model</modelPackage> + <apiPackage>org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsisol003adapter.etsicatalog.notification.model</modelPackage> <generateApiTests>false</generateApiTests> <generateModelTests>false</generateModelTests> <configOptions> @@ -34,6 +34,7 @@ <withXml>true</withXml> <useRxJava2>true</useRxJava2> <serializableModel>true</serializableModel> + <dateLibrary>java8-localdatetime</dateLibrary> </configOptions> </configuration> </execution> @@ -47,8 +48,8 @@ <language>java</language> <library>okhttp-gson</library> <output>${project.build.directory}/generated-sources/sol003-vnf-packagemanagement</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.packagemanagement.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.packagemanagement.model</modelPackage> + <apiPackage>org.onap.so.adapters.etsisol003adapter.pkgm.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsisol003adapter.pkgm.model</modelPackage> <generateApiTests>false</generateApiTests> <generateModelTests>false</generateModelTests> <configOptions> @@ -192,4 +193,4 @@ <version>${okhttp-version}</version> </dependency> </dependencies> -</project>
\ No newline at end of file +</project> diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/ETSI-Catalog-Notification-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-api/src/main/resources/ETSI-Catalog-Notification-API.json index 6db54435d2..6db54435d2 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/ETSI-Catalog-Notification-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-api/src/main/resources/ETSI-Catalog-Notification-API.json diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/SOL003-VNFPackageManagement-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-api/src/main/resources/SOL003-VNFPackageManagement-API.json index 17d81f44c1..17d81f44c1 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-api/src/main/resources/SOL003-VNFPackageManagement-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-api/src/main/resources/SOL003-VNFPackageManagement-API.json diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-ext-clients/pom.xml index 6d80d6f232..6e6de84b5f 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/pom.xml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-ext-clients/pom.xml @@ -3,10 +3,10 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.so.adapters</groupId> - <artifactId>etsi-sol003-package-management</artifactId> + <artifactId>etsi-sol003-pkgm</artifactId> <version>1.6.0-SNAPSHOT</version> </parent> - <artifactId>etsi-sol003-package-management-ext-clients</artifactId> + <artifactId>etsi-sol003-pkgm-ext-clients</artifactId> <name>ETSI SOL003 VNF Package Management Adapter Ext Clients</name> <build> <plugins> @@ -25,8 +25,8 @@ <language>java</language> <library>okhttp-gson</library> <output>${project.build.directory}/generated-sources/etsicatalog</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.model</modelPackage> + <apiPackage>org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsisol003adapter.pkgm.extclients.etsicatalog.model</modelPackage> <generateApiTests>false</generateApiTests> <generateModelTests>false</generateModelTests> <configOptions> @@ -47,8 +47,8 @@ <language>java</language> <library>okhttp-gson</library> <output>${project.build.directory}/generated-sources/sol003-vnf-packagemanagement/notification</output> - <apiPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.api</apiPackage> - <modelPackage>org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model</modelPackage> + <apiPackage>org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.api</apiPackage> + <modelPackage>org.onap.so.adapters.etsisol003adapter.pkgm.extclients.vnfm.notification.model</modelPackage> <generateApiTests>false</generateApiTests> <generateModelTests>false</generateModelTests> <configOptions> @@ -56,6 +56,7 @@ <withXml>true</withXml> <useRxJava2>true</useRxJava2> <serializableModel>true</serializableModel> + <dateLibrary>java8-localdatetime</dateLibrary> </configOptions> </configuration> </execution> @@ -193,4 +194,4 @@ </dependency> </dependencies> -</project>
\ No newline at end of file +</project> diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/ETSI-Catalog-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-ext-clients/src/main/resources/ETSI-Catalog-API.json index 35a8c2bd3d..35a8c2bd3d 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/ETSI-Catalog-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-ext-clients/src/main/resources/ETSI-Catalog-API.json diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-ext-clients/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json index 32e002f0e7..32e002f0e7 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/etsi-sol003-package-management-ext-clients/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/etsi-sol003-pkgm-ext-clients/src/main/resources/SOL003-VNFPackageManagement-Notification-API.json diff --git a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/pom.xml b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/pom.xml index 6983f2ffed..fb5b636ee4 100644 --- a/adapters/etsi-sol003-adapter/etsi-sol003-package-management/pom.xml +++ b/adapters/etsi-sol003-adapter/etsi-sol003-pkgm/pom.xml @@ -6,12 +6,12 @@ <artifactId>etsi-sol003-adapter</artifactId> <version>1.6.0-SNAPSHOT</version> </parent> - <artifactId>etsi-sol003-package-management</artifactId> + <artifactId>etsi-sol003-pkgm</artifactId> <name>ETSI SOL003 VNF Package Management</name> <packaging>pom</packaging> <modules> - <module>etsi-sol003-package-management-api</module> - <module>etsi-sol003-package-management-ext-clients</module> - <module>etsi-sol003-package-management-adapter</module> + <module>etsi-sol003-pkgm-api</module> + <module>etsi-sol003-pkgm-ext-clients</module> + <module>etsi-sol003-pkgm-adapter</module> </modules> </project>
\ No newline at end of file diff --git a/adapters/etsi-sol003-adapter/pom.xml b/adapters/etsi-sol003-adapter/pom.xml index 7179fb7492..6c3a1f5b1c 100644 --- a/adapters/etsi-sol003-adapter/pom.xml +++ b/adapters/etsi-sol003-adapter/pom.xml @@ -28,7 +28,7 @@ <modules> <module>etsi-sol003-adapter-common</module> - <module>etsi-sol003-package-management</module> + <module>etsi-sol003-pkgm</module> <module>etsi-sol003-lcm</module> <module>etsi-sol003-adapter-application</module> </modules> |