Add the data transaction of sdnc. 93/12193/1
authorlizi00164331 <li.zi30@zte.com.cn>
Wed, 13 Sep 2017 13:18:25 +0000 (21:18 +0800)
committerlizi00164331 <li.zi30@zte.com.cn>
Wed, 13 Sep 2017 13:18:25 +0000 (21:18 +0800)
Realize the data transaction thirdparty sdnc.
Fix the data structure about A&AI in esr.
Change the debug port of esr-server.

Change-Id: I5267c6ad7a249119a97354308f3efde0891a78e4
Issue-ID: AAI-294
Signed-off-by: lizi00164331 <li.zi30@zte.com.cn>
esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/AuthInfo.java [deleted file]
esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrSystemInfo.java
esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/EsrSystemInfoList.java
esr-mgr/src/main/java/org/onap/aai/esr/util/EmsManagerUtil.java
esr-mgr/src/main/java/org/onap/aai/esr/util/ExtsysUtil.java
esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java [new file with mode: 0644]
esr-mgr/src/main/java/org/onap/aai/esr/util/VimManagerUtil.java
esr-mgr/src/main/java/org/onap/aai/esr/util/VnfmManagerUtil.java
standalone/src/main/assembly/bin/run.bat
standalone/src/main/assembly/bin/run.sh

diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/AuthInfo.java b/esr-mgr/src/main/java/org/onap/aai/esr/entity/aai/AuthInfo.java
deleted file mode 100644 (file)
index 1fbca12..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * Copyright 2017 ZTE Corporation.
- *
- * 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.
- */
-package org.onap.aai.esr.entity.aai;
-
-public class AuthInfo {
-  
-  private String esrSystemInfoId;
-  
-  private String systemName;
-  
-  private String type;
-  
-  private String vendor;
-  
-  private String version;
-  
-  private String serviceUrl;
-  
-  private String userName;
-  
-  private String password;
-  
-  private String systemType;
-  
-  private String protocal;
-  
-  private String sslCassert;
-  
-  private Boolean sslInsecure;
-  
-  private String ipAddress;
-  
-  private String port;
-  
-  private String cloudDomain;
-  
-  private String defaultTenant;
-  
-  private Boolean passive;
-  
-  private String remotePath;
-  
-  private String systemStatus;
-  
-  private String resouceVersion;
-
-  public String getEsrSystemInfoId() {
-    return esrSystemInfoId;
-  }
-
-  public void setEsrSystemInfoId(String esrSystemInfoId) {
-    this.esrSystemInfoId = esrSystemInfoId;
-  }
-
-  public String getSystemName() {
-    return systemName;
-  }
-
-  public void setSystemName(String systemName) {
-    this.systemName = systemName;
-  }
-
-  public String getType() {
-    return type;
-  }
-
-  public void setType(String type) {
-    this.type = type;
-  }
-
-  public String getVendor() {
-    return vendor;
-  }
-
-  public void setVendor(String vendor) {
-    this.vendor = vendor;
-  }
-
-  public String getVersion() {
-    return version;
-  }
-
-  public void setVersion(String version) {
-    this.version = version;
-  }
-
-  public String getServiceUrl() {
-    return serviceUrl;
-  }
-
-  public void setServiceUrl(String serviceUrl) {
-    this.serviceUrl = serviceUrl;
-  }
-
-  public String getUserName() {
-    return userName;
-  }
-
-  public void setUserName(String userName) {
-    this.userName = userName;
-  }
-
-  public String getPassword() {
-    return password;
-  }
-
-  public void setPassword(String password) {
-    this.password = password;
-  }
-
-  public String getSystemType() {
-    return systemType;
-  }
-
-  public void setSystemType(String systemType) {
-    this.systemType = systemType;
-  }
-
-  public String getProtocal() {
-    return protocal;
-  }
-
-  public void setProtocal(String protocal) {
-    this.protocal = protocal;
-  }
-
-  public String getSslCassert() {
-    return sslCassert;
-  }
-
-  public void setSslCassert(String sslCassert) {
-    this.sslCassert = sslCassert;
-  }
-
-  public String getIpAddress() {
-    return ipAddress;
-  }
-
-  public void setIpAddress(String ipAddress) {
-    this.ipAddress = ipAddress;
-  }
-
-  public String getPort() {
-    return port;
-  }
-
-  public void setPort(String port) {
-    this.port = port;
-  }
-
-  public String getCloudDomain() {
-    return cloudDomain;
-  }
-
-  public void setCloudDomain(String cloudDomain) {
-    this.cloudDomain = cloudDomain;
-  }
-
-  public String getDefaultTenant() {
-    return defaultTenant;
-  }
-
-  public void setDefaultTenant(String defaultTenant) {
-    this.defaultTenant = defaultTenant;
-  }
-
-  public String getSystemStatus() {
-    return systemStatus;
-  }
-
-  public void setSystemStatus(String systemStatus) {
-    this.systemStatus = systemStatus;
-  }
-
-  public Boolean getSslInsecure() {
-    return sslInsecure;
-  }
-
-  public void setSslInsecure(Boolean sslInsecure) {
-    this.sslInsecure = sslInsecure;
-  }
-
-  public String getResouceVersion() {
-    return resouceVersion;
-  }
-
-  public void setResouceVersion(String resouceVersion) {
-    this.resouceVersion = resouceVersion;
-  }
-
-  public Boolean getPassive() {
-    return passive;
-  }
-
-  public void setPassive(Boolean passive) {
-    this.passive = passive;
-  }
-
-  public String getRemotePath() {
-    return remotePath;
-  }
-
-  public void setRemotePath(String remotePath) {
-    this.remotePath = remotePath;
-  }
-  
-}
index b6be9a7..1e1a60e 100644 (file)
  */
 package org.onap.aai.esr.entity.aai;
 
