Merge "feat: modify create ccvpn instance function."
authorKeguang He <hekeguang@chinamobile.com>
Tue, 29 Mar 2022 07:00:10 +0000 (07:00 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 29 Mar 2022 07:00:10 +0000 (07:00 +0000)
server/src/main/java/org/onap/usecaseui/server/bean/intent/CCVPNInstance.java
server/src/main/java/org/onap/usecaseui/server/controller/IntentController.java
server/src/main/java/org/onap/usecaseui/server/service/intent/impl/IntentInstanceServiceImpl.java
standalone/src/main/assembly/resources/dbscripts/postgres/uui_create_table.sql

index 50e5ac3..55eb84a 100644 (file)
@@ -62,6 +62,12 @@ public class CCVPNInstance implements Serializable {
     @Column(name = "delete_state")
     private int deleteState;
 
+    @Column(name = "protection_cloud_point_name")
+    private String protectionCloudPointName;
+
+    @Column(name = "protection_type")
+    private String protectionType;
+
     public CCVPNInstance() {
 
     }
@@ -169,4 +175,20 @@ public class CCVPNInstance implements Serializable {
     public void setProtectStatus(int protectStatus) {
         this.protectStatus = protectStatus;
     }
+
+    public String getProtectionCloudPointName() {
+        return protectionCloudPointName;
+    }
+
+    public void setProtectionCloudPointName(String protectionCloudPointName) {
+        this.protectionCloudPointName = protectionCloudPointName;
+    }
+
+    public String getProtectionType() {
+        return protectionType;
+    }
+
+    public void setProtectionType(String protectionType) {
+        this.protectionType = protectionType;
+    }
 }
\ No newline at end of file
index b8d63f4..e4d6676 100644 (file)
@@ -435,6 +435,10 @@ public class IntentController {
         instance.setAccessPointOneBandWidth(accessPointOneBandWidth);
         instance.setStatus("0");
         instance.setProtectStatus(protectStatus?1:0);
+        if (protectStatus) {
+            instance.setProtectionType("1+1");
+            instance.setProtectionCloudPointName("tranportEp_dst_ID_123_4");
+        }
 
         int flag = intentInstanceService.createCCVPNInstance(instance);
 
index b62f3aa..c703953 100644 (file)
@@ -219,6 +219,10 @@ public class IntentInstanceServiceImpl implements IntentInstanceService {
         connectionLink.put("transportEndpointA", instance.getAccessPointOneName());
         connectionLink.put("transportEndpointB", instance.getCloudPointName());
         connectionLinks.add(connectionLink);
+        if (instance.getProtectStatus() == 1) {
+            sla.put("protectionType", instance.getProtectionType());
+            connectionLink.put("transportEndpointBProtection", instance.getProtectionCloudPointName());
+        }
         transportNetwork.put("sla", sla);
         transportNetwork.put("connectionLinks", connectionLinks);
         transportNetworks.add(transportNetwork);
index 9e45d5b..4e43e20 100644 (file)
@@ -183,7 +183,9 @@ CREATE TABLE ccvpn_instance
     access_point_one_band_width integer,
     line_num                    varchar(64),
     delete_state                integer default 0,
-    protect_status              integer default 0
+    protect_status              integer default 0,
+    protection_cloud_point_name       varchar(255),
+    protection_type       varchar(255)
 );
 
 -- ----------------------------