aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-openstack-adapters/src/main')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java8
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsync.java3
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java28
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java16
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java67
5 files changed, 114 insertions, 8 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java
index 27829a6156..6e2fcb02c9 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java
@@ -55,9 +55,12 @@ public interface MsoNetworkAdapter
@WebParam(name="networkName") @XmlElement(required=true) String networkName,
@WebParam(name="physicalNetworkName") String physicalNetworkName,
@WebParam(name="vlans") List<Integer> vlans,
+ @WebParam(name="shared") String shared,
+ @WebParam(name="external") String external,
@WebParam(name="failIfExists") Boolean failIfExists,
@WebParam(name="backout") Boolean backout,
@WebParam(name="subnets") List<Subnet> subnets,
+ @WebParam(name="networkParams") Map<String, String> networkParams,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="networkId", mode=Mode.OUT) Holder<String> networkId,
@WebParam(name="neutronNetworkId", mode=Mode.OUT) Holder<String> neutronNetworkId,
@@ -77,6 +80,7 @@ public interface MsoNetworkAdapter
@WebParam(name="failIfExists") Boolean failIfExists,
@WebParam(name="backout") Boolean backout,
@WebParam(name="subnets") List<Subnet> subnets,
+ @WebParam(name="networkParams") Map<String, String> networkParams,
@WebParam(name="policyFqdns") List<String> policyFqdns,
@WebParam(name="routeTableFqdns") List<String> routeTableFqdns,
@WebParam(name="request") MsoRequest msoRequest,
@@ -100,7 +104,10 @@ public interface MsoNetworkAdapter
@WebParam(name="networkName") @XmlElement(required=true) String networkName,
@WebParam(name="physicalNetworkName") @XmlElement(required=true) String physicalNetworkName,
@WebParam(name="vlans") @XmlElement(required=true) List<Integer> vlans,
+ @WebParam(name="shared") String shared,
+ @WebParam(name="external") String external,
@WebParam(name="subnets") List<Subnet> subnets,
+ @WebParam(name="networkParams") Map<String,String> networkParams,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="subnetIdMap", mode=Mode.OUT) Holder<Map<String, String>> subnetIdMap,
@WebParam(name="rollback", mode=Mode.OUT) Holder<NetworkRollback> rollback )
@@ -117,6 +124,7 @@ public interface MsoNetworkAdapter
@WebParam(name="shared") String shared,
@WebParam(name="external") String external,
@WebParam(name="subnets") List<Subnet> subnets,
+ @WebParam(name="networkParams") Map<String,String> networkParams,
@WebParam(name="policyFqdns") List<String> policyFqdns,
@WebParam(name="routeTableFqdns") List<String> routeTableFqdns,
@WebParam(name="request") MsoRequest msoRequest,
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsync.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsync.java
index 99f590b773..a85da58536 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsync.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsync.java
@@ -22,6 +22,7 @@ package org.onap.so.adapters.network;
import java.util.List;
+import java.util.Map;
import javax.jws.Oneway;
import javax.jws.WebMethod;
@@ -56,6 +57,7 @@ public interface MsoNetworkAdapterAsync
@WebParam(name="failIfExists") Boolean failIfExists,
@WebParam(name="backout") Boolean backout,
@WebParam(name="subnets") List<Subnet> subnets,
+ @WebParam(name="networkParams") Map<String, String> networkParams,
@WebParam(name="messageId") @XmlElement(required=true) String messageId,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="notificationUrl") @XmlElement(required=true) String notificationUrl );
@@ -71,6 +73,7 @@ public interface MsoNetworkAdapterAsync
@WebParam(name="physicalNetworkName") @XmlElement(required=true) String physicalNetworkName,
@WebParam(name="vlans") @XmlElement(required=true) List<Integer> vlans,
@WebParam(name="subnets") List<Subnet> subnets,
+ @WebParam(name="networkParams") Map<String, String> networkParams,
@WebParam(name="messageId") @XmlElement(required=true) String messageId,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="notificationUrl") @XmlElement(required=true) String notificationUrl );
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
index 608f39adb4..8181714c0a 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
@@ -122,6 +122,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
Boolean failIfExists,
Boolean backout,
List <Subnet> subnets,
+ Map<String,String> networkParams,
String messageId,
MsoRequest msoRequest,
String notificationUrl) {
@@ -145,6 +146,16 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
Holder <String> neutronNetworkId = new Holder <> ();
Holder <NetworkRollback> networkRollback = new Holder <> ();
Holder <Map <String, String>> subnetIdMap = new Holder <> ();
+
+ HashMap<String, String> params = (HashMap<String,String>) networkParams;
+ if (params == null)
+ params = new HashMap<String,String>();
+ String shared = null;
+ String external = null;
+ if (params.containsKey("shared"))
+ shared = params.get("shared");
+ if (params.containsKey("external"))
+ external = params.get("external");
try {
networkAdapter.createNetwork (cloudSiteId,
@@ -154,9 +165,12 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
networkName,
physicalNetworkName,
vlans,
+ shared,
+ external,
failIfExists,
backout,
subnets,
+ params,
msoRequest,
networkId,
neutronNetworkId,
@@ -239,6 +253,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
String physicalNetworkName,
List <Integer> vlans,
List <Subnet> subnets,
+ Map <String,String> networkParams,
String messageId,
MsoRequest msoRequest,
String notificationUrl) {
@@ -261,6 +276,16 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
// Synchronous Web Service Outputs
Holder <NetworkRollback> networkRollback = new Holder <> ();
Holder <Map <String, String>> subnetIdMap = new Holder <> ();
+
+ HashMap<String, String> params = (HashMap<String,String>) networkParams;
+ if (params == null)
+ params = new HashMap<String,String>();
+ String shared = null;
+ String external = null;
+ if (params.containsKey("shared"))
+ shared = params.get("shared");
+ if (params.containsKey("external"))
+ external = params.get("external");
try {
networkAdapter.updateNetwork (cloudSiteId,
@@ -271,7 +296,10 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
networkName,
physicalNetworkName,
vlans,
+ shared,
+ external,
subnets,
+ params,
msoRequest,
subnetIdMap,
networkRollback);
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index 45285d0e51..d250561f16 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -138,9 +138,12 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
String networkName,
String physicalNetworkName,
List <Integer> vlans,
+ String shared,
+ String external,
Boolean failIfExists,
Boolean backout,
List <Subnet> subnets,
+ Map<String, String> networkParams,
MsoRequest msoRequest,
Holder <String> networkId,
Holder <String> neutronNetworkId,
@@ -155,8 +158,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
physicalNetworkName,
vlans,
null,
- null,
- null,
+ shared,
+ external,
failIfExists,
backout,
subnets,
@@ -182,6 +185,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
Boolean failIfExists,
Boolean backout,
List <Subnet> subnets,
+ Map<String, String> networkParams,
List <String> policyFqdns,
List<String> routeTableFqdns,
MsoRequest msoRequest,
@@ -660,7 +664,10 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
String networkName,
String physicalNetworkName,
List <Integer> vlans,
+ String shared,
+ String external,
List <Subnet> subnets,
+ Map<String,String> networkParams,
MsoRequest msoRequest,
Holder <Map <String, String>> subnetIdMap,
Holder <NetworkRollback> rollback) throws NetworkException {
@@ -673,8 +680,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
physicalNetworkName,
vlans,
null,
- null,
- null,
+ shared,
+ external,
subnets,
null,
null,
@@ -695,6 +702,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
String shared,
String external,
List <Subnet> subnets,
+ Map<String, String> networkParams,
List <String> policyFqdns,
List<String> routeTableFqdns,
MsoRequest msoRequest,
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
index effe7a8c61..8d08b3b52c 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/NetworkAdapterRest.java
@@ -168,6 +168,13 @@ public class NetworkAdapterRest {
Holder<String> networkFqdn = new Holder<>();
Holder<Map<String, String>> subnetIdMap = new Holder<>();
Holder<NetworkRollback> rollback = new Holder<>();
+
+ HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams();
+ if (params == null) {
+ params = new HashMap<String,String>();
+ }
+ String shared = null;
+ String external = null;
String cloudsite = req.getCloudSiteId();
if (cloudsite != null && cloudsite.equals(TESTING_KEYWORD)) {
@@ -186,6 +193,20 @@ public class NetworkAdapterRest {
ctn = new ContrailNetwork();
req.setContrailNetwork(ctn);
}
+ if (params.containsKey("shared")) {
+ shared = params.get("shared");
+ } else {
+ if (ctn.getShared() != null) {
+ shared = ctn.getShared();
+ }
+ }
+ if (params.containsKey("external")) {
+ external = params.get("external");
+ } else {
+ if (ctn.getExternal() != null) {
+ external = ctn.getExternal();
+ }
+ }
adapter.createNetworkContrail(
req.getCloudSiteId(),
req.getTenantId(),
@@ -193,11 +214,12 @@ public class NetworkAdapterRest {
req.getModelCustomizationUuid(),
req.getNetworkName(),
req.getContrailNetwork().getRouteTargets(),
- req.getContrailNetwork().getShared(),
- req.getContrailNetwork().getExternal(),
+ shared,
+ external,
req.getFailIfExists(),
req.getBackout(),
req.getSubnets(),
+ params,
req.getContrailNetwork().getPolicyFqdns(),
req.getContrailNetwork().getRouteTableFqdns(),
req.getMsoRequest(),
@@ -212,6 +234,10 @@ public class NetworkAdapterRest {
pvn = new ProviderVlanNetwork();
req.setProviderVlanNetwork(pvn);
}
+ if (params.containsKey("shared"))
+ shared = params.get("shared");
+ if (params.containsKey("external"))
+ external = params.get("external");
adapter.createNetwork(
req.getCloudSiteId(),
req.getTenantId(),
@@ -220,9 +246,12 @@ public class NetworkAdapterRest {
req.getNetworkName(),
req.getProviderVlanNetwork().getPhysicalNetworkName(),
req.getProviderVlanNetwork().getVlans(),
+ shared,
+ external,
req.getFailIfExists(),
req.getBackout(),
req.getSubnets(),
+ params,
req.getMsoRequest(),
networkId,
neutronNetworkId,
@@ -593,6 +622,12 @@ public class NetworkAdapterRest {
try {
Holder<Map<String, String>> subnetIdMap = new Holder<>();
Holder<NetworkRollback> rollback = new Holder<> ();
+ HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams();
+ if (params == null) {
+ params = new HashMap<String,String>();
+ }
+ String shared = null;
+ String external = null;
if (req.getCloudSiteId().equals(TESTING_KEYWORD)) {
subnetIdMap.value = testMap();
@@ -607,6 +642,20 @@ public class NetworkAdapterRest {
ctn = new ContrailNetwork();
req.setContrailNetwork(ctn);
}
+ if (params.containsKey("shared")) {
+ shared = params.get("shared");
+ } else {
+ if (ctn.getShared() != null) {
+ shared = ctn.getShared();
+ }
+ }
+ if (params.containsKey("external")) {
+ external = params.get("external");
+ } else {
+ if (ctn.getExternal() != null) {
+ external = ctn.getExternal();
+ }
+ }
adapter.updateNetworkContrail(
req.getCloudSiteId(),
req.getTenantId(),
@@ -615,9 +664,10 @@ public class NetworkAdapterRest {
req.getNetworkStackId(),
req.getNetworkName(),
req.getContrailNetwork().getRouteTargets(),
- req.getContrailNetwork().getShared(),
- req.getContrailNetwork().getExternal(),
+ shared,
+ external,
req.getSubnets(),
+ params,
req.getContrailNetwork().getPolicyFqdns(),
req.getContrailNetwork().getRouteTableFqdns(),
req.getMsoRequest(),
@@ -629,6 +679,12 @@ public class NetworkAdapterRest {
pvn = new ProviderVlanNetwork();
req.setProviderVlanNetwork(pvn);
}
+ if (params.containsKey("shared")) {
+ shared = params.get("shared");
+ }
+ if (params.containsKey("external")) {
+ external = params.get("external");
+ }
adapter.updateNetwork(
req.getCloudSiteId(),
req.getTenantId(),
@@ -638,7 +694,10 @@ public class NetworkAdapterRest {
req.getNetworkName(),
req.getProviderVlanNetwork().getPhysicalNetworkName(),
req.getProviderVlanNetwork().getVlans(),
+ shared,
+ external,
req.getSubnets(),
+ params,
req.getMsoRequest(),
subnetIdMap,
rollback);