-import java.util.ArrayList;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
 
 public class EsrSystemInfo {
+  
+  @SerializedName("esr-system-info-id")
+  @JsonProperty("esr-system-info-id")
+  private String esrSystemInfoId;
+  
+  @SerializedName("system-name")
+  @JsonProperty("system-name")
+  private String systemName;
+  
+  @SerializedName("type")
+  @JsonProperty("type")
+  private String type;
+  
+  @SerializedName("vendor")
+  @JsonProperty("vendor")
+  private String vendor;
+  
+  @SerializedName("version")
+  @JsonProperty("version")
+  private String version;
+  
+  @SerializedName("service-url")
+  @JsonProperty("service-url")
+  private String serviceUrl;
+  
+  @SerializedName("user-name")
+  @JsonProperty("user-name")
+  private String userName;
+  
+  @SerializedName("password")
+  @JsonProperty("password")
+  private String password;
+  
+  @SerializedName("system-type")
+  @JsonProperty("system-type")
+  private String systemType;
+  
+  @SerializedName("protocol")
+  @JsonProperty("protocol")
+  private String protocol;
+  
+  @SerializedName("ssl-cassert")
+  @JsonProperty("ssl-cassert")
+  private String sslCassert;
+  
+  @SerializedName("ssl-insecure")
+  @JsonProperty("ssl-insecure")
+  private Boolean sslInsecure;
+  
+  @SerializedName("ip-address")
+  @JsonProperty("ip-address")
+  private String ipAddress;
+  
+  @SerializedName("port")
+  @JsonProperty("port")
+  private String port;
+  
+  @SerializedName("cloud-domain")
+  @JsonProperty("cloud-domain")
+  private String cloudDomain;
+  
+  @SerializedName("default-tenant")
+  @JsonProperty("default-tenant")
+  private String defaultTenant;
+  
+  @SerializedName("passive")
+  @JsonProperty("passive")
+  private Boolean passive;
+  
+  @SerializedName("remote-path")
+  @JsonProperty("remote-path")
+  private String remotePath;
+  
+  @SerializedName("system-status")
+  @JsonProperty("system-status")
+  private String systemStatus;
+  
+  @JsonProperty("resouce-version")
+  private String resouceVersion;
 
-  private ArrayList<AuthInfo> esrSystemInfo;
+  public String getEsrSystemInfoId() {
+    return esrSystemInfoId;
+  }
+
+  public void setEsrSystemInfoId(String esrSystemInfoId) {
+    this.esrSystemInfoId = esrSystemInfoId;
+  }
+
+  public String getSystemName() {
+    return systemName;
+  }
+
+  public void setSystemName(String systemName) {
+    this.systemName = systemName;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public String getVendor() {
+    return vendor;
+  }
+
+  public void setVendor(String vendor) {
+    this.vendor = vendor;
+  }
+
+  public String getVersion() {
+    return version;
+  }
+
+  public void setVersion(String version) {
+    this.version = version;
+  }
+
+  public String getServiceUrl() {
+    return serviceUrl;
+  }
+
+  public void setServiceUrl(String serviceUrl) {
+    this.serviceUrl = serviceUrl;
+  }
+
+  public String getUserName() {
+    return userName;
+  }
+
+  public void setUserName(String userName) {
+    this.userName = userName;
+  }
+
+  public String getPassword() {
+    return password;
+  }
+
+  public void setPassword(String password) {
+    this.password = password;
+  }
+
+  public String getSystemType() {
+    return systemType;
+  }
+
+  public void setSystemType(String systemType) {
+    this.systemType = systemType;
+  }
+
+  public String getProtocol() {
+    return protocol;
+  }
+
+  public void setProtocol(String protocol) {
+    this.protocol = protocol;
+  }
+
+  public String getSslCassert() {
+    return sslCassert;
+  }
+
+  public void setSslCassert(String sslCassert) {
+    this.sslCassert = sslCassert;
+  }
+
+  public Boolean getSslInsecure() {
+    return sslInsecure;
+  }
+
+  public void setSslInsecure(Boolean sslInsecure) {
+    this.sslInsecure = sslInsecure;
+  }
+
+  public String getIpAddress() {
+    return ipAddress;
+  }
+
+  public void setIpAddress(String ipAddress) {
+    this.ipAddress = ipAddress;
+  }
+
+  public String getPort() {
+    return port;
+  }
+
+  public void setPort(String port) {
+    this.port = port;
+  }
+
+  public String getCloudDomain() {
+    return cloudDomain;
+  }
 
-  public ArrayList<AuthInfo> getEsrSystemInfo() {
-    return esrSystemInfo;
+  public void setCloudDomain(String cloudDomain) {
+    this.cloudDomain = cloudDomain;
   }
 
-  public void setEsrSystemInfo(ArrayList<AuthInfo> esrSystemInfo) {
-    this.esrSystemInfo = esrSystemInfo;
+  public String getDefaultTenant() {
+    return defaultTenant;
   }
+
+  public void setDefaultTenant(String defaultTenant) {
+    this.defaultTenant = defaultTenant;
+  }
+
+  public Boolean getPassive() {
+    return passive;
+  }
+
+  public void setPassive(Boolean passive) {
+    this.passive = passive;
+  }
+
+  public String getRemotePath() {
+    return remotePath;
+  }
+
+  public void setRemotePath(String remotePath) {
+    this.remotePath = remotePath;
+  }
+
+  public String getSystemStatus() {
+    return systemStatus;
+  }
+
+  public void setSystemStatus(String systemStatus) {
+    this.systemStatus = systemStatus;
+  }
+
+  public String getResouceVersion() {
+    return resouceVersion;
+  }
+
+  public void setResouceVersion(String resouceVersion) {
+    this.resouceVersion = resouceVersion;
+  }
+
 }
index 5adef8e..71256ff 100644 (file)
  */
 package org.onap.aai.esr.entity.aai;
 
+import java.util.ArrayList;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
+
 public class EsrSystemInfoList {
 
-  private EsrSystemInfo esrSystemInfo;
+  @SerializedName("esr-system-info")
+  @JsonProperty("esr-system-info")
+  private ArrayList<EsrSystemInfo> esrSystemInfo;
 
-  public EsrSystemInfo getEsrSystemInfo() {
+  public ArrayList<EsrSystemInfo> getEsrSystemInfo() {
     return esrSystemInfo;
   }
 
-  public void setEsrSystemInfo(EsrSystemInfo esrSystemInfo) {
+  public void setEsrSystemInfo(ArrayList<EsrSystemInfo> esrSystemInfo) {
     this.esrSystemInfo = esrSystemInfo;
   }
 }
index decd2da..b48f76c 100644 (file)
@@ -18,7 +18,7 @@ package org.onap.aai.esr.util;
 import java.util.ArrayList;
 
 import org.onap.aai.esr.common.SystemType;
-import org.onap.aai.esr.entity.aai.AuthInfo;
+import org.onap.aai.esr.entity.aai.EsrSystemInfo;
 import org.onap.aai.esr.entity.aai.EsrEms;
 import org.onap.aai.esr.entity.rest.AlarmAddr;
 import org.onap.aai.esr.entity.rest.EmsRegisterInfo;
@@ -29,17 +29,17 @@ public class EmsManagerUtil {
   public static EsrEms emsRegisterInfo2EsrEms(EmsRegisterInfo emsRegisterInfo) {
     EsrEms esrEms = new EsrEms();
     esrEms.setEmsId(ExtsysUtil.generateId());
-    ArrayList<AuthInfo> authInfos = new ArrayList<AuthInfo>();
+    ArrayList<EsrSystemInfo> authInfos = new ArrayList<EsrSystemInfo>();
     authInfos = getAuthInfosFromRegisterData(emsRegisterInfo);
     esrEms.setEsrSystemInfoList(ExtsysUtil.getEsrSystemInfoListFromAuthInfoList(authInfos));
     return esrEms;
   }
 
-  private static ArrayList<AuthInfo> getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) {
-    ArrayList<AuthInfo> authInfos = new ArrayList<AuthInfo>();
-    AuthInfo resouceAuthInfo = new AuthInfo();
-    AuthInfo performanceAuthInfo = new AuthInfo();
-    AuthInfo alarmAuthInfo = new AuthInfo();
+  private static ArrayList<EsrSystemInfo> getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) {
+    ArrayList<EsrSystemInfo> authInfos = new ArrayList<EsrSystemInfo>();
+    EsrSystemInfo resouceAuthInfo = new EsrSystemInfo();
+    EsrSystemInfo performanceAuthInfo = new EsrSystemInfo();
+    EsrSystemInfo alarmAuthInfo = new EsrSystemInfo();
     resouceAuthInfo = getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_RESOUCE.toString());
     performanceAuthInfo = getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_PERFORMANCE.toString());
     alarmAuthInfo = getAuthInfoFromAlarmAddr(emsRegisterInfo);
@@ -49,8 +49,8 @@ public class EmsManagerUtil {
     return authInfos;
   }
   
-  private static AuthInfo getAuthInfoFromFtpAddr(EmsRegisterInfo emsRegisterInfo, String systemType) {
-    AuthInfo authInfo = new AuthInfo();
+  private static EsrSystemInfo getAuthInfoFromFtpAddr(EmsRegisterInfo emsRegisterInfo, String systemType) {
+    EsrSystemInfo authInfo = new EsrSystemInfo();
     FtpAddr ftpAddr = new FtpAddr();
     if(systemType.equals(SystemType.EMS_RESOUCE.toString())) {
       ftpAddr = emsRegisterInfo.getResourceAddr();
@@ -72,8 +72,8 @@ public class EmsManagerUtil {
     return authInfo;
   }
   
-  private static AuthInfo getAuthInfoFromAlarmAddr(EmsRegisterInfo emsRegisterInfo) {
-    AuthInfo authInfo = new AuthInfo();
+  private static EsrSystemInfo getAuthInfoFromAlarmAddr(EmsRegisterInfo emsRegisterInfo) {
+    EsrSystemInfo authInfo = new EsrSystemInfo();
     AlarmAddr alarmAddr = new AlarmAddr();
     alarmAddr = emsRegisterInfo.getAlarmAddr();
     authInfo.setIpAddress(alarmAddr.getIp());
@@ -89,13 +89,13 @@ public class EmsManagerUtil {
   
   public static EmsRegisterInfo EsrEms2EmsRegisterInfo(EsrEms esrEms) {
     EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
-    ArrayList<AuthInfo> authInfos = new ArrayList<AuthInfo>();
-    AuthInfo authInfo = new AuthInfo();
-    authInfos = esrEms.getEsrSystemInfoList().getEsrSystemInfo().getEsrSystemInfo();
+    ArrayList<EsrSystemInfo> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+    EsrSystemInfo authInfo = new EsrSystemInfo();
+    esrSystemInfo = esrEms.getEsrSystemInfoList().getEsrSystemInfo();
     emsRegisterInfo.setEmsId(esrEms.getEmsId());
     
-    for(int i=0; i<authInfos.size(); i++) {
-      authInfo = authInfos.get(i);
+    for(int i=0; i<esrSystemInfo.size(); i++) {
+      authInfo = esrSystemInfo.get(i);
       if(authInfo.getSystemType().equals(SystemType.EMS_RESOUCE.toString())){
         FtpAddr resourceAddr = new FtpAddr();
         resourceAddr = getFtpAddrFromAuthInfo(authInfo);
@@ -116,7 +116,7 @@ public class EmsManagerUtil {
     return emsRegisterInfo;
   }
   
-  private static FtpAddr getFtpAddrFromAuthInfo(AuthInfo authInfo) {
+  private static FtpAddr getFtpAddrFromAuthInfo(EsrSystemInfo authInfo) {
     FtpAddr ftpAddr = new FtpAddr();
     ftpAddr.setFtptype(authInfo.getType());
     ftpAddr.setIp(authInfo.getIpAddress());
@@ -128,7 +128,7 @@ public class EmsManagerUtil {
     return ftpAddr;
   }
   
-  private static AlarmAddr getAlarmAddrFromAuthInfo(AuthInfo authInfo) {
+  private static AlarmAddr getAlarmAddrFromAuthInfo(EsrSystemInfo authInfo) {
     AlarmAddr alarmAddr = new AlarmAddr();
     alarmAddr.setIp(authInfo.getIpAddress());
     alarmAddr.setPassword(authInfo.getPassword());
index b8a120c..d0ba1d8 100644 (file)
@@ -25,7 +25,6 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.UUID;
 
-import org.onap.aai.esr.entity.aai.AuthInfo;
 import org.onap.aai.esr.entity.aai.EsrSystemInfo;
 import org.onap.aai.esr.entity.aai.EsrSystemInfoList;
 
@@ -57,21 +56,17 @@ public class ExtsysUtil {
     return sdf.format(new Date());
   }
   
-  public static EsrSystemInfoList getEsrSystemInfoListFromAuthInfo(AuthInfo authInfo) {
+  public static EsrSystemInfoList getEsrSystemInfoListFromAuthInfo(EsrSystemInfo esrSystemInfoObj) {
     EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
-    EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
-    ArrayList<AuthInfo> authInfos = new ArrayList<AuthInfo>();
-    authInfos.add(authInfo);
-    esrSystemInfo.setEsrSystemInfo(authInfos);
+    ArrayList<EsrSystemInfo> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+    esrSystemInfo.add(esrSystemInfoObj);
     esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
     return esrSystemInfoList;
   }
   
-  public static EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(ArrayList<AuthInfo> authInfos) {
+  public static EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(ArrayList<EsrSystemInfo> esrSystemInfo) {
     EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
-    EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
-    esrSystemInfo.setEsrSystemInfo(authInfos);
-    esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
+    esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);;
     return esrSystemInfoList;
   }
 }
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/ThirdpartySdncManagerUtil.java
new file mode 100644 (file)
index 0000000..a9075e3
--- /dev/null
@@ -0,0 +1,72 @@
+/**
+ * Copyright 2017 ZTE Corporation.
+ *
+ * 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.
+ */
+package org.onap.aai.esr.util;
+
+import java.util.ArrayList;
+
+import org.onap.aai.esr.common.SystemType;
+import org.onap.aai.esr.entity.aai.EsrSystemInfo;
+import org.onap.aai.esr.entity.aai.EsrSystemInfoList;
+import org.onap.aai.esr.entity.aai.EsrThirdpartySdnc;
+import org.onap.aai.esr.entity.rest.ThirdpartySdncRegisterInfo;
+
+public class ThirdpartySdncManagerUtil {
+  
+  public EsrThirdpartySdnc sdncRegisterInfo2EsrSdnc(ThirdpartySdncRegisterInfo sdncRegisterInfo) {
+    EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
+    sdncRegisterInfo.setThirdpartySdncId(ExtsysUtil.generateId());
+    esrThirdpartySdnc.setThirdpartySdncId(sdncRegisterInfo.getThirdpartySdncId());
+    esrThirdpartySdnc.setLocation(sdncRegisterInfo.getLocation());
+    esrThirdpartySdnc.setProductName(sdncRegisterInfo.getProductName());
+    esrThirdpartySdnc.setEsrSystemInfoList(getEsrSystemInfoList(sdncRegisterInfo));
+    return esrThirdpartySdnc;
+  }
+  
+  private EsrSystemInfoList getEsrSystemInfoList(ThirdpartySdncRegisterInfo sdncRegisterInfo) {
+    EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+    ArrayList<EsrSystemInfo> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+    EsrSystemInfo authInfo = new EsrSystemInfo();
+    authInfo.setResouceVersion(sdncRegisterInfo.getVersion());
+    authInfo.setSystemName(sdncRegisterInfo.getName());
+    authInfo.setServiceUrl(sdncRegisterInfo.getUrl());
+    authInfo.setVendor(sdncRegisterInfo.getVendor());
+    authInfo.setType(sdncRegisterInfo.getType());
+    authInfo.setUserName(sdncRegisterInfo.getUserName());
+    authInfo.setPassword(sdncRegisterInfo.getPassword());
+    authInfo.setProtocol(sdncRegisterInfo.getProtocol());
+    authInfo.setSystemType(SystemType.thirdparty_SDNC.toString());
+    esrSystemInfo.add(authInfo);
+    esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
+    return esrSystemInfoList;
+  }
+
+  public ThirdpartySdncRegisterInfo esrSdnc2SdncRegisterInfo(EsrThirdpartySdnc esrSdnc) {
+    ThirdpartySdncRegisterInfo registerSdncInfo = new ThirdpartySdncRegisterInfo();
+    EsrSystemInfo esrSystemInfo = esrSdnc.getEsrSystemInfoList().getEsrSystemInfo().get(0);
+    registerSdncInfo.setThirdpartySdncId(esrSdnc.getThirdpartySdncId());
+    registerSdncInfo.setLocation(esrSdnc.getLocation());
+    registerSdncInfo.setProductName(esrSdnc.getProductName());
+    registerSdncInfo.setName(esrSystemInfo.getSystemName());
+    registerSdncInfo.setPassword(esrSystemInfo.getPassword());
+    registerSdncInfo.setProtocol(esrSystemInfo.getProtocol());
+    registerSdncInfo.setType(esrSystemInfo.getType());
+    registerSdncInfo.setUrl(esrSystemInfo.getServiceUrl());
+    registerSdncInfo.setUserName(esrSystemInfo.getUserName());
+    registerSdncInfo.setVendor(esrSystemInfo.getVendor());
+    registerSdncInfo.setVersion(esrSystemInfo.getVersion());
+    return registerSdncInfo;
+  }
+}
index 6194b10..240e762 100644 (file)
@@ -19,7 +19,7 @@ import java.util.ArrayList;
 
 import org.onap.aai.esr.common.SystemStatus;
 import org.onap.aai.esr.common.SystemType;
-import org.onap.aai.esr.entity.aai.AuthInfo;
+import org.onap.aai.esr.entity.aai.EsrSystemInfo;
 import org.onap.aai.esr.entity.aai.CloudRegion;
 import org.onap.aai.esr.entity.aai.EsrSystemInfoList;
 import org.onap.aai.esr.entity.rest.VimAuthInfo;
@@ -30,8 +30,9 @@ public class VimManagerUtil {
   
   public static CloudRegion vimRegisterInfo2CloudRegion(VimRegisterInfo vimRegisterInfo) {
     CloudRegion cloudRegion = new CloudRegion();
-    EsrSystemInfoList esrSystemInfo = new EsrSystemInfoList();
-    AuthInfo authInfo = new AuthInfo();
+    EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+    ArrayList<EsrSystemInfo> esrSystemInfo = new ArrayList<EsrSystemInfo>();
+    EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
     
     cloudRegion.setCloudOwner(vimRegisterInfo.getCloudOwner());
     cloudRegion.setCloudRegionId(vimRegisterInfo.getCloudRegionId());
@@ -42,27 +43,27 @@ public class VimManagerUtil {
     cloudRegion.setOwnerDefinedType(vimRegisterInfo.getOwnerDefinedType());
     cloudRegion.setCloudExtraInfo(vimRegisterInfo.getCloudExtraInfo());
     
-    authInfo = vimAuthInfo2AuthInfo(vimRegisterInfo.getVimAuthInfo());
-    esrSystemInfo = ExtsysUtil.getEsrSystemInfoListFromAuthInfo(authInfo);
-    cloudRegion.setEsrSystemInfoList(esrSystemInfo);
+    esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfo());
+    esrSystemInfoList = ExtsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj);
+    cloudRegion.setEsrSystemInfoList(esrSystemInfoList);
     return cloudRegion;
   }
 
-  private static AuthInfo vimAuthInfo2AuthInfo(VimAuthInfo vimAuthInfo) {
-    AuthInfo authInfo = new AuthInfo();
-    authInfo.setCloudDomain(vimAuthInfo.getCloudDomain());
-    authInfo.setUserName(vimAuthInfo.getUserName());
-    authInfo.setPassword(vimAuthInfo.getPassword());
-    authInfo.setServiceUrl(vimAuthInfo.getAuthUrl());
-    authInfo.setSslCassert(vimAuthInfo.getSslCacert());
-    authInfo.setSslInsecure(vimAuthInfo.getSslInsecure());
-    authInfo.setEsrSystemInfoId(ExtsysUtil.generateId());
-    authInfo.setSystemType(SystemType.VIM.toString());
-    authInfo.setSystemStatus(SystemStatus.normal.toString());
-    return authInfo;
+  private static EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(VimAuthInfo vimAuthInfo) {
+    EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
+    esrSystemInfoObj.setCloudDomain(vimAuthInfo.getCloudDomain());
+    esrSystemInfoObj.setUserName(vimAuthInfo.getUserName());
+    esrSystemInfoObj.setPassword(vimAuthInfo.getPassword());
+    esrSystemInfoObj.setServiceUrl(vimAuthInfo.getAuthUrl());
+    esrSystemInfoObj.setSslCassert(vimAuthInfo.getSslCacert());
+    esrSystemInfoObj.setSslInsecure(vimAuthInfo.getSslInsecure());
+    esrSystemInfoObj.setEsrSystemInfoId(ExtsysUtil.generateId());
+    esrSystemInfoObj.setSystemType(SystemType.VIM.toString());
+    esrSystemInfoObj.setSystemStatus(SystemStatus.normal.toString());
+    return esrSystemInfoObj;
   }
   
-  private static VimAuthInfo authInfo2VimAuthInfo(AuthInfo authInfo) {
+  private static VimAuthInfo authInfo2VimAuthInfo(EsrSystemInfo authInfo) {
     VimAuthInfo vimAuthInfo = new VimAuthInfo();
     vimAuthInfo.setAuthUrl(authInfo.getServiceUrl());
     vimAuthInfo.setCloudDomain(authInfo.getCloudDomain());
@@ -76,7 +77,7 @@ public class VimManagerUtil {
   public static VimRegisterInfo cloudRegion2VimRegisterInfo(CloudRegion cloudRegion) {
     VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
     VimAuthInfo vimAuthInfo = new VimAuthInfo();
-    vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().getEsrSystemInfo().get(0));
+    vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0));
     vimRegisterInfo.setVimAuthInfo(vimAuthInfo);
     vimRegisterInfo.setCloudExtraInfo(cloudRegion.getCloudExtraInfo());
     vimRegisterInfo.setCloudOwner(cloudRegion.getCloudOwner());
index 531e84e..409a07c 100644 (file)
@@ -16,7 +16,7 @@
 package org.onap.aai.esr.util;
 
 import org.onap.aai.esr.common.SystemType;
-import org.onap.aai.esr.entity.aai.AuthInfo;
+import org.onap.aai.esr.entity.aai.EsrSystemInfo;
 import org.onap.aai.esr.entity.aai.EsrSystemInfoList;
 import org.onap.aai.esr.entity.aai.EsrVnfm;
 import org.onap.aai.esr.entity.rest.VnfmRegisterInfo;
@@ -26,7 +26,7 @@ public class VnfmManagerUtil {
   public EsrVnfm vnfmRegisterInfo2EsrVnfm(VnfmRegisterInfo vnfmRegisterInfo) {
     EsrVnfm esrVnfm = new EsrVnfm();
     EsrSystemInfoList esrSystemInfo = new EsrSystemInfoList();
-    AuthInfo authInfo = new AuthInfo();
+    EsrSystemInfo authInfo = new EsrSystemInfo();
     esrVnfm.setCertificateUrl(vnfmRegisterInfo.getCertificateUrl());
     esrVnfm.setResouceVersion(vnfmRegisterInfo.getVersion());
     esrVnfm.setVimId(vnfmRegisterInfo.getVimId());
@@ -41,8 +41,8 @@ public class VnfmManagerUtil {
    * @param vnfmRegisterInfo vnfm register informantion from portal
    * @return
    */
-  private AuthInfo getAuthInfoFromVnfmRegisterInfo(VnfmRegisterInfo vnfmRegisterInfo) {
-    AuthInfo authInfo = new AuthInfo();
+  private EsrSystemInfo getAuthInfoFromVnfmRegisterInfo(VnfmRegisterInfo vnfmRegisterInfo) {
+    EsrSystemInfo authInfo = new EsrSystemInfo();
     authInfo.setEsrSystemInfoId(ExtsysUtil.generateId());
     authInfo.setSystemName(vnfmRegisterInfo.getName());
     authInfo.setType(vnfmRegisterInfo.getType());
@@ -57,11 +57,11 @@ public class VnfmManagerUtil {
   
   public VnfmRegisterInfo esrVnfm2VnfmRegisterInfo(EsrVnfm esrVnfm) {
     VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
-    AuthInfo authInfo = new AuthInfo();
+    EsrSystemInfo authInfo = new EsrSystemInfo();
     vnfmRegisterInfo.setVnfmId(esrVnfm.getVnfmId());
     vnfmRegisterInfo.setCertificateUrl(esrVnfm.getCertificateUrl());
     vnfmRegisterInfo.setVimId(esrVnfm.getVimId());
-    authInfo = esrVnfm.getEsrSystemInfoList().getEsrSystemInfo().getEsrSystemInfo().get(0);
+    authInfo = esrVnfm.getEsrSystemInfoList().getEsrSystemInfo().get(0);
     vnfmRegisterInfo.setName(authInfo.getSystemName());
     vnfmRegisterInfo.setPassword(authInfo.getPassword());
     vnfmRegisterInfo.setType(authInfo.getType());
index b79cbee..95ff2c5 100644 (file)
@@ -23,7 +23,7 @@ echo ### Starting esr-service
 set main_path=%RUNHOME%..\
 cd /d %main_path%
 set JAVA="%JAVA_HOME%\bin\java.exe"
-set port=8312
+set port=9500
 set jvm_opts=-Xms50m -Xmx128m
 rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n
 set class_path=%main_path%;%main_path%esr-service.jar
index 6678624..9c25410 100644 (file)
@@ -25,7 +25,7 @@ echo @JAVA@ $JAVA
 main_path=$RUNHOME/../
 cd $main_path
 JAVA_OPTS="-Xms50m -Xmx128m"
-port=9518
+port=9500
 #JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n"
 echo @JAVA_OPTS@ $JAVA_OPTS