summaryrefslogtreecommitdiffstats
path: root/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main')
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java4
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java15
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java10
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java8
4 files changed, 29 insertions, 8 deletions
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java
index bb2730bd2b..e3166447e6 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/MessageConverterConfiguration.java
@@ -56,8 +56,8 @@ public class MessageConverterConfiguration {
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/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java
index e1c43098f8..b8a6fb9560 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/AbstractPkgNotificationConverter.java
@@ -20,6 +20,7 @@
package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003;
+import org.onap.so.adapters.vnfmadapter.VnfmAdapterUrlProvider;
import org.onap.so.adapters.vnfmadapter.extclients.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;
@@ -30,20 +31,26 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notifi
*
* @author andrew.a.lamb@est.tech
*/
-abstract public class AbstractPkgNotificationConverter {
+public abstract 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/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java
index 8c4168632b..055f96b8a2 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgChangeNotificationConverter.java
@@ -21,6 +21,7 @@
package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003;
import static org.slf4j.LoggerFactory.getLogger;
+import org.onap.so.adapters.vnfmadapter.VnfmAdapterUrlProvider;
import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgChangeNotification;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageChangeNotification;
import org.slf4j.Logger;
@@ -38,6 +39,11 @@ 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,9 +77,11 @@ 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/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java
index 836acb6d36..50f95c6353 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/converters/etsicatalog/sol003/PkgOnboardingNotificationConverter.java
@@ -21,6 +21,7 @@
package org.onap.so.adapters.vnfmadapter.converters.etsicatalog.sol003;
import static org.slf4j.LoggerFactory.getLogger;
+import org.onap.so.adapters.vnfmadapter.VnfmAdapterUrlProvider;
import org.onap.so.adapters.vnfmadapter.extclients.etsicatalog.notification.model.PkgOnboardingNotification;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification;
import org.slf4j.Logger;
@@ -38,6 +39,10 @@ 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 +66,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;
}