import org.onap.msb.sdk.httpclient.msb.MSBServiceClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import io.dropwizard.Application;
import io.dropwizard.setup.Environment;
public class ExtsysApp extends Application<ExtsysAppConfiguration> {
- private static final Logger LOGGER = LoggerFactory.getLogger(ExtsysApp.class);
-
- public static void main(String[] args) throws Exception {
- new ExtsysApp().run(args);
- }
+ private static final Logger LOGGER = LoggerFactory.getLogger(ExtsysApp.class);
+
+ public static void main(String[] args) throws Exception {
+ new ExtsysApp().run(args);
+ }
- @Override
- public String getName() {
- return "ONAP-ESR";
- }
+ @Override
+ public String getName() {
+ return "ONAP-ESR";
+ }
- @Override
- public void run(ExtsysAppConfiguration configuration, Environment environment) {
- LOGGER.info("Start to initialize esr.");
- MsbConfig.setMsbServerAddr(configuration.getMsbServerAddr());
- MsbConfig.setMsbDiscoveryIp(configuration.getMsbDiscoveryIp());
- MsbConfig.setMsbDiscoveryPort(configuration.getMsbDiscoveryPort());
- environment.jersey().register(new EmsManager());
- environment.jersey().register(new ThirdpartySdncManager());
- environment.jersey().register(new VimManager());
- environment.jersey().register(new VnfmManager());
- environment.jersey().register(new ServiceTest());
- if (configuration.getRegistByHand().equals("true")){
- String MSB_IP=configuration.getMsbDiscoveryIp();
- Integer MSB_Port= Integer.valueOf(configuration.getMsbDiscoveryPort());
- MSBServiceClient msbClient = new MSBServiceClient(MSB_IP, MSB_Port);
- MsbHelper helper = new MsbHelper(msbClient);
- try {
- helper.registerMsb();
- LOGGER.info("Register esr-server to msb by java-sdk finished");
- } catch (Exception e) {
- LOGGER.error("Register esr-server to msb by java-sdk failed", e);
- }
+ @Override
+ public void run(ExtsysAppConfiguration configuration, Environment environment) {
+ LOGGER.info("Start to initialize esr.");
+ MsbConfig.setMsbServerAddr(configuration.getMsbServerAddr());
+ MsbConfig.setMsbDiscoveryIp(configuration.getMsbDiscoveryIp());
+ MsbConfig.setMsbDiscoveryPort(configuration.getMsbDiscoveryPort());
+ environment.jersey().register(new EmsManager());
+ environment.jersey().register(new ThirdpartySdncManager());
+ environment.jersey().register(new VimManager());
+ environment.jersey().register(new VnfmManager());
+ environment.jersey().register(new ServiceTest());
+ if (configuration.getRegistByHand().equals("true")) {
+ String MSB_IP = configuration.getMsbDiscoveryIp();
+ Integer MSB_Port = Integer.valueOf(configuration.getMsbDiscoveryPort());
+ MSBServiceClient msbClient = new MSBServiceClient(MSB_IP, MSB_Port);
+ MsbHelper helper = new MsbHelper(msbClient);
+ try {
+ helper.registerMsb();
+ LOGGER.info("Register esr-server to msb by java-sdk finished");
+ } catch (Exception e) {
+ LOGGER.error("Register esr-server to msb by java-sdk failed", e);
+ }
+ }
+ LOGGER.info("Initialize extsys finished.");
}
- LOGGER.info("Initialize extsys finished.");
- }
}
import io.dropwizard.Configuration;
import org.hibernate.validator.constraints.NotEmpty;
import org.jvnet.hk2.annotations.Service;
-
-
import javax.validation.Valid;
@Service
public class ExtsysAppConfiguration extends Configuration {
- @NotEmpty
- private String template;
-
- @NotEmpty
- private String defaultName = "ONAP-A&AI-ESR";
-
- @NotEmpty
- private String msbDiscoveryIp;
-
- @NotEmpty
- private String msbDiscoveryPort;
-
- @NotEmpty
- private String registByHand;
-
- @NotEmpty
- private String msbServerAddr;
-
- @Valid
- private String serviceIp;
-
- @JsonProperty
- public String getTemplate() {
- return template;
- }
-
- @JsonProperty
- public void setTemplate(String template) {
- this.template = template;
- }
-
- @JsonProperty
- public String getDefaultName() {
- return defaultName;
- }
-
- @JsonProperty
- public void setDefaultName(String name) {
- this.defaultName = name;
- }
-
- @JsonProperty
- public String getMsbDiscoveryIp() {
- return msbDiscoveryIp;
- }
-
- @JsonProperty
- public void setMsbDiscoveryIp(String discoveryIp) {
- this.msbDiscoveryIp = discoveryIp;
- }
-
- @JsonProperty
- public String getMsbServerAddr() {
- return msbServerAddr;
- }
-
- @JsonProperty
- public void setMsbServerAddr(String msbServerAddr) {
- this.msbServerAddr = msbServerAddr;
- }
- @JsonProperty
- public String getServiceIp() {
- return serviceIp;
- }
-
- @JsonProperty
- public void setServiceIp(String serviceIp) {
- this.serviceIp = serviceIp;
- }
-
- @JsonProperty
- public String getRegistByHand() {
- return registByHand;
- }
-
- @JsonProperty
- public void setRegistByHand(String registByHand) {
- this.registByHand = registByHand;
- }
-
- @JsonProperty
- public void setMsbDiscoveryPort(String msbDiscoveryPort) {
- this.msbDiscoveryPort = msbDiscoveryPort;
- }
-
- @JsonProperty
- public String getMsbDiscoveryPort() {
- return msbDiscoveryPort;
- }
+ @NotEmpty
+ private String template;
+
+ @NotEmpty
+ private String defaultName = "ONAP-A&AI-ESR";
+
+ @NotEmpty
+ private String msbDiscoveryIp;
+
+ @NotEmpty
+ private String msbDiscoveryPort;
+
+ @NotEmpty
+ private String registByHand;
+
+ @NotEmpty
+ private String msbServerAddr;
+
+ @Valid
+ private String serviceIp;
+
+ @JsonProperty
+ public String getTemplate() {
+ return template;
+ }
+
+ @JsonProperty
+ public void setTemplate(String template) {
+ this.template = template;
+ }
+
+ @JsonProperty
+ public String getDefaultName() {
+ return defaultName;
+ }
+
+ @JsonProperty
+ public void setDefaultName(String name) {
+ this.defaultName = name;
+ }
+
+ @JsonProperty
+ public String getMsbDiscoveryIp() {
+ return msbDiscoveryIp;
+ }
+
+ @JsonProperty
+ public void setMsbDiscoveryIp(String discoveryIp) {
+ this.msbDiscoveryIp = discoveryIp;
+ }
+
+ @JsonProperty
+ public String getMsbServerAddr() {
+ return msbServerAddr;
+ }
+
+ @JsonProperty
+ public void setMsbServerAddr(String msbServerAddr) {
+ this.msbServerAddr = msbServerAddr;
+ }
+
+ @JsonProperty
+ public String getServiceIp() {
+ return serviceIp;
+ }
+
+ @JsonProperty
+ public void setServiceIp(String serviceIp) {
+ this.serviceIp = serviceIp;
+ }
+
+ @JsonProperty
+ public String getRegistByHand() {
+ return registByHand;
+ }
+
+ @JsonProperty
+ public void setRegistByHand(String registByHand) {
+ this.registByHand = registByHand;
+ }
+
+ @JsonProperty
+ public void setMsbDiscoveryPort(String msbDiscoveryPort) {
+ this.msbDiscoveryPort = msbDiscoveryPort;
+ }
+
+ @JsonProperty
+ public String getMsbDiscoveryPort() {
+ return msbDiscoveryPort;
+ }
}
public class Config {
- private static ExtsysAppConfiguration configration;
+ private static ExtsysAppConfiguration configration;
- public static ExtsysAppConfiguration getConfigration() {
- return configration;
- }
+ public static ExtsysAppConfiguration getConfigration() {
+ return configration;
+ }
- public static void setConfigration(ExtsysAppConfiguration config) {
- configration = config;
- }
+ public static void setConfigration(ExtsysAppConfiguration config) {
+ configration = config;
+ }
}
public class MsbConfig {
-
- protected static String msbServerAddr;
-
- protected static String cloudInfrastructureAddr;
-
- protected static String externalSystemAddr;
-
- protected static String multiCloudAddr;
-
- protected static String msbDiscoveryIp;
-
- protected static String msbDiscoveryPort;
-
- public static void setCloudInfrastructureAddr(String address){
- cloudInfrastructureAddr = address;
- }
-
- public static String getCloudInfrastructureAddr(){
- return msbServerAddr + "/api/aai-cloudInfrastructure/v11";
- }
-
- public static String getExternalSystemAddr() {
- return msbServerAddr + "/api/aai-externalSystem/v11";
- }
-
- public static void setExternalSystemAddr(String Addr) {
- externalSystemAddr = Addr;
- }
-
- public static void setMultiCloudAddr(String address){
- multiCloudAddr = address;
- }
-
- public static String getMultiCloudAddr(){
- return msbServerAddr + "/api/multicloud/v0";
- }
-
- public static String getMsbDiscoveryIp() {
- return msbDiscoveryIp;
- }
-
- public static void setMsbDiscoveryIp(String discoveryIp) {
- msbDiscoveryIp = discoveryIp;
- }
-
- public static String getMsbDiscoveryPort() {
- return msbDiscoveryPort;
- }
-
- public static void setMsbDiscoveryPort(String discoveryPort) {
- msbDiscoveryPort = discoveryPort;
- }
-
- public static String getMsbServerAddr() {
- return msbServerAddr;
- }
-
- public static void setMsbServerAddr(String msbServerAddr) {
- MsbConfig.msbServerAddr = msbServerAddr;
- }
+
+ protected static String msbServerAddr;
+
+ protected static String cloudInfrastructureAddr;
+
+ protected static String externalSystemAddr;
+
+ protected static String multiCloudAddr;
+
+ protected static String msbDiscoveryIp;
+
+ protected static String msbDiscoveryPort;
+
+ public static void setCloudInfrastructureAddr(String address) {
+ cloudInfrastructureAddr = address;
+ }
+
+ public static String getCloudInfrastructureAddr() {
+ return msbServerAddr + "/api/aai-cloudInfrastructure/v11";
+ }
+
+ public static String getExternalSystemAddr() {
+ return msbServerAddr + "/api/aai-externalSystem/v11";
+ }
+
+ public static void setExternalSystemAddr(String Addr) {
+ externalSystemAddr = Addr;
+ }
+
+ public static void setMultiCloudAddr(String address) {
+ multiCloudAddr = address;
+ }
+
+ public static String getMultiCloudAddr() {
+ return msbServerAddr + "/api/multicloud/v0";
+ }
+
+ public static String getMsbDiscoveryIp() {
+ return msbDiscoveryIp;
+ }
+
+ public static void setMsbDiscoveryIp(String discoveryIp) {
+ msbDiscoveryIp = discoveryIp;
+ }
+
+ public static String getMsbDiscoveryPort() {
+ return msbDiscoveryPort;
+ }
+
+ public static void setMsbDiscoveryPort(String discoveryPort) {
+ msbDiscoveryPort = discoveryPort;
+ }
+
+ public static String getMsbServerAddr() {
+ return msbServerAddr;
+ }
+
+ public static void setMsbServerAddr(String msbServerAddr) {
+ MsbConfig.msbServerAddr = msbServerAddr;
+ }
}
package org.onap.aai.esr.common;
public enum SystemStatus {
- normal,abnormal
+ normal, abnormal
}
package org.onap.aai.esr.common;
public enum SystemType {
- VNFM,EMS_RESOUCE,EMS_PERFORMANCE,EMS_ALARM,thirdparty_SDNC,VIM
+ VNFM, EMS_RESOUCE, EMS_PERFORMANCE, EMS_ALARM, thirdparty_SDNC, VIM
}
package org.onap.aai.esr.entity.aai;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class CloudRegion implements Serializable {
-
- public static final long serialVersionUID = 1L;
-
- @SerializedName("cloud-owner")
- private String cloudOwner;
-
- @SerializedName("cloud-region-id")
- private String cloudRegionId;
-
- @SerializedName("cloud-type")
- private String cloudType;
-
- @SerializedName("cloud-region-version")
- private String cloudRegionVersion;
-
- @SerializedName("owner-defined-type")
- private String ownerDefinedType;
-
- @SerializedName("cloud-zone")
- private String cloudZone;
-
- @SerializedName("complex-name")
- private String complexName;
-
- @SerializedName("cloud-extra-info")
- private String cloudExtraInfo;
-
- @SerializedName("resource-version")
- private String resourceVersion;
-
- public String getCloudOwner() {
- return cloudOwner;
- }
-
- public void setCloudOwner(String cloudOwner) {
- this.cloudOwner = cloudOwner;
- }
-
- public String getCloudRegionId() {
- return cloudRegionId;
- }
-
- public void setCloudRegionId(String cloudRegionId) {
- this.cloudRegionId = cloudRegionId;
- }
-
- public String getCloudType() {
- return cloudType;
- }
-
- public void setCloudType(String cloudType) {
- this.cloudType = cloudType;
- }
-
- public String getCloudRegionVersion() {
- return cloudRegionVersion;
- }
-
- public void setCloudRegionVersion(String cloudRegionVersion) {
- this.cloudRegionVersion = cloudRegionVersion;
- }
-
- public String getOwnerDefinedType() {
- return ownerDefinedType;
- }
-
- public void setOwnerDefinedType(String ownerDefinedType) {
- this.ownerDefinedType = ownerDefinedType;
- }
-
- public String getCloudZone() {
- return cloudZone;
- }
-
- public void setCloudZone(String cloudZone) {
- this.cloudZone = cloudZone;
- }
-
- public String getComplexName() {
- return complexName;
- }
-
- public void setComplexName(String complexName) {
- this.complexName = complexName;
- }
-
- public String getCloudExtraInfo() {
- return cloudExtraInfo;
- }
-
- public void setCloudExtraInfo(String cloudExtraInfo) {
- this.cloudExtraInfo = cloudExtraInfo;
- }
-
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
-
- public static long getSerialversionuid() {
- return serialVersionUID;
- }
+
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("cloud-owner")
+ private String cloudOwner;
+
+ @SerializedName("cloud-region-id")
+ private String cloudRegionId;
+
+ @SerializedName("cloud-type")
+ private String cloudType;
+
+ @SerializedName("cloud-region-version")
+ private String cloudRegionVersion;
+
+ @SerializedName("owner-defined-type")
+ private String ownerDefinedType;
+
+ @SerializedName("cloud-zone")
+ private String cloudZone;
+
+ @SerializedName("complex-name")
+ private String complexName;
+
+ @SerializedName("cloud-extra-info")
+ private String cloudExtraInfo;
+
+ @SerializedName("resource-version")
+ private String resourceVersion;
+
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
+ public String getCloudRegionId() {
+ return cloudRegionId;
+ }
+
+ public void setCloudRegionId(String cloudRegionId) {
+ this.cloudRegionId = cloudRegionId;
+ }
+
+ public String getCloudType() {
+ return cloudType;
+ }
+
+ public void setCloudType(String cloudType) {
+ this.cloudType = cloudType;
+ }
+
+ public String getCloudRegionVersion() {
+ return cloudRegionVersion;
+ }
+
+ public void setCloudRegionVersion(String cloudRegionVersion) {
+ this.cloudRegionVersion = cloudRegionVersion;
+ }
+
+ public String getOwnerDefinedType() {
+ return ownerDefinedType;
+ }
+
+ public void setOwnerDefinedType(String ownerDefinedType) {
+ this.ownerDefinedType = ownerDefinedType;
+ }
+
+ public String getCloudZone() {
+ return cloudZone;
+ }
+
+ public void setCloudZone(String cloudZone) {
+ this.cloudZone = cloudZone;
+ }
+
+ public String getComplexName() {
+ return complexName;
+ }
+
+ public void setComplexName(String complexName) {
+ this.complexName = complexName;
+ }
+
+ public String getCloudExtraInfo() {
+ return cloudExtraInfo;
+ }
+
+ public void setCloudExtraInfo(String cloudExtraInfo) {
+ this.cloudExtraInfo = cloudExtraInfo;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ public static long getSerialversionuid() {
+ return serialVersionUID;
+ }
}
package org.onap.aai.esr.entity.aai;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class CloudRegionDetail implements Serializable {
-
- public static final long serialVersionUID = 1L;
-
- @SerializedName("cloud-owner")
- private String cloudOwner;
-
- @SerializedName("cloud-region-id")
- private String cloudRegionId;
-
- @SerializedName("cloud-type")
- private String cloudType;
-
- @SerializedName("cloud-region-version")
- private String cloudRegionVersion;
-
- @SerializedName("owner-defined-type")
- private String ownerDefinedType;
-
- @SerializedName("cloud-zone")
- private String cloudZone;
-
- @SerializedName("complex-name")
- private String complexName;
-
- @SerializedName("cloud-extra-info")
- private String cloudExtraInfo;
-
- @SerializedName("resource-version")
- private String resourceVersion;
-
- @SerializedName("esr-system-info-list")
- private EsrSystemInfoList esrSystemInfoList;
-
- public String getCloudOwner() {
- return cloudOwner;
- }
-
- public void setCloudOwner(String cloudOwner) {
- this.cloudOwner = cloudOwner;
- }
-
- public String getCloudRegionId() {
- return cloudRegionId;
- }
-
- public void setCloudRegionId(String cloudRegionId) {
- this.cloudRegionId = cloudRegionId;
- }
-
- public String getCloudType() {
- return cloudType;
- }
-
- public void setCloudType(String cloudType) {
- this.cloudType = cloudType;
- }
-
- public String getCloudRegionVersion() {
- return cloudRegionVersion;
- }
-
- public void setCloudRegionVersion(String cloudRegionVersion) {
- this.cloudRegionVersion = cloudRegionVersion;
- }
-
- public String getOwnerDefinedType() {
- return ownerDefinedType;
- }
-
- public void setOwnerDefinedType(String ownerDefinedType) {
- this.ownerDefinedType = ownerDefinedType;
- }
-
- public String getCloudZone() {
- return cloudZone;
- }
-
- public void setCloudZone(String cloudZone) {
- this.cloudZone = cloudZone;
- }
-
- public String getComplexName() {
- return complexName;
- }
-
- public void setComplexName(String complexName) {
- this.complexName = complexName;
- }
-
- public String getCloudExtraInfo() {
- return cloudExtraInfo;
- }
-
- public void setCloudExtraInfo(String cloudExtraInfo) {
- this.cloudExtraInfo = cloudExtraInfo;
- }
-
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
-
- public EsrSystemInfoList getEsrSystemInfoList() {
- return esrSystemInfoList;
- }
-
- public void setEsrSystemInfoList(EsrSystemInfoList esrSystemInfoList) {
- this.esrSystemInfoList = esrSystemInfoList;
- }
+
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("cloud-owner")
+ private String cloudOwner;
+
+ @SerializedName("cloud-region-id")
+ private String cloudRegionId;
+
+ @SerializedName("cloud-type")
+ private String cloudType;
+
+ @SerializedName("cloud-region-version")
+ private String cloudRegionVersion;
+
+ @SerializedName("owner-defined-type")
+ private String ownerDefinedType;
+
+ @SerializedName("cloud-zone")
+ private String cloudZone;
+
+ @SerializedName("complex-name")
+ private String complexName;
+
+ @SerializedName("cloud-extra-info")
+ private String cloudExtraInfo;
+
+ @SerializedName("resource-version")
+ private String resourceVersion;
+
+ @SerializedName("esr-system-info-list")
+ private EsrSystemInfoList esrSystemInfoList;
+
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
+ public String getCloudRegionId() {
+ return cloudRegionId;
+ }
+
+ public void setCloudRegionId(String cloudRegionId) {
+ this.cloudRegionId = cloudRegionId;
+ }
+
+ public String getCloudType() {
+ return cloudType;
+ }
+
+ public void setCloudType(String cloudType) {
+ this.cloudType = cloudType;
+ }
+
+ public String getCloudRegionVersion() {
+ return cloudRegionVersion;
+ }
+
+ public void setCloudRegionVersion(String cloudRegionVersion) {
+ this.cloudRegionVersion = cloudRegionVersion;
+ }
+
+ public String getOwnerDefinedType() {
+ return ownerDefinedType;
+ }
+
+ public void setOwnerDefinedType(String ownerDefinedType) {
+ this.ownerDefinedType = ownerDefinedType;
+ }
+
+ public String getCloudZone() {
+ return cloudZone;
+ }
+
+ public void setCloudZone(String cloudZone) {
+ this.cloudZone = cloudZone;
+ }
+
+ public String getComplexName() {
+ return complexName;
+ }
+
+ public void setComplexName(String complexName) {
+ this.complexName = complexName;
+ }
+
+ public String getCloudExtraInfo() {
+ return cloudExtraInfo;
+ }
+
+ public void setCloudExtraInfo(String cloudExtraInfo) {
+ this.cloudExtraInfo = cloudExtraInfo;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ public EsrSystemInfoList getEsrSystemInfoList() {
+ return esrSystemInfoList;
+ }
+
+ public void setEsrSystemInfoList(EsrSystemInfoList esrSystemInfoList) {
+ this.esrSystemInfoList = esrSystemInfoList;
+ }
}
import java.io.Serializable;
import java.util.List;
-
import com.google.gson.annotations.SerializedName;
public class CloudRegionList implements Serializable {
-
- public static final long serialVersionUID = 1L;
- @SerializedName("cloud-region")
- private List<CloudRegion> cloudRegion;
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("cloud-region")
+ private List<CloudRegion> cloudRegion;
- public List<CloudRegion> getCloudRegion() {
- return cloudRegion;
- }
+ public List<CloudRegion> getCloudRegion() {
+ return cloudRegion;
+ }
- public void setCloudRegion(List<CloudRegion> cloudRegion) {
- this.cloudRegion = cloudRegion;
- }
+ public void setCloudRegion(List<CloudRegion> cloudRegion) {
+ this.cloudRegion = cloudRegion;
+ }
}
package org.onap.aai.esr.entity.aai;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class EsrEms implements Serializable {
-
-public static final long serialVersionUID = 1L;
-
- @SerializedName("ems-id")
- private String emsId;
-
- @SerializedName("resource-version")
- private String resourceVersion;
-
- public String getEmsId() {
- return emsId;
- }
-
- public void setEmsId(String emsId) {
- this.emsId = emsId;
- }
-
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
+
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("ems-id")
+ private String emsId;
+
+ @SerializedName("resource-version")
+ private String resourceVersion;
+
+ public String getEmsId() {
+ return emsId;
+ }
+
+ public void setEmsId(String emsId) {
+ this.emsId = emsId;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
}
package org.onap.aai.esr.entity.aai;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class EsrEmsDetail implements Serializable {
- public static final long serialVersionUID = 1L;
-
- @SerializedName("ems-id")
- private String emsId;
-
- @SerializedName("resource-version")
- private String resourceVersion;
-
- @SerializedName("esr-system-info-list")
- private EsrSystemInfoList esrSystemInfoList;
-
- public String getEmsId() {
- return emsId;
- }
-
- public void setEmsId(String emsId) {
- this.emsId = emsId;
- }
-
- public EsrSystemInfoList getEsrSystemInfoList() {
- return esrSystemInfoList;
- }
-
- public void setEsrSystemInfoList(EsrSystemInfoList esrSystemInfoList) {
- this.esrSystemInfoList = esrSystemInfoList;
- }
-
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("ems-id")
+ private String emsId;
+
+ @SerializedName("resource-version")
+ private String resourceVersion;
+
+ @SerializedName("esr-system-info-list")
+ private EsrSystemInfoList esrSystemInfoList;
+
+ public String getEmsId() {
+ return emsId;
+ }
+
+ public void setEmsId(String emsId) {
+ this.emsId = emsId;
+ }
+
+ public EsrSystemInfoList getEsrSystemInfoList() {
+ return esrSystemInfoList;
+ }
+
+ public void setEsrSystemInfoList(EsrSystemInfoList esrSystemInfoList) {
+ this.esrSystemInfoList = esrSystemInfoList;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
}
import java.io.Serializable;
import java.util.List;
-
import com.google.gson.annotations.SerializedName;
public class EsrEmsList implements Serializable {
- public static final long serialVersionUID = 1L;
-
- @SerializedName("esr-ems")
- private List<EsrEms> esrEms;
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("esr-ems")
+ private List<EsrEms> esrEms;
- public List<EsrEms> getEsrEms() {
- return esrEms;
- }
+ public List<EsrEms> getEsrEms() {
+ return esrEms;
+ }
- public void setEsrEms(List<EsrEms> esrEms) {
- this.esrEms = esrEms;
- }
+ public void setEsrEms(List<EsrEms> esrEms) {
+ this.esrEms = esrEms;
+ }
}
package org.onap.aai.esr.entity.aai;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class EsrSystemInfo implements Serializable {
-
- public static final long serialVersionUID = 1L;
-
- @SerializedName("esr-system-info-id")
- private String esrSystemInfoId;
-
- @SerializedName("system-name")
- private String systemName;
-
- @SerializedName("type")
- private String type;
-
- @SerializedName("vendor")
- private String vendor;
-
- @SerializedName("version")
- private String version;
-
- @SerializedName("service-url")
- private String serviceUrl;
-
- @SerializedName("user-name")
- private String userName;
-
- @SerializedName("password")
- private String password;
-
- @SerializedName("system-type")
- private String systemType;
-
- @SerializedName("protocol")
- private String protocol;
-
- @SerializedName("ssl-cassert")
- private String sslCassert;
-
- @SerializedName("ssl-insecure")
- private Boolean sslInsecure;
-
- @SerializedName("ip-address")
- private String ipAddress;
-
- @SerializedName("port")
- private String port;
-
- @SerializedName("cloud-domain")
- private String cloudDomain;
-
- @SerializedName("default-tenant")
- private String defaultTenant;
-
- @SerializedName("passive")
- private Boolean passive;
-
- @SerializedName("remote-path")
- private String remotePath;
-
- @SerializedName("system-status")
- private String systemStatus;
-
- @SerializedName("resource-version")
- private String resourceVersion;
-
- 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 static final long serialVersionUID = 1L;
+
+ @SerializedName("esr-system-info-id")
+ private String esrSystemInfoId;
+
+ @SerializedName("system-name")
+ private String systemName;
+
+ @SerializedName("type")
+ private String type;
+
+ @SerializedName("vendor")
+ private String vendor;
+
+ @SerializedName("version")
+ private String version;
+
+ @SerializedName("service-url")
+ private String serviceUrl;
+
+ @SerializedName("user-name")
+ private String userName;
+
+ @SerializedName("password")
+ private String password;
+
+ @SerializedName("system-type")
+ private String systemType;
+
+ @SerializedName("protocol")
+ private String protocol;
+
+ @SerializedName("ssl-cassert")
+ private String sslCassert;
+
+ @SerializedName("ssl-insecure")
+ private Boolean sslInsecure;
+
+ @SerializedName("ip-address")
+ private String ipAddress;
+
+ @SerializedName("port")
+ private String port;
+
+ @SerializedName("cloud-domain")
+ private String cloudDomain;
+
+ @SerializedName("default-tenant")
+ private String defaultTenant;
+
+ @SerializedName("passive")
+ private Boolean passive;
+
+ @SerializedName("remote-path")
+ private String remotePath;
+
+ @SerializedName("system-status")
+ private String systemStatus;
+
+ @SerializedName("resource-version")
+ private String resourceVersion;
+
+ 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 String getPort() {
+ return port;
+ }
- public void setPort(String port) {
- this.port = port;
- }
+ public void setPort(String port) {
+ this.port = port;
+ }
- public String getCloudDomain() {
- return cloudDomain;
- }
+ public String getCloudDomain() {
+ return cloudDomain;
+ }
- public void setCloudDomain(String cloudDomain) {
- this.cloudDomain = cloudDomain;
- }
+ public void setCloudDomain(String cloudDomain) {
+ this.cloudDomain = cloudDomain;
+ }
- public String getDefaultTenant() {
- return defaultTenant;
- }
+ public String getDefaultTenant() {
+ return defaultTenant;
+ }
- public void setDefaultTenant(String defaultTenant) {
- this.defaultTenant = defaultTenant;
- }
+ public void setDefaultTenant(String defaultTenant) {
+ this.defaultTenant = defaultTenant;
+ }
- public Boolean getPassive() {
- return passive;
- }
+ public Boolean getPassive() {
+ return passive;
+ }
- public void setPassive(Boolean passive) {
- this.passive = passive;
- }
+ public void setPassive(Boolean passive) {
+ this.passive = passive;
+ }
- public String getRemotePath() {
- return remotePath;
- }
+ public String getRemotePath() {
+ return remotePath;
+ }
- public void setRemotePath(String remotePath) {
- this.remotePath = remotePath;
- }
+ public void setRemotePath(String remotePath) {
+ this.remotePath = remotePath;
+ }
- public String getSystemStatus() {
- return systemStatus;
- }
+ public String getSystemStatus() {
+ return systemStatus;
+ }
- public void setSystemStatus(String systemStatus) {
- this.systemStatus = systemStatus;
- }
+ public void setSystemStatus(String systemStatus) {
+ this.systemStatus = systemStatus;
+ }
- public String getResouceVersion() {
- return resourceVersion;
- }
+ public String getResouceVersion() {
+ return resourceVersion;
+ }
- public void setResouceVersion(String resouceVersion) {
- this.resourceVersion = resouceVersion;
- }
+ public void setResouceVersion(String resouceVersion) {
+ this.resourceVersion = resouceVersion;
+ }
}
import java.io.Serializable;
import java.util.List;
-
import com.google.gson.annotations.SerializedName;
public class EsrSystemInfoList implements Serializable {
- public static final long serialVersionUID = 1L;
-
- @SerializedName("esr-system-info")
- private List<EsrSystemInfo> esrSystemInfo;
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("esr-system-info")
+ private List<EsrSystemInfo> esrSystemInfo;
- public List<EsrSystemInfo> getEsrSystemInfo() {
- return esrSystemInfo;
- }
+ public List<EsrSystemInfo> getEsrSystemInfo() {
+ return esrSystemInfo;
+ }
- public void setEsrSystemInfo(List<EsrSystemInfo> esrSystemInfo) {
- this.esrSystemInfo = esrSystemInfo;
- }
+ public void setEsrSystemInfo(List<EsrSystemInfo> esrSystemInfo) {
+ this.esrSystemInfo = esrSystemInfo;
+ }
}
package org.onap.aai.esr.entity.aai;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class EsrThirdpartySdnc implements Serializable {
-public static final long serialVersionUID = 1L;
-
- @SerializedName("thirdparty-sdnc-id")
- private String thirdpartySdncId;
-
- @SerializedName("location")
- private String location;
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("thirdparty-sdnc-id")
+ private String thirdpartySdncId;
+
+ @SerializedName("location")
+ private String location;
+
+ @SerializedName("product-name")
+ private String productName;
- @SerializedName("product-name")
- private String productName;
-
- @SerializedName("resource-version")
- private String resourceVersion;
+ @SerializedName("resource-version")
+ private String resourceVersion;
- public String getThirdpartySdncId() {
- return thirdpartySdncId;
- }
+ public String getThirdpartySdncId() {
+ return thirdpartySdncId;
+ }
- public void setThirdpartySdncId(String thirdpartySdncId) {
- this.thirdpartySdncId = thirdpartySdncId;
- }
+ public void setThirdpartySdncId(String thirdpartySdncId) {
+ this.thirdpartySdncId = thirdpartySdncId;
+ }
- public String getLocation() {
- return location;
- }
+ public String getLocation() {
+ return location;
+ }
- public void setLocation(String location) {
- this.location = location;
- }
+ public void setLocation(String location) {
+ this.location = location;
+ }
- public String getProductName() {
- return productName;
- }
+ public String getProductName() {
+ return productName;
+ }
- public void setProductName(String productName) {
- this.productName = productName;
- }
+ public void setProductName(String productName) {
+ this.productName = productName;
+ }
- public String getResourceVersion() {
- return resourceVersion;
- }
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
}
package org.onap.aai.esr.entity.aai;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class EsrThirdpartySdncDetail implements Serializable {
- public static final long serialVersionUID = 1L;
-
- @SerializedName("thirdparty-sdnc-id")
- private String thirdpartySdncId;
-
- @SerializedName("location")
- private String location;
-
- @SerializedName("product-name")
- private String productName;
-
- @SerializedName("resource-version")
- private String resourceVersion;
-
- @SerializedName("esr-system-info-list")
- private EsrSystemInfoList esrSystemInfoList;
-
- public String getThirdpartySdncId() {
- return thirdpartySdncId;
- }
-
- public void setThirdpartySdncId(String thirdpartySdncId) {
- this.thirdpartySdncId = thirdpartySdncId;
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public String getProductName() {
- return productName;
- }
-
- public void setProductName(String productName) {
- this.productName = productName;
- }
-
- public EsrSystemInfoList getEsrSystemInfoList() {
- return esrSystemInfoList;
- }
-
- public void setEsrSystemInfoList(EsrSystemInfoList esrSystemInfoList) {
- this.esrSystemInfoList = esrSystemInfoList;
- }
-
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("thirdparty-sdnc-id")
+ private String thirdpartySdncId;
+
+ @SerializedName("location")
+ private String location;
+
+ @SerializedName("product-name")
+ private String productName;
+
+ @SerializedName("resource-version")
+ private String resourceVersion;
+
+ @SerializedName("esr-system-info-list")
+ private EsrSystemInfoList esrSystemInfoList;
+
+ public String getThirdpartySdncId() {
+ return thirdpartySdncId;
+ }
+
+ public void setThirdpartySdncId(String thirdpartySdncId) {
+ this.thirdpartySdncId = thirdpartySdncId;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public String getProductName() {
+ return productName;
+ }
+
+ public void setProductName(String productName) {
+ this.productName = productName;
+ }
+
+ public EsrSystemInfoList getEsrSystemInfoList() {
+ return esrSystemInfoList;
+ }
+
+ public void setEsrSystemInfoList(EsrSystemInfoList esrSystemInfoList) {
+ this.esrSystemInfoList = esrSystemInfoList;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
}
import java.io.Serializable;
import java.util.List;
-
import com.google.gson.annotations.SerializedName;
public class EsrThirdpartySdncList implements Serializable {
- public static final long serialVersionUID = 1L;
-
- @SerializedName("esr-thirdparty-sdnc")
- private List<EsrThirdpartySdnc> esrThirdpartySdnc;
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("esr-thirdparty-sdnc")
+ private List<EsrThirdpartySdnc> esrThirdpartySdnc;
- public List<EsrThirdpartySdnc> getEsrThirdpartySdnc() {
- return esrThirdpartySdnc;
- }
+ public List<EsrThirdpartySdnc> getEsrThirdpartySdnc() {
+ return esrThirdpartySdnc;
+ }
- public void setEsrThirdpartySdnc(List<EsrThirdpartySdnc> esrThirdpartySdnc) {
- this.esrThirdpartySdnc = esrThirdpartySdnc;
- }
+ public void setEsrThirdpartySdnc(List<EsrThirdpartySdnc> esrThirdpartySdnc) {
+ this.esrThirdpartySdnc = esrThirdpartySdnc;
+ }
}
package org.onap.aai.esr.entity.aai;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class EsrVnfm implements Serializable {
- public static final long serialVersionUID = 1L;
-
- @SerializedName("vnfm-id")
- private String vnfmId;
-
- @SerializedName("vim-id")
- private String vimId;
-
- @SerializedName("certificate-id")
- private String certificateUrl;
-
- @SerializedName("resource-version")
- private String resourceVersion;
-
- public String getVnfmId() {
- return vnfmId;
- }
-
- public void setVnfmId(String vnfmId) {
- this.vnfmId = vnfmId;
- }
-
- public String getVimId() {
- return vimId;
- }
-
- public void setVimId(String vimId) {
- this.vimId = vimId;
- }
-
- public String getCertificateUrl() {
- return certificateUrl;
- }
-
- public void setCertificateUrl(String certificateUrl) {
- this.certificateUrl = certificateUrl;
- }
-
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
-
- public static long getSerialversionuid() {
- return serialVersionUID;
- }
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("vnfm-id")
+ private String vnfmId;
+
+ @SerializedName("vim-id")
+ private String vimId;
+
+ @SerializedName("certificate-id")
+ private String certificateUrl;
+
+ @SerializedName("resource-version")
+ private String resourceVersion;
+
+ public String getVnfmId() {
+ return vnfmId;
+ }
+
+ public void setVnfmId(String vnfmId) {
+ this.vnfmId = vnfmId;
+ }
+
+ public String getVimId() {
+ return vimId;
+ }
+
+ public void setVimId(String vimId) {
+ this.vimId = vimId;
+ }
+
+ public String getCertificateUrl() {
+ return certificateUrl;
+ }
+
+ public void setCertificateUrl(String certificateUrl) {
+ this.certificateUrl = certificateUrl;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ public static long getSerialversionuid() {
+ return serialVersionUID;
+ }
}
package org.onap.aai.esr.entity.aai;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class EsrVnfmDetail implements Serializable {
-
- public static final long serialVersionUID = 1L;
-
- @SerializedName("vnfm-id")
- private String vnfmId;
-
- @SerializedName("vim-id")
- private String vimId;
-
- @SerializedName("certificate-url")
- private String certificateUrl;
-
- @SerializedName("resource-version")
- private String resourceVersion;
-
- @SerializedName("esr-system-info-list")
- private EsrSystemInfoList esrSystemInfoList;
-
- public String getVnfmId() {
- return vnfmId;
- }
-
- public void setVnfmId(String vnfmId) {
- this.vnfmId = vnfmId;
- }
-
- public String getVimId() {
- return vimId;
- }
-
- public void setVimId(String vimId) {
- this.vimId = vimId;
- }
-
- public String getCertificateUrl() {
- return certificateUrl;
- }
-
- public void setCertificateUrl(String certificateUrl) {
- this.certificateUrl = certificateUrl;
- }
-
- public EsrSystemInfoList getEsrSystemInfoList() {
- return esrSystemInfoList;
- }
-
- public void setEsrSystemInfoList(EsrSystemInfoList esrSystemInfoList) {
- this.esrSystemInfoList = esrSystemInfoList;
- }
-
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
+
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("vnfm-id")
+ private String vnfmId;
+
+ @SerializedName("vim-id")
+ private String vimId;
+
+ @SerializedName("certificate-url")
+ private String certificateUrl;
+
+ @SerializedName("resource-version")
+ private String resourceVersion;
+
+ @SerializedName("esr-system-info-list")
+ private EsrSystemInfoList esrSystemInfoList;
+
+ public String getVnfmId() {
+ return vnfmId;
+ }
+
+ public void setVnfmId(String vnfmId) {
+ this.vnfmId = vnfmId;
+ }
+
+ public String getVimId() {
+ return vimId;
+ }
+
+ public void setVimId(String vimId) {
+ this.vimId = vimId;
+ }
+
+ public String getCertificateUrl() {
+ return certificateUrl;
+ }
+
+ public void setCertificateUrl(String certificateUrl) {
+ this.certificateUrl = certificateUrl;
+ }
+
+ public EsrSystemInfoList getEsrSystemInfoList() {
+ return esrSystemInfoList;
+ }
+
+ public void setEsrSystemInfoList(EsrSystemInfoList esrSystemInfoList) {
+ this.esrSystemInfoList = esrSystemInfoList;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
}
import java.io.Serializable;
import java.util.List;
-
import com.google.gson.annotations.SerializedName;
public class EsrVnfmList implements Serializable {
- public static final long serialVersionUID = 1L;
-
- @SerializedName("esr-vnfm")
- private List<EsrVnfm> esrVnfm;
+ public static final long serialVersionUID = 1L;
+
+ @SerializedName("esr-vnfm")
+ private List<EsrVnfm> esrVnfm;
- public List<EsrVnfm> getEsrVnfm() {
- return esrVnfm;
- }
+ public List<EsrVnfm> getEsrVnfm() {
+ return esrVnfm;
+ }
- public void setEsrVnfm(List<EsrVnfm> esrVnfm) {
- this.esrVnfm = esrVnfm;
- }
+ public void setEsrVnfm(List<EsrVnfm> esrVnfm) {
+ this.esrVnfm = esrVnfm;
+ }
}
public class AlarmAddr {
- private String ip;
-
- private String port;
-
- private String user;
-
- private String password;
-
- public String getIp() {
- return ip;
- }
-
- public void setIp(String ip) {
- this.ip = ip;
- }
-
- public String getPort() {
- return port;
- }
-
- public void setPort(String port) {
- this.port = port;
- }
-
- public String getUser() {
- return user;
- }
-
- public void setUser(String user) {
- this.user = user;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
+ private String ip;
+
+ private String port;
+
+ private String user;
+
+ private String password;
+
+ public String getIp() {
+ return ip;
+ }
+
+ public void setIp(String ip) {
+ this.ip = ip;
+ }
+
+ public String getPort() {
+ return port;
+ }
+
+ public void setPort(String port) {
+ this.port = port;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
}
package org.onap.aai.esr.entity.rest;
public class CommonRegisterResponse {
-
- private String id;
- public String getId() {
- return id;
- }
+ private String id;
- public void setId(String id) {
- this.id = id;
- }
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
}
public class EmsRegisterInfo {
- private String emsId;
-
- private String name;
-
- private String vendor;
-
- private String version;
-
- private FtpAddr resourceAddr;
-
- private FtpAddr performanceAddr;
-
- private AlarmAddr alarmAddr;
-
- public String getEmsId() {
- return emsId;
- }
-
- public void setEmsId(String emsId) {
- this.emsId = emsId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- 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 FtpAddr getResourceAddr() {
- return resourceAddr;
- }
-
- public void setResourceAddr(FtpAddr resourceAddr) {
- this.resourceAddr = resourceAddr;
- }
-
- public FtpAddr getPerformanceAddr() {
- return performanceAddr;
- }
-
- public void setPerformanceAddr(FtpAddr performanceAddr) {
- this.performanceAddr = performanceAddr;
- }
-
- public AlarmAddr getAlarmAddr() {
- return alarmAddr;
- }
-
- public void setAlarmAddr(AlarmAddr alarmAddr) {
- this.alarmAddr = alarmAddr;
- }
+ private String emsId;
+
+ private String name;
+
+ private String vendor;
+
+ private String version;
+
+ private FtpAddr resourceAddr;
+
+ private FtpAddr performanceAddr;
+
+ private AlarmAddr alarmAddr;
+
+ public String getEmsId() {
+ return emsId;
+ }
+
+ public void setEmsId(String emsId) {
+ this.emsId = emsId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ 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 FtpAddr getResourceAddr() {
+ return resourceAddr;
+ }
+
+ public void setResourceAddr(FtpAddr resourceAddr) {
+ this.resourceAddr = resourceAddr;
+ }
+
+ public FtpAddr getPerformanceAddr() {
+ return performanceAddr;
+ }
+
+ public void setPerformanceAddr(FtpAddr performanceAddr) {
+ this.performanceAddr = performanceAddr;
+ }
+
+ public AlarmAddr getAlarmAddr() {
+ return alarmAddr;
+ }
+
+ public void setAlarmAddr(AlarmAddr alarmAddr) {
+ this.alarmAddr = alarmAddr;
+ }
}
package org.onap.aai.esr.entity.rest;
public class FtpAddr {
-
- private String ftptype;
-
- private String ip;
-
- private String port;
-
- private String user;
-
- private String password;
-
- private String remotepath;
-
- private Boolean passive;
-
- public String getFtptype() {
- return ftptype;
- }
-
- public void setFtptype(String ftptype) {
- this.ftptype = ftptype;
- }
-
- public String getIp() {
- return ip;
- }
-
- public void setIp(String ip) {
- this.ip = ip;
- }
-
- public String getPort() {
- return port;
- }
-
- public void setPort(String port) {
- this.port = port;
- }
-
- public String getUser() {
- return user;
- }
-
- public void setUser(String user) {
- this.user = user;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getRemotepath() {
- return remotepath;
- }
-
- public void setRemotepath(String remotepath) {
- this.remotepath = remotepath;
- }
-
- public Boolean getPassive() {
- return passive;
- }
-
- public void setPassive(Boolean passive) {
- this.passive = passive;
- }
+
+ private String ftptype;
+
+ private String ip;
+
+ private String port;
+
+ private String user;
+
+ private String password;
+
+ private String remotepath;
+
+ private Boolean passive;
+
+ public String getFtptype() {
+ return ftptype;
+ }
+
+ public void setFtptype(String ftptype) {
+ this.ftptype = ftptype;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ public void setIp(String ip) {
+ this.ip = ip;
+ }
+
+ public String getPort() {
+ return port;
+ }
+
+ public void setPort(String port) {
+ this.port = port;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getRemotepath() {
+ return remotepath;
+ }
+
+ public void setRemotepath(String remotepath) {
+ this.remotepath = remotepath;
+ }
+
+ public Boolean getPassive() {
+ return passive;
+ }
+
+ public void setPassive(Boolean passive) {
+ this.passive = passive;
+ }
}
public class ThirdpartySdncRegisterInfo {
- private String thirdpartySdncId;
-
- private String name;
-
- private String vendor;
-
- private String version;
-
- private String type;
-
- private String location;
-
- private String url;
-
- private String userName;
-
- private String password;
-
- private String productName;
-
- private String protocol;
-
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- 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 getProductName() {
- return productName;
- }
-
- public void setProductName(String productName) {
- this.productName = productName;
- }
-
- public String getProtocol() {
- return protocol;
- }
-
- public void setProtocol(String protocol) {
- this.protocol = protocol;
- }
-
- public ThirdpartySdncRegisterInfo() {
-
- }
-
- public String getThirdpartySdncId() {
- return thirdpartySdncId;
- }
-
- public void setThirdpartySdncId(String thirdpartySdncId) {
- this.thirdpartySdncId = thirdpartySdncId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- 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 getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
+ private String thirdpartySdncId;
+
+ private String name;
+
+ private String vendor;
+
+ private String version;
+
+ private String type;
+
+ private String location;
+
+ private String url;
+
+ private String userName;
+
+ private String password;
+
+ private String productName;
+
+ private String protocol;
+
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ 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 getProductName() {
+ return productName;
+ }
+
+ public void setProductName(String productName) {
+ this.productName = productName;
+ }
+
+ public String getProtocol() {
+ return protocol;
+ }
+
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
+ }
+
+ public ThirdpartySdncRegisterInfo() {
+
+ }
+
+ public String getThirdpartySdncId() {
+ return thirdpartySdncId;
+ }
+
+ public void setThirdpartySdncId(String thirdpartySdncId) {
+ this.thirdpartySdncId = thirdpartySdncId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ 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 getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
}
package org.onap.aai.esr.entity.rest;
public class VimAuthInfo {
-
- private String cloudDomain;
-
- private String userName;
-
- private String password;
-
- private String authUrl;
-
- private String defaultTenant;
-
- private String sslCacert;
-
- private Boolean sslInsecure;
-
- public String getCloudDomain() {
- return cloudDomain;
- }
-
- public void setCloudDomain(String cloudDomain) {
- this.cloudDomain = cloudDomain;
- }
-
- 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 getAuthUrl() {
- return authUrl;
- }
-
- public void setAuthUrl(String authUrl) {
- this.authUrl = authUrl;
- }
-
- public String getSslCacert() {
- return sslCacert;
- }
-
- public void setSslCacert(String sslCacert) {
- this.sslCacert = sslCacert;
- }
-
- public Boolean getSslInsecure() {
- return sslInsecure;
- }
-
- public void setSslInsecure(Boolean sslInsecure) {
- this.sslInsecure = sslInsecure;
- }
-
- public String getDefaultTenant() {
- return defaultTenant;
- }
-
- public void setDefaultTenant(String defaultTenant) {
- this.defaultTenant = defaultTenant;
- }
+
+ private String cloudDomain;
+
+ private String userName;
+
+ private String password;
+
+ private String authUrl;
+
+ private String defaultTenant;
+
+ private String sslCacert;
+
+ private Boolean sslInsecure;
+
+ public String getCloudDomain() {
+ return cloudDomain;
+ }
+
+ public void setCloudDomain(String cloudDomain) {
+ this.cloudDomain = cloudDomain;
+ }
+
+ 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 getAuthUrl() {
+ return authUrl;
+ }
+
+ public void setAuthUrl(String authUrl) {
+ this.authUrl = authUrl;
+ }
+
+ public String getSslCacert() {
+ return sslCacert;
+ }
+
+ public void setSslCacert(String sslCacert) {
+ this.sslCacert = sslCacert;
+ }
+
+ public Boolean getSslInsecure() {
+ return sslInsecure;
+ }
+
+ public void setSslInsecure(Boolean sslInsecure) {
+ this.sslInsecure = sslInsecure;
+ }
+
+ public String getDefaultTenant() {
+ return defaultTenant;
+ }
+
+ public void setDefaultTenant(String defaultTenant) {
+ this.defaultTenant = defaultTenant;
+ }
}
public class VimRegisterInfo {
- private String cloudOwner;
+ private String cloudOwner;
- private String cloudRegionId;
+ private String cloudRegionId;
- private String cloudType;
+ private String cloudType;
- private String cloudRegionVersion;
+ private String cloudRegionVersion;
- private String ownerDefinedType;
+ private String ownerDefinedType;
- private String cloudZone;
-
- private String complexName;
-
- private String cloudExtraInfo;
-
- private String status;
-
- private List<VimAuthInfo> vimAuthInfos;
+ private String cloudZone;
- public String getCloudOwner() {
- return cloudOwner;
- }
+ private String complexName;
- public void setCloudOwner(String cloudOwner) {
- this.cloudOwner = cloudOwner;
- }
+ private String cloudExtraInfo;
- public String getCloudRegionId() {
- return cloudRegionId;
- }
+ private String status;
- public void setCloudRegionId(String cloudRegionId) {
- this.cloudRegionId = cloudRegionId;
- }
+ private List<VimAuthInfo> vimAuthInfos;
- public String getCloudType() {
- return cloudType;
- }
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
- public void setCloudType(String cloudType) {
- this.cloudType = cloudType;
- }
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
- public String getCloudRegionVersion() {
- return cloudRegionVersion;
- }
+ public String getCloudRegionId() {
+ return cloudRegionId;
+ }
- public void setCloudRegionVersion(String cloudRegionVersion) {
- this.cloudRegionVersion = cloudRegionVersion;
- }
+ public void setCloudRegionId(String cloudRegionId) {
+ this.cloudRegionId = cloudRegionId;
+ }
- public String getOwnerDefinedType() {
- return ownerDefinedType;
- }
+ public String getCloudType() {
+ return cloudType;
+ }
- public void setOwnerDefinedType(String ownerDefinedType) {
- this.ownerDefinedType = ownerDefinedType;
- }
+ public void setCloudType(String cloudType) {
+ this.cloudType = cloudType;
+ }
- public String getCloudZone() {
- return cloudZone;
- }
+ public String getCloudRegionVersion() {
+ return cloudRegionVersion;
+ }
- public void setCloudZone(String cloudZone) {
- this.cloudZone = cloudZone;
- }
+ public void setCloudRegionVersion(String cloudRegionVersion) {
+ this.cloudRegionVersion = cloudRegionVersion;
+ }
- public String getComplexName() {
- return complexName;
- }
+ public String getOwnerDefinedType() {
+ return ownerDefinedType;
+ }
- public void setComplexName(String complexName) {
- this.complexName = complexName;
- }
+ public void setOwnerDefinedType(String ownerDefinedType) {
+ this.ownerDefinedType = ownerDefinedType;
+ }
- public String getCloudExtraInfo() {
- return cloudExtraInfo;
- }
+ public String getCloudZone() {
+ return cloudZone;
+ }
- public void setCloudExtraInfo(String cloudExtraInfo) {
- this.cloudExtraInfo = cloudExtraInfo;
- }
+ public void setCloudZone(String cloudZone) {
+ this.cloudZone = cloudZone;
+ }
- public List<VimAuthInfo> getVimAuthInfos() {
- return vimAuthInfos;
- }
+ public String getComplexName() {
+ return complexName;
+ }
- public void setVimAuthInfos(List<VimAuthInfo> vimAuthInfos) {
- this.vimAuthInfos = vimAuthInfos;
- }
+ public void setComplexName(String complexName) {
+ this.complexName = complexName;
+ }
- public String getStatus() {
- return status;
- }
+ public String getCloudExtraInfo() {
+ return cloudExtraInfo;
+ }
- public void setStatus(String status) {
- this.status = status;
- }
+ public void setCloudExtraInfo(String cloudExtraInfo) {
+ this.cloudExtraInfo = cloudExtraInfo;
+ }
+
+ public List<VimAuthInfo> getVimAuthInfos() {
+ return vimAuthInfos;
+ }
+
+ public void setVimAuthInfos(List<VimAuthInfo> vimAuthInfos) {
+ this.vimAuthInfos = vimAuthInfos;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
}
package org.onap.aai.esr.entity.rest;
public class VimRegisterResponse {
-
- private String cloudOwner;
-
- private String cloudRegionId;
-
- public String getCloudOwner() {
- return cloudOwner;
- }
-
- public void setCloudOwner(String cloudOwner) {
- this.cloudOwner = cloudOwner;
- }
-
- public String getCloudRegionId() {
- return cloudRegionId;
- }
-
- public void setCloudRegionId(String cloudRegionId) {
- this.cloudRegionId = cloudRegionId;
- }
+
+ private String cloudOwner;
+
+ private String cloudRegionId;
+
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
+ public String getCloudRegionId() {
+ return cloudRegionId;
+ }
+
+ public void setCloudRegionId(String cloudRegionId) {
+ this.cloudRegionId = cloudRegionId;
+ }
}
*/
package org.onap.aai.esr.entity.rest;
-public class VnfmRegisterInfo{
-
- private String vnfmId;
-
- private String name;
-
- private String type;
-
- private String vimId;
-
- private String vendor;
-
- private String version;
-
- private String certificateUrl;
-
- private String url;
-
- private String userName;
-
- private String password;
-
- public String getVnfmId() {
- return vnfmId;
- }
-
- public void setVnfmId(String vnfmId) {
- this.vnfmId = vnfmId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getVimId() {
- return vimId;
- }
-
- public void setVimId(String vimId) {
- this.vimId = vimId;
- }
-
- 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 getCertificateUrl() {
- return certificateUrl;
- }
-
- public void setCertificateUrl(String certificateUrl) {
- this.certificateUrl = certificateUrl;
- }
-
- public String getUrl() {
- return url;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
- 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 class VnfmRegisterInfo {
+
+ private String vnfmId;
+
+ private String name;
+
+ private String type;
+
+ private String vimId;
+
+ private String vendor;
+
+ private String version;
+
+ private String certificateUrl;
+
+ private String url;
+
+ private String userName;
+
+ private String password;
+
+ public String getVnfmId() {
+ return vnfmId;
+ }
+
+ public void setVnfmId(String vnfmId) {
+ this.vnfmId = vnfmId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getVimId() {
+ return vimId;
+ }
+
+ public void setVimId(String vimId) {
+ this.vimId = vimId;
+ }
+
+ 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 getCertificateUrl() {
+ return certificateUrl;
+ }
+
+ public void setCertificateUrl(String certificateUrl) {
+ this.certificateUrl = certificateUrl;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ 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 class ExceptionUtil {
- private static final int EXCEPTION_CODE = 498;
+ private static final int EXCEPTION_CODE = 498;
- private ExceptionUtil() {
+ private ExceptionUtil() {
- }
+ }
- public static WebApplicationException buildExceptionResponse(String message) {
- Response response = Response.status(EXCEPTION_CODE).entity(message).type(MediaType.TEXT_PLAIN).build();
- return new WebApplicationException(response);
- }
+ public static WebApplicationException buildExceptionResponse(String message) {
+ Response response = Response.status(EXCEPTION_CODE).entity(message).type(MediaType.TEXT_PLAIN).build();
+ return new WebApplicationException(response);
+ }
}
public class ExtsysException extends Exception {
- private static final long serialVersionUID = 1L;
- private String errorCode;
- private String errorMsg;
-
- public String getErrorCode() {
- return errorCode;
- }
-
- public void setErrorCode(String errorCode) {
- this.errorCode = errorCode;
- }
-
- public String getErrorMsg() {
- return errorMsg;
- }
-
- public void setErrorMsg(String errorMsg) {
- this.errorMsg = errorMsg;
- }
-
- public ExtsysException() {
- super();
- }
-
- public ExtsysException(String msg, Exception e) {
- super(msg, e);
- }
-
- public ExtsysException(String msg) {
- super(msg);
- }
+ private static final long serialVersionUID = 1L;
+ private String errorCode;
+ private String errorMsg;
+
+ public String getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(String errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getErrorMsg() {
+ return errorMsg;
+ }
+
+ public void setErrorMsg(String errorMsg) {
+ this.errorMsg = errorMsg;
+ }
+
+ public ExtsysException() {
+ super();
+ }
+
+ public ExtsysException(String msg, Exception e) {
+ super(msg, e);
+ }
+
+ public ExtsysException(String msg) {
+ super(msg);
+ }
}
public class AaiCommon {
- private static String AAI_AUTHENTICATION_USER = "AAI";
- private static String AAI_AUTHENTICATION_PAASWORD = "AAI";
-
- public static String getAuthenticationCredentials() {
- String usernameAndPassword = AAI_AUTHENTICATION_USER + ":"
- + AAI_AUTHENTICATION_PAASWORD;
- return "Basic " + java.util.Base64.getEncoder().encodeToString(usernameAndPassword.getBytes());
- }
-
+ private static String AAI_AUTHENTICATION_USER = "AAI";
+ private static String AAI_AUTHENTICATION_PAASWORD = "AAI";
+
+ public static String getAuthenticationCredentials() {
+ String usernameAndPassword = AAI_AUTHENTICATION_USER + ":" + AAI_AUTHENTICATION_PAASWORD;
+ return "Basic " + java.util.Base64.getEncoder().encodeToString(usernameAndPassword.getBytes());
+ }
+
}
import org.onap.aai.esr.common.MsbConfig;
import org.onap.aai.esr.entity.aai.CloudRegionDetail;
import org.onap.aai.esr.exception.ExtsysException;
-
import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
public class CloudRegionProxy {
- private static ICloudRegion adapterServiceproxy;
+ private static ICloudRegion adapterServiceproxy;
- private static String transactionId = "9999";
- private static String fromAppId = "esr-server";
- private static String authorization = AaiCommon.getAuthenticationCredentials();
- static {
- ClientConfig config = new ClientConfig();
- adapterServiceproxy = ConsumerFactory.createConsumer(MsbConfig.getCloudInfrastructureAddr(),
- config, ICloudRegion.class);
- }
+ private static String transactionId = "9999";
+ private static String fromAppId = "esr-server";
+ private static String authorization = AaiCommon.getAuthenticationCredentials();
+ static {
+ ClientConfig config = new ClientConfig();
+ adapterServiceproxy =
+ ConsumerFactory.createConsumer(MsbConfig.getCloudInfrastructureAddr(), config, ICloudRegion.class);
+ }
- public void registerVim(String cloudOwner, String cloudRegionId,
- CloudRegionDetail cloudRegion) throws ExtsysException {
- ClientConfig config = new ClientConfig(new VimRegisterProvider());
- ICloudRegion registerVimServiceproxy = ConsumerFactory
- .createConsumer(MsbConfig.getCloudInfrastructureAddr(), config, ICloudRegion.class);
- try {
- registerVimServiceproxy.registerVIMService(transactionId, fromAppId, authorization, cloudOwner,
- cloudRegionId, cloudRegion);
- } catch (Exception e) {
- throw new ExtsysException("PUT cloud region to A&AI failed.", e);
+ public void registerVim(String cloudOwner, String cloudRegionId, CloudRegionDetail cloudRegion)
+ throws ExtsysException {
+ ClientConfig config = new ClientConfig(new VimRegisterProvider());
+ ICloudRegion registerVimServiceproxy =
+ ConsumerFactory.createConsumer(MsbConfig.getCloudInfrastructureAddr(), config, ICloudRegion.class);
+ try {
+ registerVimServiceproxy.registerVIMService(transactionId, fromAppId, authorization, cloudOwner,
+ cloudRegionId, cloudRegion);
+ } catch (Exception e) {
+ throw new ExtsysException("PUT cloud region to A&AI failed.", e);
+ }
}
- }
- public String queryVimDetail(String cloud_owner, String cloud_region_id) throws ExtsysException {
- try {
- return adapterServiceproxy.queryVIMDetail(transactionId, fromAppId, authorization, cloud_owner,
- cloud_region_id);
- } catch (Exception e) {
- throw new ExtsysException("Query cloud region detail from A&AI failed.", e);
+ public String queryVimDetail(String cloud_owner, String cloud_region_id) throws ExtsysException {
+ try {
+ return adapterServiceproxy.queryVIMDetail(transactionId, fromAppId, authorization, cloud_owner,
+ cloud_region_id);
+ } catch (Exception e) {
+ throw new ExtsysException("Query cloud region detail from A&AI failed.", e);
+ }
}
- }
- public String qureyVimList() throws ExtsysException {
- try {
- return adapterServiceproxy.queryVIMList(transactionId, fromAppId, authorization);
- } catch (Exception e) {
- throw new ExtsysException("Query cloud region list from A&AI failed.", e);
+ public String qureyVimList() throws ExtsysException {
+ try {
+ return adapterServiceproxy.queryVIMList(transactionId, fromAppId, authorization);
+ } catch (Exception e) {
+ throw new ExtsysException("Query cloud region list from A&AI failed.", e);
+ }
}
- }
- public void deleteVim(String cloud_owner, String cloud_region_id, String resourceVersion) throws ExtsysException
- {
- try {
- adapterServiceproxy.deleteVim(transactionId, fromAppId, authorization, cloud_owner,
- cloud_region_id, resourceVersion);
- } catch (Exception e) {
- throw new ExtsysException("Delete cloud region from A&AI failed.", e);
+ public void deleteVim(String cloud_owner, String cloud_region_id, String resourceVersion) throws ExtsysException {
+ try {
+ adapterServiceproxy.deleteVim(transactionId, fromAppId, authorization, cloud_owner, cloud_region_id,
+ resourceVersion);
+ } catch (Exception e) {
+ throw new ExtsysException("Delete cloud region from A&AI failed.", e);
+ }
}
- }
}
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
-
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
-
import org.onap.aai.esr.entity.aai.EsrEmsDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import com.google.gson.Gson;
-public class EmsRegisterProvider implements MessageBodyWriter<EsrEmsDetail>{
-
- private static final Logger logger = LoggerFactory.getLogger(EmsRegisterProvider.class);
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations,
- MediaType mediaType) {
- return EsrEmsDetail.class.isAssignableFrom(type);
- }
-
- @Override
- public long getSize(EsrEmsDetail t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-
- @Override
- public void writeTo(EsrEmsDetail t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException, WebApplicationException {
- String json = new Gson().toJson(t, EsrEmsDetail.class);
- logger.info("the param to register EMS input is:" + json);
- entityStream.write(json.getBytes("UTF-8"));
- }
+public class EmsRegisterProvider implements MessageBodyWriter<EsrEmsDetail> {
+
+ private static final Logger logger = LoggerFactory.getLogger(EmsRegisterProvider.class);
+
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+ return EsrEmsDetail.class.isAssignableFrom(type);
+ }
+
+ @Override
+ public long getSize(EsrEmsDetail t, Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType) {
+ return -1;
+ }
+
+ @Override
+ public void writeTo(EsrEmsDetail t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
+ MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
+ throws IOException, WebApplicationException {
+ String json = new Gson().toJson(t, EsrEmsDetail.class);
+ logger.info("the param to register EMS input is:" + json);
+ entityStream.write(json.getBytes("UTF-8"));
+ }
}
import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail;
import org.onap.aai.esr.entity.aai.EsrVnfmDetail;
import org.onap.aai.esr.exception.ExtsysException;
-
import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
public class ExternalSystemProxy {
- public static boolean isTest = false;
- private static IExternalSystem externalSystemproxy;
- private static String transactionId = "9999";
- private static String fromAppId = "esr-server";
- private static String authorization = AaiCommon.getAuthenticationCredentials();
- static {
- ClientConfig config = new ClientConfig();
- externalSystemproxy = ConsumerFactory.createConsumer(MsbConfig.getExternalSystemAddr(),
- config, IExternalSystem.class);
- }
-
- public static void registerVnfm(String vnfmId, EsrVnfmDetail esrVnfmDetail)
- throws ExtsysException {
- if (isTest) {
-
- } else {
- ClientConfig config = new ClientConfig(new VnfmRegisterProvider());
- IExternalSystem registerVnfmServiceproxy = ConsumerFactory
- .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class);
- try {
- registerVnfmServiceproxy.registerVNFM(transactionId, fromAppId, authorization, vnfmId,
- esrVnfmDetail);
- } catch (Exception e) {
- throw new ExtsysException("PUT VNFM to A&AI failed.", e);
- }
- }
- }
-
- public static String queryVnfmDetail(String vnfmId) throws ExtsysException {
- if(isTest) {
- String esrVnfmDetailStr = "{\"vnfm-id\":\"123456\","
- + "\"vim-id\":\"987654\","
- + "\"certificate-url\":\"http://11.22.33.44:5000/v3\","
- + "\"esr-system-info-list\":{"
- + "\"esr-system-info\":[{"
- + "\"esr-system-info-id\":\"qwerty\","
- + "\"system-name\":\"ONAP VNFM\","
- + "\"type\":\"vnfm\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1\","
- + "\"service-url\":\"http://10.11.22.33:8000\","
- + "\"user-name\":\"onap\","
- + "\"password\":\"987654\","
- + "\"system-type\":\"VNFM\"}]}}";
- return esrVnfmDetailStr;
- }
- try {
- return externalSystemproxy.queryVNFMDetail(transactionId, fromAppId, authorization, vnfmId);
- } catch (Exception e) {
- throw new ExtsysException("Query VNFM detail from A&AI failed.", e);
+ public static boolean isTest = false;
+ private static IExternalSystem externalSystemproxy;
+ private static String transactionId = "9999";
+ private static String fromAppId = "esr-server";
+ private static String authorization = AaiCommon.getAuthenticationCredentials();
+ static {
+ ClientConfig config = new ClientConfig();
+ externalSystemproxy =
+ ConsumerFactory.createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class);
}
- }
-
- public static String queryVnfmList() throws ExtsysException {
- if(isTest) {
- String vnfmListStr = "{\"esr-vnfm\": "
- + "[{\"vnfm-id\": \"123456\","
- + "\"vim-id\": \"987654\","
- + "\"certificate-url\": \"http://11.22.33.44:5000/v3\","
- + "\"resource-version\": \"1\"}]}";
- return vnfmListStr;
- }
- try {
- return externalSystemproxy.queryVNFMList(transactionId, fromAppId, authorization);
- } catch (Exception e) {
- throw new ExtsysException("Query VNFM list from A&AI failed.", e);
+
+ public static void registerVnfm(String vnfmId, EsrVnfmDetail esrVnfmDetail) throws ExtsysException {
+ if (isTest) {
+
+ } else {
+ ClientConfig config = new ClientConfig(new VnfmRegisterProvider());
+ IExternalSystem registerVnfmServiceproxy =
+ ConsumerFactory.createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class);
+ try {
+ registerVnfmServiceproxy.registerVNFM(transactionId, fromAppId, authorization, vnfmId, esrVnfmDetail);
+ } catch (Exception e) {
+ throw new ExtsysException("PUT VNFM to A&AI failed.", e);
+ }
+ }
}
- }
-
- public static void deleteVnfm(String vnfmId, String resourceVersion) throws ExtsysException {
- if(!isTest) {
- try {
- externalSystemproxy.deleteVNFM(transactionId, fromAppId, authorization, vnfmId, resourceVersion);
- } catch (Exception e) {
- throw new ExtsysException("Delete VNFM from A&AI failed.", e);
- }
+
+ public static String queryVnfmDetail(String vnfmId) throws ExtsysException {
+ if (isTest) {
+ String esrVnfmDetailStr = "{\"vnfm-id\":\"123456\"," + "\"vim-id\":\"987654\","
+ + "\"certificate-url\":\"http://11.22.33.44:5000/v3\"," + "\"esr-system-info-list\":{"
+ + "\"esr-system-info\":[{" + "\"esr-system-info-id\":\"qwerty\"," + "\"system-name\":\"ONAP VNFM\","
+ + "\"type\":\"vnfm\"," + "\"vendor\":\"zte\"," + "\"version\":\"v1\","
+ + "\"service-url\":\"http://10.11.22.33:8000\"," + "\"user-name\":\"onap\","
+ + "\"password\":\"987654\"," + "\"system-type\":\"VNFM\"}]}}";
+ return esrVnfmDetailStr;
+ }
+ try {
+ return externalSystemproxy.queryVNFMDetail(transactionId, fromAppId, authorization, vnfmId);
+ } catch (Exception e) {
+ throw new ExtsysException("Query VNFM detail from A&AI failed.", e);
+ }
}
- }
-
- public static void registerSdnc(String thirdpartySdncId, EsrThirdpartySdncDetail esrSdncDetail) throws ExtsysException {
- if(!isTest) {
- ClientConfig config = new ClientConfig(new ThirdpartySdncRegisterProvider());
- IExternalSystem registerSdncServiceproxy = ConsumerFactory
- .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class);
- try {
- registerSdncServiceproxy.registerThirdpartySdnc(transactionId, fromAppId, authorization, thirdpartySdncId,
- esrSdncDetail);
- } catch (Exception e) {
- throw new ExtsysException("PUT thirdparty SDNC to A&AI failed.", e);
- }
+
+ public static String queryVnfmList() throws ExtsysException {
+ if (isTest) {
+ String vnfmListStr = "{\"esr-vnfm\": " + "[{\"vnfm-id\": \"123456\"," + "\"vim-id\": \"987654\","
+ + "\"certificate-url\": \"http://11.22.33.44:5000/v3\"," + "\"resource-version\": \"1\"}]}";
+ return vnfmListStr;
+ }
+ try {
+ return externalSystemproxy.queryVNFMList(transactionId, fromAppId, authorization);
+ } catch (Exception e) {
+ throw new ExtsysException("Query VNFM list from A&AI failed.", e);
+ }
}
- }
-
- public static String queryThirdpartySdncDetail(String thirdpartySdncId) throws ExtsysException {
- if(isTest) {
- String sdncDetail = "{\"thirdparty-sdnc-id\":\"123456\","
- + "\"location\":\"edge\","
- + "\"product-name\":\"thirdparty SDNC\","
- + "\"esr-system-info-list\":{"
- + "\"esr-system-info\":"
- + "[{\"esr-system-info-id\":\"987654\","
- + "\"system-name\":\"SDNC_TEST\","
- + "\"type\":\"SDNC\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1\","
- + "\"service-url\":\"http://127.0.0.1:8000\","
- + "\"user-name\":\"nancy\","
- + "\"password\":\"123987\","
- + "\"system-type\":\"thirdparty_SDNC\","
- + "\"protocol\":\"protocol\"}]}}";
- return sdncDetail;
+
+ public static void deleteVnfm(String vnfmId, String resourceVersion) throws ExtsysException {
+ if (!isTest) {
+ try {
+ externalSystemproxy.deleteVNFM(transactionId, fromAppId, authorization, vnfmId, resourceVersion);
+ } catch (Exception e) {
+ throw new ExtsysException("Delete VNFM from A&AI failed.", e);
+ }
+ }
}
- try {
- return externalSystemproxy.queryThirdpartySdncDetail(transactionId, fromAppId, authorization, thirdpartySdncId);
- } catch (Exception e) {
- throw new ExtsysException("Query thirdparty SDNC detail from A&AI failed.", e);
+
+ public static void registerSdnc(String thirdpartySdncId, EsrThirdpartySdncDetail esrSdncDetail)
+ throws ExtsysException {
+ if (!isTest) {
+ ClientConfig config = new ClientConfig(new ThirdpartySdncRegisterProvider());
+ IExternalSystem registerSdncServiceproxy =
+ ConsumerFactory.createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class);
+ try {
+ registerSdncServiceproxy.registerThirdpartySdnc(transactionId, fromAppId, authorization,
+ thirdpartySdncId, esrSdncDetail);
+ } catch (Exception e) {
+ throw new ExtsysException("PUT thirdparty SDNC to A&AI failed.", e);
+ }
+ }
}
- }
-
- public static String querySdncList() throws ExtsysException {
- if(isTest) {
- String sdncList = "{\"esr-thirdparty-sdnc\": "
- + "[{\"thirdparty-sdnc-id\": \"123456\","
- + "\"location\": \"edge\","
- + "\"product-name\": \"thirdparty SDNC\","
- + "\"resource-version\": \"1\"}]}";
- return sdncList;
+
+ public static String queryThirdpartySdncDetail(String thirdpartySdncId) throws ExtsysException {
+ if (isTest) {
+ String sdncDetail = "{\"thirdparty-sdnc-id\":\"123456\"," + "\"location\":\"edge\","
+ + "\"product-name\":\"thirdparty SDNC\"," + "\"esr-system-info-list\":{" + "\"esr-system-info\":"
+ + "[{\"esr-system-info-id\":\"987654\"," + "\"system-name\":\"SDNC_TEST\"," + "\"type\":\"SDNC\","
+ + "\"vendor\":\"zte\"," + "\"version\":\"v1\"," + "\"service-url\":\"http://127.0.0.1:8000\","
+ + "\"user-name\":\"nancy\"," + "\"password\":\"123987\"," + "\"system-type\":\"thirdparty_SDNC\","
+ + "\"protocol\":\"protocol\"}]}}";
+ return sdncDetail;
+ }
+ try {
+ return externalSystemproxy.queryThirdpartySdncDetail(transactionId, fromAppId, authorization,
+ thirdpartySdncId);
+ } catch (Exception e) {
+ throw new ExtsysException("Query thirdparty SDNC detail from A&AI failed.", e);
+ }
}
- try {
- return externalSystemproxy.queryThirdpartySdncList(transactionId, fromAppId, authorization);
- } catch (Exception e) {
- throw new ExtsysException("Query thirdparty SDNC list from A&AI failed.", e);
+
+ public static String querySdncList() throws ExtsysException {
+ if (isTest) {
+ String sdncList =
+ "{\"esr-thirdparty-sdnc\": " + "[{\"thirdparty-sdnc-id\": \"123456\"," + "\"location\": \"edge\","
+ + "\"product-name\": \"thirdparty SDNC\"," + "\"resource-version\": \"1\"}]}";
+ return sdncList;
+ }
+ try {
+ return externalSystemproxy.queryThirdpartySdncList(transactionId, fromAppId, authorization);
+ } catch (Exception e) {
+ throw new ExtsysException("Query thirdparty SDNC list from A&AI failed.", e);
+ }
}
- }
-
- public static void deleteThirdpartySdnc(String sdncId, String resourceVersion) throws ExtsysException {
- if(!isTest) {
- try {
- externalSystemproxy.deleteThirdpartySdnc(transactionId, fromAppId, authorization, sdncId, resourceVersion);
- } catch (Exception e) {
- throw new ExtsysException("Delete thirdparty SDNC from A&AI failed.", e);
- }
+
+ public static void deleteThirdpartySdnc(String sdncId, String resourceVersion) throws ExtsysException {
+ if (!isTest) {
+ try {
+ externalSystemproxy.deleteThirdpartySdnc(transactionId, fromAppId, authorization, sdncId,
+ resourceVersion);
+ } catch (Exception e) {
+ throw new ExtsysException("Delete thirdparty SDNC from A&AI failed.", e);
+ }
+ }
}
- }
-
- public static void registerEms(String emsId, EsrEmsDetail emsDetail) throws ExtsysException {
- ClientConfig config = new ClientConfig(new EmsRegisterProvider());
- IExternalSystem registerEmsServiceproxy = ConsumerFactory
- .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class);
- try {
- registerEmsServiceproxy.registerEMS(transactionId, fromAppId, authorization, emsId,
- emsDetail);
- } catch (Exception e) {
- throw new ExtsysException("PUT EMS to A&AI failed.", e);
+
+ public static void registerEms(String emsId, EsrEmsDetail emsDetail) throws ExtsysException {
+ ClientConfig config = new ClientConfig(new EmsRegisterProvider());
+ IExternalSystem registerEmsServiceproxy =
+ ConsumerFactory.createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class);
+ try {
+ registerEmsServiceproxy.registerEMS(transactionId, fromAppId, authorization, emsId, emsDetail);
+ } catch (Exception e) {
+ throw new ExtsysException("PUT EMS to A&AI failed.", e);
+ }
}
- }
-
- public static String queryEmsDetail(String emsId) throws ExtsysException {
- try {
- return externalSystemproxy.queryEMSDetail(transactionId, fromAppId, authorization, emsId);
- } catch (Exception e) {
- throw new ExtsysException("Query EMS detail from A&AI failed.", e);
+
+ public static String queryEmsDetail(String emsId) throws ExtsysException {
+ try {
+ return externalSystemproxy.queryEMSDetail(transactionId, fromAppId, authorization, emsId);
+ } catch (Exception e) {
+ throw new ExtsysException("Query EMS detail from A&AI failed.", e);
+ }
}
- }
-
- public static String queryEmsList() throws ExtsysException {
- try {
- return externalSystemproxy.queryEMSList(transactionId, fromAppId, authorization);
- } catch (Exception e) {
- throw new ExtsysException("Query EMS list from A&AI failed.", e);
+
+ public static String queryEmsList() throws ExtsysException {
+ try {
+ return externalSystemproxy.queryEMSList(transactionId, fromAppId, authorization);
+ } catch (Exception e) {
+ throw new ExtsysException("Query EMS list from A&AI failed.", e);
+ }
}
- }
-
- public static void deleteEms(String emsId, String resourceVersion) throws ExtsysException {
- try {
- externalSystemproxy.deleteEMS(transactionId, fromAppId, authorization, emsId, resourceVersion);
- } catch (Exception e) {
- throw new ExtsysException("Delete EMS from A&AI failed.", e);
+
+ public static void deleteEms(String emsId, String resourceVersion) throws ExtsysException {
+ try {
+ externalSystemproxy.deleteEMS(transactionId, fromAppId, authorization, emsId, resourceVersion);
+ } catch (Exception e) {
+ throw new ExtsysException("Delete EMS from A&AI failed.", e);
+ }
}
- }
}
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
-
import org.onap.aai.esr.entity.aai.CloudRegionDetail;
import org.onap.aai.esr.exception.ExtsysException;
@Path("/cloud-regions")
public interface ICloudRegion {
- @PUT
- @Path("/cloud-region/{cloud_owner}/{cloud_region_id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public void registerVIMService(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization,
- @PathParam("cloud_owner") String cloud_owner,
- @PathParam("cloud_region_id") String cloud_region_id, CloudRegionDetail cloudRegion) throws ExtsysException;
+ @PUT
+ @Path("/cloud-region/{cloud_owner}/{cloud_region_id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public void registerVIMService(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("cloud_owner") String cloud_owner, @PathParam("cloud_region_id") String cloud_region_id,
+ CloudRegionDetail cloudRegion) throws ExtsysException;
+
+ @GET
+ @Path("/cloud-region/{cloud_owner}/{cloud_region_id}?depth=all")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String queryVIMDetail(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("cloud_owner") String cloud_owner, @PathParam("cloud_region_id") String cloud_region_id)
+ throws ExtsysException;
- @GET
- @Path("/cloud-region/{cloud_owner}/{cloud_region_id}?depth=all")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String queryVIMDetail(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization,
- @PathParam("cloud_owner") String cloud_owner,
- @PathParam("cloud_region_id") String cloud_region_id) throws ExtsysException;
-
- @GET
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String queryVIMList(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization) throws ExtsysException;
+ @GET
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String queryVIMList(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization)
+ throws ExtsysException;
- @DELETE
- @Path("/cloud-region/{cloud_owner}/{cloud_region_id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public void deleteVim(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization,
- @PathParam("cloud_owner") String cloud_owner,
- @PathParam("cloud_region_id") String cloud_region_id,
- @QueryParam("resource-version") String resourceVersion) throws ExtsysException;
+ @DELETE
+ @Path("/cloud-region/{cloud_owner}/{cloud_region_id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public void deleteVim(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("cloud_owner") String cloud_owner, @PathParam("cloud_region_id") String cloud_region_id,
+ @QueryParam("resource-version") String resourceVersion) throws ExtsysException;
}
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
-
import org.onap.aai.esr.entity.aai.EsrEmsDetail;
import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail;
import org.onap.aai.esr.entity.aai.EsrVnfmDetail;
@Path("/")
public interface IExternalSystem {
- @PUT
- @Path("/esr-vnfm-list/esr-vnfm/{vnfm_id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public void registerVNFM(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization, @PathParam("vnfm_id") String vnfmId,
- EsrVnfmDetail esrVnfmDetail) throws ExtsysException;
+ @PUT
+ @Path("/esr-vnfm-list/esr-vnfm/{vnfm_id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public void registerVNFM(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("vnfm_id") String vnfmId, EsrVnfmDetail esrVnfmDetail) throws ExtsysException;
+
+ @GET
+ @Path("/esr-vnfm-list/esr-vnfm/{vnfm_id}?depth=all")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String queryVNFMDetail(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("vnfm_id") String vnfmId) throws ExtsysException;
- @GET
- @Path("/esr-vnfm-list/esr-vnfm/{vnfm_id}?depth=all")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String queryVNFMDetail(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization, @PathParam("vnfm_id") String vnfmId)
- throws ExtsysException;
+ @GET
+ @Path("/esr-vnfm-list")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String queryVNFMList(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization)
+ throws ExtsysException;
- @GET
- @Path("/esr-vnfm-list")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String queryVNFMList(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization) throws ExtsysException;
+ @DELETE
+ @Path("/esr-vnfm-list/esr-vnfm/{vnfm_id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public void deleteVNFM(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("vnfm_id") String vnfmId, @QueryParam("resource-version") String resourceVersion)
+ throws ExtsysException;
- @DELETE
- @Path("/esr-vnfm-list/esr-vnfm/{vnfm_id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public void deleteVNFM(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization,
- @PathParam("vnfm_id") String vnfmId,
- @QueryParam("resource-version") String resourceVersion) throws ExtsysException;
+ @PUT
+ @Path("/esr-ems-list/esr-ems/{ems_id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public void registerEMS(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("ems_id") String emsId, EsrEmsDetail esrEmsDetail) throws ExtsysException;
- @PUT
- @Path("/esr-ems-list/esr-ems/{ems_id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public void registerEMS(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization, @PathParam("ems_id") String emsId,
- EsrEmsDetail esrEmsDetail) throws ExtsysException;
+ @GET
+ @Path("/esr-ems-list/esr-ems/{ems_id}?depth=all")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String queryEMSDetail(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("ems_id") String emsId) throws ExtsysException;
- @GET
- @Path("/esr-ems-list/esr-ems/{ems_id}?depth=all")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String queryEMSDetail(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization, @PathParam("ems_id") String emsId)
- throws ExtsysException;
+ @GET
+ @Path("/esr-ems-list")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String queryEMSList(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization)
+ throws ExtsysException;
- @GET
- @Path("/esr-ems-list")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String queryEMSList(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization) throws ExtsysException;
+ @DELETE
+ @Path("/esr-ems-list/esr-ems/{ems_id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public void deleteEMS(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("ems_id") String emsId, @QueryParam("resource-version") String resourceVersion)
+ throws ExtsysException;
- @DELETE
- @Path("/esr-ems-list/esr-ems/{ems_id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public void deleteEMS(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization,
- @PathParam("ems_id") String emsId,
- @QueryParam("resource-version") String resourceVersion) throws ExtsysException;
-
- @PUT
- @Path("/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/{thirdparty-sdnc-id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public void registerThirdpartySdnc(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization, @PathParam("thirdparty-sdnc-id") String thirdpartySdncId,
- EsrThirdpartySdncDetail esrThirdpartySdncDetail) throws ExtsysException;
+ @PUT
+ @Path("/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/{thirdparty-sdnc-id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public void registerThirdpartySdnc(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("thirdparty-sdnc-id") String thirdpartySdncId, EsrThirdpartySdncDetail esrThirdpartySdncDetail)
+ throws ExtsysException;
- @GET
- @Path("/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/{thirdparty-sdnc-id}?depth=all")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String queryThirdpartySdncDetail(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization, @PathParam("thirdparty-sdnc-id") String thirdpartySdncId)
- throws ExtsysException;
+ @GET
+ @Path("/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/{thirdparty-sdnc-id}?depth=all")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String queryThirdpartySdncDetail(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("thirdparty-sdnc-id") String thirdpartySdncId) throws ExtsysException;
- @GET
- @Path("/esr-thirdparty-sdnc-list")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String queryThirdpartySdncList(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization) throws ExtsysException;
+ @GET
+ @Path("/esr-thirdparty-sdnc-list")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String queryThirdpartySdncList(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization)
+ throws ExtsysException;
- @DELETE
- @Path("/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/{thirdparty-sdnc-id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public void deleteThirdpartySdnc(@HeaderParam("X-TransactionId") String transactionId,
- @HeaderParam("X-FromAppId") String fromApp,
- @HeaderParam("Authorization") String authorization,
- @PathParam("thirdparty-sdnc-id") String thirdpartySdncId,
- @QueryParam("resource-version") String resourceVersion) throws ExtsysException;
+ @DELETE
+ @Path("/esr-thirdparty-sdnc-list/esr-thirdparty-sdnc/{thirdparty-sdnc-id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public void deleteThirdpartySdnc(@HeaderParam("X-TransactionId") String transactionId,
+ @HeaderParam("X-FromAppId") String fromApp, @HeaderParam("Authorization") String authorization,
+ @PathParam("thirdparty-sdnc-id") String thirdpartySdncId,
+ @QueryParam("resource-version") String resourceVersion) throws ExtsysException;
}
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
-
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
-
import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import com.google.gson.Gson;
-public class ThirdpartySdncRegisterProvider implements MessageBodyWriter<EsrThirdpartySdncDetail>{
-
- private static final Logger logger = LoggerFactory.getLogger(VimRegisterProvider.class);
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations,
- MediaType mediaType) {
- return EsrThirdpartySdncDetail.class.isAssignableFrom(type);
- }
-
- @Override
- public long getSize(EsrThirdpartySdncDetail t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-
- @Override
- public void writeTo(EsrThirdpartySdncDetail t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException, WebApplicationException {
- String json = new Gson().toJson(t, EsrThirdpartySdncDetail.class);
- logger.info("the param to register VIM input is:" + json);
- entityStream.write(json.getBytes("UTF-8"));
- }
+public class ThirdpartySdncRegisterProvider implements MessageBodyWriter<EsrThirdpartySdncDetail> {
+
+ private static final Logger logger = LoggerFactory.getLogger(VimRegisterProvider.class);
+
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+ return EsrThirdpartySdncDetail.class.isAssignableFrom(type);
+ }
+
+ @Override
+ public long getSize(EsrThirdpartySdncDetail t, Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType) {
+ return -1;
+ }
+
+ @Override
+ public void writeTo(EsrThirdpartySdncDetail t, Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
+ throws IOException, WebApplicationException {
+ String json = new Gson().toJson(t, EsrThirdpartySdncDetail.class);
+ logger.info("the param to register VIM input is:" + json);
+ entityStream.write(json.getBytes("UTF-8"));
+ }
}
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
-
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
-
import org.onap.aai.esr.entity.aai.CloudRegionDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import com.google.gson.Gson;
-public class VimRegisterProvider implements MessageBodyWriter<CloudRegionDetail>{
- private static final Logger logger = LoggerFactory.getLogger(VimRegisterProvider.class);
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations,
- MediaType mediaType) {
- return CloudRegionDetail.class.isAssignableFrom(type);
- }
-
- @Override
- public long getSize(CloudRegionDetail t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-
- @Override
- public void writeTo(CloudRegionDetail t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException, WebApplicationException {
- String json = new Gson().toJson(t, CloudRegionDetail.class);
- logger.info("the param to register VIM input is:" + json);
- entityStream.write(json.getBytes("UTF-8"));
- }
+public class VimRegisterProvider implements MessageBodyWriter<CloudRegionDetail> {
+ private static final Logger logger = LoggerFactory.getLogger(VimRegisterProvider.class);
+
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+ return CloudRegionDetail.class.isAssignableFrom(type);
+ }
+
+ @Override
+ public long getSize(CloudRegionDetail t, Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType) {
+ return -1;
+ }
+
+ @Override
+ public void writeTo(CloudRegionDetail t, Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
+ throws IOException, WebApplicationException {
+ String json = new Gson().toJson(t, CloudRegionDetail.class);
+ logger.info("the param to register VIM input is:" + json);
+ entityStream.write(json.getBytes("UTF-8"));
+ }
}
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
-
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
-
import org.onap.aai.esr.entity.aai.EsrVnfmDetail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import com.google.gson.Gson;
-public class VnfmRegisterProvider implements MessageBodyWriter<EsrVnfmDetail>{
-
- private static final Logger logger = LoggerFactory.getLogger(VnfmRegisterProvider.class);
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations,
- MediaType mediaType) {
- return EsrVnfmDetail.class.isAssignableFrom(type);
- }
-
- @Override
- public long getSize(EsrVnfmDetail t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-
- @Override
- public void writeTo(EsrVnfmDetail t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException, WebApplicationException {
- String json = new Gson().toJson(t, EsrVnfmDetail.class);
- logger.info("the param to register VNFM input is:" + json);
- entityStream.write(json.getBytes("UTF-8"));
- }
+public class VnfmRegisterProvider implements MessageBodyWriter<EsrVnfmDetail> {
+
+ private static final Logger logger = LoggerFactory.getLogger(VnfmRegisterProvider.class);
+
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+ return EsrVnfmDetail.class.isAssignableFrom(type);
+ }
+
+ @Override
+ public long getSize(EsrVnfmDetail t, Class<?> type, Type genericType, Annotation[] annotations,
+ MediaType mediaType) {
+ return -1;
+ }
+
+ @Override
+ public void writeTo(EsrVnfmDetail t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
+ MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
+ throws IOException, WebApplicationException {
+ String json = new Gson().toJson(t, EsrVnfmDetail.class);
+ logger.info("the param to register VNFM input is:" + json);
+ entityStream.write(json.getBytes("UTF-8"));
+ }
}
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
-
import org.onap.aai.esr.exception.ExtsysException;
@Path("/")
public interface IVimManage {
- @POST
- @Path("/{cloud_owner}_{cloud_region_id}/registry")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public void updateVIM(@PathParam("cloud_owner") String cloud_owner,
- @PathParam("cloud_region_id") String cloud_region_id, Tenant tenant) throws ExtsysException;
+ @POST
+ @Path("/{cloud_owner}_{cloud_region_id}/registry")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public void updateVIM(@PathParam("cloud_owner") String cloud_owner,
+ @PathParam("cloud_region_id") String cloud_region_id, Tenant tenant) throws ExtsysException;
}
package org.onap.aai.esr.externalservice.cloud;
import java.io.Serializable;
-
import com.google.gson.annotations.SerializedName;
public class Tenant implements Serializable {
- public static final long serialVersionUID = 1L;
+ public static final long serialVersionUID = 1L;
- @SerializedName("defaultTenant")
- private String defaultTenant;
+ @SerializedName("defaultTenant")
+ private String defaultTenant;
- public String getDefaultTenant() {
- return defaultTenant;
- }
+ public String getDefaultTenant() {
+ return defaultTenant;
+ }
- public void setDefaultTenant(String defaultTenant) {
- this.defaultTenant = defaultTenant;
- }
+ public void setDefaultTenant(String defaultTenant) {
+ this.defaultTenant = defaultTenant;
+ }
}
import org.glassfish.jersey.client.ClientConfig;
import org.onap.aai.esr.common.MsbConfig;
import org.onap.aai.esr.exception.ExtsysException;
-
import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
public class VimManagerProxy {
-
- public static void updateVim(String cloudOwner, String cloudRegionId,
- Tenant tenant) throws ExtsysException {
- ClientConfig config = new ClientConfig(new VimUpdateProvider());
- IVimManage updateVimServiceproxy = ConsumerFactory
- .createConsumer(MsbConfig.getMultiCloudAddr(), config, IVimManage.class);
- try {
- updateVimServiceproxy.updateVIM(cloudOwner, cloudRegionId, tenant);
- } catch (Exception e) {
- throw new ExtsysException("Update cloud region to A&AI by Multi-Cloud failed.", e);
+
+ public static void updateVim(String cloudOwner, String cloudRegionId, Tenant tenant) throws ExtsysException {
+ ClientConfig config = new ClientConfig(new VimUpdateProvider());
+ IVimManage updateVimServiceproxy =
+ ConsumerFactory.createConsumer(MsbConfig.getMultiCloudAddr(), config, IVimManage.class);
+ try {
+ updateVimServiceproxy.updateVIM(cloudOwner, cloudRegionId, tenant);
+ } catch (Exception e) {
+ throw new ExtsysException("Update cloud region to A&AI by Multi-Cloud failed.", e);
+ }
}
- }
}
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
-
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
-
import org.onap.aai.esr.externalservice.aai.VimRegisterProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import com.google.gson.Gson;
-public class VimUpdateProvider implements MessageBodyWriter<Tenant>{
- private static final Logger logger = LoggerFactory.getLogger(VimRegisterProvider.class);
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations,
- MediaType mediaType) {
- return Tenant.class.isAssignableFrom(type);
- }
-
- @Override
- public long getSize(Tenant t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-
- @Override
- public void writeTo(Tenant t, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException, WebApplicationException {
- String json = new Gson().toJson(t, Tenant.class);
- logger.info("the param to update VIM input is:" + json);
- entityStream.write(json.getBytes("UTF-8"));
- }
+public class VimUpdateProvider implements MessageBodyWriter<Tenant> {
+ private static final Logger logger = LoggerFactory.getLogger(VimRegisterProvider.class);
+
+ @Override
+ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+ return Tenant.class.isAssignableFrom(type);
+ }
+
+ @Override
+ public long getSize(Tenant t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
+ return -1;
+ }
+
+ @Override
+ public void writeTo(Tenant t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
+ MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
+ throws IOException, WebApplicationException {
+ String json = new Gson().toJson(t, Tenant.class);
+ logger.info("the param to update VIM input is:" + json);
+ entityStream.write(json.getBytes("UTF-8"));
+ }
}
import java.net.InetAddress;
import java.util.HashSet;
import java.util.Set;
-
import org.onap.msb.sdk.discovery.entity.MicroServiceInfo;
import org.onap.msb.sdk.httpclient.msb.MSBServiceClient;
import org.onap.msb.sdk.discovery.entity.Node;
public class MsbHelper {
- private MSBServiceClient msbClient;
+ private MSBServiceClient msbClient;
+
+ public MsbHelper(MSBServiceClient msbClient) {
+ super();
+ this.msbClient = msbClient;
+ }
- public MsbHelper(MSBServiceClient msbClient) {
- super();
- this.msbClient = msbClient;
- }
+ public void registerMsb() throws Exception {
- public void registerMsb() throws Exception {
+ MicroServiceInfo msinfo = new MicroServiceInfo();
- MicroServiceInfo msinfo = new MicroServiceInfo();
+ msinfo.setServiceName("aai-esr-server");
+ msinfo.setVersion("v1");
+ msinfo.setUrl("/api/aai-esr-server/v1");
+ msinfo.setProtocol("REST");
+ msinfo.setVisualRange("0|1");
- msinfo.setServiceName("aai-esr-server");
- msinfo.setVersion("v1");
- msinfo.setUrl("/api/aai-esr-server/v1");
- msinfo.setProtocol("REST");
- msinfo.setVisualRange("0|1");
-
- Set<Node> nodes = new HashSet<>();
- Node node1 = new Node();
- node1.setIp(InetAddress.getLocalHost().getHostAddress());
- node1.setPort("9518");
- nodes.add(node1);
- msinfo.setNodes(nodes);
- msbClient.registerMicroServiceInfo(msinfo, false);
- }
+ Set<Node> nodes = new HashSet<>();
+ Node node1 = new Node();
+ node1.setIp(InetAddress.getLocalHost().getHostAddress());
+ node1.setPort("9518");
+ nodes.add(node1);
+ msinfo.setNodes(nodes);
+ msbClient.registerMicroServiceInfo(msinfo, false);
+ }
}
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.SwaggerDefinition;
-
import org.eclipse.jetty.http.HttpStatus;
import org.onap.aai.esr.entity.rest.EmsRegisterInfo;
import org.onap.aai.esr.util.ExtsysUtil;
import org.onap.aai.esr.wrapper.EmsManagerWrapper;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
+import org.slf4j.LoggerFactory;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@Api(tags = {" ems Management "})
public class EmsManager {
- private static final Logger LOGGER = LoggerFactory.getLogger(EmsManager.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EmsManager.class);
+
+ private static ExtsysUtil extsysUtil = new ExtsysUtil();
+
+ /**
+ * query all ems.
+ */
+ @GET
+ @ApiOperation(value = "get all ems ")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response queryEmsList() {
+ LOGGER.info("start query all ems!");
+ return EmsManagerWrapper.getInstance().queryEmsList();
+ }
+
+ /**
+ * query ems info by id.
+ */
+ @Path("/{emsId}")
+ @GET
+ @ApiOperation(value = "get ems by id")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response queryemsById(@ApiParam(value = "ems id") @PathParam("emsId") String emsId) {
+ LOGGER.info("start query ems by id." + emsId);
+ return EmsManagerWrapper.getInstance().queryEmsById(emsId);
+ }
+
+ /**
+ * delete ems by id.
+ */
+ @Path("/{emsId}")
+ @DELETE
+ @ApiOperation(value = "delete a ems")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response delems(@ApiParam(value = "ems id") @PathParam("emsId") String emsId) {
+ LOGGER.info("start delete ems .id:" + emsId);
+ return EmsManagerWrapper.getInstance().delEms(emsId);
+ }
+
+ /**
+ * update ems by id.
+ */
+ @PUT
+ @Path("/{emsId}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+ @ApiOperation(value = "update a ems")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response updateEms(@ApiParam(value = "ems", required = true) EmsRegisterInfo ems,
+ @ApiParam(value = "ems id", required = true) @PathParam("emsId") String emsId) {
+ LOGGER.info("start update ems .id:" + emsId + " info:" + extsysUtil.objectToString(ems));
+ return EmsManagerWrapper.getInstance().updateEms(ems, emsId);
+ }
- private static ExtsysUtil extsysUtil = new ExtsysUtil();
-
- /**
- * query all ems.
- */
- @GET
- @ApiOperation(value = "get all ems ")
- @Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response queryEmsList() {
- LOGGER.info("start query all ems!");
- return EmsManagerWrapper.getInstance().queryEmsList();
- }
-
- /**
- * query ems info by id.
- */
- @Path("/{emsId}")
- @GET
- @ApiOperation(value = "get ems by id")
- @Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response queryemsById(@ApiParam(value = "ems id") @PathParam("emsId") String emsId) {
- LOGGER.info("start query ems by id." + emsId);
- return EmsManagerWrapper.getInstance().queryEmsById(emsId);
- }
-
- /**
- * delete ems by id.
- */
- @Path("/{emsId}")
- @DELETE
- @ApiOperation(value = "delete a ems")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response delems(@ApiParam(value = "ems id") @PathParam("emsId") String emsId) {
- LOGGER.info("start delete ems .id:" + emsId);
- return EmsManagerWrapper.getInstance().delEms(emsId);
- }
-
- /**
- * update ems by id.
- */
- @PUT
- @Path("/{emsId}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
- @ApiOperation(value = "update a ems")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response updateEms(@ApiParam(value = "ems", required = true) EmsRegisterInfo ems,
- @ApiParam(value = "ems id", required = true) @PathParam("emsId") String emsId) {
- LOGGER.info("start update ems .id:" + emsId + " info:" + extsysUtil.objectToString(ems));
- return EmsManagerWrapper.getInstance().updateEms(ems, emsId);
- }
-
- /**
- * register ems.
- */
- @POST
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
- @ApiOperation(value = "create a ems")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response registerEms(@ApiParam(value = "ems", required = true) EmsRegisterInfo ems) {
- LOGGER.info("start add ems" + " info:" + extsysUtil.objectToString(ems));
- return EmsManagerWrapper.getInstance().registerEms(ems);
- }
+ /**
+ * register ems.
+ */
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+ @ApiOperation(value = "create a ems")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response registerEms(@ApiParam(value = "ems", required = true) EmsRegisterInfo ems) {
+ LOGGER.info("start add ems" + " info:" + extsysUtil.objectToString(ems));
+ return EmsManagerWrapper.getInstance().registerEms(ems);
+ }
}
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.eclipse.jetty.http.HttpStatus;
-
import com.codahale.metrics.annotation.Timed;
-
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
@Api(tags = {" service test "})
public class ServiceTest {
- @GET
- @ApiOperation(value = " service test ")
- @Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response queryEmsList() {
- return Response.ok("hello world !").build();
- }
+ @GET
+ @ApiOperation(value = " service test ")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response queryEmsList() {
+ return Response.ok("hello world !").build();
+ }
}
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.SwaggerDefinition;
-
import org.eclipse.jetty.http.HttpStatus;
import org.onap.aai.esr.entity.rest.ThirdpartySdncRegisterInfo;
import org.onap.aai.esr.util.ExtsysUtil;
import org.onap.aai.esr.wrapper.ThirdpartySdncWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@Api(tags = {"ThirdParty sdnc Management "})
public class ThirdpartySdncManager {
- private static final Logger LOGGER = LoggerFactory.getLogger(ThirdpartySdncManager.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ThirdpartySdncManager.class);
+
+ private static ExtsysUtil extsysUtil = new ExtsysUtil();
+
+ /**
+ * query all thirdParty sdnc.
+ */
+ @GET
+ @ApiOperation(value = "get all thirdParty sdnc ")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response queryThirdpartySdncList() {
+ LOGGER.info("start query all thirdParty sdnc!");
+ return ThirdpartySdncWrapper.getInstance().queryThirdpartySdncList();
+ }
+
+ /**
+ * query thirdParty sdnc by id.
+ */
+ @Path("/{thirdPartySdncId}")
+ @GET
+ @ApiOperation(value = "get thirdParty sdnc by id")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response queryThirdpartySdncById(
+ @ApiParam(value = "thirdparty sdnc id") @PathParam("thirdPartySdncId") String thirdPartySdncId) {
+ LOGGER.info("start query thirdparty sdnc by id." + thirdPartySdncId);
+ return ThirdpartySdncWrapper.getInstance().queryThirdpartySdncById(thirdPartySdncId);
+ }
+
+ /**
+ * delete thirdparty sdnc by id.
+ */
+ @Path("/{thirdPartySdncId}")
+ @DELETE
+ @ApiOperation(value = "delete a thirdparty sdnc")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response delThirdpartySdnc(
+ @ApiParam(value = "thirdparty sdnc id") @PathParam("thirdPartySdncId") String thirdPartySdncId) {
+ LOGGER.info("start delete thirdparty sdnc .id:" + thirdPartySdncId);
+ return ThirdpartySdncWrapper.getInstance().delThirdpartySdnc(thirdPartySdncId);
+ }
+
+ /**
+ * update thirdParty sdnc by id.
+ */
+ @PUT
+ @Path("/{thirdPartySdncId}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+ @ApiOperation(value = "update a thirdParty Sdnc")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response updateThirdpartySdnc(
+ @ApiParam(value = "thirdpartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc,
+ @ApiParam(value = "sdnc id", required = true) @PathParam("thirdPartySdncId") String thirdPartySdncId) {
+ LOGGER.info("start update sdnc .id:" + thirdPartySdncId + " info:" + extsysUtil.objectToString(thirdPartySdnc));
+ return ThirdpartySdncWrapper.getInstance().updateThirdpartySdnc(thirdPartySdnc, thirdPartySdncId);
+ }
- private static ExtsysUtil extsysUtil = new ExtsysUtil();
- /**
- *query all thirdParty sdnc.
- */
- @GET
- @ApiOperation(value = "get all thirdParty sdnc ")
- @Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response queryThirdpartySdncList() {
- LOGGER.info("start query all thirdParty sdnc!");
- return ThirdpartySdncWrapper.getInstance().queryThirdpartySdncList();
- }
-
- /**
- *query thirdParty sdnc by id.
- */
- @Path("/{thirdPartySdncId}")
- @GET
- @ApiOperation(value = "get thirdParty sdnc by id")
- @Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response queryThirdpartySdncById(@ApiParam(value = "thirdparty sdnc id") @PathParam("thirdPartySdncId") String thirdPartySdncId) {
- LOGGER.info("start query thirdparty sdnc by id." + thirdPartySdncId);
- return ThirdpartySdncWrapper.getInstance().queryThirdpartySdncById(thirdPartySdncId);
- }
-
- /**
- *delete thirdparty sdnc by id.
- */
- @Path("/{thirdPartySdncId}")
- @DELETE
- @ApiOperation(value = "delete a thirdparty sdnc")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response delThirdpartySdnc(@ApiParam(value = "thirdparty sdnc id") @PathParam("thirdPartySdncId") String thirdPartySdncId) {
- LOGGER.info("start delete thirdparty sdnc .id:" + thirdPartySdncId);
- return ThirdpartySdncWrapper.getInstance().delThirdpartySdnc(thirdPartySdncId);
- }
-
- /**
- *update thirdParty sdnc by id.
- */
- @PUT
- @Path("/{thirdPartySdncId}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
- @ApiOperation(value = "update a thirdParty Sdnc")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response updateThirdpartySdnc(@ApiParam(value = "thirdpartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc,
- @ApiParam(value = "sdnc id", required = true) @PathParam("thirdPartySdncId") String thirdPartySdncId) {
- LOGGER.info("start update sdnc .id:" + thirdPartySdncId + " info:" + extsysUtil.objectToString(thirdPartySdnc));
- return ThirdpartySdncWrapper.getInstance().updateThirdpartySdnc(thirdPartySdnc, thirdPartySdncId);
- }
-
- /**
- *thirdParty sdnc register.
- */
- @POST
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
- @ApiOperation(value = "register a thirdparty sdnc")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response registerThirdpatySdnc(@ApiParam(value = "thirdPartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc) {
- LOGGER.info("start register sdnc" + " info:" + extsysUtil.objectToString(thirdPartySdnc));
- return ThirdpartySdncWrapper.getInstance().registerThirdpartySdnc(thirdPartySdnc);
- }
+ /**
+ * thirdParty sdnc register.
+ */
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+ @ApiOperation(value = "register a thirdparty sdnc")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response registerThirdpatySdnc(
+ @ApiParam(value = "thirdPartySdnc", required = true) ThirdpartySdncRegisterInfo thirdPartySdnc) {
+ LOGGER.info("start register sdnc" + " info:" + extsysUtil.objectToString(thirdPartySdnc));
+ return ThirdpartySdncWrapper.getInstance().registerThirdpartySdnc(thirdPartySdnc);
+ }
}
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.SwaggerDefinition;
-
import org.eclipse.jetty.http.HttpStatus;
import org.onap.aai.esr.entity.rest.VimRegisterInfo;
import org.onap.aai.esr.util.ExtsysUtil;
import org.onap.aai.esr.wrapper.VimManagerWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@Api(tags = {" vim Management "})
public class VimManager {
- private static final Logger LOGGER = LoggerFactory.getLogger(VimManager.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(VimManager.class);
+
+ private static ExtsysUtil extsysUtil = new ExtsysUtil();
+
+ /**
+ * query all VIM.
+ */
+ @GET
+ @ApiOperation(value = "get all vim ")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response queryVimList() {
+ return VimManagerWrapper.getInstance().queryVimListDetails();
+ }
+
+ /**
+ * query vim by id.
+ */
+ @Path("/{cloudOwner}/{cloudRegionId}")
+ @GET
+ @ApiOperation(value = "get vim by id")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response queryVimById(@PathParam("cloudOwner") String cloudOwner,
+ @PathParam("cloudRegionId") String cloudRegionId) {
+ LOGGER.info("start query vim by cloud owner and cloud region id." + cloudOwner + "," + cloudRegionId);
+ return VimManagerWrapper.getInstance().queryVimById(cloudOwner, cloudRegionId);
+ }
+
+ /**
+ * delete vim by id.
+ */
+ @Path("/{cloudOwner}/{cloudRegionId}")
+ @DELETE
+ @ApiOperation(value = "delete a vim")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response delvim(@PathParam("cloudOwner") String cloudOwner,
+ @PathParam("cloudRegionId") String cloudRegionId) {
+ LOGGER.info("start delete cloud-owner :" + cloudOwner + ", cloud-region-id: " + cloudRegionId);
+ return VimManagerWrapper.getInstance().delVim(cloudOwner, cloudRegionId);
+ }
- private static ExtsysUtil extsysUtil = new ExtsysUtil();
-
- /**
- * query all VIM.
- */
- @GET
- @ApiOperation(value = "get all vim ")
- @Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response queryVimList() {
- return VimManagerWrapper.getInstance().queryVimListDetails();
- }
+ /**
+ * update vim by id.
+ */
+ @PUT
+ @Path("/{cloudOwner}/{cloudRegionId}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(value = "update a vim")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response updatevims(@PathParam("cloudOwner") String cloudOwner,
+ @PathParam("cloudRegionId") String cloudRegionId, VimRegisterInfo vim) {
+ LOGGER.info("start update vim info:" + extsysUtil.objectToString(vim));
+ return VimManagerWrapper.getInstance().updateVim(cloudOwner, cloudRegionId, vim);
+ }
- /**
- * query vim by id.
- */
- @Path("/{cloudOwner}/{cloudRegionId}")
- @GET
- @ApiOperation(value = "get vim by id")
- @Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response queryVimById(@PathParam("cloudOwner") String cloudOwner, @PathParam("cloudRegionId") String cloudRegionId) {
- LOGGER.info("start query vim by cloud owner and cloud region id." + cloudOwner +"," + cloudRegionId);
- return VimManagerWrapper.getInstance().queryVimById(cloudOwner, cloudRegionId);
- }
-
- /**
- * delete vim by id.
- */
- @Path("/{cloudOwner}/{cloudRegionId}")
- @DELETE
- @ApiOperation(value = "delete a vim")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response delvim(@PathParam("cloudOwner") String cloudOwner,@PathParam("cloudRegionId") String cloudRegionId) {
- LOGGER.info("start delete cloud-owner :" + cloudOwner +", cloud-region-id: " + cloudRegionId);
- return VimManagerWrapper.getInstance().delVim(cloudOwner, cloudRegionId);
- }
-
- /**
- * update vim by id.
- */
- @PUT
- @Path("/{cloudOwner}/{cloudRegionId}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "update a vim")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response updatevims(@PathParam("cloudOwner") String cloudOwner, @PathParam("cloudRegionId") String cloudRegionId, VimRegisterInfo vim) {
- LOGGER.info("start update vim info:" + extsysUtil.objectToString(vim));
- return VimManagerWrapper.getInstance().updateVim(cloudOwner, cloudRegionId, vim);
- }
-
- /**
- * register vim .
- */
- @POST
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
- @ApiOperation(value = "create a vim")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response registerVims(VimRegisterInfo vim) {
- LOGGER.info("start add vim" + " info:" + extsysUtil.objectToString(vim));
- return VimManagerWrapper.getInstance().registerVim(vim);
- }
+ /**
+ * register vim .
+ */
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+ @ApiOperation(value = "create a vim")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response registerVims(VimRegisterInfo vim) {
+ LOGGER.info("start add vim" + " info:" + extsysUtil.objectToString(vim));
+ return VimManagerWrapper.getInstance().registerVim(vim);
+ }
}
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.SwaggerDefinition;
-
import org.eclipse.jetty.http.HttpStatus;
import org.onap.aai.esr.entity.rest.VnfmRegisterInfo;
import org.onap.aai.esr.util.ExtsysUtil;
import org.onap.aai.esr.wrapper.VnfmManagerWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@Api(tags = {" vnfm Management "})
public class VnfmManager {
- private static final Logger LOGGER = LoggerFactory.getLogger(VnfmManager.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(VnfmManager.class);
+
+ private static ExtsysUtil extsysUtil = new ExtsysUtil();
+
+ /**
+ * query all vnfm.
+ */
+ @GET
+ @ApiOperation(value = "get all vnfm ")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response queryVnfmList() {
+ LOGGER.info("start query all vnfm!");
+ return VnfmManagerWrapper.getInstance().queryVnfmList();
+ }
+
+ /**
+ * query vnfm by id.
+ */
+ @Path("/{vnfmId}")
+ @GET
+ @ApiOperation(value = "get vnfm by id")
+ @Produces(MediaType.APPLICATION_JSON)
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response queryVnfmById(@ApiParam(value = "vnfm id") @PathParam("vnfmId") String vnfmId) {
+ LOGGER.info("start query vnfm by id." + vnfmId);
+ return VnfmManagerWrapper.getInstance().queryVnfmById(vnfmId);
+ }
+
+ /**
+ * delete vnfm by id.
+ */
+ @Path("/{vnfmId}")
+ @DELETE
+ @ApiOperation(value = "delete a vnfm")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response delVnfm(@ApiParam(value = "vnfm id") @PathParam("vnfmId") String vnfmId) {
+ LOGGER.info("start delete vnfm .id:" + vnfmId);
+ return VnfmManagerWrapper.getInstance().delVnfm(vnfmId);
+ }
+
+ /**
+ * update vnfm by id.
+ */
+ @PUT
+ @Path("/{vnfmId}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+ @ApiOperation(value = "update a vnfm")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response updateVnfm(@ApiParam(value = "vnfm", required = true) VnfmRegisterInfo vnfm,
+ @ApiParam(value = "vnfm id", required = true) @PathParam("vnfmId") String vnfmId) {
+ LOGGER.info("start update vnfm .id:" + vnfmId + " info:" + extsysUtil.objectToString(vnfm));
+ return VnfmManagerWrapper.getInstance().updateVnfm(vnfm, vnfmId);
+ }
- private static ExtsysUtil extsysUtil = new ExtsysUtil();
-
- /**
- * query all vnfm.
- */
- @GET
- @ApiOperation(value = "get all vnfm ")
- @Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response queryVnfmList() {
- LOGGER.info("start query all vnfm!");
- return VnfmManagerWrapper.getInstance().queryVnfmList();
- }
-
- /**
- * query vnfm by id.
- */
- @Path("/{vnfmId}")
- @GET
- @ApiOperation(value = "get vnfm by id")
- @Produces(MediaType.APPLICATION_JSON)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response queryVnfmById(@ApiParam(value = "vnfm id") @PathParam("vnfmId") String vnfmId) {
- LOGGER.info("start query vnfm by id." + vnfmId);
- return VnfmManagerWrapper.getInstance().queryVnfmById(vnfmId);
- }
-
- /**
- * delete vnfm by id.
- */
- @Path("/{vnfmId}")
- @DELETE
- @ApiOperation(value = "delete a vnfm")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response delVnfm(@ApiParam(value = "vnfm id") @PathParam("vnfmId") String vnfmId) {
- LOGGER.info("start delete vnfm .id:" + vnfmId);
- return VnfmManagerWrapper.getInstance().delVnfm(vnfmId);
- }
-
- /**
- * update vnfm by id.
- */
- @PUT
- @Path("/{vnfmId}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
- @ApiOperation(value = "update a vnfm")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response updateVnfm(@ApiParam(value = "vnfm", required = true) VnfmRegisterInfo vnfm,
- @ApiParam(value = "vnfm id", required = true) @PathParam("vnfmId") String vnfmId) {
- LOGGER.info("start update vnfm .id:" + vnfmId + " info:" + extsysUtil.objectToString(vnfm));
- return VnfmManagerWrapper.getInstance().updateVnfm(vnfm, vnfmId);
- }
-
- /**
- * add vnfm .
- */
- @POST
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
- @ApiOperation(value = "create a vnfm")
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found",
- response = String.class),
- @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
- message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
- response = String.class)})
- @Timed
- public Response registerVnfm(@ApiParam(value = "vnfm", required = true) VnfmRegisterInfo vnfm) {
- return VnfmManagerWrapper.getInstance().registerVnfm(vnfm);
- }
+ /**
+ * add vnfm .
+ */
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+ @ApiOperation(value = "create a vnfm")
+ @ApiResponses(value = {
+ @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", response = String.class),
+ @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415,
+ message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
+ @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error",
+ response = String.class)})
+ @Timed
+ public Response registerVnfm(@ApiParam(value = "vnfm", required = true) VnfmRegisterInfo vnfm) {
+ return VnfmManagerWrapper.getInstance().registerVnfm(vnfm);
+ }
}
import java.util.ArrayList;
import java.util.List;
-
import org.onap.aai.esr.common.SystemType;
import org.onap.aai.esr.entity.aai.EsrSystemInfo;
import org.onap.aai.esr.entity.aai.EsrEmsDetail;
import org.onap.aai.esr.entity.rest.FtpAddr;
public class EmsManagerUtil {
- private static ExtsysUtil extsysUtil = new ExtsysUtil();
-
- public EsrEmsDetail emsRegisterInfo2EsrEms(EmsRegisterInfo emsRegisterInfo) {
- EsrEmsDetail esrEms = new EsrEmsDetail();
- esrEms.setEmsId(extsysUtil.generateId());
- List<EsrSystemInfo> authInfos = getAuthInfosFromRegisterData(emsRegisterInfo);
- esrEms.setEsrSystemInfoList(extsysUtil.getEsrSystemInfoListFromAuthInfoList(authInfos));
- return esrEms;
- }
+ private static ExtsysUtil extsysUtil = new ExtsysUtil();
+
+ public EsrEmsDetail emsRegisterInfo2EsrEms(EmsRegisterInfo emsRegisterInfo) {
+ EsrEmsDetail esrEms = new EsrEmsDetail();
+ esrEms.setEmsId(extsysUtil.generateId());
+ List<EsrSystemInfo> authInfos = getAuthInfosFromRegisterData(emsRegisterInfo);
+ esrEms.setEsrSystemInfoList(extsysUtil.getEsrSystemInfoListFromAuthInfoList(authInfos));
+ return esrEms;
+ }
+
+ private List<EsrSystemInfo> getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) {
+ List<EsrSystemInfo> authInfos = new ArrayList<>();
+ EsrSystemInfo resouceAuthInfo = getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_RESOUCE.toString());
+ EsrSystemInfo performanceAuthInfo =
+ getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_PERFORMANCE.toString());
+ EsrSystemInfo alarmAuthInfo = getAuthInfoFromAlarmAddr(emsRegisterInfo);
+ authInfos.add(resouceAuthInfo);
+ authInfos.add(performanceAuthInfo);
+ authInfos.add(alarmAuthInfo);
+ return authInfos;
+ }
+
+ private EsrSystemInfo getAuthInfoFromFtpAddr(EmsRegisterInfo emsRegisterInfo, String systemType) {
+ EsrSystemInfo authInfo = new EsrSystemInfo();
+ FtpAddr ftpAddr = new FtpAddr();
+ if (systemType.equals(SystemType.EMS_RESOUCE.toString())) {
+ ftpAddr = emsRegisterInfo.getResourceAddr();
+ } else if (systemType.equals(SystemType.EMS_PERFORMANCE.toString())) {
+ ftpAddr = emsRegisterInfo.getPerformanceAddr();
+ }
+ authInfo.setType(ftpAddr.getFtptype());
+ authInfo.setIpAddress(ftpAddr.getIp());
+ authInfo.setPort(ftpAddr.getPort());
+ authInfo.setUserName(ftpAddr.getUser());
+ authInfo.setPassword(ftpAddr.getPassword());
+ authInfo.setRemotePath(ftpAddr.getRemotepath());
+ authInfo.setPassive(ftpAddr.getPassive());
+ authInfo.setEsrSystemInfoId(extsysUtil.generateId());
+ authInfo.setSystemType(systemType);
+ authInfo.setSystemName(emsRegisterInfo.getName());
+ authInfo.setVendor(emsRegisterInfo.getVendor());
+ authInfo.setVersion(emsRegisterInfo.getVersion());
+ return authInfo;
+ }
- private List<EsrSystemInfo> getAuthInfosFromRegisterData(EmsRegisterInfo emsRegisterInfo) {
- List<EsrSystemInfo> authInfos = new ArrayList<>();
- EsrSystemInfo resouceAuthInfo = getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_RESOUCE.toString());
- EsrSystemInfo performanceAuthInfo = getAuthInfoFromFtpAddr(emsRegisterInfo, SystemType.EMS_PERFORMANCE.toString());
- EsrSystemInfo alarmAuthInfo = getAuthInfoFromAlarmAddr(emsRegisterInfo);
- authInfos.add(resouceAuthInfo);
- authInfos.add(performanceAuthInfo);
- authInfos.add(alarmAuthInfo);
- return authInfos;
- }
-
- private EsrSystemInfo getAuthInfoFromFtpAddr(EmsRegisterInfo emsRegisterInfo, String systemType) {
- EsrSystemInfo authInfo = new EsrSystemInfo();
- FtpAddr ftpAddr = new FtpAddr();
- if(systemType.equals(SystemType.EMS_RESOUCE.toString())) {
- ftpAddr = emsRegisterInfo.getResourceAddr();
- } else if(systemType.equals(SystemType.EMS_PERFORMANCE.toString())) {
- ftpAddr = emsRegisterInfo.getPerformanceAddr();
+ private EsrSystemInfo getAuthInfoFromAlarmAddr(EmsRegisterInfo emsRegisterInfo) {
+ EsrSystemInfo authInfo = new EsrSystemInfo();
+ AlarmAddr alarmAddr = emsRegisterInfo.getAlarmAddr();
+ authInfo.setEsrSystemInfoId(extsysUtil.generateId());
+ authInfo.setIpAddress(alarmAddr.getIp());
+ authInfo.setPort(alarmAddr.getPort());
+ authInfo.setUserName(alarmAddr.getUser());
+ authInfo.setPassword(alarmAddr.getPassword());
+ authInfo.setSystemType(SystemType.EMS_ALARM.toString());
+ authInfo.setSystemName(emsRegisterInfo.getName());
+ authInfo.setVendor(emsRegisterInfo.getVendor());
+ authInfo.setVersion(emsRegisterInfo.getVersion());
+ return authInfo;
}
- authInfo.setType(ftpAddr.getFtptype());
- authInfo.setIpAddress(ftpAddr.getIp());
- authInfo.setPort(ftpAddr.getPort());
- authInfo.setUserName(ftpAddr.getUser());
- authInfo.setPassword(ftpAddr.getPassword());
- authInfo.setRemotePath(ftpAddr.getRemotepath());
- authInfo.setPassive(ftpAddr.getPassive());
- authInfo.setEsrSystemInfoId(extsysUtil.generateId());
- authInfo.setSystemType(systemType);
- authInfo.setSystemName(emsRegisterInfo.getName());
- authInfo.setVendor(emsRegisterInfo.getVendor());
- authInfo.setVersion(emsRegisterInfo.getVersion());
- return authInfo;
- }
-
- private EsrSystemInfo getAuthInfoFromAlarmAddr(EmsRegisterInfo emsRegisterInfo) {
- EsrSystemInfo authInfo = new EsrSystemInfo();
- AlarmAddr alarmAddr = emsRegisterInfo.getAlarmAddr();
- authInfo.setEsrSystemInfoId(extsysUtil.generateId());
- authInfo.setIpAddress(alarmAddr.getIp());
- authInfo.setPort(alarmAddr.getPort());
- authInfo.setUserName(alarmAddr.getUser());
- authInfo.setPassword(alarmAddr.getPassword());
- authInfo.setSystemType(SystemType.EMS_ALARM.toString());
- authInfo.setSystemName(emsRegisterInfo.getName());
- authInfo.setVendor(emsRegisterInfo.getVendor());
- authInfo.setVersion(emsRegisterInfo.getVersion());
- return authInfo;
- }
-
- public EmsRegisterInfo EsrEms2EmsRegisterInfo(EsrEmsDetail esrEms) {
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- EsrSystemInfo authInfo = new EsrSystemInfo();
- List<EsrSystemInfo> esrSystemInfo = esrEms.getEsrSystemInfoList().getEsrSystemInfo();
- emsRegisterInfo.setEmsId(esrEms.getEmsId());
-
- 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);
- emsRegisterInfo.setResourceAddr(resourceAddr);
- } else if(authInfo.getSystemType().equals(SystemType.EMS_PERFORMANCE.toString())) {
- FtpAddr performanceAddr = new FtpAddr();
- performanceAddr = getFtpAddrFromAuthInfo(authInfo);
- emsRegisterInfo.setPerformanceAddr(performanceAddr);
- } else if(authInfo.getSystemType().equals(SystemType.EMS_ALARM.toString())) {
+
+ public EmsRegisterInfo EsrEms2EmsRegisterInfo(EsrEmsDetail esrEms) {
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ EsrSystemInfo authInfo = new EsrSystemInfo();
+ List<EsrSystemInfo> esrSystemInfo = esrEms.getEsrSystemInfoList().getEsrSystemInfo();
+ emsRegisterInfo.setEmsId(esrEms.getEmsId());
+
+ 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);
+ emsRegisterInfo.setResourceAddr(resourceAddr);
+ } else if (authInfo.getSystemType().equals(SystemType.EMS_PERFORMANCE.toString())) {
+ FtpAddr performanceAddr = new FtpAddr();
+ performanceAddr = getFtpAddrFromAuthInfo(authInfo);
+ emsRegisterInfo.setPerformanceAddr(performanceAddr);
+ } else if (authInfo.getSystemType().equals(SystemType.EMS_ALARM.toString())) {
+ AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr = getAlarmAddrFromAuthInfo(authInfo);
+ emsRegisterInfo.setAlarmAddr(alarmAddr);
+ }
+ }
+ emsRegisterInfo.setName(authInfo.getSystemName());
+ emsRegisterInfo.setVendor(authInfo.getVendor());
+ emsRegisterInfo.setVersion(authInfo.getVersion());
+ return emsRegisterInfo;
+ }
+
+ private FtpAddr getFtpAddrFromAuthInfo(EsrSystemInfo authInfo) {
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setFtptype(authInfo.getType());
+ ftpAddr.setIp(authInfo.getIpAddress());
+ ftpAddr.setPassive(authInfo.getPassive());
+ ftpAddr.setPassword(authInfo.getPassword());
+ ftpAddr.setPort(authInfo.getPort());
+ ftpAddr.setRemotepath(authInfo.getRemotePath());
+ ftpAddr.setUser(authInfo.getUserName());
+ return ftpAddr;
+ }
+
+ private AlarmAddr getAlarmAddrFromAuthInfo(EsrSystemInfo authInfo) {
AlarmAddr alarmAddr = new AlarmAddr();
- alarmAddr = getAlarmAddrFromAuthInfo(authInfo);
- emsRegisterInfo.setAlarmAddr(alarmAddr);
- }
+ alarmAddr.setIp(authInfo.getIpAddress());
+ alarmAddr.setPassword(authInfo.getPassword());
+ alarmAddr.setPort(authInfo.getPort());
+ alarmAddr.setUser(authInfo.getUserName());
+ return alarmAddr;
}
- emsRegisterInfo.setName(authInfo.getSystemName());
- emsRegisterInfo.setVendor(authInfo.getVendor());
- emsRegisterInfo.setVersion(authInfo.getVersion());
- return emsRegisterInfo;
- }
-
- private FtpAddr getFtpAddrFromAuthInfo(EsrSystemInfo authInfo) {
- FtpAddr ftpAddr = new FtpAddr();
- ftpAddr.setFtptype(authInfo.getType());
- ftpAddr.setIp(authInfo.getIpAddress());
- ftpAddr.setPassive(authInfo.getPassive());
- ftpAddr.setPassword(authInfo.getPassword());
- ftpAddr.setPort(authInfo.getPort());
- ftpAddr.setRemotepath(authInfo.getRemotePath());
- ftpAddr.setUser(authInfo.getUserName());
- return ftpAddr;
- }
-
- private AlarmAddr getAlarmAddrFromAuthInfo(EsrSystemInfo authInfo) {
- AlarmAddr alarmAddr = new AlarmAddr();
- alarmAddr.setIp(authInfo.getIpAddress());
- alarmAddr.setPassword(authInfo.getPassword());
- alarmAddr.setPort(authInfo.getPort());
- alarmAddr.setUser(authInfo.getUserName());
- return alarmAddr;
- }
}
package org.onap.aai.esr.util;
import com.google.gson.Gson;
-
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class ExtsysUtil {
- public String generateId() {
- return UUID.randomUUID().toString();
- }
+ public String generateId() {
+ return UUID.randomUUID().toString();
+ }
- /**
- * change object to str.
- */
- public String objectToString(Object obj) {
- Gson gson = new Gson();
- if (obj != null) {
- return gson.toJson(obj);
- } else {
- return null;
+ /**
+ * change object to str.
+ */
+ public String objectToString(Object obj) {
+ Gson gson = new Gson();
+ if (obj != null) {
+ return gson.toJson(obj);
+ } else {
+ return null;
+ }
}
- }
- public EsrSystemInfoList getEsrSystemInfoListFromAuthInfo(EsrSystemInfo esrSystemInfoObj) {
- EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
- esrSystemInfo.add(esrSystemInfoObj);
- esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
- return esrSystemInfoList;
- }
-
- public EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(List<EsrSystemInfo> esrSystemInfo) {
- EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);;
- return esrSystemInfoList;
- }
+ public EsrSystemInfoList getEsrSystemInfoListFromAuthInfo(EsrSystemInfo esrSystemInfoObj) {
+ EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+ List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
+ esrSystemInfo.add(esrSystemInfoObj);
+ esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
+ return esrSystemInfoList;
+ }
+
+ public EsrSystemInfoList getEsrSystemInfoListFromAuthInfoList(List<EsrSystemInfo> esrSystemInfo) {
+ EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+ esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);;
+ return esrSystemInfoList;
+ }
}
import java.util.ArrayList;
import java.util.List;
-
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.rest.ThirdpartySdncRegisterInfo;
public class ThirdpartySdncManagerUtil {
- private static ExtsysUtil extsysUtil = new ExtsysUtil();
-
- public EsrThirdpartySdncDetail sdncRegisterInfo2EsrSdnc(ThirdpartySdncRegisterInfo sdncRegisterInfo) {
- EsrThirdpartySdncDetail esrThirdpartySdnc = new EsrThirdpartySdncDetail();
- 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();
- List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
- EsrSystemInfo authInfo = new EsrSystemInfo();
- authInfo.setEsrSystemInfoId(extsysUtil.generateId());
- authInfo.setVersion(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;
- }
+ private static ExtsysUtil extsysUtil = new ExtsysUtil();
+
+ public EsrThirdpartySdncDetail sdncRegisterInfo2EsrSdnc(ThirdpartySdncRegisterInfo sdncRegisterInfo) {
+ EsrThirdpartySdncDetail esrThirdpartySdnc = new EsrThirdpartySdncDetail();
+ 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();
+ List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
+ EsrSystemInfo authInfo = new EsrSystemInfo();
+ authInfo.setEsrSystemInfoId(extsysUtil.generateId());
+ authInfo.setVersion(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(EsrThirdpartySdncDetail 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;
- }
+ public ThirdpartySdncRegisterInfo esrSdnc2SdncRegisterInfo(EsrThirdpartySdncDetail 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;
+ }
}
import java.util.ArrayList;
import java.util.List;
-
import org.onap.aai.esr.common.SystemType;
import org.onap.aai.esr.entity.aai.EsrSystemInfo;
import org.onap.aai.esr.entity.aai.CloudRegionDetail;
import org.onap.aai.esr.entity.rest.VimRegisterInfo;
public class VimManagerUtil {
- private static ExtsysUtil extsysUtil = new ExtsysUtil();
-
- public CloudRegionDetail vimRegisterInfo2CloudRegion(VimRegisterInfo vimRegisterInfo) {
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
-
- cloudRegion.setCloudOwner(vimRegisterInfo.getCloudOwner());
- cloudRegion.setCloudRegionId(vimRegisterInfo.getCloudRegionId());
- cloudRegion.setCloudType(vimRegisterInfo.getCloudType());
- cloudRegion.setCloudRegionVersion(vimRegisterInfo.getCloudRegionVersion());
- cloudRegion.setCloudZone(vimRegisterInfo.getCloudZone());
- cloudRegion.setComplexName(vimRegisterInfo.getComplexName());
- cloudRegion.setOwnerDefinedType(vimRegisterInfo.getOwnerDefinedType());
- cloudRegion.setCloudExtraInfo(vimRegisterInfo.getCloudExtraInfo());
-
- EsrSystemInfo esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfos());
- esrSystemInfoObj.setSystemStatus(vimRegisterInfo.getStatus());
- EsrSystemInfoList esrSystemInfoList = extsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj);
- cloudRegion.setEsrSystemInfoList(esrSystemInfoList);
- return cloudRegion;
- }
+ private static ExtsysUtil extsysUtil = new ExtsysUtil();
+
+ public CloudRegionDetail vimRegisterInfo2CloudRegion(VimRegisterInfo vimRegisterInfo) {
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+
+ cloudRegion.setCloudOwner(vimRegisterInfo.getCloudOwner());
+ cloudRegion.setCloudRegionId(vimRegisterInfo.getCloudRegionId());
+ cloudRegion.setCloudType(vimRegisterInfo.getCloudType());
+ cloudRegion.setCloudRegionVersion(vimRegisterInfo.getCloudRegionVersion());
+ cloudRegion.setCloudZone(vimRegisterInfo.getCloudZone());
+ cloudRegion.setComplexName(vimRegisterInfo.getComplexName());
+ cloudRegion.setOwnerDefinedType(vimRegisterInfo.getOwnerDefinedType());
+ cloudRegion.setCloudExtraInfo(vimRegisterInfo.getCloudExtraInfo());
+
+ EsrSystemInfo esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfos());
+ esrSystemInfoObj.setSystemStatus(vimRegisterInfo.getStatus());
+ EsrSystemInfoList esrSystemInfoList = extsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj);
+ cloudRegion.setEsrSystemInfoList(esrSystemInfoList);
+ return cloudRegion;
+ }
+
+ private EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(List<VimAuthInfo> vimAuthInfos) {
+ EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
+ VimAuthInfo vimAuthInfo = vimAuthInfos.get(0);
+ 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.setDefaultTenant(vimAuthInfo.getDefaultTenant());
+ esrSystemInfoObj.setEsrSystemInfoId(extsysUtil.generateId());
+ esrSystemInfoObj.setSystemType(SystemType.VIM.toString());
+ // esrSystemInfoObj.setSystemStatus(SystemStatus.normal.toString());
+ return esrSystemInfoObj;
+ }
+
+ private VimAuthInfo authInfo2VimAuthInfo(EsrSystemInfo authInfo) {
+ VimAuthInfo vimAuthInfo = new VimAuthInfo();
+ vimAuthInfo.setAuthUrl(authInfo.getServiceUrl());
+ vimAuthInfo.setCloudDomain(authInfo.getCloudDomain());
+ vimAuthInfo.setPassword(authInfo.getPassword());
+ vimAuthInfo.setSslCacert(authInfo.getSslCassert());
+ vimAuthInfo.setSslInsecure(authInfo.getSslInsecure());
+ vimAuthInfo.setUserName(authInfo.getUserName());
+ vimAuthInfo.setDefaultTenant(authInfo.getDefaultTenant());
+ return vimAuthInfo;
+ }
- private EsrSystemInfo vimAuthInfo2EsrSystemInfoObj(List<VimAuthInfo> vimAuthInfos) {
- EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
- VimAuthInfo vimAuthInfo = vimAuthInfos.get(0);
- 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.setDefaultTenant(vimAuthInfo.getDefaultTenant());
- esrSystemInfoObj.setEsrSystemInfoId(extsysUtil.generateId());
- esrSystemInfoObj.setSystemType(SystemType.VIM.toString());
-// esrSystemInfoObj.setSystemStatus(SystemStatus.normal.toString());
- return esrSystemInfoObj;
- }
-
- private VimAuthInfo authInfo2VimAuthInfo(EsrSystemInfo authInfo) {
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- vimAuthInfo.setAuthUrl(authInfo.getServiceUrl());
- vimAuthInfo.setCloudDomain(authInfo.getCloudDomain());
- vimAuthInfo.setPassword(authInfo.getPassword());
- vimAuthInfo.setSslCacert(authInfo.getSslCassert());
- vimAuthInfo.setSslInsecure(authInfo.getSslInsecure());
- vimAuthInfo.setUserName(authInfo.getUserName());
- vimAuthInfo.setDefaultTenant(authInfo.getDefaultTenant());
- return vimAuthInfo;
- }
-
- public VimRegisterInfo cloudRegion2VimRegisterInfo(CloudRegionDetail cloudRegion) {
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- List<VimAuthInfo> vimAuthInfos = new ArrayList<>();
- if(cloudRegion.getEsrSystemInfoList()!=null){
- VimAuthInfo vimAuthInfo = authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0));
- vimAuthInfos.add(vimAuthInfo);
- vimRegisterInfo.setStatus(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getSystemStatus());
+ public VimRegisterInfo cloudRegion2VimRegisterInfo(CloudRegionDetail cloudRegion) {
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ List<VimAuthInfo> vimAuthInfos = new ArrayList<>();
+ if (cloudRegion.getEsrSystemInfoList() != null) {
+ VimAuthInfo vimAuthInfo =
+ authInfo2VimAuthInfo(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0));
+ vimAuthInfos.add(vimAuthInfo);
+ vimRegisterInfo.setStatus(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getSystemStatus());
+ }
+ vimRegisterInfo.setVimAuthInfos(vimAuthInfos);
+ vimRegisterInfo.setCloudExtraInfo(cloudRegion.getCloudExtraInfo());
+ vimRegisterInfo.setCloudOwner(cloudRegion.getCloudOwner());
+ vimRegisterInfo.setCloudRegionId(cloudRegion.getCloudRegionId());
+ vimRegisterInfo.setCloudType(cloudRegion.getCloudType());
+ vimRegisterInfo.setCloudZone(cloudRegion.getCloudZone());
+ vimRegisterInfo.setComplexName(cloudRegion.getComplexName());
+ vimRegisterInfo.setCloudRegionVersion(cloudRegion.getCloudRegionVersion());
+ vimRegisterInfo.setOwnerDefinedType(cloudRegion.getOwnerDefinedType());
+ return vimRegisterInfo;
}
- vimRegisterInfo.setVimAuthInfos(vimAuthInfos);
- vimRegisterInfo.setCloudExtraInfo(cloudRegion.getCloudExtraInfo());
- vimRegisterInfo.setCloudOwner(cloudRegion.getCloudOwner());
- vimRegisterInfo.setCloudRegionId(cloudRegion.getCloudRegionId());
- vimRegisterInfo.setCloudType(cloudRegion.getCloudType());
- vimRegisterInfo.setCloudZone(cloudRegion.getCloudZone());
- vimRegisterInfo.setComplexName(cloudRegion.getComplexName());
- vimRegisterInfo.setCloudRegionVersion(cloudRegion.getCloudRegionVersion());
- vimRegisterInfo.setOwnerDefinedType(cloudRegion.getOwnerDefinedType());
- return vimRegisterInfo;
- }
}
import org.onap.aai.esr.entity.rest.VnfmRegisterInfo;
public class VnfmManagerUtil {
- private static ExtsysUtil extsysUtil = new ExtsysUtil();
-
- public EsrVnfmDetail vnfmRegisterInfo2EsrVnfm(VnfmRegisterInfo vnfmRegisterInfo) {
- EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
- EsrSystemInfoList esrSystemInfo = new EsrSystemInfoList();
- EsrSystemInfo authInfo = new EsrSystemInfo();
- esrVnfm.setCertificateUrl(vnfmRegisterInfo.getCertificateUrl());
- esrVnfm.setVimId(vnfmRegisterInfo.getVimId());
- esrVnfm.setVnfmId(extsysUtil.generateId());
- authInfo = getAuthInfoFromVnfmRegisterInfo(vnfmRegisterInfo);
- esrSystemInfo = extsysUtil.getEsrSystemInfoListFromAuthInfo(authInfo);
- esrVnfm.setEsrSystemInfoList(esrSystemInfo);
- return esrVnfm;
- }
+ private static ExtsysUtil extsysUtil = new ExtsysUtil();
- /**
- * @param vnfmRegisterInfo vnfm register informantion from portal
- * @return
- */
- private EsrSystemInfo getAuthInfoFromVnfmRegisterInfo(VnfmRegisterInfo vnfmRegisterInfo) {
- EsrSystemInfo authInfo = new EsrSystemInfo();
- authInfo.setEsrSystemInfoId(extsysUtil.generateId());
- authInfo.setSystemName(vnfmRegisterInfo.getName());
- authInfo.setType(vnfmRegisterInfo.getType());
- authInfo.setVendor(vnfmRegisterInfo.getVendor());
- authInfo.setVersion(vnfmRegisterInfo.getVersion());
- authInfo.setServiceUrl(vnfmRegisterInfo.getUrl());
- authInfo.setUserName(vnfmRegisterInfo.getUserName());
- authInfo.setPassword(vnfmRegisterInfo.getPassword());
- authInfo.setSystemType(SystemType.VNFM.toString());
- return authInfo;
- }
-
- public VnfmRegisterInfo esrVnfm2VnfmRegisterInfo(EsrVnfmDetail esrVnfm) {
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- EsrSystemInfo authInfo = new EsrSystemInfo();
- vnfmRegisterInfo.setVnfmId(esrVnfm.getVnfmId());
- vnfmRegisterInfo.setCertificateUrl(esrVnfm.getCertificateUrl());
- vnfmRegisterInfo.setVimId(esrVnfm.getVimId());
- authInfo = esrVnfm.getEsrSystemInfoList().getEsrSystemInfo().get(0);
- vnfmRegisterInfo.setName(authInfo.getSystemName());
- vnfmRegisterInfo.setPassword(authInfo.getPassword());
- vnfmRegisterInfo.setType(authInfo.getType());
- vnfmRegisterInfo.setUrl(authInfo.getServiceUrl());
- vnfmRegisterInfo.setUserName(authInfo.getUserName());
- vnfmRegisterInfo.setVendor(authInfo.getVendor());
- vnfmRegisterInfo.setVersion(authInfo.getVersion());
- return vnfmRegisterInfo;
- }
+ public EsrVnfmDetail vnfmRegisterInfo2EsrVnfm(VnfmRegisterInfo vnfmRegisterInfo) {
+ EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
+ EsrSystemInfoList esrSystemInfo = new EsrSystemInfoList();
+ EsrSystemInfo authInfo = new EsrSystemInfo();
+ esrVnfm.setCertificateUrl(vnfmRegisterInfo.getCertificateUrl());
+ esrVnfm.setVimId(vnfmRegisterInfo.getVimId());
+ esrVnfm.setVnfmId(extsysUtil.generateId());
+ authInfo = getAuthInfoFromVnfmRegisterInfo(vnfmRegisterInfo);
+ esrSystemInfo = extsysUtil.getEsrSystemInfoListFromAuthInfo(authInfo);
+ esrVnfm.setEsrSystemInfoList(esrSystemInfo);
+ return esrVnfm;
+ }
+
+ /**
+ * @param vnfmRegisterInfo vnfm register informantion from portal
+ * @return
+ */
+ private EsrSystemInfo getAuthInfoFromVnfmRegisterInfo(VnfmRegisterInfo vnfmRegisterInfo) {
+ EsrSystemInfo authInfo = new EsrSystemInfo();
+ authInfo.setEsrSystemInfoId(extsysUtil.generateId());
+ authInfo.setSystemName(vnfmRegisterInfo.getName());
+ authInfo.setType(vnfmRegisterInfo.getType());
+ authInfo.setVendor(vnfmRegisterInfo.getVendor());
+ authInfo.setVersion(vnfmRegisterInfo.getVersion());
+ authInfo.setServiceUrl(vnfmRegisterInfo.getUrl());
+ authInfo.setUserName(vnfmRegisterInfo.getUserName());
+ authInfo.setPassword(vnfmRegisterInfo.getPassword());
+ authInfo.setSystemType(SystemType.VNFM.toString());
+ return authInfo;
+ }
+
+ public VnfmRegisterInfo esrVnfm2VnfmRegisterInfo(EsrVnfmDetail esrVnfm) {
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ EsrSystemInfo authInfo = new EsrSystemInfo();
+ vnfmRegisterInfo.setVnfmId(esrVnfm.getVnfmId());
+ vnfmRegisterInfo.setCertificateUrl(esrVnfm.getCertificateUrl());
+ vnfmRegisterInfo.setVimId(esrVnfm.getVimId());
+ authInfo = esrVnfm.getEsrSystemInfoList().getEsrSystemInfo().get(0);
+ vnfmRegisterInfo.setName(authInfo.getSystemName());
+ vnfmRegisterInfo.setPassword(authInfo.getPassword());
+ vnfmRegisterInfo.setType(authInfo.getType());
+ vnfmRegisterInfo.setUrl(authInfo.getServiceUrl());
+ vnfmRegisterInfo.setUserName(authInfo.getUserName());
+ vnfmRegisterInfo.setVendor(authInfo.getVendor());
+ vnfmRegisterInfo.setVersion(authInfo.getVersion());
+ return vnfmRegisterInfo;
+ }
}
import java.util.ArrayList;
import java.util.List;
-
import javax.ws.rs.core.Response;
-
import org.onap.aai.esr.entity.rest.EmsRegisterInfo;
import org.onap.aai.esr.exception.ExceptionUtil;
import org.onap.aai.esr.exception.ExtsysException;
import org.onap.aai.esr.entity.rest.CommonRegisterResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import com.google.gson.Gson;
public class EmsManagerWrapper {
- private static EmsManagerWrapper emsManagerWrapper;
- private static final Logger LOG = LoggerFactory.getLogger(EmsManagerWrapper.class);
- private static EmsManagerUtil emsManagerUtil = new EmsManagerUtil();
+ private static EmsManagerWrapper emsManagerWrapper;
+ private static final Logger LOG = LoggerFactory.getLogger(EmsManagerWrapper.class);
+ private static EmsManagerUtil emsManagerUtil = new EmsManagerUtil();
- /**
- * get VnfmManagerWrapper instance.
- * @return ems manager wrapper instance
- */
- public static EmsManagerWrapper getInstance() {
- if (emsManagerWrapper == null) {
- emsManagerWrapper = new EmsManagerWrapper();
+ /**
+ * get VnfmManagerWrapper instance.
+ *
+ * @return ems manager wrapper instance
+ */
+ public static EmsManagerWrapper getInstance() {
+ if (emsManagerWrapper == null) {
+ emsManagerWrapper = new EmsManagerWrapper();
+ }
+ return emsManagerWrapper;
}
- return emsManagerWrapper;
- }
-
- public Response registerEms(EmsRegisterInfo emsRegisterInfo) {
- CommonRegisterResponse result = new CommonRegisterResponse();
- EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- esrEmsDetail = emsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
- String emsId = esrEmsDetail.getEmsId();
- try {
- ExternalSystemProxy.registerEms(emsId, esrEmsDetail);
- result.setId(emsId);
- return Response.ok(result).build();
- } catch (ExtsysException e) {
- LOG.error("Register EMS failed !", e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ public Response registerEms(EmsRegisterInfo emsRegisterInfo) {
+ CommonRegisterResponse result = new CommonRegisterResponse();
+ EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
+ esrEmsDetail = emsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
+ String emsId = esrEmsDetail.getEmsId();
+ try {
+ ExternalSystemProxy.registerEms(emsId, esrEmsDetail);
+ result.setId(emsId);
+ return Response.ok(result).build();
+ } catch (ExtsysException e) {
+ LOG.error("Register EMS failed !", e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
- public Response updateEms(EmsRegisterInfo emsRegisterInfo, String emsId) {
- CommonRegisterResponse result = new CommonRegisterResponse();
- EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- esrEmsDetail = getNewEsrEmsDetail(emsRegisterInfo, emsId);
- try {
- ExternalSystemProxy.registerEms(emsId, esrEmsDetail);
- result.setId(emsId);
- return Response.ok(result).build();
- } catch (ExtsysException e) {
- LOG.error("Update VNFM failed !", e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ public Response updateEms(EmsRegisterInfo emsRegisterInfo, String emsId) {
+ CommonRegisterResponse result = new CommonRegisterResponse();
+ EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
+ esrEmsDetail = getNewEsrEmsDetail(emsRegisterInfo, emsId);
+ try {
+ ExternalSystemProxy.registerEms(emsId, esrEmsDetail);
+ result.setId(emsId);
+ return Response.ok(result).build();
+ } catch (ExtsysException e) {
+ LOG.error("Update VNFM failed !", e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
-
- public Response queryEmsList() {
- List<EmsRegisterInfo> emsList = new ArrayList<>();
- EsrEmsList esrEms = new EsrEmsList();
- try {
- String esrEmsStr = ExternalSystemProxy.queryEmsList();
- esrEms = new Gson().fromJson(esrEmsStr, EsrEmsList.class);
- LOG.info("Response from AAI by query EMS list: " + esrEms);
- emsList = getEmsDetailList(esrEms);
- return Response.ok(emsList).build();
- } catch (ExtsysException e) {
- LOG.error("Query EMS list failed !", e);
- return Response.ok(emsList).build();
+
+ public Response queryEmsList() {
+ List<EmsRegisterInfo> emsList = new ArrayList<>();
+ EsrEmsList esrEms = new EsrEmsList();
+ try {
+ String esrEmsStr = ExternalSystemProxy.queryEmsList();
+ esrEms = new Gson().fromJson(esrEmsStr, EsrEmsList.class);
+ LOG.info("Response from AAI by query EMS list: " + esrEms);
+ emsList = getEmsDetailList(esrEms);
+ return Response.ok(emsList).build();
+ } catch (ExtsysException e) {
+ LOG.error("Query EMS list failed !", e);
+ return Response.ok(emsList).build();
+ }
}
- }
-
- public Response queryEmsById(String emsId) {
- EmsRegisterInfo ems;
- ems = queryEmsDetail(emsId);
- if (ems != null) {
- return Response.ok(ems).build();
- } else {
- return Response.ok(ems).build();
+
+ public Response queryEmsById(String emsId) {
+ EmsRegisterInfo ems;
+ ems = queryEmsDetail(emsId);
+ if (ems != null) {
+ return Response.ok(ems).build();
+ } else {
+ return Response.ok(ems).build();
+ }
}
- }
-
- public Response delEms(String emsId) {
- EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- esrEmsDetail = queryEsrEmsDetail(emsId);
- String resourceVersion = esrEmsDetail.getResourceVersion();
- try {
- ExternalSystemProxy.deleteEms(emsId, resourceVersion);
- return Response.noContent().build();
- } catch (ExtsysException e) {
- LOG.error(
- "Delete EMS from A&AI failed! EMS ID: " + emsId + "resouce-version:" + resourceVersion,
- e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ public Response delEms(String emsId) {
+ EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
+ esrEmsDetail = queryEsrEmsDetail(emsId);
+ String resourceVersion = esrEmsDetail.getResourceVersion();
+ try {
+ ExternalSystemProxy.deleteEms(emsId, resourceVersion);
+ return Response.noContent().build();
+ } catch (ExtsysException e) {
+ LOG.error("Delete EMS from A&AI failed! EMS ID: " + emsId + "resouce-version:" + resourceVersion, e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
- private EmsRegisterInfo queryEmsDetail(String emsId) {
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- try {
- String esrEmsStr = ExternalSystemProxy.queryEmsDetail(emsId);
- LOG.info("Response from AAI by query EMS: " + esrEmsStr);
- esrEmsDetail = new Gson().fromJson(esrEmsStr, EsrEmsDetail.class);
- emsRegisterInfo = emsManagerUtil.EsrEms2EmsRegisterInfo(esrEmsDetail);
- } catch (ExtsysException e) {
- LOG.error("Query EMS detail failed! EMS ID: " + emsId, e);
+ private EmsRegisterInfo queryEmsDetail(String emsId) {
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
+ try {
+ String esrEmsStr = ExternalSystemProxy.queryEmsDetail(emsId);
+ LOG.info("Response from AAI by query EMS: " + esrEmsStr);
+ esrEmsDetail = new Gson().fromJson(esrEmsStr, EsrEmsDetail.class);
+ emsRegisterInfo = emsManagerUtil.EsrEms2EmsRegisterInfo(esrEmsDetail);
+ } catch (ExtsysException e) {
+ LOG.error("Query EMS detail failed! EMS ID: " + emsId, e);
+ }
+ return emsRegisterInfo;
}
- return emsRegisterInfo;
- }
-
- private List<EmsRegisterInfo> getEmsDetailList(EsrEmsList esrEms) {
- List<EmsRegisterInfo> emsInfoList = new ArrayList<>();
- EmsRegisterInfo emsInfo = new EmsRegisterInfo();
- for (int i = 0; i < esrEms.getEsrEms().size(); i++) {
- String emsId = esrEms.getEsrEms().get(i).getEmsId();
- emsInfo = queryEmsDetail(emsId);
- if (emsInfo != null) {
- emsInfoList.add(emsInfo);
- }
+
+ private List<EmsRegisterInfo> getEmsDetailList(EsrEmsList esrEms) {
+ List<EmsRegisterInfo> emsInfoList = new ArrayList<>();
+ EmsRegisterInfo emsInfo = new EmsRegisterInfo();
+ for (int i = 0; i < esrEms.getEsrEms().size(); i++) {
+ String emsId = esrEms.getEsrEms().get(i).getEmsId();
+ emsInfo = queryEmsDetail(emsId);
+ if (emsInfo != null) {
+ emsInfoList.add(emsInfo);
+ }
+ }
+ return emsInfoList;
}
- return emsInfoList;
- }
-
- private EsrEmsDetail queryEsrEmsDetail (String emsId) {
- EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- try {
- String esrEmsStr = ExternalSystemProxy.queryEmsDetail(emsId);
- LOG.info("Response from AAI by query EMS: " + esrEmsStr);
- esrEmsDetail = new Gson().fromJson(esrEmsStr, EsrEmsDetail.class);
- } catch (ExtsysException e) {
- LOG.error("Query EMS detail failed! EMS ID: " + emsId, e);
+
+ private EsrEmsDetail queryEsrEmsDetail(String emsId) {
+ EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
+ try {
+ String esrEmsStr = ExternalSystemProxy.queryEmsDetail(emsId);
+ LOG.info("Response from AAI by query EMS: " + esrEmsStr);
+ esrEmsDetail = new Gson().fromJson(esrEmsStr, EsrEmsDetail.class);
+ } catch (ExtsysException e) {
+ LOG.error("Query EMS detail failed! EMS ID: " + emsId, e);
+ }
+ return esrEmsDetail;
}
- return esrEmsDetail;
- }
-
- private EsrEmsDetail getNewEsrEmsDetail(EmsRegisterInfo emsRegisterInfo, String emsId) {
- EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- List<EsrSystemInfo> newEsrSysInfoList = new ArrayList<>();
- EsrSystemInfo newEsrSystemInfo = new EsrSystemInfo();
- EsrEmsDetail oriEsrEmsDetail = new EsrEmsDetail();
- List<EsrSystemInfo> oriEsrSysInfoList = new ArrayList<>();
- EsrSystemInfo originalEsrSystemInfo = new EsrSystemInfo();
-
- oriEsrEmsDetail = queryEsrEmsDetail(emsId);
- esrEmsDetail = emsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
- String emsResourceVersion = oriEsrEmsDetail.getResourceVersion();
- esrEmsDetail.setResourceVersion(emsResourceVersion);
- esrEmsDetail.setEmsId(emsId);
- newEsrSysInfoList = esrEmsDetail.getEsrSystemInfoList().getEsrSystemInfo();
- oriEsrSysInfoList = oriEsrEmsDetail.getEsrSystemInfoList().getEsrSystemInfo();
- for (int i = 0; i < oriEsrSysInfoList.size(); i++) {
- originalEsrSystemInfo = oriEsrSysInfoList.get(i);
- for (int j = 0; j < newEsrSysInfoList.size(); j++) {
- newEsrSystemInfo = newEsrSysInfoList.get(j);
- if (originalEsrSystemInfo.getSystemType().equals(newEsrSystemInfo.getSystemType())) {
- esrEmsDetail.getEsrSystemInfoList().getEsrSystemInfo().get(j)
- .setResouceVersion(originalEsrSystemInfo.getResouceVersion());
- esrEmsDetail.getEsrSystemInfoList().getEsrSystemInfo().get(j)
- .setEsrSystemInfoId(originalEsrSystemInfo.getEsrSystemInfoId());
- break;
+
+ private EsrEmsDetail getNewEsrEmsDetail(EmsRegisterInfo emsRegisterInfo, String emsId) {
+ EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
+ List<EsrSystemInfo> newEsrSysInfoList = new ArrayList<>();
+ EsrSystemInfo newEsrSystemInfo = new EsrSystemInfo();
+ EsrEmsDetail oriEsrEmsDetail = new EsrEmsDetail();
+ List<EsrSystemInfo> oriEsrSysInfoList = new ArrayList<>();
+ EsrSystemInfo originalEsrSystemInfo = new EsrSystemInfo();
+
+ oriEsrEmsDetail = queryEsrEmsDetail(emsId);
+ esrEmsDetail = emsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
+ String emsResourceVersion = oriEsrEmsDetail.getResourceVersion();
+ esrEmsDetail.setResourceVersion(emsResourceVersion);
+ esrEmsDetail.setEmsId(emsId);
+ newEsrSysInfoList = esrEmsDetail.getEsrSystemInfoList().getEsrSystemInfo();
+ oriEsrSysInfoList = oriEsrEmsDetail.getEsrSystemInfoList().getEsrSystemInfo();
+ for (int i = 0; i < oriEsrSysInfoList.size(); i++) {
+ originalEsrSystemInfo = oriEsrSysInfoList.get(i);
+ for (int j = 0; j < newEsrSysInfoList.size(); j++) {
+ newEsrSystemInfo = newEsrSysInfoList.get(j);
+ if (originalEsrSystemInfo.getSystemType().equals(newEsrSystemInfo.getSystemType())) {
+ esrEmsDetail.getEsrSystemInfoList().getEsrSystemInfo().get(j)
+ .setResouceVersion(originalEsrSystemInfo.getResouceVersion());
+ esrEmsDetail.getEsrSystemInfoList().getEsrSystemInfo().get(j)
+ .setEsrSystemInfoId(originalEsrSystemInfo.getEsrSystemInfoId());
+ break;
+ }
+ }
}
- }
+ return esrEmsDetail;
}
- return esrEmsDetail;
- }
}
import java.util.ArrayList;
import java.util.List;
-
import javax.ws.rs.core.Response;
-
import org.onap.aai.esr.entity.aai.EsrSystemInfo;
import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail;
import org.onap.aai.esr.entity.aai.EsrThirdpartySdncList;
import org.onap.aai.esr.util.ThirdpartySdncManagerUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import com.google.gson.Gson;
public class ThirdpartySdncWrapper {
- private static ThirdpartySdncWrapper thirdpatySdncWrapper;
- private static final Logger LOG = LoggerFactory.getLogger(ThirdpartySdncWrapper.class);
- private static ThirdpartySdncManagerUtil thirdpartySdncManagerUtil = new ThirdpartySdncManagerUtil();
+ private static ThirdpartySdncWrapper thirdpatySdncWrapper;
+ private static final Logger LOG = LoggerFactory.getLogger(ThirdpartySdncWrapper.class);
+ private static ThirdpartySdncManagerUtil thirdpartySdncManagerUtil = new ThirdpartySdncManagerUtil();
- /**
- * get ThirdpatySdncWrapper instance.
- * @return ThirdpatySdnc manager wrapper instance
- */
- public static ThirdpartySdncWrapper getInstance() {
- if (thirdpatySdncWrapper == null) {
- thirdpatySdncWrapper = new ThirdpartySdncWrapper();
+ /**
+ * get ThirdpatySdncWrapper instance.
+ *
+ * @return ThirdpatySdnc manager wrapper instance
+ */
+ public static ThirdpartySdncWrapper getInstance() {
+ if (thirdpatySdncWrapper == null) {
+ thirdpatySdncWrapper = new ThirdpartySdncWrapper();
+ }
+ return thirdpatySdncWrapper;
}
- return thirdpatySdncWrapper;
- }
-
- public Response registerThirdpartySdnc(ThirdpartySdncRegisterInfo thirdpartySdnc) {
- CommonRegisterResponse result = new CommonRegisterResponse();
- EsrThirdpartySdncDetail esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc);
- String sdncId = esrSdncDetail.getThirdpartySdncId();
- try {
- ExternalSystemProxy.registerSdnc(sdncId, esrSdncDetail);
- result.setId(sdncId);
- return Response.ok(result).build();
- } catch (ExtsysException e) {
- LOG.error("Register thirdParty SDNC failed !" , e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ public Response registerThirdpartySdnc(ThirdpartySdncRegisterInfo thirdpartySdnc) {
+ CommonRegisterResponse result = new CommonRegisterResponse();
+ EsrThirdpartySdncDetail esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc);
+ String sdncId = esrSdncDetail.getThirdpartySdncId();
+ try {
+ ExternalSystemProxy.registerSdnc(sdncId, esrSdncDetail);
+ result.setId(sdncId);
+ return Response.ok(result).build();
+ } catch (ExtsysException e) {
+ LOG.error("Register thirdParty SDNC failed !", e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
+
}
-
- }
- public Response updateThirdpartySdnc(ThirdpartySdncRegisterInfo thirdpartySdnc, String sdncId) {
- CommonRegisterResponse result = new CommonRegisterResponse();
- EsrThirdpartySdncDetail originalEsrSdncDetail = queryEsrThirdpartySdncDetail(sdncId);
- EsrThirdpartySdncDetail esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc);
- String resourceVersion = originalEsrSdncDetail.getResourceVersion();
- esrSdncDetail.setResourceVersion(resourceVersion);
- esrSdncDetail.setThirdpartySdncId(sdncId);
- EsrSystemInfo originalEsrSystemInfo = originalEsrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0);
- esrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
- .setEsrSystemInfoId(originalEsrSystemInfo.getEsrSystemInfoId());
- esrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
- .setResouceVersion(originalEsrSystemInfo.getResouceVersion());
- try {
- ExternalSystemProxy.registerSdnc(sdncId, esrSdncDetail);
- result.setId(sdncId);
- return Response.ok(result).build();
- } catch (ExtsysException e) {
- LOG.error("Update VNFM failed !" , e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ public Response updateThirdpartySdnc(ThirdpartySdncRegisterInfo thirdpartySdnc, String sdncId) {
+ CommonRegisterResponse result = new CommonRegisterResponse();
+ EsrThirdpartySdncDetail originalEsrSdncDetail = queryEsrThirdpartySdncDetail(sdncId);
+ EsrThirdpartySdncDetail esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(thirdpartySdnc);
+ String resourceVersion = originalEsrSdncDetail.getResourceVersion();
+ esrSdncDetail.setResourceVersion(resourceVersion);
+ esrSdncDetail.setThirdpartySdncId(sdncId);
+ EsrSystemInfo originalEsrSystemInfo = originalEsrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0);
+ esrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
+ .setEsrSystemInfoId(originalEsrSystemInfo.getEsrSystemInfoId());
+ esrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
+ .setResouceVersion(originalEsrSystemInfo.getResouceVersion());
+ try {
+ ExternalSystemProxy.registerSdnc(sdncId, esrSdncDetail);
+ result.setId(sdncId);
+ return Response.ok(result).build();
+ } catch (ExtsysException e) {
+ LOG.error("Update VNFM failed !", e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
-
- public Response queryThirdpartySdncList() {
- List<ThirdpartySdncRegisterInfo> sdncList = new ArrayList<>();
- EsrThirdpartySdncList esrSdnc = new EsrThirdpartySdncList();
- try {
- String esrSdncStr = ExternalSystemProxy.querySdncList();
- esrSdnc = new Gson().fromJson(esrSdncStr, EsrThirdpartySdncList.class);
- LOG.info("Response from AAI by query thirdparty SDNC list: " + esrSdnc);
- sdncList = getSdncDetailList(esrSdnc);
- } catch (ExtsysException e) {
- LOG.error("Query thirdparty SDNC list failed !", e);
+
+ public Response queryThirdpartySdncList() {
+ List<ThirdpartySdncRegisterInfo> sdncList = new ArrayList<>();
+ EsrThirdpartySdncList esrSdnc = new EsrThirdpartySdncList();
+ try {
+ String esrSdncStr = ExternalSystemProxy.querySdncList();
+ esrSdnc = new Gson().fromJson(esrSdncStr, EsrThirdpartySdncList.class);
+ LOG.info("Response from AAI by query thirdparty SDNC list: " + esrSdnc);
+ sdncList = getSdncDetailList(esrSdnc);
+ } catch (ExtsysException e) {
+ LOG.error("Query thirdparty SDNC list failed !", e);
+ }
+ return Response.ok(sdncList).build();
}
- return Response.ok(sdncList).build();
- }
-
- public Response queryThirdpartySdncById(String thirdpartySdncId) {
- ThirdpartySdncRegisterInfo thirdpartySdnc = querySdncDetail(thirdpartySdncId);
- return Response.ok(thirdpartySdnc).build();
- }
-
- public Response delThirdpartySdnc(String thirdpartySdncId) {
- EsrThirdpartySdncDetail thirdpartySdncDetail = queryEsrThirdpartySdncDetail(thirdpartySdncId);
- String resourceVersion = thirdpartySdncDetail.getResourceVersion();
- try {
- ExternalSystemProxy.deleteThirdpartySdnc(thirdpartySdncId, resourceVersion);
- return Response.noContent().build();
- } catch (ExtsysException e) {
- LOG.error("Delete VNFM from A&AI failed! thirdparty SDNC ID: " + thirdpartySdncId
- + "resouce-version:" + resourceVersion, e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ public Response queryThirdpartySdncById(String thirdpartySdncId) {
+ ThirdpartySdncRegisterInfo thirdpartySdnc = querySdncDetail(thirdpartySdncId);
+ return Response.ok(thirdpartySdnc).build();
}
- }
-
- private ThirdpartySdncRegisterInfo querySdncDetail(String sdncId) {
- ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- EsrThirdpartySdncDetail esrSdncDetail = new EsrThirdpartySdncDetail();
- try {
- String esrSdncStr = ExternalSystemProxy.queryThirdpartySdncDetail(sdncId);
- LOG.info("Response from AAI by query thirdparty SDNC: " + esrSdncStr);
- esrSdncDetail = new Gson().fromJson(esrSdncStr, EsrThirdpartySdncDetail.class);
- sdncRegisterInfo = thirdpartySdncManagerUtil.esrSdnc2SdncRegisterInfo(esrSdncDetail);
- return sdncRegisterInfo;
- } catch (ExtsysException e) {
- LOG.error("Query VNFM detail failed! thirdpaty SDNC ID: " + sdncId, e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ public Response delThirdpartySdnc(String thirdpartySdncId) {
+ EsrThirdpartySdncDetail thirdpartySdncDetail = queryEsrThirdpartySdncDetail(thirdpartySdncId);
+ String resourceVersion = thirdpartySdncDetail.getResourceVersion();
+ try {
+ ExternalSystemProxy.deleteThirdpartySdnc(thirdpartySdncId, resourceVersion);
+ return Response.noContent().build();
+ } catch (ExtsysException e) {
+ LOG.error("Delete VNFM from A&AI failed! thirdparty SDNC ID: " + thirdpartySdncId + "resouce-version:"
+ + resourceVersion, e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
+ }
+
+ private ThirdpartySdncRegisterInfo querySdncDetail(String sdncId) {
+ ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ EsrThirdpartySdncDetail esrSdncDetail = new EsrThirdpartySdncDetail();
+ try {
+ String esrSdncStr = ExternalSystemProxy.queryThirdpartySdncDetail(sdncId);
+ LOG.info("Response from AAI by query thirdparty SDNC: " + esrSdncStr);
+ esrSdncDetail = new Gson().fromJson(esrSdncStr, EsrThirdpartySdncDetail.class);
+ sdncRegisterInfo = thirdpartySdncManagerUtil.esrSdnc2SdncRegisterInfo(esrSdncDetail);
+ return sdncRegisterInfo;
+ } catch (ExtsysException e) {
+ LOG.error("Query VNFM detail failed! thirdpaty SDNC ID: " + sdncId, e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
-
- private List<ThirdpartySdncRegisterInfo> getSdncDetailList(EsrThirdpartySdncList esrThirdPartySdnc) {
- List<ThirdpartySdncRegisterInfo> sdncInfoList = new ArrayList<>();
- for (int i = 0; i < esrThirdPartySdnc.getEsrThirdpartySdnc().size(); i++) {
- String sdncId = esrThirdPartySdnc.getEsrThirdpartySdnc().get(i).getThirdpartySdncId();
- ThirdpartySdncRegisterInfo sdncInfo = querySdncDetail(sdncId);
- if (sdncInfo != null) {
- sdncInfoList.add(sdncInfo);
- }
+
+ private List<ThirdpartySdncRegisterInfo> getSdncDetailList(EsrThirdpartySdncList esrThirdPartySdnc) {
+ List<ThirdpartySdncRegisterInfo> sdncInfoList = new ArrayList<>();
+ for (int i = 0; i < esrThirdPartySdnc.getEsrThirdpartySdnc().size(); i++) {
+ String sdncId = esrThirdPartySdnc.getEsrThirdpartySdnc().get(i).getThirdpartySdncId();
+ ThirdpartySdncRegisterInfo sdncInfo = querySdncDetail(sdncId);
+ if (sdncInfo != null) {
+ sdncInfoList.add(sdncInfo);
+ }
+ }
+ return sdncInfoList;
}
- return sdncInfoList;
- }
-
- private EsrThirdpartySdncDetail queryEsrThirdpartySdncDetail (String sdncId) {
- EsrThirdpartySdncDetail esrSdncDetail = new EsrThirdpartySdncDetail();
- try {
- String esrThirdpartySdncStr = ExternalSystemProxy.queryThirdpartySdncDetail(sdncId);
- LOG.info("Response from AAI by query thirdparty SDNC: " + esrThirdpartySdncStr);
- esrSdncDetail = new Gson().fromJson(esrThirdpartySdncStr, EsrThirdpartySdncDetail.class);
- } catch (ExtsysException e) {
- LOG.error("Query VNFM detail failed! VNFM ID: " + sdncId, e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ private EsrThirdpartySdncDetail queryEsrThirdpartySdncDetail(String sdncId) {
+ EsrThirdpartySdncDetail esrSdncDetail = new EsrThirdpartySdncDetail();
+ try {
+ String esrThirdpartySdncStr = ExternalSystemProxy.queryThirdpartySdncDetail(sdncId);
+ LOG.info("Response from AAI by query thirdparty SDNC: " + esrThirdpartySdncStr);
+ esrSdncDetail = new Gson().fromJson(esrThirdpartySdncStr, EsrThirdpartySdncDetail.class);
+ } catch (ExtsysException e) {
+ LOG.error("Query VNFM detail failed! VNFM ID: " + sdncId, e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
+ return esrSdncDetail;
}
- return esrSdncDetail;
- }
-
+
}
import java.util.ArrayList;
import java.util.List;
-
import javax.ws.rs.core.Response;
-
import org.onap.aai.esr.entity.aai.CloudRegionDetail;
import org.onap.aai.esr.entity.aai.CloudRegionList;
import org.onap.aai.esr.entity.aai.EsrSystemInfo;
import org.onap.aai.esr.util.VimManagerUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import com.google.gson.Gson;
public class VimManagerWrapper {
- private static VimManagerWrapper vimManagerWrapper;
- private static final Logger LOG = LoggerFactory.getLogger(VimManagerWrapper.class);
-
- private static VimManagerUtil vimManagerUtil = new VimManagerUtil();
-
- private static CloudRegionProxy cloudRegionProxy = new CloudRegionProxy();
-
- private static ExtsysUtil extsysUtil = new ExtsysUtil();
-
- /**
- * get VimManagerWrapper instance.
- *
- * @return vim manager wrapper instance
- */
- public static VimManagerWrapper getInstance() {
- if (vimManagerWrapper == null) {
- vimManagerWrapper = new VimManagerWrapper();
+ private static VimManagerWrapper vimManagerWrapper;
+ private static final Logger LOG = LoggerFactory.getLogger(VimManagerWrapper.class);
+
+ private static VimManagerUtil vimManagerUtil = new VimManagerUtil();
+
+ private static CloudRegionProxy cloudRegionProxy = new CloudRegionProxy();
+
+ private static ExtsysUtil extsysUtil = new ExtsysUtil();
+
+ /**
+ * get VimManagerWrapper instance.
+ *
+ * @return vim manager wrapper instance
+ */
+ public static VimManagerWrapper getInstance() {
+ if (vimManagerWrapper == null) {
+ vimManagerWrapper = new VimManagerWrapper();
+ }
+ return vimManagerWrapper;
+
}
- return vimManagerWrapper;
-
- }
-
- public Response registerVim(VimRegisterInfo vimRegisterInfo) {
- LOG.info(
- "Start register VIM, input VIM info is: " + extsysUtil.objectToString(vimRegisterInfo));
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- VimRegisterResponse result = new VimRegisterResponse();
- cloudRegion = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
- String cloudOwner = vimRegisterInfo.getCloudOwner();
- String cloudRegionId = vimRegisterInfo.getCloudRegionId();
- try {
- cloudRegionProxy.registerVim(cloudOwner, cloudRegionId, cloudRegion);
- result.setCloudOwner(cloudOwner);
- result.setCloudRegionId(cloudRegionId);
- Tenant tenant = new Tenant();
- tenant.setDefaultTenant(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getDefaultTenant());
- try {
- VimManagerProxy.updateVim(cloudOwner, cloudRegionId, tenant);
- } catch (ExtsysException e) {
- LOG.error("Update VIM by Multi-cloud failed !", e);
- }
- return Response.ok(result).build();
- } catch (ExtsysException error) {
- LOG.error("Register VIM failed !", error);
- throw ExceptionUtil.buildExceptionResponse(error.getMessage());
+
+ public Response registerVim(VimRegisterInfo vimRegisterInfo) {
+ LOG.info("Start register VIM, input VIM info is: " + extsysUtil.objectToString(vimRegisterInfo));
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ VimRegisterResponse result = new VimRegisterResponse();
+ cloudRegion = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
+ String cloudOwner = vimRegisterInfo.getCloudOwner();
+ String cloudRegionId = vimRegisterInfo.getCloudRegionId();
+ try {
+ cloudRegionProxy.registerVim(cloudOwner, cloudRegionId, cloudRegion);
+ result.setCloudOwner(cloudOwner);
+ result.setCloudRegionId(cloudRegionId);
+ Tenant tenant = new Tenant();
+ tenant.setDefaultTenant(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getDefaultTenant());
+ try {
+ VimManagerProxy.updateVim(cloudOwner, cloudRegionId, tenant);
+ } catch (ExtsysException e) {
+ LOG.error("Update VIM by Multi-cloud failed !", e);
+ }
+ return Response.ok(result).build();
+ } catch (ExtsysException error) {
+ LOG.error("Register VIM failed !", error);
+ throw ExceptionUtil.buildExceptionResponse(error.getMessage());
+ }
}
- }
-
- public Response updateVim(String cloudOwner, String cloudRegionId,VimRegisterInfo vimRegisterInfo) {
- LOG.info("Start update VIM, input VIM info is: " + extsysUtil.objectToString(vimRegisterInfo));
- CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
- VimRegisterResponse result = new VimRegisterResponse();
-
- cloudRegionDetail = getVimUpdateInfo(vimRegisterInfo);
- try {
- cloudRegionProxy.registerVim(cloudOwner, cloudRegionId, cloudRegionDetail);
- result.setCloudOwner(cloudOwner);
- result.setCloudRegionId(cloudRegionId);
- return Response.ok(result).build();
- } catch (ExtsysException e) {
- LOG.error("Update VIM failed !", e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ public Response updateVim(String cloudOwner, String cloudRegionId, VimRegisterInfo vimRegisterInfo) {
+ LOG.info("Start update VIM, input VIM info is: " + extsysUtil.objectToString(vimRegisterInfo));
+ CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
+ VimRegisterResponse result = new VimRegisterResponse();
+
+ cloudRegionDetail = getVimUpdateInfo(vimRegisterInfo);
+ try {
+ cloudRegionProxy.registerVim(cloudOwner, cloudRegionId, cloudRegionDetail);
+ result.setCloudOwner(cloudOwner);
+ result.setCloudRegionId(cloudRegionId);
+ return Response.ok(result).build();
+ } catch (ExtsysException e) {
+ LOG.error("Update VIM failed !", e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
-
- public Response queryVimListDetails() {
- List<VimRegisterInfo> vimRegisterInfos = new ArrayList<>();
- CloudRegionList cloudRegionList = new CloudRegionList();
- try {
- String aaiVimList = cloudRegionProxy.qureyVimList();
- cloudRegionList = new Gson().fromJson(aaiVimList, CloudRegionList.class);
- vimRegisterInfos = getVimDetailList(cloudRegionList);
- return Response.ok(vimRegisterInfos).build();
- } catch (ExtsysException error) {
- LOG.error("Query vim list details failed !", error);
- return Response.ok(vimRegisterInfos).build();
+
+ public Response queryVimListDetails() {
+ List<VimRegisterInfo> vimRegisterInfos = new ArrayList<>();
+ CloudRegionList cloudRegionList = new CloudRegionList();
+ try {
+ String aaiVimList = cloudRegionProxy.qureyVimList();
+ cloudRegionList = new Gson().fromJson(aaiVimList, CloudRegionList.class);
+ vimRegisterInfos = getVimDetailList(cloudRegionList);
+ return Response.ok(vimRegisterInfos).build();
+ } catch (ExtsysException error) {
+ LOG.error("Query vim list details failed !", error);
+ return Response.ok(vimRegisterInfos).build();
+ }
+
}
- }
-
- public Response queryVimById(String cloudOwner, String cloudRegionId) {
- VimRegisterInfo vim = new VimRegisterInfo();
- CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
- try {
- String cloudRegionstr = cloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
- LOG.info("Response from AAI by query VIM: " + cloudRegionstr);
- cloudRegionDetail = new Gson().fromJson(cloudRegionstr, CloudRegionDetail.class);
- vim = vimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
- return Response.ok(vim).build();
- } catch (ExtsysException e) {
- LOG.error("Query vim details by ID failed !", e);
- return Response.ok(vim).build();
+ public Response queryVimById(String cloudOwner, String cloudRegionId) {
+ VimRegisterInfo vim = new VimRegisterInfo();
+ CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
+ try {
+ String cloudRegionstr = cloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
+ LOG.info("Response from AAI by query VIM: " + cloudRegionstr);
+ cloudRegionDetail = new Gson().fromJson(cloudRegionstr, CloudRegionDetail.class);
+ vim = vimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
+ return Response.ok(vim).build();
+ } catch (ExtsysException e) {
+ LOG.error("Query vim details by ID failed !", e);
+ return Response.ok(vim).build();
+ }
+
}
- }
-
- private List<VimRegisterInfo> getVimDetailList(CloudRegionList cloudRegionList) {
- List<VimRegisterInfo> vimRegisterInfos = new ArrayList<>();
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- int cloudRegionNum = cloudRegionList.getCloudRegion().size();
- for (int i = 0; i < cloudRegionNum; i++) {
- String cloudOwner = cloudRegionList.getCloudRegion().get(i).getCloudOwner();
- String cloudRegionId = cloudRegionList.getCloudRegion().get(i).getCloudRegionId();
- vimRegisterInfo = getVimDetail(cloudOwner, cloudRegionId);
- vimRegisterInfos.add(vimRegisterInfo);
+ private List<VimRegisterInfo> getVimDetailList(CloudRegionList cloudRegionList) {
+ List<VimRegisterInfo> vimRegisterInfos = new ArrayList<>();
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ int cloudRegionNum = cloudRegionList.getCloudRegion().size();
+ for (int i = 0; i < cloudRegionNum; i++) {
+ String cloudOwner = cloudRegionList.getCloudRegion().get(i).getCloudOwner();
+ String cloudRegionId = cloudRegionList.getCloudRegion().get(i).getCloudRegionId();
+ vimRegisterInfo = getVimDetail(cloudOwner, cloudRegionId);
+ vimRegisterInfos.add(vimRegisterInfo);
+ }
+ return vimRegisterInfos;
}
- return vimRegisterInfos;
- }
-
- private VimRegisterInfo getVimDetail(String cloudOwner, String cloudRegionId) {
- CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
- VimRegisterInfo registeredVimInfo = new VimRegisterInfo();
- try {
- String cloudRegionstr = cloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
- cloudRegionDetail = new Gson().fromJson(cloudRegionstr, CloudRegionDetail.class);
- registeredVimInfo = vimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
- } catch (ExtsysException error) {
- LOG.error("query VIM detail failed ! cloud-owner = " + cloudOwner + ", cloud-region-id = "
- + cloudRegionId, error);
+
+ private VimRegisterInfo getVimDetail(String cloudOwner, String cloudRegionId) {
+ CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
+ VimRegisterInfo registeredVimInfo = new VimRegisterInfo();
+ try {
+ String cloudRegionstr = cloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
+ cloudRegionDetail = new Gson().fromJson(cloudRegionstr, CloudRegionDetail.class);
+ registeredVimInfo = vimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
+ } catch (ExtsysException error) {
+ LOG.error("query VIM detail failed ! cloud-owner = " + cloudOwner + ", cloud-region-id = " + cloudRegionId,
+ error);
+ }
+ return registeredVimInfo;
}
- return registeredVimInfo;
- }
-
- private CloudRegionDetail getOriginalCloudRegion(String cloudOwner, String cloudRegionId) {
- CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
- try {
- String cloudRegionstr = cloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
- cloudRegionDetail = new Gson().fromJson(cloudRegionstr, CloudRegionDetail.class);
- return cloudRegionDetail;
- } catch (ExtsysException error) {
- LOG.error("query VIM detail failed ! cloud-owner = " + cloudOwner + ", cloud-region-id = "
- + cloudRegionId, error);
- return null;
+
+ private CloudRegionDetail getOriginalCloudRegion(String cloudOwner, String cloudRegionId) {
+ CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
+ try {
+ String cloudRegionstr = cloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
+ cloudRegionDetail = new Gson().fromJson(cloudRegionstr, CloudRegionDetail.class);
+ return cloudRegionDetail;
+ } catch (ExtsysException error) {
+ LOG.error("query VIM detail failed ! cloud-owner = " + cloudOwner + ", cloud-region-id = " + cloudRegionId,
+ error);
+ return null;
+ }
}
- }
-
- private CloudRegionDetail getVimUpdateInfo(VimRegisterInfo vimRegisterInfo) {
- CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
- CloudRegionDetail originalCloudRegionDetail = new CloudRegionDetail();
- EsrSystemInfo originalSystemInfo = new EsrSystemInfo();
- String cloudOwner = vimRegisterInfo.getCloudOwner();
- String cloudRegionId = vimRegisterInfo.getCloudRegionId();
- originalCloudRegionDetail = getOriginalCloudRegion(cloudOwner, cloudRegionId);
- String resourceVersion = originalCloudRegionDetail.getResourceVersion();
- cloudRegionDetail = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
- if(resourceVersion != null) {
- cloudRegionDetail.setResourceVersion(resourceVersion);
- originalSystemInfo = originalCloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0);
- cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0).setEsrSystemInfoId(originalSystemInfo.getEsrSystemInfoId());
- cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0).setResouceVersion(originalSystemInfo.getResouceVersion());
+
+ private CloudRegionDetail getVimUpdateInfo(VimRegisterInfo vimRegisterInfo) {
+ CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
+ CloudRegionDetail originalCloudRegionDetail = new CloudRegionDetail();
+ EsrSystemInfo originalSystemInfo = new EsrSystemInfo();
+ String cloudOwner = vimRegisterInfo.getCloudOwner();
+ String cloudRegionId = vimRegisterInfo.getCloudRegionId();
+ originalCloudRegionDetail = getOriginalCloudRegion(cloudOwner, cloudRegionId);
+ String resourceVersion = originalCloudRegionDetail.getResourceVersion();
+ cloudRegionDetail = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
+ if (resourceVersion != null) {
+ cloudRegionDetail.setResourceVersion(resourceVersion);
+ originalSystemInfo = originalCloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0);
+ cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
+ .setEsrSystemInfoId(originalSystemInfo.getEsrSystemInfoId());
+ cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
+ .setResouceVersion(originalSystemInfo.getResouceVersion());
+ }
+ return cloudRegionDetail;
}
- return cloudRegionDetail;
- }
-
- public Response delVim(String cloudOwner, String cloudRegionId) {
- CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
- cloudRegionDetail = queryCloudRegionDetail(cloudOwner, cloudRegionId);
- String resourceVersion = cloudRegionDetail.getResourceVersion();
- try {
- cloudRegionProxy.deleteVim(cloudOwner, cloudRegionId, resourceVersion);
- return Response.noContent().build();
- } catch (ExtsysException e) {
- LOG.error("Delete cloud region from A&AI failed! cloud-owner = " + cloudOwner
- + ", cloud-region-id = " + cloudRegionId + "resouce-version:" + resourceVersion, e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ public Response delVim(String cloudOwner, String cloudRegionId) {
+ CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
+ cloudRegionDetail = queryCloudRegionDetail(cloudOwner, cloudRegionId);
+ String resourceVersion = cloudRegionDetail.getResourceVersion();
+ try {
+ cloudRegionProxy.deleteVim(cloudOwner, cloudRegionId, resourceVersion);
+ return Response.noContent().build();
+ } catch (ExtsysException e) {
+ LOG.error("Delete cloud region from A&AI failed! cloud-owner = " + cloudOwner + ", cloud-region-id = "
+ + cloudRegionId + "resouce-version:" + resourceVersion, e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
-
- private CloudRegionDetail queryCloudRegionDetail (String cloudOwner, String cloudRegionId) {
- CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
- try {
- String cloudRegionStr = cloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
- LOG.info("Response from AAI by query cloud region: " + cloudRegionStr);
- cloudRegionDetail = new Gson().fromJson(cloudRegionStr, CloudRegionDetail.class);
- } catch (ExtsysException e) {
- LOG.error("Query EMS detail failed! cloud-owner = " + cloudOwner
- + ", cloud-region-id = " + cloudRegionId , e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ private CloudRegionDetail queryCloudRegionDetail(String cloudOwner, String cloudRegionId) {
+ CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
+ try {
+ String cloudRegionStr = cloudRegionProxy.queryVimDetail(cloudOwner, cloudRegionId);
+ LOG.info("Response from AAI by query cloud region: " + cloudRegionStr);
+ cloudRegionDetail = new Gson().fromJson(cloudRegionStr, CloudRegionDetail.class);
+ } catch (ExtsysException e) {
+ LOG.error("Query EMS detail failed! cloud-owner = " + cloudOwner + ", cloud-region-id = " + cloudRegionId,
+ e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
+ return cloudRegionDetail;
}
- return cloudRegionDetail;
- }
}
import java.util.ArrayList;
import java.util.List;
-
import javax.ws.rs.core.Response;
-
import org.onap.aai.esr.entity.aai.EsrSystemInfo;
import org.onap.aai.esr.entity.aai.EsrVnfmDetail;
import org.onap.aai.esr.entity.aai.EsrVnfmList;
import org.onap.aai.esr.util.VnfmManagerUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import com.google.gson.Gson;
public class VnfmManagerWrapper {
- private static VnfmManagerWrapper vnfmManagerWrapper;
- private static final Logger LOG = LoggerFactory.getLogger(VnfmManagerWrapper.class);
+ private static VnfmManagerWrapper vnfmManagerWrapper;
+ private static final Logger LOG = LoggerFactory.getLogger(VnfmManagerWrapper.class);
- private static VnfmManagerUtil vnfmManagerUtil = new VnfmManagerUtil();
-
- /**
- * get VnfmManagerWrapper instance.
- *
- * @return vnfm manager wrapper instance
- */
- public static VnfmManagerWrapper getInstance() {
- if (vnfmManagerWrapper == null) {
- vnfmManagerWrapper = new VnfmManagerWrapper();
+ private static VnfmManagerUtil vnfmManagerUtil = new VnfmManagerUtil();
+
+ /**
+ * get VnfmManagerWrapper instance.
+ *
+ * @return vnfm manager wrapper instance
+ */
+ public static VnfmManagerWrapper getInstance() {
+ if (vnfmManagerWrapper == null) {
+ vnfmManagerWrapper = new VnfmManagerWrapper();
+ }
+ return vnfmManagerWrapper;
}
- return vnfmManagerWrapper;
- }
- public Response registerVnfm(VnfmRegisterInfo vnfm) {
- CommonRegisterResponse result = new CommonRegisterResponse();
- EsrVnfmDetail esrVnfmDetail = vnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfm);
- String vnfmId = esrVnfmDetail.getVnfmId();
- try {
- ExternalSystemProxy.registerVnfm(vnfmId, esrVnfmDetail);
- result.setId(vnfmId);
- return Response.ok(result).build();
- } catch (ExtsysException e) {
- LOG.error("Register VNFM failed !" , e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ public Response registerVnfm(VnfmRegisterInfo vnfm) {
+ CommonRegisterResponse result = new CommonRegisterResponse();
+ EsrVnfmDetail esrVnfmDetail = vnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfm);
+ String vnfmId = esrVnfmDetail.getVnfmId();
+ try {
+ ExternalSystemProxy.registerVnfm(vnfmId, esrVnfmDetail);
+ result.setId(vnfmId);
+ return Response.ok(result).build();
+ } catch (ExtsysException e) {
+ LOG.error("Register VNFM failed !", e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
- public Response updateVnfm(VnfmRegisterInfo vnfm, String vnfmId) {
- CommonRegisterResponse result = new CommonRegisterResponse();
- EsrVnfmDetail originalEsrVnfmDetail = queryEsrVnfmDetail(vnfmId);
- EsrVnfmDetail esrVnfmDetail = vnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfm);
- String resourceVersion = getResourceVersion(vnfmId);
- esrVnfmDetail.setResourceVersion(resourceVersion);
- esrVnfmDetail.setVnfmId(vnfmId);
- EsrSystemInfo originalEsrSystemInfo = originalEsrVnfmDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0);
- esrVnfmDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
- .setEsrSystemInfoId(originalEsrSystemInfo.getEsrSystemInfoId());
- esrVnfmDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
- .setResouceVersion(originalEsrSystemInfo.getResouceVersion());
- try {
- ExternalSystemProxy.registerVnfm(vnfmId, esrVnfmDetail);
- result.setId(vnfmId);
- return Response.ok(result).build();
- } catch (ExtsysException e) {
- LOG.error("Update VNFM failed !", e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ public Response updateVnfm(VnfmRegisterInfo vnfm, String vnfmId) {
+ CommonRegisterResponse result = new CommonRegisterResponse();
+ EsrVnfmDetail originalEsrVnfmDetail = queryEsrVnfmDetail(vnfmId);
+ EsrVnfmDetail esrVnfmDetail = vnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfm);
+ String resourceVersion = getResourceVersion(vnfmId);
+ esrVnfmDetail.setResourceVersion(resourceVersion);
+ esrVnfmDetail.setVnfmId(vnfmId);
+ EsrSystemInfo originalEsrSystemInfo = originalEsrVnfmDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0);
+ esrVnfmDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
+ .setEsrSystemInfoId(originalEsrSystemInfo.getEsrSystemInfoId());
+ esrVnfmDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0)
+ .setResouceVersion(originalEsrSystemInfo.getResouceVersion());
+ try {
+ ExternalSystemProxy.registerVnfm(vnfmId, esrVnfmDetail);
+ result.setId(vnfmId);
+ return Response.ok(result).build();
+ } catch (ExtsysException e) {
+ LOG.error("Update VNFM failed !", e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
- public Response queryVnfmList() {
- List<VnfmRegisterInfo> vnfmList = new ArrayList<>();
- EsrVnfmList esrVnfm = new EsrVnfmList();
- try {
- String esrVnfmStr = ExternalSystemProxy.queryVnfmList();
- esrVnfm = new Gson().fromJson(esrVnfmStr, EsrVnfmList.class);
- LOG.info("Response from AAI by query VNFM list: " + esrVnfm);
- vnfmList = getVnfmDetailList(esrVnfm);
- return Response.ok(vnfmList).build();
- } catch (ExtsysException e) {
- LOG.error("Query VNFM list failed !", e);
- return Response.ok(vnfmList).build();
+ public Response queryVnfmList() {
+ List<VnfmRegisterInfo> vnfmList = new ArrayList<>();
+ EsrVnfmList esrVnfm = new EsrVnfmList();
+ try {
+ String esrVnfmStr = ExternalSystemProxy.queryVnfmList();
+ esrVnfm = new Gson().fromJson(esrVnfmStr, EsrVnfmList.class);
+ LOG.info("Response from AAI by query VNFM list: " + esrVnfm);
+ vnfmList = getVnfmDetailList(esrVnfm);
+ return Response.ok(vnfmList).build();
+ } catch (ExtsysException e) {
+ LOG.error("Query VNFM list failed !", e);
+ return Response.ok(vnfmList).build();
+ }
}
- }
- public Response queryVnfmById(String vnfmId) {
- VnfmRegisterInfo vnfm = queryVnfmDetail(vnfmId);
- if (vnfm != null) {
- return Response.ok(vnfm).build();
- } else {
- return Response.ok(vnfm).build();
+ public Response queryVnfmById(String vnfmId) {
+ VnfmRegisterInfo vnfm = queryVnfmDetail(vnfmId);
+ if (vnfm != null) {
+ return Response.ok(vnfm).build();
+ } else {
+ return Response.ok(vnfm).build();
+ }
}
- }
- public Response delVnfm(String vnfmId) {
- String resourceVersion = getResourceVersion(vnfmId);
- try {
- ExternalSystemProxy.deleteVnfm(vnfmId, resourceVersion);
- return Response.noContent().build();
- } catch (ExtsysException e) {
- LOG.error(
- "Delete VNFM from A&AI failed! VNFM ID: " + vnfmId + "resouce-version:" + resourceVersion,
- e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ public Response delVnfm(String vnfmId) {
+ String resourceVersion = getResourceVersion(vnfmId);
+ try {
+ ExternalSystemProxy.deleteVnfm(vnfmId, resourceVersion);
+ return Response.noContent().build();
+ } catch (ExtsysException e) {
+ LOG.error("Delete VNFM from A&AI failed! VNFM ID: " + vnfmId + "resouce-version:" + resourceVersion, e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
}
- }
- private VnfmRegisterInfo queryVnfmDetail(String vnfmId) {
- VnfmRegisterInfo vnfm = new VnfmRegisterInfo();
- EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
- try {
- String esrVnfmstr = ExternalSystemProxy.queryVnfmDetail(vnfmId);
- LOG.info("Response from AAI by query VNFM: " + esrVnfmstr);
- esrVnfmDetail = new Gson().fromJson(esrVnfmstr, EsrVnfmDetail.class);
- vnfm = vnfmManagerUtil.esrVnfm2VnfmRegisterInfo(esrVnfmDetail);
- } catch (ExtsysException e) {
- LOG.error("Query VNFM detail failed! VNFM ID: " + vnfmId, e);
+ private VnfmRegisterInfo queryVnfmDetail(String vnfmId) {
+ VnfmRegisterInfo vnfm = new VnfmRegisterInfo();
+ EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
+ try {
+ String esrVnfmstr = ExternalSystemProxy.queryVnfmDetail(vnfmId);
+ LOG.info("Response from AAI by query VNFM: " + esrVnfmstr);
+ esrVnfmDetail = new Gson().fromJson(esrVnfmstr, EsrVnfmDetail.class);
+ vnfm = vnfmManagerUtil.esrVnfm2VnfmRegisterInfo(esrVnfmDetail);
+ } catch (ExtsysException e) {
+ LOG.error("Query VNFM detail failed! VNFM ID: " + vnfmId, e);
+ }
+ return vnfm;
}
- return vnfm;
- }
- private List<VnfmRegisterInfo> getVnfmDetailList(EsrVnfmList esrVnfm) {
- List<VnfmRegisterInfo> vnfmInfoList = new ArrayList<>();
- for (int i = 0; i < esrVnfm.getEsrVnfm().size(); i++) {
- String vnfmId = esrVnfm.getEsrVnfm().get(i).getVnfmId();
- VnfmRegisterInfo vnfmInfo = queryVnfmDetail(vnfmId);
- if (vnfmInfo != null) {
- vnfmInfoList.add(vnfmInfo);
- }
+ private List<VnfmRegisterInfo> getVnfmDetailList(EsrVnfmList esrVnfm) {
+ List<VnfmRegisterInfo> vnfmInfoList = new ArrayList<>();
+ for (int i = 0; i < esrVnfm.getEsrVnfm().size(); i++) {
+ String vnfmId = esrVnfm.getEsrVnfm().get(i).getVnfmId();
+ VnfmRegisterInfo vnfmInfo = queryVnfmDetail(vnfmId);
+ if (vnfmInfo != null) {
+ vnfmInfoList.add(vnfmInfo);
+ }
+ }
+ return vnfmInfoList;
}
- return vnfmInfoList;
- }
-
- private String getResourceVersion (String vnfmId) {
- String resourceVersion = null;
- EsrVnfmDetail esrVnfmDetail = queryEsrVnfmDetail(vnfmId);
- if (esrVnfmDetail != null && esrVnfmDetail.getResourceVersion() != null) {
- resourceVersion = esrVnfmDetail.getResourceVersion();
+
+ private String getResourceVersion(String vnfmId) {
+ String resourceVersion = null;
+ EsrVnfmDetail esrVnfmDetail = queryEsrVnfmDetail(vnfmId);
+ if (esrVnfmDetail != null && esrVnfmDetail.getResourceVersion() != null) {
+ resourceVersion = esrVnfmDetail.getResourceVersion();
+ }
+ return resourceVersion;
}
- return resourceVersion;
- }
-
- private EsrVnfmDetail queryEsrVnfmDetail (String vnfmId) {
- EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
- try {
- String esrVnfmstr = ExternalSystemProxy.queryVnfmDetail(vnfmId);
- LOG.info("Response from AAI by query VNFM: " + esrVnfmstr);
- esrVnfmDetail = new Gson().fromJson(esrVnfmstr, EsrVnfmDetail.class);
- } catch (ExtsysException e) {
- LOG.error("Query VNFM detail failed! VNFM ID: " + vnfmId, e);
- throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+
+ private EsrVnfmDetail queryEsrVnfmDetail(String vnfmId) {
+ EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
+ try {
+ String esrVnfmstr = ExternalSystemProxy.queryVnfmDetail(vnfmId);
+ LOG.info("Response from AAI by query VNFM: " + esrVnfmstr);
+ esrVnfmDetail = new Gson().fromJson(esrVnfmstr, EsrVnfmDetail.class);
+ } catch (ExtsysException e) {
+ LOG.error("Query VNFM detail failed! VNFM ID: " + vnfmId, e);
+ throw ExceptionUtil.buildExceptionResponse(e.getMessage());
+ }
+ return esrVnfmDetail;
}
- return esrVnfmDetail;
- }
}
package org.onap.aai.esr;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class ExtsysAppConfigurationTest {
-
- @Test
- public void getterAndSetter4template(){
- final String template = "Hello ESR";
- ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
- appConfiguration.setTemplate(template);
- assertEquals(appConfiguration.getTemplate(), template);
- }
-
- @Test
- public void getterAndSetter4defaultName(){
- final String defaultName = "ONAP-A&AI-ESR";
- ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
- appConfiguration.setDefaultName(defaultName);
- assertEquals(appConfiguration.getDefaultName(), defaultName);
- }
-
- @Test
- public void getterAndSetter4msbDiscoveryIp(){
- final String msbDiscoveryIp = "127.0.0.1";
- ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
- appConfiguration.setMsbDiscoveryIp(msbDiscoveryIp);
- assertEquals(appConfiguration.getMsbDiscoveryIp(), msbDiscoveryIp);
- }
-
- @Test
- public void getterAndSetter4msbDiscoveryPort(){
- final String msbDiscoveryPort = "10081";
- ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
- appConfiguration.setMsbDiscoveryPort(msbDiscoveryPort);
- assertEquals(appConfiguration.getMsbDiscoveryPort(), msbDiscoveryPort);
- }
-
- @Test
- public void getterAndSetter4registByHand(){
- final String registByHand = "true";
- ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
- appConfiguration.setRegistByHand(registByHand);
- assertEquals(appConfiguration.getRegistByHand(), registByHand);
- }
-
- @Test
- public void getterAndSetter4msbServerAddr(){
- final String msbServerAddr = "http://127.0.0.1:80";
- ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
- appConfiguration.setMsbServerAddr(msbServerAddr);
- assertEquals(appConfiguration.getMsbServerAddr(), msbServerAddr);
- }
-
- @Test
- public void getterAndSetter4serviceIp(){
- final String serviceIp = "true";
- ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
- appConfiguration.setServiceIp(serviceIp);
- assertEquals(appConfiguration.getServiceIp(), serviceIp);
- }
+
+ @Test
+ public void getterAndSetter4template() {
+ final String template = "Hello ESR";
+ ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
+ appConfiguration.setTemplate(template);
+ assertEquals(appConfiguration.getTemplate(), template);
+ }
+
+ @Test
+ public void getterAndSetter4defaultName() {
+ final String defaultName = "ONAP-A&AI-ESR";
+ ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
+ appConfiguration.setDefaultName(defaultName);
+ assertEquals(appConfiguration.getDefaultName(), defaultName);
+ }
+
+ @Test
+ public void getterAndSetter4msbDiscoveryIp() {
+ final String msbDiscoveryIp = "127.0.0.1";
+ ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
+ appConfiguration.setMsbDiscoveryIp(msbDiscoveryIp);
+ assertEquals(appConfiguration.getMsbDiscoveryIp(), msbDiscoveryIp);
+ }
+
+ @Test
+ public void getterAndSetter4msbDiscoveryPort() {
+ final String msbDiscoveryPort = "10081";
+ ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
+ appConfiguration.setMsbDiscoveryPort(msbDiscoveryPort);
+ assertEquals(appConfiguration.getMsbDiscoveryPort(), msbDiscoveryPort);
+ }
+
+ @Test
+ public void getterAndSetter4registByHand() {
+ final String registByHand = "true";
+ ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
+ appConfiguration.setRegistByHand(registByHand);
+ assertEquals(appConfiguration.getRegistByHand(), registByHand);
+ }
+
+ @Test
+ public void getterAndSetter4msbServerAddr() {
+ final String msbServerAddr = "http://127.0.0.1:80";
+ ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
+ appConfiguration.setMsbServerAddr(msbServerAddr);
+ assertEquals(appConfiguration.getMsbServerAddr(), msbServerAddr);
+ }
+
+ @Test
+ public void getterAndSetter4serviceIp() {
+ final String serviceIp = "true";
+ ExtsysAppConfiguration appConfiguration = new ExtsysAppConfiguration();
+ appConfiguration.setServiceIp(serviceIp);
+ assertEquals(appConfiguration.getServiceIp(), serviceIp);
+ }
}
package org.onap.aai.esr;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
import org.onap.aai.esr.common.Config;
public class ExtsysAppTest {
- static {
- ExtsysAppConfiguration configuration = new ExtsysAppConfiguration();
- Config.setConfigration(configuration);
- }
-
- @Test
- public void getName() throws Exception {
- ExtsysApp app = new ExtsysApp();
- assertEquals(app.getName(),"ONAP-ESR");
- }
+ static {
+ ExtsysAppConfiguration configuration = new ExtsysAppConfiguration();
+ Config.setConfigration(configuration);
+ }
+
+ @Test
+ public void getName() throws Exception {
+ ExtsysApp app = new ExtsysApp();
+ assertEquals(app.getName(), "ONAP-ESR");
+ }
}
public class MsbConfigTest {\r
\r
@Test\r
- public void testAllMethods(){\r
+ public void testAllMethods() {\r
MsbConfig.setMsbServerAddr("msb-server");\r
Assert.assertEquals(MsbConfig.getMsbServerAddr(), "msb-server");\r
\r
}\r
\r
@Test\r
- public void testConfigClass(){\r
+ public void testConfigClass() {\r
ExtsysAppConfiguration configur = new ExtsysAppConfiguration();\r
Config.setConfigration(configur);\r
Assert.assertEquals(Config.getConfigration(), configur);\r
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class CloudRegionDetailTest {
- @Test
- public void getterAndSetter4CloudOwner(){
- final String cloudOwner = "cloud-owner-test";
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- cloudRegion.setCloudOwner(cloudOwner);
- assertEquals(cloudRegion.getCloudOwner(), cloudOwner);
- }
-
- @Test
- public void getterAndSetter4CloudRegionId(){
- final String cloudRegionId = "cloud-region-id-test";
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- cloudRegion.setCloudRegionId(cloudRegionId);
- assertEquals(cloudRegion.getCloudRegionId(), cloudRegionId);
- }
-
- @Test
- public void getterAndSetter4CloudType(){
- final String cloudType = "cloud-type-test";
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- cloudRegion.setCloudType(cloudType);
- assertEquals(cloudRegion.getCloudType(), cloudType);
- }
-
- @Test
- public void getterAndSetter4cloudRegionVersion(){
- final String cloudRegionVersion = "cloud-region-version-test";
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- cloudRegion.setCloudRegionVersion(cloudRegionVersion);
- assertEquals(cloudRegion.getCloudRegionVersion(), cloudRegionVersion);
- }
-
- @Test
- public void getterAndSetter4ownerDefinedType(){
- final String ownerDefinedType = "owner-defined-type-test";
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- cloudRegion.setOwnerDefinedType(ownerDefinedType);
- assertEquals(cloudRegion.getOwnerDefinedType(), ownerDefinedType);
- }
-
- @Test
- public void getterAndSetter4cloudZone(){
- final String cloudZone = "cloudZone-test";
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- cloudRegion.setCloudZone(cloudZone);
- assertEquals(cloudRegion.getCloudZone(), cloudZone);
- }
-
- @Test
- public void getterAndSetter4complexName(){
- final String complexName = "complexName-test";
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- cloudRegion.setComplexName(complexName);
- assertEquals(cloudRegion.getComplexName(), complexName);
- }
-
- @Test
- public void getterAndSetter4cloudExtraInfo(){
- final String cloudExtraInfo = "cloudExtraInfo-test";
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- cloudRegion.setCloudExtraInfo(cloudExtraInfo);
- assertEquals(cloudRegion.getCloudExtraInfo(), cloudExtraInfo);
- }
-
- @Test
- public void getterAndSetter4esrSystemInfoList(){
- final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
- EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
- esrSystemInfoObj.setEsrSystemInfoId("123");
- esrSystemInfo.add(esrSystemInfoObj );
- esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
- CloudRegionDetail cloudRegion = new CloudRegionDetail();
- cloudRegion.setEsrSystemInfoList(esrSystemInfoList);
- assertEquals(cloudRegion.getEsrSystemInfoList(), esrSystemInfoList);
- }
+ @Test
+ public void getterAndSetter4CloudOwner() {
+ final String cloudOwner = "cloud-owner-test";
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ cloudRegion.setCloudOwner(cloudOwner);
+ assertEquals(cloudRegion.getCloudOwner(), cloudOwner);
+ }
+
+ @Test
+ public void getterAndSetter4CloudRegionId() {
+ final String cloudRegionId = "cloud-region-id-test";
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ cloudRegion.setCloudRegionId(cloudRegionId);
+ assertEquals(cloudRegion.getCloudRegionId(), cloudRegionId);
+ }
+
+ @Test
+ public void getterAndSetter4CloudType() {
+ final String cloudType = "cloud-type-test";
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ cloudRegion.setCloudType(cloudType);
+ assertEquals(cloudRegion.getCloudType(), cloudType);
+ }
+
+ @Test
+ public void getterAndSetter4cloudRegionVersion() {
+ final String cloudRegionVersion = "cloud-region-version-test";
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ cloudRegion.setCloudRegionVersion(cloudRegionVersion);
+ assertEquals(cloudRegion.getCloudRegionVersion(), cloudRegionVersion);
+ }
+
+ @Test
+ public void getterAndSetter4ownerDefinedType() {
+ final String ownerDefinedType = "owner-defined-type-test";
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ cloudRegion.setOwnerDefinedType(ownerDefinedType);
+ assertEquals(cloudRegion.getOwnerDefinedType(), ownerDefinedType);
+ }
+
+ @Test
+ public void getterAndSetter4cloudZone() {
+ final String cloudZone = "cloudZone-test";
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ cloudRegion.setCloudZone(cloudZone);
+ assertEquals(cloudRegion.getCloudZone(), cloudZone);
+ }
+
+ @Test
+ public void getterAndSetter4complexName() {
+ final String complexName = "complexName-test";
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ cloudRegion.setComplexName(complexName);
+ assertEquals(cloudRegion.getComplexName(), complexName);
+ }
+
+ @Test
+ public void getterAndSetter4cloudExtraInfo() {
+ final String cloudExtraInfo = "cloudExtraInfo-test";
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ cloudRegion.setCloudExtraInfo(cloudExtraInfo);
+ assertEquals(cloudRegion.getCloudExtraInfo(), cloudExtraInfo);
+ }
+
+ @Test
+ public void getterAndSetter4esrSystemInfoList() {
+ final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+ List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
+ EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
+ esrSystemInfoObj.setEsrSystemInfoId("123");
+ esrSystemInfo.add(esrSystemInfoObj);
+ esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
+ CloudRegionDetail cloudRegion = new CloudRegionDetail();
+ cloudRegion.setEsrSystemInfoList(esrSystemInfoList);
+ assertEquals(cloudRegion.getEsrSystemInfoList(), esrSystemInfoList);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class CloudRegionListTest {
-
- @Test
- public void getterAndSetter4cloudRegion() {
- CloudRegionList cloudRegionList = new CloudRegionList();
- List<CloudRegion> cloudRegions = new ArrayList<>();
- CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setCloudOwner("owner");
- cloudRegion.setCloudRegionId("regionId");
- cloudRegions.add(cloudRegion);
- cloudRegionList.setCloudRegion(cloudRegions);
- assertEquals(cloudRegionList.getCloudRegion(), cloudRegions);
- }
+
+ @Test
+ public void getterAndSetter4cloudRegion() {
+ CloudRegionList cloudRegionList = new CloudRegionList();
+ List<CloudRegion> cloudRegions = new ArrayList<>();
+ CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setCloudOwner("owner");
+ cloudRegion.setCloudRegionId("regionId");
+ cloudRegions.add(cloudRegion);
+ cloudRegionList.setCloudRegion(cloudRegions);
+ assertEquals(cloudRegionList.getCloudRegion(), cloudRegions);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class CloudRegionTest {
- @Test
- public void getterAndSetter4CloudOwner(){
- final String cloudOwner = "cloud-owner-test";
- CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setCloudOwner(cloudOwner);
- assertEquals(cloudRegion.getCloudOwner(), cloudOwner);
- }
-
- @Test
- public void getterAndSetter4CloudRegionId(){
- final String cloudRegionId = "cloud-region-id-test";
- CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setCloudRegionId(cloudRegionId);
- assertEquals(cloudRegion.getCloudRegionId(), cloudRegionId);
- }
-
- @Test
- public void getterAndSetter4CloudType(){
- final String cloudType = "cloud-type-test";
- CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setCloudType(cloudType);
- assertEquals(cloudRegion.getCloudType(), cloudType);
- }
-
- @Test
- public void getterAndSetter4cloudRegionVersion(){
- final String cloudRegionVersion = "cloud-region-version-test";
- CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setCloudRegionVersion(cloudRegionVersion);
- assertEquals(cloudRegion.getCloudRegionVersion(), cloudRegionVersion);
- }
-
- @Test
- public void getterAndSetter4ownerDefinedType(){
- final String ownerDefinedType = "owner-defined-type-test";
- CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setOwnerDefinedType(ownerDefinedType);
- assertEquals(cloudRegion.getOwnerDefinedType(), ownerDefinedType);
- }
-
- @Test
- public void getterAndSetter4cloudZone(){
- final String cloudZone = "cloudZone-test";
- CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setCloudZone(cloudZone);
- assertEquals(cloudRegion.getCloudZone(), cloudZone);
- }
-
- @Test
- public void getterAndSetter4complexName(){
- final String complexName = "complexName-test";
- CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setComplexName(complexName);
- assertEquals(cloudRegion.getComplexName(), complexName);
- }
-
- @Test
- public void getterAndSetter4cloudExtraInfo(){
- final String cloudExtraInfo = "cloudExtraInfo-test";
- CloudRegion cloudRegion = new CloudRegion();
- cloudRegion.setCloudExtraInfo(cloudExtraInfo);
- assertEquals(cloudRegion.getCloudExtraInfo(), cloudExtraInfo);
- }
+ @Test
+ public void getterAndSetter4CloudOwner() {
+ final String cloudOwner = "cloud-owner-test";
+ CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setCloudOwner(cloudOwner);
+ assertEquals(cloudRegion.getCloudOwner(), cloudOwner);
+ }
+
+ @Test
+ public void getterAndSetter4CloudRegionId() {
+ final String cloudRegionId = "cloud-region-id-test";
+ CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setCloudRegionId(cloudRegionId);
+ assertEquals(cloudRegion.getCloudRegionId(), cloudRegionId);
+ }
+
+ @Test
+ public void getterAndSetter4CloudType() {
+ final String cloudType = "cloud-type-test";
+ CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setCloudType(cloudType);
+ assertEquals(cloudRegion.getCloudType(), cloudType);
+ }
+
+ @Test
+ public void getterAndSetter4cloudRegionVersion() {
+ final String cloudRegionVersion = "cloud-region-version-test";
+ CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setCloudRegionVersion(cloudRegionVersion);
+ assertEquals(cloudRegion.getCloudRegionVersion(), cloudRegionVersion);
+ }
+
+ @Test
+ public void getterAndSetter4ownerDefinedType() {
+ final String ownerDefinedType = "owner-defined-type-test";
+ CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setOwnerDefinedType(ownerDefinedType);
+ assertEquals(cloudRegion.getOwnerDefinedType(), ownerDefinedType);
+ }
+
+ @Test
+ public void getterAndSetter4cloudZone() {
+ final String cloudZone = "cloudZone-test";
+ CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setCloudZone(cloudZone);
+ assertEquals(cloudRegion.getCloudZone(), cloudZone);
+ }
+
+ @Test
+ public void getterAndSetter4complexName() {
+ final String complexName = "complexName-test";
+ CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setComplexName(complexName);
+ assertEquals(cloudRegion.getComplexName(), complexName);
+ }
+
+ @Test
+ public void getterAndSetter4cloudExtraInfo() {
+ final String cloudExtraInfo = "cloudExtraInfo-test";
+ CloudRegion cloudRegion = new CloudRegion();
+ cloudRegion.setCloudExtraInfo(cloudExtraInfo);
+ assertEquals(cloudRegion.getCloudExtraInfo(), cloudExtraInfo);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class EsrEmsDetailTest {
- @Test
- public void getterAndSetter4emsId(){
- final String emsId = "emsId-test";
- EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- esrEmsDetail.setEmsId(emsId);
- assertEquals(esrEmsDetail.getEmsId(), emsId);
- }
-
- @Test
- public void getterAndSetter4resourceVersion(){
- final String resourceVersion = "resourceVersion-test";
- EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- esrEmsDetail.setResourceVersion(resourceVersion);
- assertEquals(esrEmsDetail.getResourceVersion(), resourceVersion);
- }
-
- @Test
- public void getterAndSetter4esrSystemInfoList(){
- final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
- EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
- esrSystemInfoObj.setEsrSystemInfoId("123");
- esrSystemInfo.add(esrSystemInfoObj );
- esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
- EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
- esrEmsDetail.setEsrSystemInfoList(esrSystemInfoList);
- assertEquals(esrEmsDetail.getEsrSystemInfoList(), esrSystemInfoList);
- }
+ @Test
+ public void getterAndSetter4emsId() {
+ final String emsId = "emsId-test";
+ EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
+ esrEmsDetail.setEmsId(emsId);
+ assertEquals(esrEmsDetail.getEmsId(), emsId);
+ }
+
+ @Test
+ public void getterAndSetter4resourceVersion() {
+ final String resourceVersion = "resourceVersion-test";
+ EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
+ esrEmsDetail.setResourceVersion(resourceVersion);
+ assertEquals(esrEmsDetail.getResourceVersion(), resourceVersion);
+ }
+
+ @Test
+ public void getterAndSetter4esrSystemInfoList() {
+ final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+ List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
+ EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
+ esrSystemInfoObj.setEsrSystemInfoId("123");
+ esrSystemInfo.add(esrSystemInfoObj);
+ esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
+ EsrEmsDetail esrEmsDetail = new EsrEmsDetail();
+ esrEmsDetail.setEsrSystemInfoList(esrSystemInfoList);
+ assertEquals(esrEmsDetail.getEsrSystemInfoList(), esrSystemInfoList);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class EsrEmsListTest {
- @Test
- public void getterAndSetter4EsrEmsList() {
- EsrEmsList esrEmsList = new EsrEmsList();
- List<EsrEms> esrEmses = new ArrayList<>();
- EsrEms esrEms = new EsrEms();
- esrEms.setEmsId("123");
- esrEmses.add(esrEms);
- esrEmsList.setEsrEms(esrEmses);
- assertEquals(esrEmsList.getEsrEms(), esrEmses);
- }
+ @Test
+ public void getterAndSetter4EsrEmsList() {
+ EsrEmsList esrEmsList = new EsrEmsList();
+ List<EsrEms> esrEmses = new ArrayList<>();
+ EsrEms esrEms = new EsrEms();
+ esrEms.setEmsId("123");
+ esrEmses.add(esrEms);
+ esrEmsList.setEsrEms(esrEmses);
+ assertEquals(esrEmsList.getEsrEms(), esrEmses);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class EsrEmsTest {
- @Test
- public void getterAndSetter4emsId(){
- final String emsId = "emsId-test";
- EsrEms esrEms = new EsrEms();
- esrEms.setEmsId(emsId);
- assertEquals(esrEms.getEmsId(), emsId);
- }
-
- @Test
- public void getterAndSetter4resourceVersion(){
- final String resourceVersion = "resourceVersion-test";
- EsrEms esrEms = new EsrEms();
- esrEms.setResourceVersion(resourceVersion);
- assertEquals(esrEms.getResourceVersion(), resourceVersion);
- }
+ @Test
+ public void getterAndSetter4emsId() {
+ final String emsId = "emsId-test";
+ EsrEms esrEms = new EsrEms();
+ esrEms.setEmsId(emsId);
+ assertEquals(esrEms.getEmsId(), emsId);
+ }
+
+ @Test
+ public void getterAndSetter4resourceVersion() {
+ final String resourceVersion = "resourceVersion-test";
+ EsrEms esrEms = new EsrEms();
+ esrEms.setResourceVersion(resourceVersion);
+ assertEquals(esrEms.getResourceVersion(), resourceVersion);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class EsrSystemInfoListTest {
- @Test
- public void getterAndSetter4cloudRegion() {
- EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- List<EsrSystemInfo> esrSystemInfos = new ArrayList<>();
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setEsrSystemInfoId("123");
- esrSystemInfos.add(esrSystemInfo);
- esrSystemInfoList.setEsrSystemInfo(esrSystemInfos);
- assertEquals(esrSystemInfoList.getEsrSystemInfo(), esrSystemInfos);
- }
+ @Test
+ public void getterAndSetter4cloudRegion() {
+ EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+ List<EsrSystemInfo> esrSystemInfos = new ArrayList<>();
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setEsrSystemInfoId("123");
+ esrSystemInfos.add(esrSystemInfo);
+ esrSystemInfoList.setEsrSystemInfo(esrSystemInfos);
+ assertEquals(esrSystemInfoList.getEsrSystemInfo(), esrSystemInfos);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class EsrSystemInfoTest {
-
- @Test
- public void getterAndSetter4esrSystemInfoId(){
- final String esrSystemInfoId = "esrSystemInfoId-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setEsrSystemInfoId(esrSystemInfoId);
- assertEquals(esrSystemInfo.getEsrSystemInfoId(), esrSystemInfoId);
- }
-
- @Test
- public void getterAndSetter4systemName(){
- final String systemName = "systemName-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setSystemName(systemName);
- assertEquals(esrSystemInfo.getSystemName(), systemName);
- }
-
- @Test
- public void getterAndSetter4type(){
- final String type = "type-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setType(type);
- assertEquals(esrSystemInfo.getType(), type);
- }
-
- @Test
- public void getterAndSetter4vendor(){
- final String vendor = "vendor-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setVendor(vendor);
- assertEquals(esrSystemInfo.getVendor(), vendor);
- }
-
- @Test
- public void getterAndSetter4version(){
- final String version = "version-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setVersion(version);
- assertEquals(esrSystemInfo.getVersion(), version);
- }
-
- @Test
- public void getterAndSetter4serviceUrl(){
- final String serviceUrl = "serviceUrl-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setServiceUrl(serviceUrl);
- assertEquals(esrSystemInfo.getServiceUrl(), serviceUrl);
- }
-
- @Test
- public void getterAndSetter4userName(){
- final String userName = "userName-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setUserName(userName);
- assertEquals(esrSystemInfo.getUserName(), userName);
- }
-
- @Test
- public void getterAndSetter4password(){
- final String password = "password-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setPassword(password);
- assertEquals(esrSystemInfo.getPassword(), password);
- }
-
- @Test
- public void getterAndSetter4systemType(){
- final String systemType = "systemType-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setSystemType(systemType);
- assertEquals(esrSystemInfo.getSystemType(), systemType);
- }
-
- @Test
- public void getterAndSetter4protocol(){
- final String protocol = "protocol-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setProtocol(protocol);
- assertEquals(esrSystemInfo.getProtocol(), protocol);
- }
-
- @Test
- public void getterAndSetter4sslCassert(){
- final String sslCassert = "sslCassert-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setSslCassert(sslCassert);
- assertEquals(esrSystemInfo.getSslCassert(), sslCassert);
- }
-
- @Test
- public void getterAndSetter4sslInsecure(){
- final Boolean sslInsecure = true;
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setSslInsecure(sslInsecure);
- assertEquals(esrSystemInfo.getSslInsecure(), sslInsecure);
- }
-
- @Test
- public void getterAndSetter4ipAddress(){
- final String ipAddress = "ipAddress-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setIpAddress(ipAddress);
- assertEquals(esrSystemInfo.getIpAddress(), ipAddress);
- }
-
- @Test
- public void getterAndSetter4port(){
- final String port = "port-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setIpAddress(port);
- assertEquals(esrSystemInfo.getIpAddress(), port);
- }
-
- @Test
- public void getterAndSetter4cloudDomain(){
- final String cloudDomain = "cloudDomain-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setCloudDomain(cloudDomain);
- assertEquals(esrSystemInfo.getCloudDomain(), cloudDomain);
- }
-
- @Test
- public void getterAndSetter4defaultTenant(){
- final String defaultTenant = "defaultTenant-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setDefaultTenant(defaultTenant);
- assertEquals(esrSystemInfo.getDefaultTenant(), defaultTenant);
- }
-
- @Test
- public void getterAndSetter4passive(){
- final Boolean passive = true;
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setPassive(passive);
- assertEquals(esrSystemInfo.getPassive(), passive);
- }
-
- @Test
- public void getterAndSetter4remotePath(){
- final String remotePath = "remotePath-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setRemotePath(remotePath);
- assertEquals(esrSystemInfo.getRemotePath(), remotePath);
- }
-
- @Test
- public void getterAndSetter4systemStatus(){
- final String systemStatus = "defaultTenant-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setSystemStatus(systemStatus);
- assertEquals(esrSystemInfo.getSystemStatus(), systemStatus);
- }
-
- @Test
- public void getterAndSetter4resourceVersion(){
- final String resourceVersion = "resourceVersion-test";
- EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
- esrSystemInfo.setResouceVersion(resourceVersion);
- assertEquals(esrSystemInfo.getResouceVersion(), resourceVersion);
- }
+
+ @Test
+ public void getterAndSetter4esrSystemInfoId() {
+ final String esrSystemInfoId = "esrSystemInfoId-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setEsrSystemInfoId(esrSystemInfoId);
+ assertEquals(esrSystemInfo.getEsrSystemInfoId(), esrSystemInfoId);
+ }
+
+ @Test
+ public void getterAndSetter4systemName() {
+ final String systemName = "systemName-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setSystemName(systemName);
+ assertEquals(esrSystemInfo.getSystemName(), systemName);
+ }
+
+ @Test
+ public void getterAndSetter4type() {
+ final String type = "type-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setType(type);
+ assertEquals(esrSystemInfo.getType(), type);
+ }
+
+ @Test
+ public void getterAndSetter4vendor() {
+ final String vendor = "vendor-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setVendor(vendor);
+ assertEquals(esrSystemInfo.getVendor(), vendor);
+ }
+
+ @Test
+ public void getterAndSetter4version() {
+ final String version = "version-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setVersion(version);
+ assertEquals(esrSystemInfo.getVersion(), version);
+ }
+
+ @Test
+ public void getterAndSetter4serviceUrl() {
+ final String serviceUrl = "serviceUrl-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setServiceUrl(serviceUrl);
+ assertEquals(esrSystemInfo.getServiceUrl(), serviceUrl);
+ }
+
+ @Test
+ public void getterAndSetter4userName() {
+ final String userName = "userName-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setUserName(userName);
+ assertEquals(esrSystemInfo.getUserName(), userName);
+ }
+
+ @Test
+ public void getterAndSetter4password() {
+ final String password = "password-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setPassword(password);
+ assertEquals(esrSystemInfo.getPassword(), password);
+ }
+
+ @Test
+ public void getterAndSetter4systemType() {
+ final String systemType = "systemType-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setSystemType(systemType);
+ assertEquals(esrSystemInfo.getSystemType(), systemType);
+ }
+
+ @Test
+ public void getterAndSetter4protocol() {
+ final String protocol = "protocol-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setProtocol(protocol);
+ assertEquals(esrSystemInfo.getProtocol(), protocol);
+ }
+
+ @Test
+ public void getterAndSetter4sslCassert() {
+ final String sslCassert = "sslCassert-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setSslCassert(sslCassert);
+ assertEquals(esrSystemInfo.getSslCassert(), sslCassert);
+ }
+
+ @Test
+ public void getterAndSetter4sslInsecure() {
+ final Boolean sslInsecure = true;
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setSslInsecure(sslInsecure);
+ assertEquals(esrSystemInfo.getSslInsecure(), sslInsecure);
+ }
+
+ @Test
+ public void getterAndSetter4ipAddress() {
+ final String ipAddress = "ipAddress-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setIpAddress(ipAddress);
+ assertEquals(esrSystemInfo.getIpAddress(), ipAddress);
+ }
+
+ @Test
+ public void getterAndSetter4port() {
+ final String port = "port-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setIpAddress(port);
+ assertEquals(esrSystemInfo.getIpAddress(), port);
+ }
+
+ @Test
+ public void getterAndSetter4cloudDomain() {
+ final String cloudDomain = "cloudDomain-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setCloudDomain(cloudDomain);
+ assertEquals(esrSystemInfo.getCloudDomain(), cloudDomain);
+ }
+
+ @Test
+ public void getterAndSetter4defaultTenant() {
+ final String defaultTenant = "defaultTenant-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setDefaultTenant(defaultTenant);
+ assertEquals(esrSystemInfo.getDefaultTenant(), defaultTenant);
+ }
+
+ @Test
+ public void getterAndSetter4passive() {
+ final Boolean passive = true;
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setPassive(passive);
+ assertEquals(esrSystemInfo.getPassive(), passive);
+ }
+
+ @Test
+ public void getterAndSetter4remotePath() {
+ final String remotePath = "remotePath-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setRemotePath(remotePath);
+ assertEquals(esrSystemInfo.getRemotePath(), remotePath);
+ }
+
+ @Test
+ public void getterAndSetter4systemStatus() {
+ final String systemStatus = "defaultTenant-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setSystemStatus(systemStatus);
+ assertEquals(esrSystemInfo.getSystemStatus(), systemStatus);
+ }
+
+ @Test
+ public void getterAndSetter4resourceVersion() {
+ final String resourceVersion = "resourceVersion-test";
+ EsrSystemInfo esrSystemInfo = new EsrSystemInfo();
+ esrSystemInfo.setResouceVersion(resourceVersion);
+ assertEquals(esrSystemInfo.getResouceVersion(), resourceVersion);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class EsrThirdpartySdncDetailTest {
- @Test
- public void getterAndSetter4thirdpartySdncId(){
- final String thirdpartySdncId = "thirdpartySdncId-test";
- EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
- esrThirdpartySdncDetail.setThirdpartySdncId(thirdpartySdncId);
- assertEquals(esrThirdpartySdncDetail.getThirdpartySdncId(), thirdpartySdncId);
- }
-
- @Test
- public void getterAndSetter4resourceVersion(){
- final String resourceVersion = "resourceVersion-test";
- EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
- esrThirdpartySdncDetail.setResourceVersion(resourceVersion);
- assertEquals(esrThirdpartySdncDetail.getResourceVersion(), resourceVersion);
- }
-
- @Test
- public void getterAndSetter4location(){
- final String location = "location-test";
- EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
- esrThirdpartySdncDetail.setLocation(location);
- assertEquals(esrThirdpartySdncDetail.getLocation(), location);
- }
-
- @Test
- public void getterAndSetter4productName(){
- final String productName = "productName-test";
- EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
- esrThirdpartySdncDetail.setProductName(productName);
- assertEquals(esrThirdpartySdncDetail.getProductName(), productName);
- }
-
- @Test
- public void getterAndSetter4esrSystemInfoList(){
- final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
- EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
- esrSystemInfoObj.setEsrSystemInfoId("123");
- esrSystemInfo.add(esrSystemInfoObj );
- esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
- EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
- esrThirdpartySdncDetail.setEsrSystemInfoList(esrSystemInfoList);
- assertEquals(esrThirdpartySdncDetail.getEsrSystemInfoList(), esrSystemInfoList);
- }
+ @Test
+ public void getterAndSetter4thirdpartySdncId() {
+ final String thirdpartySdncId = "thirdpartySdncId-test";
+ EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
+ esrThirdpartySdncDetail.setThirdpartySdncId(thirdpartySdncId);
+ assertEquals(esrThirdpartySdncDetail.getThirdpartySdncId(), thirdpartySdncId);
+ }
+
+ @Test
+ public void getterAndSetter4resourceVersion() {
+ final String resourceVersion = "resourceVersion-test";
+ EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
+ esrThirdpartySdncDetail.setResourceVersion(resourceVersion);
+ assertEquals(esrThirdpartySdncDetail.getResourceVersion(), resourceVersion);
+ }
+
+ @Test
+ public void getterAndSetter4location() {
+ final String location = "location-test";
+ EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
+ esrThirdpartySdncDetail.setLocation(location);
+ assertEquals(esrThirdpartySdncDetail.getLocation(), location);
+ }
+
+ @Test
+ public void getterAndSetter4productName() {
+ final String productName = "productName-test";
+ EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
+ esrThirdpartySdncDetail.setProductName(productName);
+ assertEquals(esrThirdpartySdncDetail.getProductName(), productName);
+ }
+
+ @Test
+ public void getterAndSetter4esrSystemInfoList() {
+ final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+ List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
+ EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
+ esrSystemInfoObj.setEsrSystemInfoId("123");
+ esrSystemInfo.add(esrSystemInfoObj);
+ esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
+ EsrThirdpartySdncDetail esrThirdpartySdncDetail = new EsrThirdpartySdncDetail();
+ esrThirdpartySdncDetail.setEsrSystemInfoList(esrSystemInfoList);
+ assertEquals(esrThirdpartySdncDetail.getEsrSystemInfoList(), esrSystemInfoList);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class EsrThirdpartySdncListTest {
- @Test
- public void getterAndSetter4EsrThirdpartySdncList() {
- EsrThirdpartySdncList esrThirdpartySdncList = new EsrThirdpartySdncList();
- List<EsrThirdpartySdnc> esrThirdpartySdncs = new ArrayList<>();
- EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
- esrThirdpartySdnc.setThirdpartySdncId("123");
- esrThirdpartySdncs.add(esrThirdpartySdnc);
- esrThirdpartySdncList.setEsrThirdpartySdnc(esrThirdpartySdncs);
- assertEquals(esrThirdpartySdncList.getEsrThirdpartySdnc(), esrThirdpartySdncs);
- }
+ @Test
+ public void getterAndSetter4EsrThirdpartySdncList() {
+ EsrThirdpartySdncList esrThirdpartySdncList = new EsrThirdpartySdncList();
+ List<EsrThirdpartySdnc> esrThirdpartySdncs = new ArrayList<>();
+ EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
+ esrThirdpartySdnc.setThirdpartySdncId("123");
+ esrThirdpartySdncs.add(esrThirdpartySdnc);
+ esrThirdpartySdncList.setEsrThirdpartySdnc(esrThirdpartySdncs);
+ assertEquals(esrThirdpartySdncList.getEsrThirdpartySdnc(), esrThirdpartySdncs);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class EsrThirdpartySdncTest {
- @Test
- public void getterAndSetter4thirdpartySdncId(){
- final String thirdpartySdncId = "thirdpartySdncId-test";
- EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
- esrThirdpartySdnc.setThirdpartySdncId(thirdpartySdncId);
- assertEquals(esrThirdpartySdnc.getThirdpartySdncId(), thirdpartySdncId);
- }
-
- @Test
- public void getterAndSetter4resourceVersion(){
- final String resourceVersion = "resourceVersion-test";
- EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
- esrThirdpartySdnc.setResourceVersion(resourceVersion);
- assertEquals(esrThirdpartySdnc.getResourceVersion(), resourceVersion);
- }
-
- @Test
- public void getterAndSetter4location(){
- final String location = "location-test";
- EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
- esrThirdpartySdnc.setLocation(location);
- assertEquals(esrThirdpartySdnc.getLocation(), location);
- }
-
- @Test
- public void getterAndSetter4productName(){
- final String productName = "productName-test";
- EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
- esrThirdpartySdnc.setProductName(productName);
- assertEquals(esrThirdpartySdnc.getProductName(), productName);
- }
+ @Test
+ public void getterAndSetter4thirdpartySdncId() {
+ final String thirdpartySdncId = "thirdpartySdncId-test";
+ EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
+ esrThirdpartySdnc.setThirdpartySdncId(thirdpartySdncId);
+ assertEquals(esrThirdpartySdnc.getThirdpartySdncId(), thirdpartySdncId);
+ }
+
+ @Test
+ public void getterAndSetter4resourceVersion() {
+ final String resourceVersion = "resourceVersion-test";
+ EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
+ esrThirdpartySdnc.setResourceVersion(resourceVersion);
+ assertEquals(esrThirdpartySdnc.getResourceVersion(), resourceVersion);
+ }
+
+ @Test
+ public void getterAndSetter4location() {
+ final String location = "location-test";
+ EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
+ esrThirdpartySdnc.setLocation(location);
+ assertEquals(esrThirdpartySdnc.getLocation(), location);
+ }
+
+ @Test
+ public void getterAndSetter4productName() {
+ final String productName = "productName-test";
+ EsrThirdpartySdnc esrThirdpartySdnc = new EsrThirdpartySdnc();
+ esrThirdpartySdnc.setProductName(productName);
+ assertEquals(esrThirdpartySdnc.getProductName(), productName);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class EsrVnfmDetailTest {
- @Test
- public void getterAndSetter4vnfmId(){
- final String vnfmId = "vnfmId-test";
- EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
- esrVnfm.setVnfmId(vnfmId);
- assertEquals(esrVnfm.getVnfmId(), vnfmId);
- }
-
- @Test
- public void getterAndSetter4resourceVersion(){
- final String resourceVersion = "resourceVersion-test";
- EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
- esrVnfm.setResourceVersion(resourceVersion);
- assertEquals(esrVnfm.getResourceVersion(), resourceVersion);
- }
-
- @Test
- public void getterAndSetter4vimId(){
- final String vimId = "vimId-test";
- EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
- esrVnfm.setVimId(vimId);
- assertEquals(esrVnfm.getVimId(), vimId);
- }
-
- @Test
- public void getterAndSetter4certificateUrl(){
- final String certificateUrl = "certificateUrl-test";
- EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
- esrVnfm.setCertificateUrl(certificateUrl);
- assertEquals(esrVnfm.getCertificateUrl(), certificateUrl);
- }
-
- @Test
- public void getterAndSetter4esrSystemInfoList(){
- final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
- EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
- esrSystemInfoObj.setEsrSystemInfoId("123");
- esrSystemInfo.add(esrSystemInfoObj );
- esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
- EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
- esrVnfmDetail.setEsrSystemInfoList(esrSystemInfoList);
- assertEquals(esrVnfmDetail.getEsrSystemInfoList(), esrSystemInfoList);
- }
+ @Test
+ public void getterAndSetter4vnfmId() {
+ final String vnfmId = "vnfmId-test";
+ EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
+ esrVnfm.setVnfmId(vnfmId);
+ assertEquals(esrVnfm.getVnfmId(), vnfmId);
+ }
+
+ @Test
+ public void getterAndSetter4resourceVersion() {
+ final String resourceVersion = "resourceVersion-test";
+ EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
+ esrVnfm.setResourceVersion(resourceVersion);
+ assertEquals(esrVnfm.getResourceVersion(), resourceVersion);
+ }
+
+ @Test
+ public void getterAndSetter4vimId() {
+ final String vimId = "vimId-test";
+ EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
+ esrVnfm.setVimId(vimId);
+ assertEquals(esrVnfm.getVimId(), vimId);
+ }
+
+ @Test
+ public void getterAndSetter4certificateUrl() {
+ final String certificateUrl = "certificateUrl-test";
+ EsrVnfmDetail esrVnfm = new EsrVnfmDetail();
+ esrVnfm.setCertificateUrl(certificateUrl);
+ assertEquals(esrVnfm.getCertificateUrl(), certificateUrl);
+ }
+
+ @Test
+ public void getterAndSetter4esrSystemInfoList() {
+ final EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+ List<EsrSystemInfo> esrSystemInfo = new ArrayList<>();
+ EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
+ esrSystemInfoObj.setEsrSystemInfoId("123");
+ esrSystemInfo.add(esrSystemInfoObj);
+ esrSystemInfoList.setEsrSystemInfo(esrSystemInfo);
+ EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
+ esrVnfmDetail.setEsrSystemInfoList(esrSystemInfoList);
+ assertEquals(esrVnfmDetail.getEsrSystemInfoList(), esrSystemInfoList);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class EsrVnfmListTest {
- @Test
- public void getterAndSetter4EsrVnfmList() {
- EsrVnfmList esrVnfmList = new EsrVnfmList();
- List<EsrVnfm> esrVnfms = new ArrayList<>();
- EsrVnfm esrVnfm = new EsrVnfm();
- esrVnfm.setVnfmId("fadasf");
- esrVnfms.add(esrVnfm);
- esrVnfmList.setEsrVnfm(esrVnfms);
- assertEquals(esrVnfmList.getEsrVnfm(), esrVnfms);
- }
+ @Test
+ public void getterAndSetter4EsrVnfmList() {
+ EsrVnfmList esrVnfmList = new EsrVnfmList();
+ List<EsrVnfm> esrVnfms = new ArrayList<>();
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setVnfmId("fadasf");
+ esrVnfms.add(esrVnfm);
+ esrVnfmList.setEsrVnfm(esrVnfms);
+ assertEquals(esrVnfmList.getEsrVnfm(), esrVnfms);
+ }
}
package org.onap.aai.esr.entity.aai;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class EsrVnfmTest {
- @Test
- public void getterAndSetter4vnfmId(){
- final String vnfmId = "vnfmId-test";
- EsrVnfm esrVnfm = new EsrVnfm();
- esrVnfm.setVnfmId(vnfmId);
- assertEquals(esrVnfm.getVnfmId(), vnfmId);
- }
-
- @Test
- public void getterAndSetter4resourceVersion(){
- final String resourceVersion = "resourceVersion-test";
- EsrVnfm esrVnfm = new EsrVnfm();
- esrVnfm.setResourceVersion(resourceVersion);
- assertEquals(esrVnfm.getResourceVersion(), resourceVersion);
- }
-
- @Test
- public void getterAndSetter4vimId(){
- final String vimId = "vimId-test";
- EsrVnfm esrVnfm = new EsrVnfm();
- esrVnfm.setVimId(vimId);
- assertEquals(esrVnfm.getVimId(), vimId);
- }
-
- @Test
- public void getterAndSetter4certificateUrl(){
- final String certificateUrl = "certificateUrl-test";
- EsrVnfm esrVnfm = new EsrVnfm();
- esrVnfm.setCertificateUrl(certificateUrl);
- assertEquals(esrVnfm.getCertificateUrl(), certificateUrl);
- }
+ @Test
+ public void getterAndSetter4vnfmId() {
+ final String vnfmId = "vnfmId-test";
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setVnfmId(vnfmId);
+ assertEquals(esrVnfm.getVnfmId(), vnfmId);
+ }
+
+ @Test
+ public void getterAndSetter4resourceVersion() {
+ final String resourceVersion = "resourceVersion-test";
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setResourceVersion(resourceVersion);
+ assertEquals(esrVnfm.getResourceVersion(), resourceVersion);
+ }
+
+ @Test
+ public void getterAndSetter4vimId() {
+ final String vimId = "vimId-test";
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setVimId(vimId);
+ assertEquals(esrVnfm.getVimId(), vimId);
+ }
+
+ @Test
+ public void getterAndSetter4certificateUrl() {
+ final String certificateUrl = "certificateUrl-test";
+ EsrVnfm esrVnfm = new EsrVnfm();
+ esrVnfm.setCertificateUrl(certificateUrl);
+ assertEquals(esrVnfm.getCertificateUrl(), certificateUrl);
+ }
}
package org.onap.aai.esr.entity.rest;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class AlarmAddrTest {
- @Test
- public void getterAndSetter4ip(){
- final String ip = "127.0.0.1";
- AlarmAddr alarmAddr = new AlarmAddr();
- alarmAddr.setIp(ip);
- assertEquals(alarmAddr.getIp(), ip);
- }
-
- @Test
- public void getterAndSetter4port(){
- final String port = "8080";
- AlarmAddr alarmAddr = new AlarmAddr();
- alarmAddr.setPort(port);
- assertEquals(alarmAddr.getPort(), port);
- }
-
- @Test
- public void getterAndSetter4user(){
- final String user = "root";
- AlarmAddr alarmAddr = new AlarmAddr();
- alarmAddr.setUser(user);
- assertEquals(alarmAddr.getUser(), user);
- }
-
- @Test
- public void getterAndSetter4password(){
- final String password = "dfasfa";
- AlarmAddr alarmAddr = new AlarmAddr();
- alarmAddr.setPassword(password);
- assertEquals(alarmAddr.getPassword(), password);
- }
+ @Test
+ public void getterAndSetter4ip() {
+ final String ip = "127.0.0.1";
+ AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setIp(ip);
+ assertEquals(alarmAddr.getIp(), ip);
+ }
+
+ @Test
+ public void getterAndSetter4port() {
+ final String port = "8080";
+ AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setPort(port);
+ assertEquals(alarmAddr.getPort(), port);
+ }
+
+ @Test
+ public void getterAndSetter4user() {
+ final String user = "root";
+ AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setUser(user);
+ assertEquals(alarmAddr.getUser(), user);
+ }
+
+ @Test
+ public void getterAndSetter4password() {
+ final String password = "dfasfa";
+ AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setPassword(password);
+ assertEquals(alarmAddr.getPassword(), password);
+ }
}
package org.onap.aai.esr.entity.rest;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class CommonRegisterResponseTest {
- @Test
- public void getterAndSetter4id(){
- final String id = "312erqdfa";
- CommonRegisterResponse commonRegisterResponse = new CommonRegisterResponse();
- commonRegisterResponse.setId(id);
- assertEquals(commonRegisterResponse.getId(), id);
- }
+ @Test
+ public void getterAndSetter4id() {
+ final String id = "312erqdfa";
+ CommonRegisterResponse commonRegisterResponse = new CommonRegisterResponse();
+ commonRegisterResponse.setId(id);
+ assertEquals(commonRegisterResponse.getId(), id);
+ }
}
package org.onap.aai.esr.entity.rest;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class EmsRegisterInfoTest {
- @Test
- public void getterAndSetter4emsId(){
- final String emsId = "dafadf";
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- emsRegisterInfo.setEmsId(emsId);
- assertEquals(emsRegisterInfo.getEmsId(), emsId);
- }
-
- @Test
- public void getterAndSetter4name() {
- final String name = "dafadf";
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- emsRegisterInfo.setName(name);
- assertEquals(emsRegisterInfo.getName(), name);
- }
-
- @Test
- public void getterAndSetter4vendor(){
- final String vendor = "dafadf";
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- emsRegisterInfo.setVendor(vendor);
- assertEquals(emsRegisterInfo.getVendor(), vendor);
- }
-
- @Test
- public void getterAndSetter4version(){
- final String version = "dafadf";
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- emsRegisterInfo.setVersion(version);
- assertEquals(emsRegisterInfo.getVersion(), version);
- }
-
- @Test
- public void getterAndSetter4resouceAddr(){
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- final FtpAddr resourceAddr = new FtpAddr();
- resourceAddr.setFtptype("sftp");
- emsRegisterInfo.setResourceAddr(resourceAddr);
- assertEquals(emsRegisterInfo.getResourceAddr(), resourceAddr);
- }
-
- @Test
- public void getterAndSetter4performanceAddr(){
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- final FtpAddr performanceAddr = new FtpAddr();
- performanceAddr.setFtptype("sftp");
- emsRegisterInfo.setPerformanceAddr(performanceAddr);
- assertEquals(emsRegisterInfo.getPerformanceAddr(), performanceAddr);
- }
-
- @Test
- public void getterAndSetter4alarmAddr(){
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- final AlarmAddr alarmAddr = new AlarmAddr();
- alarmAddr.setIp("127.0.0.1");
- emsRegisterInfo.setAlarmAddr(alarmAddr);
- assertEquals(emsRegisterInfo.getAlarmAddr(), alarmAddr);
- }
+ @Test
+ public void getterAndSetter4emsId() {
+ final String emsId = "dafadf";
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ emsRegisterInfo.setEmsId(emsId);
+ assertEquals(emsRegisterInfo.getEmsId(), emsId);
+ }
+
+ @Test
+ public void getterAndSetter4name() {
+ final String name = "dafadf";
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ emsRegisterInfo.setName(name);
+ assertEquals(emsRegisterInfo.getName(), name);
+ }
+
+ @Test
+ public void getterAndSetter4vendor() {
+ final String vendor = "dafadf";
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ emsRegisterInfo.setVendor(vendor);
+ assertEquals(emsRegisterInfo.getVendor(), vendor);
+ }
+
+ @Test
+ public void getterAndSetter4version() {
+ final String version = "dafadf";
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ emsRegisterInfo.setVersion(version);
+ assertEquals(emsRegisterInfo.getVersion(), version);
+ }
+
+ @Test
+ public void getterAndSetter4resouceAddr() {
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ final FtpAddr resourceAddr = new FtpAddr();
+ resourceAddr.setFtptype("sftp");
+ emsRegisterInfo.setResourceAddr(resourceAddr);
+ assertEquals(emsRegisterInfo.getResourceAddr(), resourceAddr);
+ }
+
+ @Test
+ public void getterAndSetter4performanceAddr() {
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ final FtpAddr performanceAddr = new FtpAddr();
+ performanceAddr.setFtptype("sftp");
+ emsRegisterInfo.setPerformanceAddr(performanceAddr);
+ assertEquals(emsRegisterInfo.getPerformanceAddr(), performanceAddr);
+ }
+
+ @Test
+ public void getterAndSetter4alarmAddr() {
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ final AlarmAddr alarmAddr = new AlarmAddr();
+ alarmAddr.setIp("127.0.0.1");
+ emsRegisterInfo.setAlarmAddr(alarmAddr);
+ assertEquals(emsRegisterInfo.getAlarmAddr(), alarmAddr);
+ }
}
package org.onap.aai.esr.entity.rest;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class FtpAddrTest {
- @Test
- public void getterAndSetter4ip(){
- final String ip = "127.0.0.1";
- FtpAddr ftpAddr = new FtpAddr();
- ftpAddr.setIp(ip);
- assertEquals(ftpAddr.getIp(), ip);
- }
-
- @Test
- public void getterAndSetter4port(){
- final String port = "8080";
- FtpAddr ftpAddr = new FtpAddr();
- ftpAddr.setPort(port);
- assertEquals(ftpAddr.getPort(), port);
- }
-
- @Test
- public void getterAndSetter4user(){
- final String user = "root";
- FtpAddr ftpAddr = new FtpAddr();
- ftpAddr.setUser(user);
- assertEquals(ftpAddr.getUser(), user);
- }
-
- @Test
- public void getterAndSetter4password(){
- final String password = "dfasfa";
- FtpAddr ftpAddr = new FtpAddr();
- ftpAddr.setPassword(password);
- assertEquals(ftpAddr.getPassword(), password);
- }
-
- @Test
- public void getterAndSetter4ftptype(){
- final String ftptype = "sftp";
- FtpAddr ftpAddr = new FtpAddr();
- ftpAddr.setFtptype(ftptype);
- assertEquals(ftpAddr.getFtptype(), ftptype);
- }
-
- @Test
- public void getterAndSetter4remotepath(){
- final String remotepath = "/home/opt/";
- FtpAddr ftpAddr = new FtpAddr();
- ftpAddr.setRemotepath(remotepath);
- assertEquals(ftpAddr.getRemotepath(), remotepath);
- }
-
- @Test
- public void getterAndSetter4passive(){
- final Boolean passive = true;
- FtpAddr ftpAddr = new FtpAddr();
- ftpAddr.setPassive(passive);
- assertEquals(ftpAddr.getPassive(), passive);
- }
+ @Test
+ public void getterAndSetter4ip() {
+ final String ip = "127.0.0.1";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setIp(ip);
+ assertEquals(ftpAddr.getIp(), ip);
+ }
+
+ @Test
+ public void getterAndSetter4port() {
+ final String port = "8080";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setPort(port);
+ assertEquals(ftpAddr.getPort(), port);
+ }
+
+ @Test
+ public void getterAndSetter4user() {
+ final String user = "root";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setUser(user);
+ assertEquals(ftpAddr.getUser(), user);
+ }
+
+ @Test
+ public void getterAndSetter4password() {
+ final String password = "dfasfa";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setPassword(password);
+ assertEquals(ftpAddr.getPassword(), password);
+ }
+
+ @Test
+ public void getterAndSetter4ftptype() {
+ final String ftptype = "sftp";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setFtptype(ftptype);
+ assertEquals(ftpAddr.getFtptype(), ftptype);
+ }
+
+ @Test
+ public void getterAndSetter4remotepath() {
+ final String remotepath = "/home/opt/";
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setRemotepath(remotepath);
+ assertEquals(ftpAddr.getRemotepath(), remotepath);
+ }
+
+ @Test
+ public void getterAndSetter4passive() {
+ final Boolean passive = true;
+ FtpAddr ftpAddr = new FtpAddr();
+ ftpAddr.setPassive(passive);
+ assertEquals(ftpAddr.getPassive(), passive);
+ }
}
package org.onap.aai.esr.entity.rest;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class ThirdpartySdncRegisterInfoTest {
- @Test
- public void getterAndSetter4cloudDomain(){
- final String thirdpartySdncId = "312erqdfa";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setThirdpartySdncId(thirdpartySdncId);
- assertEquals(thirdpartySdncRegisterInfo.getThirdpartySdncId(), thirdpartySdncId);
- }
-
- @Test
- public void getterAndSetter4name(){
- final String name = "sdnc-test";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setName(name);
- assertEquals(thirdpartySdncRegisterInfo.getName(), name);
- }
-
- @Test
- public void getterAndSetter4vendor(){
- final String vendor = "zte";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setVendor(vendor);
- assertEquals(thirdpartySdncRegisterInfo.getVendor(), vendor);
- }
-
- @Test
- public void getterAndSetter4version(){
- final String version = "v1.0";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setVersion(version);
- assertEquals(thirdpartySdncRegisterInfo.getVersion(), version);
- }
-
- @Test
- public void getterAndSetter4type(){
- final String type = "type-test";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setType(type);
- assertEquals(thirdpartySdncRegisterInfo.getType(), type);
- }
-
- @Test
- public void getterAndSetter4location(){
- final String location = "312erqdfa";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setLocation(location);
- assertEquals(thirdpartySdncRegisterInfo.getLocation(), location);
- }
-
- @Test
- public void getterAndSetter4url(){
- final String url = "http://13.44.22.11:5000";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setUrl(url);
- assertEquals(thirdpartySdncRegisterInfo.getUrl(), url);
- }
-
- @Test
- public void getterAndSetter4userName(){
- final String userName = "root";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setUserName(userName);
- assertEquals(thirdpartySdncRegisterInfo.getUserName(), userName);
- }
-
- @Test
- public void getterAndSetter4password(){
- final String password = "root";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setPassword(password);
- assertEquals(thirdpartySdncRegisterInfo.getPassword(), password);
- }
-
- @Test
- public void getterAndSetter4productName(){
- final String productName = "sdnctest";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setProductName(productName);
- assertEquals(thirdpartySdncRegisterInfo.getProductName(), productName);
- }
-
- @Test
- public void getterAndSetter4protocol(){
- final String protocol = "root";
- ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- thirdpartySdncRegisterInfo.setProtocol(protocol);
- assertEquals(thirdpartySdncRegisterInfo.getProtocol(), protocol);
- }
+ @Test
+ public void getterAndSetter4cloudDomain() {
+ final String thirdpartySdncId = "312erqdfa";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setThirdpartySdncId(thirdpartySdncId);
+ assertEquals(thirdpartySdncRegisterInfo.getThirdpartySdncId(), thirdpartySdncId);
+ }
+
+ @Test
+ public void getterAndSetter4name() {
+ final String name = "sdnc-test";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setName(name);
+ assertEquals(thirdpartySdncRegisterInfo.getName(), name);
+ }
+
+ @Test
+ public void getterAndSetter4vendor() {
+ final String vendor = "zte";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setVendor(vendor);
+ assertEquals(thirdpartySdncRegisterInfo.getVendor(), vendor);
+ }
+
+ @Test
+ public void getterAndSetter4version() {
+ final String version = "v1.0";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setVersion(version);
+ assertEquals(thirdpartySdncRegisterInfo.getVersion(), version);
+ }
+
+ @Test
+ public void getterAndSetter4type() {
+ final String type = "type-test";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setType(type);
+ assertEquals(thirdpartySdncRegisterInfo.getType(), type);
+ }
+
+ @Test
+ public void getterAndSetter4location() {
+ final String location = "312erqdfa";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setLocation(location);
+ assertEquals(thirdpartySdncRegisterInfo.getLocation(), location);
+ }
+
+ @Test
+ public void getterAndSetter4url() {
+ final String url = "http://13.44.22.11:5000";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setUrl(url);
+ assertEquals(thirdpartySdncRegisterInfo.getUrl(), url);
+ }
+
+ @Test
+ public void getterAndSetter4userName() {
+ final String userName = "root";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setUserName(userName);
+ assertEquals(thirdpartySdncRegisterInfo.getUserName(), userName);
+ }
+
+ @Test
+ public void getterAndSetter4password() {
+ final String password = "root";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setPassword(password);
+ assertEquals(thirdpartySdncRegisterInfo.getPassword(), password);
+ }
+
+ @Test
+ public void getterAndSetter4productName() {
+ final String productName = "sdnctest";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setProductName(productName);
+ assertEquals(thirdpartySdncRegisterInfo.getProductName(), productName);
+ }
+
+ @Test
+ public void getterAndSetter4protocol() {
+ final String protocol = "root";
+ ThirdpartySdncRegisterInfo thirdpartySdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ thirdpartySdncRegisterInfo.setProtocol(protocol);
+ assertEquals(thirdpartySdncRegisterInfo.getProtocol(), protocol);
+ }
}
package org.onap.aai.esr.entity.rest;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class VimAuthInfoTest {
- @Test
- public void getterAndSetter4cloudDomain(){
- final String cloudDomain = "chengdu";
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- vimAuthInfo.setCloudDomain(cloudDomain);
- assertEquals(vimAuthInfo.getCloudDomain(), cloudDomain);
- }
-
- @Test
- public void getterAndSetter4userName(){
- final String userName = "nancy";
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- vimAuthInfo.setUserName(userName);
- assertEquals(vimAuthInfo.getUserName(), userName);
- }
-
- @Test
- public void getterAndSetter4password(){
- final String password = "dasffa";
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- vimAuthInfo.setPassword(password);
- assertEquals(vimAuthInfo.getPassword(), password);
- }
-
- @Test
- public void getterAndSetter4authUrl(){
- final String authUrl = "http://127.0.0.1:5000/auth/";
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- vimAuthInfo.setAuthUrl(authUrl);
- assertEquals(vimAuthInfo.getAuthUrl(), authUrl);
- }
-
- @Test
- public void getterAndSetter4sslCacert(){
- final String sslCacert = "fdfafda";
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- vimAuthInfo.setSslCacert(sslCacert);
- assertEquals(vimAuthInfo.getSslCacert(), sslCacert);
- }
-
- @Test
- public void getterAndSetter4sslInsecure(){
- final Boolean sslInsecure = true;
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- vimAuthInfo.setSslInsecure(sslInsecure);
- assertEquals(vimAuthInfo.getSslInsecure(), sslInsecure);
- }
+ @Test
+ public void getterAndSetter4cloudDomain() {
+ final String cloudDomain = "chengdu";
+ VimAuthInfo vimAuthInfo = new VimAuthInfo();
+ vimAuthInfo.setCloudDomain(cloudDomain);
+ assertEquals(vimAuthInfo.getCloudDomain(), cloudDomain);
+ }
+
+ @Test
+ public void getterAndSetter4userName() {
+ final String userName = "nancy";
+ VimAuthInfo vimAuthInfo = new VimAuthInfo();
+ vimAuthInfo.setUserName(userName);
+ assertEquals(vimAuthInfo.getUserName(), userName);
+ }
+
+ @Test
+ public void getterAndSetter4password() {
+ final String password = "dasffa";
+ VimAuthInfo vimAuthInfo = new VimAuthInfo();
+ vimAuthInfo.setPassword(password);
+ assertEquals(vimAuthInfo.getPassword(), password);
+ }
+
+ @Test
+ public void getterAndSetter4authUrl() {
+ final String authUrl = "http://127.0.0.1:5000/auth/";
+ VimAuthInfo vimAuthInfo = new VimAuthInfo();
+ vimAuthInfo.setAuthUrl(authUrl);
+ assertEquals(vimAuthInfo.getAuthUrl(), authUrl);
+ }
+
+ @Test
+ public void getterAndSetter4sslCacert() {
+ final String sslCacert = "fdfafda";
+ VimAuthInfo vimAuthInfo = new VimAuthInfo();
+ vimAuthInfo.setSslCacert(sslCacert);
+ assertEquals(vimAuthInfo.getSslCacert(), sslCacert);
+ }
+
+ @Test
+ public void getterAndSetter4sslInsecure() {
+ final Boolean sslInsecure = true;
+ VimAuthInfo vimAuthInfo = new VimAuthInfo();
+ vimAuthInfo.setSslInsecure(sslInsecure);
+ assertEquals(vimAuthInfo.getSslInsecure(), sslInsecure);
+ }
}
package org.onap.aai.esr.entity.rest;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
public class VimRegisterInfoTest {
- @Test
- public void getterAndSetter4cloudOwner(){
- final String cloudOwner = "zte";
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setCloudOwner(cloudOwner);
- assertEquals(vimRegisterInfo.getCloudOwner(), cloudOwner);
- }
-
- @Test
- public void getterAndSetter4cloudRegionId(){
- final String cloudRegionId = "region-one";
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setCloudRegionId(cloudRegionId);
- assertEquals(vimRegisterInfo.getCloudRegionId(), cloudRegionId);
- }
-
- @Test
- public void getterAndSetter4cloudType(){
- final String cloudType = "openstack";
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setCloudType(cloudType);
- assertEquals(vimRegisterInfo.getCloudType(), cloudType);
- }
-
- @Test
- public void getterAndSetter4cloudRegionVersion(){
- final String cloudRegionVersion = "v1.0";
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setCloudRegionVersion(cloudRegionVersion);
- assertEquals(vimRegisterInfo.getCloudRegionVersion(), cloudRegionVersion);
- }
-
- @Test
- public void getterAndSetter4ownerDefinedType(){
- final String ownerDefinedType = "test";
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setOwnerDefinedType(ownerDefinedType);
- assertEquals(vimRegisterInfo.getOwnerDefinedType(), ownerDefinedType);
- }
-
- @Test
- public void getterAndSetter4cloudZone(){
- final String cloudZone = "zone1";
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setCloudZone(cloudZone);
- assertEquals(vimRegisterInfo.getCloudZone(), cloudZone);
- }
-
- @Test
- public void getterAndSetter4complexName(){
- final String complexName = "test";
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setComplexName(complexName);
- assertEquals(vimRegisterInfo.getComplexName(), complexName);
- }
-
- @Test
- public void getterAndSetter4cloudExtraInfo(){
- final String cloudExtraInfo = "test";
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setCloudExtraInfo(cloudExtraInfo);
- assertEquals(vimRegisterInfo.getCloudExtraInfo(), cloudExtraInfo);
- }
-
- @Test
- public void getterAndSetter4status(){
- final String status = "normal";
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setStatus(status);
- assertEquals(vimRegisterInfo.getStatus(), status);
- }
-
- @Test
- public void getterAndSetter4vimAuthInfos(){
- final List<VimAuthInfo> vimAuthInfos = new ArrayList<>();
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- vimRegisterInfo.setVimAuthInfos(vimAuthInfos);
- assertEquals(vimRegisterInfo.getVimAuthInfos(), vimAuthInfos);
- }
-
+ @Test
+ public void getterAndSetter4cloudOwner() {
+ final String cloudOwner = "zte";
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setCloudOwner(cloudOwner);
+ assertEquals(vimRegisterInfo.getCloudOwner(), cloudOwner);
+ }
+
+ @Test
+ public void getterAndSetter4cloudRegionId() {
+ final String cloudRegionId = "region-one";
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setCloudRegionId(cloudRegionId);
+ assertEquals(vimRegisterInfo.getCloudRegionId(), cloudRegionId);
+ }
+
+ @Test
+ public void getterAndSetter4cloudType() {
+ final String cloudType = "openstack";
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setCloudType(cloudType);
+ assertEquals(vimRegisterInfo.getCloudType(), cloudType);
+ }
+
+ @Test
+ public void getterAndSetter4cloudRegionVersion() {
+ final String cloudRegionVersion = "v1.0";
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setCloudRegionVersion(cloudRegionVersion);
+ assertEquals(vimRegisterInfo.getCloudRegionVersion(), cloudRegionVersion);
+ }
+
+ @Test
+ public void getterAndSetter4ownerDefinedType() {
+ final String ownerDefinedType = "test";
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setOwnerDefinedType(ownerDefinedType);
+ assertEquals(vimRegisterInfo.getOwnerDefinedType(), ownerDefinedType);
+ }
+
+ @Test
+ public void getterAndSetter4cloudZone() {
+ final String cloudZone = "zone1";
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setCloudZone(cloudZone);
+ assertEquals(vimRegisterInfo.getCloudZone(), cloudZone);
+ }
+
+ @Test
+ public void getterAndSetter4complexName() {
+ final String complexName = "test";
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setComplexName(complexName);
+ assertEquals(vimRegisterInfo.getComplexName(), complexName);
+ }
+
+ @Test
+ public void getterAndSetter4cloudExtraInfo() {
+ final String cloudExtraInfo = "test";
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setCloudExtraInfo(cloudExtraInfo);
+ assertEquals(vimRegisterInfo.getCloudExtraInfo(), cloudExtraInfo);
+ }
+
+ @Test
+ public void getterAndSetter4status() {
+ final String status = "normal";
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setStatus(status);
+ assertEquals(vimRegisterInfo.getStatus(), status);
+ }
+
+ @Test
+ public void getterAndSetter4vimAuthInfos() {
+ final List<VimAuthInfo> vimAuthInfos = new ArrayList<>();
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ vimRegisterInfo.setVimAuthInfos(vimAuthInfos);
+ assertEquals(vimRegisterInfo.getVimAuthInfos(), vimAuthInfos);
+ }
+
}
package org.onap.aai.esr.entity.rest;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class VimRegisterResponseTest {
- @Test
- public void getterAndSetter4cloudOwner(){
- final String cloudOwner = "zte";
- VimRegisterResponse vimRegisterResponse = new VimRegisterResponse();
- vimRegisterResponse.setCloudOwner(cloudOwner);
- assertEquals(vimRegisterResponse.getCloudOwner(), cloudOwner);
- }
-
- @Test
- public void getterAndSetter4cloudRegionId(){
- final String cloudRegionId = "region-one";
- VimRegisterResponse vimRegisterResponse = new VimRegisterResponse();
- vimRegisterResponse.setCloudRegionId(cloudRegionId);
- assertEquals(vimRegisterResponse.getCloudRegionId(), cloudRegionId);
- }
+ @Test
+ public void getterAndSetter4cloudOwner() {
+ final String cloudOwner = "zte";
+ VimRegisterResponse vimRegisterResponse = new VimRegisterResponse();
+ vimRegisterResponse.setCloudOwner(cloudOwner);
+ assertEquals(vimRegisterResponse.getCloudOwner(), cloudOwner);
+ }
+
+ @Test
+ public void getterAndSetter4cloudRegionId() {
+ final String cloudRegionId = "region-one";
+ VimRegisterResponse vimRegisterResponse = new VimRegisterResponse();
+ vimRegisterResponse.setCloudRegionId(cloudRegionId);
+ assertEquals(vimRegisterResponse.getCloudRegionId(), cloudRegionId);
+ }
}
package org.onap.aai.esr.entity.rest;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
public class VnfmRegisterInfoTest {
-
- @Test
- public void getterAndSetter4vnfmId(){
- final String vnfmId = "dafadf";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setVnfmId(vnfmId);
- assertEquals(vnfmRegisterInfo.getVnfmId(), vnfmId);
- }
-
- @Test
- public void getterAndSetter4name(){
- final String name = "name-test";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setName(name);
- assertEquals(vnfmRegisterInfo.getName(), name);
- }
-
- @Test
- public void getterAndSetter4type(){
- final String type = "vnfm-type";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setType(type);
- assertEquals(vnfmRegisterInfo.getType(), type);
- }
-
- @Test
- public void getterAndSetter4vimId(){
- final String vimId = "dafadf";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setVimId(vimId);
- assertEquals(vnfmRegisterInfo.getVimId(), vimId);
- }
-
- @Test
- public void getterAndSetter4vendor(){
- final String vendor = "zte";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setVendor(vendor);
- assertEquals(vnfmRegisterInfo.getVendor(), vendor);
- }
-
- @Test
- public void getterAndSetter4version(){
- final String version = "v1.0";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setVersion(version);
- assertEquals(vnfmRegisterInfo.getVersion(), version);
- }
-
- @Test
- public void getterAndSetter4certificateUrl(){
- final String certificateUrl = "/test";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setCertificateUrl(certificateUrl);
- assertEquals(vnfmRegisterInfo.getCertificateUrl(), certificateUrl);
- }
-
- @Test
- public void getterAndSetter4url(){
- final String url = "/home";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setUrl(url);
- assertEquals(vnfmRegisterInfo.getUrl(), url);
- }
-
- @Test
- public void getterAndSetter4userName(){
- final String userName = "li";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setUserName(userName);
- assertEquals(vnfmRegisterInfo.getUserName(), userName);
- }
-
- @Test
- public void getterAndSetter4password(){
- final String password = "dfaaf";
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setPassword(password);
- assertEquals(vnfmRegisterInfo.getPassword(), password);
- }
+
+ @Test
+ public void getterAndSetter4vnfmId() {
+ final String vnfmId = "dafadf";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setVnfmId(vnfmId);
+ assertEquals(vnfmRegisterInfo.getVnfmId(), vnfmId);
+ }
+
+ @Test
+ public void getterAndSetter4name() {
+ final String name = "name-test";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setName(name);
+ assertEquals(vnfmRegisterInfo.getName(), name);
+ }
+
+ @Test
+ public void getterAndSetter4type() {
+ final String type = "vnfm-type";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setType(type);
+ assertEquals(vnfmRegisterInfo.getType(), type);
+ }
+
+ @Test
+ public void getterAndSetter4vimId() {
+ final String vimId = "dafadf";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setVimId(vimId);
+ assertEquals(vnfmRegisterInfo.getVimId(), vimId);
+ }
+
+ @Test
+ public void getterAndSetter4vendor() {
+ final String vendor = "zte";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setVendor(vendor);
+ assertEquals(vnfmRegisterInfo.getVendor(), vendor);
+ }
+
+ @Test
+ public void getterAndSetter4version() {
+ final String version = "v1.0";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setVersion(version);
+ assertEquals(vnfmRegisterInfo.getVersion(), version);
+ }
+
+ @Test
+ public void getterAndSetter4certificateUrl() {
+ final String certificateUrl = "/test";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setCertificateUrl(certificateUrl);
+ assertEquals(vnfmRegisterInfo.getCertificateUrl(), certificateUrl);
+ }
+
+ @Test
+ public void getterAndSetter4url() {
+ final String url = "/home";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setUrl(url);
+ assertEquals(vnfmRegisterInfo.getUrl(), url);
+ }
+
+ @Test
+ public void getterAndSetter4userName() {
+ final String userName = "li";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setUserName(userName);
+ assertEquals(vnfmRegisterInfo.getUserName(), userName);
+ }
+
+ @Test
+ public void getterAndSetter4password() {
+ final String password = "dfaaf";
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setPassword(password);
+ assertEquals(vnfmRegisterInfo.getPassword(), password);
+ }
}
\r
import org.junit.Assert;\r
import org.junit.Test;\r
-\r
import javax.ws.rs.WebApplicationException;\r
\r
public class ExceptionUtilTest {\r
\r
@Test\r
- public void testBuildExceptionResponse(){\r
+ public void testBuildExceptionResponse() {\r
WebApplicationException exp = ExceptionUtil.buildExceptionResponse("Exception from JUnit");\r
Assert.assertNotNull(exp);\r
Assert.assertNotNull(exp.getResponse());\r
public class ExtsysExceptionTest {\r
\r
@Test\r
- public void testAllMethods(){\r
+ public void testAllMethods() {\r
ExtsysException esExp = new ExtsysException();\r
esExp.setErrorCode("498");\r
Assert.assertEquals(esExp.getErrorCode(), "498");\r
public class AaiCommonTest {\r
\r
@Test\r
- public void testGetAuthenticationCredentials(){\r
+ public void testGetAuthenticationCredentials() {\r
String cred = AaiCommon.getAuthenticationCredentials();\r
Assert.assertNotNull(cred);\r
Assert.assertTrue(cred.contains("Basic"));\r
CloudRegionProxy proxy;\r
\r
@Before\r
- public void init(){\r
+ public void init() {\r
MsbConfig.setMsbServerAddr("http://msb-server");\r
proxy = new CloudRegionProxy();\r
}\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testQueryVimList() throws ExtsysException{\r
+ public void testQueryVimList() throws ExtsysException {\r
proxy.qureyVimList();\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testDeleteVim() throws ExtsysException{\r
+ public void testDeleteVim() throws ExtsysException {\r
proxy.deleteVim("owner-1", "region-1", "version-1");\r
}\r
}\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testRegisterVnfm() throws ExtsysException{\r
+ public void testRegisterVnfm() throws ExtsysException {\r
EsrVnfmDetail detail = new EsrVnfmDetail();\r
ExternalSystemProxy.registerVnfm("vnfm-1", detail);\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testQueryVnfmDetail() throws ExtsysException{\r
+ public void testQueryVnfmDetail() throws ExtsysException {\r
ExternalSystemProxy.queryVnfmDetail("vnfm-1");\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testQueryVnfmList() throws ExtsysException{\r
+ public void testQueryVnfmList() throws ExtsysException {\r
ExternalSystemProxy.queryVnfmList();\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testDeleteVnfm() throws ExtsysException{\r
+ public void testDeleteVnfm() throws ExtsysException {\r
ExternalSystemProxy.deleteVnfm("vnfm-1", "version-1");\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testRegisterSdnc() throws ExtsysException{\r
+ public void testRegisterSdnc() throws ExtsysException {\r
EsrThirdpartySdncDetail detail = new EsrThirdpartySdncDetail();\r
ExternalSystemProxy.registerSdnc("sdnc-1", detail);\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testQueryThirdpartySdncDetail() throws ExtsysException{\r
+ public void testQueryThirdpartySdncDetail() throws ExtsysException {\r
ExternalSystemProxy.queryThirdpartySdncDetail("sdnc-1");\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testQuerySdncList() throws ExtsysException{\r
+ public void testQuerySdncList() throws ExtsysException {\r
ExternalSystemProxy.querySdncList();\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testDeleteThirdpartySdnc() throws ExtsysException{\r
+ public void testDeleteThirdpartySdnc() throws ExtsysException {\r
ExternalSystemProxy.deleteThirdpartySdnc("sdnc-1", "version-1");\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testRegisterEms() throws ExtsysException{\r
+ public void testRegisterEms() throws ExtsysException {\r
EsrEmsDetail detail = new EsrEmsDetail();\r
- ExternalSystemProxy.registerEms("ems-1",detail);\r
+ ExternalSystemProxy.registerEms("ems-1", detail);\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testQueryEmsDetail() throws ExtsysException{\r
+ public void testQueryEmsDetail() throws ExtsysException {\r
ExternalSystemProxy.queryEmsDetail("ems-1");\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testQueryEmsList() throws ExtsysException{\r
+ public void testQueryEmsList() throws ExtsysException {\r
ExternalSystemProxy.queryEmsList();\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testDeleteEms() throws ExtsysException{\r
+ public void testDeleteEms() throws ExtsysException {\r
ExternalSystemProxy.deleteEms("ems-1", "version-1");\r
}\r
}\r
}\r
\r
@Test(expected = ExtsysException.class)\r
- public void testUpdateVim() throws ExtsysException{\r
+ public void testUpdateVim() throws ExtsysException {\r
Tenant tenant = new Tenant();\r
tenant.setDefaultTenant("defaultTenant");\r
Assert.assertEquals(tenant.getDefaultTenant(), "defaultTenant");\r
MicroServiceFullInfo serviceInfo;\r
\r
@Before\r
- public void init(){\r
+ public void init() {\r
MockitoAnnotations.initMocks(this);\r
helper = new MsbHelper(client);\r
}\r
\r
@Test\r
public void testRegisterMsb() throws Exception {\r
- Mockito.when(client.registerMicroServiceInfo(Mockito.any(MicroServiceInfo.class),\r
- Mockito.anyBoolean())).thenReturn(serviceInfo);\r
+ Mockito.when(client.registerMicroServiceInfo(Mockito.any(MicroServiceInfo.class), Mockito.anyBoolean()))\r
+ .thenReturn(serviceInfo);\r
helper.registerMsb();\r
- Mockito.verify(client, Mockito.times(1)).\r
- registerMicroServiceInfo(Mockito.any(MicroServiceInfo.class), Mockito.anyBoolean());\r
+ Mockito.verify(client, Mockito.times(1)).registerMicroServiceInfo(Mockito.any(MicroServiceInfo.class),\r
+ Mockito.anyBoolean());\r
}\r
}\r
package org.onap.aai.esr.util;
import static org.junit.Assert.assertEquals;
-
-
import org.junit.Test;
import org.onap.aai.esr.entity.aai.EsrEmsDetail;
import org.onap.aai.esr.entity.rest.AlarmAddr;
import org.onap.aai.esr.entity.rest.EmsRegisterInfo;
import org.onap.aai.esr.entity.rest.FtpAddr;
-
import com.google.gson.Gson;
public class EmsManagerUtilTest {
-
- @Test
- public void getEsrSystemInfoListFromAuthInfoTest() {
- EmsManagerUtil emsManagerUtil = new EmsManagerUtil();
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- EsrEmsDetail esrEms = new EsrEmsDetail();
- AlarmAddr alarmAddr = new AlarmAddr();
- FtpAddr resourceAddr = new FtpAddr();
- FtpAddr performanceAddr = new FtpAddr();
- alarmAddr.setIp("127.0.0.1");
- alarmAddr.setPassword("987654");
- alarmAddr.setPort("5000");
- alarmAddr.setUser("nancy");
- resourceAddr.setFtptype("sftp");
- resourceAddr.setIp("127.0.0.1");
- resourceAddr.setPassive(true);
- resourceAddr.setPassword("asdf");
- resourceAddr.setPort("5000");
- resourceAddr.setRemotepath("/home/per");
- resourceAddr.setUser("nancy");
- performanceAddr.setFtptype("sftp");
- performanceAddr.setIp("127.0.0.1");
- performanceAddr.setPassive(true);
- performanceAddr.setPassword("asdf");
- performanceAddr.setPort("5000");
- performanceAddr.setRemotepath("/home/per");
- performanceAddr.setUser("nancy");
- emsRegisterInfo.setName("EMS_TEST");
- emsRegisterInfo.setVendor("ZTE");
- emsRegisterInfo.setVersion("V1");
- emsRegisterInfo.setAlarmAddr(alarmAddr);
- emsRegisterInfo.setResourceAddr(resourceAddr);
- emsRegisterInfo.setPerformanceAddr(performanceAddr);
- esrEms = emsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
- esrEms.setEmsId("123456");
- esrEms.getEsrSystemInfoList().getEsrSystemInfo().get(0).setEsrSystemInfoId("234567");
- esrEms.getEsrSystemInfoList().getEsrSystemInfo().get(1).setEsrSystemInfoId("345678");
- esrEms.getEsrSystemInfoList().getEsrSystemInfo().get(2).setEsrSystemInfoId("456789");
- String esremsStr = new ExtsysUtil().objectToString(esrEms);
- String expect = "{\"ems-id\":\"123456\","
- + "\"esr-system-info-list\":"
- + "{\"esr-system-info\":"
- + "[{\"esr-system-info-id\":\"234567\","
- + "\"system-name\":\"EMS_TEST\","
- + "\"type\":\"sftp\","
- + "\"vendor\":\"ZTE\","
- + "\"version\":\"V1\","
- + "\"user-name\":\"nancy\","
- + "\"password\":\"asdf\","
- + "\"system-type\":\"EMS_RESOUCE\","
- + "\"ip-address\":\"127.0.0.1\","
- + "\"port\":\"5000\","
- + "\"passive\":true,"
- + "\"remote-path\":\"/home/per\"},"
- + "{\"esr-system-info-id\":\"345678\","
- + "\"system-name\":\"EMS_TEST\","
- + "\"type\":\"sftp\","
- + "\"vendor\":\"ZTE\","
- + "\"version\":\"V1\","
- + "\"user-name\":\"nancy\","
- + "\"password\":\"asdf\","
- + "\"system-type\":\"EMS_PERFORMANCE\","
- + "\"ip-address\":\"127.0.0.1\","
- + "\"port\":\"5000\","
- + "\"passive\":true,"
- + "\"remote-path\":\"/home/per\"},"
- + "{\"esr-system-info-id\":\"456789\","
- + "\"system-name\":\"EMS_TEST\","
- + "\"vendor\":\"ZTE\","
- + "\"version\":\"V1\","
- + "\"user-name\":\"nancy\","
- + "\"password\":\"987654\","
- + "\"system-type\":\"EMS_ALARM\","
- + "\"ip-address\":\"127.0.0.1\","
- + "\"port\":\"5000\"}]}}";
- assertEquals(expect, esremsStr);
- }
-
- @Test
- public void EsrEms2EmsRegisterInfoTest() {
- EsrEmsDetail esrEms = new EsrEmsDetail();
- EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
- EmsManagerUtil emsManagerUtil = new EmsManagerUtil();
- String esrEmsStr = "{\"ems-id\":\"123456\","
- + "\"esr-system-info-list\":"
- + "{\"esr-system-info\":"
- + "[{\"esr-system-info-id\":\"234567\","
- + "\"system-name\":\"EMS_TEST\","
- + "\"type\":\"sftp\","
- + "\"vendor\":\"ZTE\","
- + "\"version\":\"V1\","
- + "\"user-name\":\"nancy\","
- + "\"password\":\"asdf\","
- + "\"system-type\":\"EMS_RESOUCE\","
- + "\"ip-address\":\"127.0.0.1\","
- + "\"port\":\"5000\","
- + "\"passive\":true,"
- + "\"remote-path\":\"/home/per\"},"
- + "{\"esr-system-info-id\":\"345678\","
- + "\"system-name\":\"EMS_TEST\","
- + "\"type\":\"sftp\","
- + "\"vendor\":\"ZTE\","
- + "\"version\":\"V1\","
- + "\"user-name\":\"nancy\","
- + "\"password\":\"asdf\","
- + "\"system-type\":\"EMS_PERFORMANCE\","
- + "\"ip-address\":\"127.0.0.1\","
- + "\"port\":\"5000\","
- + "\"passive\":true,"
- + "\"remote-path\":\"/home/per\"},"
- + "{\"esr-system-info-id\":\"456789\","
- + "\"system-name\":\"EMS_TEST\","
- + "\"vendor\":\"ZTE\","
- + "\"version\":\"V1\","
- + "\"user-name\":\"nancy\","
- + "\"password\":\"987654\","
- + "\"system-type\":\"EMS_ALARM\","
- + "\"ip-address\":\"127.0.0.1\","
- + "\"port\":\"5000\"}]}}";
- esrEms = new Gson().fromJson(esrEmsStr, EsrEmsDetail.class);
- emsRegisterInfo = emsManagerUtil.EsrEms2EmsRegisterInfo(esrEms);
- String registerInfoStr = new ExtsysUtil().objectToString(emsRegisterInfo);
- String expectRegisterInfo = "{\"emsId\":\"123456\","
- + "\"name\":\"EMS_TEST\","
- + "\"vendor\":\"ZTE\","
- + "\"version\":\"V1\","
- + "\"resourceAddr\":{"
- + "\"ftptype\":\"sftp\","
- + "\"ip\":\"127.0.0.1\","
- + "\"port\":\"5000\","
- + "\"user\":\"nancy\","
- + "\"password\":\"asdf\","
- + "\"remotepath\":\"/home/per\","
- + "\"passive\":true},"
- + "\"performanceAddr\":{"
- + "\"ftptype\":\"sftp\","
- + "\"ip\":\"127.0.0.1\","
- + "\"port\":\"5000\","
- + "\"user\":\"nancy\","
- + "\"password\":\"asdf\","
- + "\"remotepath\":\"/home/per\","
- + "\"passive\":true},"
- + "\"alarmAddr\":{"
- + "\"ip\":\"127.0.0.1\","
- + "\"port\":\"5000\","
- + "\"user\":\"nancy\","
- + "\"password\":\"987654\"}}";
- assertEquals(registerInfoStr, expectRegisterInfo);
- }
+
+ @Test
+ public void getEsrSystemInfoListFromAuthInfoTest() {
+ EmsManagerUtil emsManagerUtil = new EmsManagerUtil();
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ EsrEmsDetail esrEms = new EsrEmsDetail();
+ AlarmAddr alarmAddr = new AlarmAddr();
+ FtpAddr resourceAddr = new FtpAddr();
+ FtpAddr performanceAddr = new FtpAddr();
+ alarmAddr.setIp("127.0.0.1");
+ alarmAddr.setPassword("987654");
+ alarmAddr.setPort("5000");
+ alarmAddr.setUser("nancy");
+ resourceAddr.setFtptype("sftp");
+ resourceAddr.setIp("127.0.0.1");
+ resourceAddr.setPassive(true);
+ resourceAddr.setPassword("asdf");
+ resourceAddr.setPort("5000");
+ resourceAddr.setRemotepath("/home/per");
+ resourceAddr.setUser("nancy");
+ performanceAddr.setFtptype("sftp");
+ performanceAddr.setIp("127.0.0.1");
+ performanceAddr.setPassive(true);
+ performanceAddr.setPassword("asdf");
+ performanceAddr.setPort("5000");
+ performanceAddr.setRemotepath("/home/per");
+ performanceAddr.setUser("nancy");
+ emsRegisterInfo.setName("EMS_TEST");
+ emsRegisterInfo.setVendor("ZTE");
+ emsRegisterInfo.setVersion("V1");
+ emsRegisterInfo.setAlarmAddr(alarmAddr);
+ emsRegisterInfo.setResourceAddr(resourceAddr);
+ emsRegisterInfo.setPerformanceAddr(performanceAddr);
+ esrEms = emsManagerUtil.emsRegisterInfo2EsrEms(emsRegisterInfo);
+ esrEms.setEmsId("123456");
+ esrEms.getEsrSystemInfoList().getEsrSystemInfo().get(0).setEsrSystemInfoId("234567");
+ esrEms.getEsrSystemInfoList().getEsrSystemInfo().get(1).setEsrSystemInfoId("345678");
+ esrEms.getEsrSystemInfoList().getEsrSystemInfo().get(2).setEsrSystemInfoId("456789");
+ String esremsStr = new ExtsysUtil().objectToString(esrEms);
+ String expect = "{\"ems-id\":\"123456\"," + "\"esr-system-info-list\":" + "{\"esr-system-info\":"
+ + "[{\"esr-system-info-id\":\"234567\"," + "\"system-name\":\"EMS_TEST\"," + "\"type\":\"sftp\","
+ + "\"vendor\":\"ZTE\"," + "\"version\":\"V1\"," + "\"user-name\":\"nancy\"," + "\"password\":\"asdf\","
+ + "\"system-type\":\"EMS_RESOUCE\"," + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\","
+ + "\"passive\":true," + "\"remote-path\":\"/home/per\"}," + "{\"esr-system-info-id\":\"345678\","
+ + "\"system-name\":\"EMS_TEST\"," + "\"type\":\"sftp\"," + "\"vendor\":\"ZTE\"," + "\"version\":\"V1\","
+ + "\"user-name\":\"nancy\"," + "\"password\":\"asdf\"," + "\"system-type\":\"EMS_PERFORMANCE\","
+ + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\"," + "\"passive\":true,"
+ + "\"remote-path\":\"/home/per\"}," + "{\"esr-system-info-id\":\"456789\","
+ + "\"system-name\":\"EMS_TEST\"," + "\"vendor\":\"ZTE\"," + "\"version\":\"V1\","
+ + "\"user-name\":\"nancy\"," + "\"password\":\"987654\"," + "\"system-type\":\"EMS_ALARM\","
+ + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\"}]}}";
+ assertEquals(expect, esremsStr);
+ }
+
+ @Test
+ public void EsrEms2EmsRegisterInfoTest() {
+ EsrEmsDetail esrEms = new EsrEmsDetail();
+ EmsRegisterInfo emsRegisterInfo = new EmsRegisterInfo();
+ EmsManagerUtil emsManagerUtil = new EmsManagerUtil();
+ String esrEmsStr = "{\"ems-id\":\"123456\"," + "\"esr-system-info-list\":" + "{\"esr-system-info\":"
+ + "[{\"esr-system-info-id\":\"234567\"," + "\"system-name\":\"EMS_TEST\"," + "\"type\":\"sftp\","
+ + "\"vendor\":\"ZTE\"," + "\"version\":\"V1\"," + "\"user-name\":\"nancy\"," + "\"password\":\"asdf\","
+ + "\"system-type\":\"EMS_RESOUCE\"," + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\","
+ + "\"passive\":true," + "\"remote-path\":\"/home/per\"}," + "{\"esr-system-info-id\":\"345678\","
+ + "\"system-name\":\"EMS_TEST\"," + "\"type\":\"sftp\"," + "\"vendor\":\"ZTE\"," + "\"version\":\"V1\","
+ + "\"user-name\":\"nancy\"," + "\"password\":\"asdf\"," + "\"system-type\":\"EMS_PERFORMANCE\","
+ + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\"," + "\"passive\":true,"
+ + "\"remote-path\":\"/home/per\"}," + "{\"esr-system-info-id\":\"456789\","
+ + "\"system-name\":\"EMS_TEST\"," + "\"vendor\":\"ZTE\"," + "\"version\":\"V1\","
+ + "\"user-name\":\"nancy\"," + "\"password\":\"987654\"," + "\"system-type\":\"EMS_ALARM\","
+ + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\"}]}}";
+ esrEms = new Gson().fromJson(esrEmsStr, EsrEmsDetail.class);
+ emsRegisterInfo = emsManagerUtil.EsrEms2EmsRegisterInfo(esrEms);
+ String registerInfoStr = new ExtsysUtil().objectToString(emsRegisterInfo);
+ String expectRegisterInfo = "{\"emsId\":\"123456\"," + "\"name\":\"EMS_TEST\"," + "\"vendor\":\"ZTE\","
+ + "\"version\":\"V1\"," + "\"resourceAddr\":{" + "\"ftptype\":\"sftp\"," + "\"ip\":\"127.0.0.1\","
+ + "\"port\":\"5000\"," + "\"user\":\"nancy\"," + "\"password\":\"asdf\","
+ + "\"remotepath\":\"/home/per\"," + "\"passive\":true}," + "\"performanceAddr\":{"
+ + "\"ftptype\":\"sftp\"," + "\"ip\":\"127.0.0.1\"," + "\"port\":\"5000\"," + "\"user\":\"nancy\","
+ + "\"password\":\"asdf\"," + "\"remotepath\":\"/home/per\"," + "\"passive\":true}," + "\"alarmAddr\":{"
+ + "\"ip\":\"127.0.0.1\"," + "\"port\":\"5000\"," + "\"user\":\"nancy\"," + "\"password\":\"987654\"}}";
+ assertEquals(registerInfoStr, expectRegisterInfo);
+ }
}
package org.onap.aai.esr.util;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
import org.onap.aai.esr.entity.aai.EsrSystemInfo;
import org.onap.aai.esr.entity.aai.EsrSystemInfoList;
import org.onap.aai.esr.externalservice.cloud.Tenant;
public class ExtsysUtilTest {
-
- @Test
- public void objectToStringTest() {
- ExtsysUtil extsysUtil = new ExtsysUtil();
- Tenant tenant = new Tenant();
- tenant.setDefaultTenant("admin");
- String tenantStr = "{\"defaultTenant\":\"admin\"}";
- String result = extsysUtil.objectToString(tenant);
- assertEquals(tenantStr, result);
- }
-
-
- @Test
- public void getEsrSystemInfoListFromAuthInfoTest() {
- EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
- ExtsysUtil extsysUtil = new ExtsysUtil();
- EsrSystemInfoList result = new EsrSystemInfoList();
- esrSystemInfoObj.setCloudDomain("cloudDomain");
- esrSystemInfoObj.setDefaultTenant("admin");
- esrSystemInfoObj.setEsrSystemInfoId("123456");
- esrSystemInfoObj.setIpAddress("127.0.0.1");
- esrSystemInfoObj.setPassive(true);
- esrSystemInfoObj.setPassword("qwelk");
- esrSystemInfoObj.setPort("5000");
- esrSystemInfoObj.setProtocol("http");
- esrSystemInfoObj.setRemotePath("/root/test");
- esrSystemInfoObj.setServiceUrl("http://127.0.0.1:8080");
- esrSystemInfoObj.setSslCassert("sslCassert");
- esrSystemInfoObj.setSslInsecure(false);
- esrSystemInfoObj.setSystemName("vnfm");
- esrSystemInfoObj.setSystemStatus("normal");
- esrSystemInfoObj.setSystemType("VNFM");
- esrSystemInfoObj.setType("test");
- esrSystemInfoObj.setUserName("root");
- esrSystemInfoObj.setVendor("zte");
- esrSystemInfoObj.setVersion("v1.0");
- result = extsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj);
-
- String listStr = "{\"esr-system-info\":[{"
- + "\"esr-system-info-id\":\"123456\","
- + "\"system-name\":\"vnfm\","
- + "\"type\":\"test\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1.0\","
- + "\"service-url\":\"http://127.0.0.1:8080\","
- + "\"user-name\":\"root\","
- + "\"password\":\"qwelk\","
- + "\"system-type\":\"VNFM\","
- + "\"protocol\":\"http\","
- + "\"ssl-cassert\":\"sslCassert\","
- + "\"ssl-insecure\":false,"
- + "\"ip-address\":\"127.0.0.1\","
- + "\"port\":\"5000\","
- + "\"cloud-domain\":\"cloudDomain\","
- + "\"default-tenant\":\"admin\","
- + "\"passive\":true,"
- + "\"remote-path\":\"/root/test\","
- + "\"system-status\":\"normal\"}]}";
- assertEquals(extsysUtil.objectToString(result), listStr);
- }
-
- @Test
- public void getEsrSystemInfoListFromAuthInfoListTest() {
- List<EsrSystemInfo> esrSystemInfos = new ArrayList<>();
- EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
- EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
- ExtsysUtil extsysUtil = new ExtsysUtil();
- esrSystemInfoObj.setCloudDomain("cloudDomain");
- esrSystemInfoObj.setDefaultTenant("admin");
- esrSystemInfoObj.setEsrSystemInfoId("123456");
- esrSystemInfoObj.setIpAddress("127.0.0.1");
- esrSystemInfoObj.setPassive(true);
- esrSystemInfoObj.setPassword("qwelk");
- esrSystemInfoObj.setPort("5000");
- esrSystemInfoObj.setProtocol("http");
- esrSystemInfoObj.setRemotePath("/root/test");
- esrSystemInfoObj.setServiceUrl("http://127.0.0.1:8080");
- esrSystemInfoObj.setSslCassert("sslCassert");
- esrSystemInfoObj.setSslInsecure(false);
- esrSystemInfoObj.setSystemName("vnfm");
- esrSystemInfoObj.setSystemStatus("normal");
- esrSystemInfoObj.setSystemType("VNFM");
- esrSystemInfoObj.setType("test");
- esrSystemInfoObj.setUserName("root");
- esrSystemInfoObj.setVendor("zte");
- esrSystemInfoObj.setVersion("v1.0");
- esrSystemInfos.add(esrSystemInfoObj);
- esrSystemInfoList.setEsrSystemInfo(esrSystemInfos);
-
- String listStr = "{\"esr-system-info\":[{"
- + "\"esr-system-info-id\":\"123456\","
- + "\"system-name\":\"vnfm\","
- + "\"type\":\"test\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1.0\","
- + "\"service-url\":\"http://127.0.0.1:8080\","
- + "\"user-name\":\"root\","
- + "\"password\":\"qwelk\","
- + "\"system-type\":\"VNFM\","
- + "\"protocol\":\"http\","
- + "\"ssl-cassert\":\"sslCassert\","
- + "\"ssl-insecure\":false,"
- + "\"ip-address\":\"127.0.0.1\","
- + "\"port\":\"5000\","
- + "\"cloud-domain\":\"cloudDomain\","
- + "\"default-tenant\":\"admin\","
- + "\"passive\":true,"
- + "\"remote-path\":\"/root/test\","
- + "\"system-status\":\"normal\"}]}";
- assertEquals(extsysUtil.objectToString(esrSystemInfoList), listStr);
- }
+
+ @Test
+ public void objectToStringTest() {
+ ExtsysUtil extsysUtil = new ExtsysUtil();
+ Tenant tenant = new Tenant();
+ tenant.setDefaultTenant("admin");
+ String tenantStr = "{\"defaultTenant\":\"admin\"}";
+ String result = extsysUtil.objectToString(tenant);
+ assertEquals(tenantStr, result);
+ }
+
+
+ @Test
+ public void getEsrSystemInfoListFromAuthInfoTest() {
+ EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
+ ExtsysUtil extsysUtil = new ExtsysUtil();
+ EsrSystemInfoList result = new EsrSystemInfoList();
+ esrSystemInfoObj.setCloudDomain("cloudDomain");
+ esrSystemInfoObj.setDefaultTenant("admin");
+ esrSystemInfoObj.setEsrSystemInfoId("123456");
+ esrSystemInfoObj.setIpAddress("127.0.0.1");
+ esrSystemInfoObj.setPassive(true);
+ esrSystemInfoObj.setPassword("qwelk");
+ esrSystemInfoObj.setPort("5000");
+ esrSystemInfoObj.setProtocol("http");
+ esrSystemInfoObj.setRemotePath("/root/test");
+ esrSystemInfoObj.setServiceUrl("http://127.0.0.1:8080");
+ esrSystemInfoObj.setSslCassert("sslCassert");
+ esrSystemInfoObj.setSslInsecure(false);
+ esrSystemInfoObj.setSystemName("vnfm");
+ esrSystemInfoObj.setSystemStatus("normal");
+ esrSystemInfoObj.setSystemType("VNFM");
+ esrSystemInfoObj.setType("test");
+ esrSystemInfoObj.setUserName("root");
+ esrSystemInfoObj.setVendor("zte");
+ esrSystemInfoObj.setVersion("v1.0");
+ result = extsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj);
+
+ String listStr = "{\"esr-system-info\":[{" + "\"esr-system-info-id\":\"123456\"," + "\"system-name\":\"vnfm\","
+ + "\"type\":\"test\"," + "\"vendor\":\"zte\"," + "\"version\":\"v1.0\","
+ + "\"service-url\":\"http://127.0.0.1:8080\"," + "\"user-name\":\"root\"," + "\"password\":\"qwelk\","
+ + "\"system-type\":\"VNFM\"," + "\"protocol\":\"http\"," + "\"ssl-cassert\":\"sslCassert\","
+ + "\"ssl-insecure\":false," + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\","
+ + "\"cloud-domain\":\"cloudDomain\"," + "\"default-tenant\":\"admin\"," + "\"passive\":true,"
+ + "\"remote-path\":\"/root/test\"," + "\"system-status\":\"normal\"}]}";
+ assertEquals(extsysUtil.objectToString(result), listStr);
+ }
+
+ @Test
+ public void getEsrSystemInfoListFromAuthInfoListTest() {
+ List<EsrSystemInfo> esrSystemInfos = new ArrayList<>();
+ EsrSystemInfoList esrSystemInfoList = new EsrSystemInfoList();
+ EsrSystemInfo esrSystemInfoObj = new EsrSystemInfo();
+ ExtsysUtil extsysUtil = new ExtsysUtil();
+ esrSystemInfoObj.setCloudDomain("cloudDomain");
+ esrSystemInfoObj.setDefaultTenant("admin");
+ esrSystemInfoObj.setEsrSystemInfoId("123456");
+ esrSystemInfoObj.setIpAddress("127.0.0.1");
+ esrSystemInfoObj.setPassive(true);
+ esrSystemInfoObj.setPassword("qwelk");
+ esrSystemInfoObj.setPort("5000");
+ esrSystemInfoObj.setProtocol("http");
+ esrSystemInfoObj.setRemotePath("/root/test");
+ esrSystemInfoObj.setServiceUrl("http://127.0.0.1:8080");
+ esrSystemInfoObj.setSslCassert("sslCassert");
+ esrSystemInfoObj.setSslInsecure(false);
+ esrSystemInfoObj.setSystemName("vnfm");
+ esrSystemInfoObj.setSystemStatus("normal");
+ esrSystemInfoObj.setSystemType("VNFM");
+ esrSystemInfoObj.setType("test");
+ esrSystemInfoObj.setUserName("root");
+ esrSystemInfoObj.setVendor("zte");
+ esrSystemInfoObj.setVersion("v1.0");
+ esrSystemInfos.add(esrSystemInfoObj);
+ esrSystemInfoList.setEsrSystemInfo(esrSystemInfos);
+
+ String listStr = "{\"esr-system-info\":[{" + "\"esr-system-info-id\":\"123456\"," + "\"system-name\":\"vnfm\","
+ + "\"type\":\"test\"," + "\"vendor\":\"zte\"," + "\"version\":\"v1.0\","
+ + "\"service-url\":\"http://127.0.0.1:8080\"," + "\"user-name\":\"root\"," + "\"password\":\"qwelk\","
+ + "\"system-type\":\"VNFM\"," + "\"protocol\":\"http\"," + "\"ssl-cassert\":\"sslCassert\","
+ + "\"ssl-insecure\":false," + "\"ip-address\":\"127.0.0.1\"," + "\"port\":\"5000\","
+ + "\"cloud-domain\":\"cloudDomain\"," + "\"default-tenant\":\"admin\"," + "\"passive\":true,"
+ + "\"remote-path\":\"/root/test\"," + "\"system-status\":\"normal\"}]}";
+ assertEquals(extsysUtil.objectToString(esrSystemInfoList), listStr);
+ }
}
package org.onap.aai.esr.util;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail;
import org.onap.aai.esr.entity.rest.ThirdpartySdncRegisterInfo;
-
import com.google.gson.Gson;
public class ThirdpartySdncManagerUtilTest {
-
- @Test
- public void sdncRegisterInfo2EsrSdncTest() {
- ThirdpartySdncManagerUtil thirdpartySdncManagerUtil = new ThirdpartySdncManagerUtil();
- ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- EsrThirdpartySdncDetail esrSdncDetail = new EsrThirdpartySdncDetail();
- sdncRegisterInfo.setLocation("edge");
- sdncRegisterInfo.setName("SDNC_TEST");
- sdncRegisterInfo.setPassword("123987");
- sdncRegisterInfo.setProductName("thirdparty SDNC");
- sdncRegisterInfo.setProtocol("protocol");
- sdncRegisterInfo.setThirdpartySdncId("123456");
- sdncRegisterInfo.setType("SDNC");
- sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
- sdncRegisterInfo.setUserName("nancy");
- sdncRegisterInfo.setVendor("zte");
- sdncRegisterInfo.setVersion("v1");
- esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(sdncRegisterInfo);
- esrSdncDetail.setThirdpartySdncId("123456");
- esrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0).setEsrSystemInfoId("987654");
- String esrSdncDetailStr = new ExtsysUtil().objectToString(esrSdncDetail);
- String expectResult = "{\"thirdparty-sdnc-id\":\"123456\","
- + "\"location\":\"edge\","
- + "\"product-name\":\"thirdparty SDNC\","
- + "\"esr-system-info-list\":{"
- + "\"esr-system-info\":"
- + "[{\"esr-system-info-id\":\"987654\","
- + "\"system-name\":\"SDNC_TEST\","
- + "\"type\":\"SDNC\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1\","
- + "\"service-url\":\"http://127.0.0.1:8000\","
- + "\"user-name\":\"nancy\","
- + "\"password\":\"123987\","
- + "\"system-type\":\"thirdparty_SDNC\","
- + "\"protocol\":\"protocol\"}]}}";
- assertEquals(expectResult, esrSdncDetailStr);
- }
-
- @Test
- public void esrSdnc2SdncRegisterInfoTest() {
- EsrThirdpartySdncDetail esrSdnc = new EsrThirdpartySdncDetail();
- String esrSdncStr = "{\"thirdparty-sdnc-id\":\"123456\","
- + "\"location\":\"edge\","
- + "\"product-name\":\"thirdparty SDNC\","
- + "\"esr-system-info-list\":{"
- + "\"esr-system-info\":"
- + "[{\"esr-system-info-id\":\"987654\","
- + "\"system-name\":\"SDNC_TEST\","
- + "\"type\":\"SDNC\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1\","
- + "\"service-url\":\"http://127.0.0.1:8000\","
- + "\"user-name\":\"nancy\","
- + "\"password\":\"123987\","
- + "\"system-type\":\"thirdparty_SDNC\","
- + "\"protocol\":\"protocol\"}]}}";
- esrSdnc = new Gson().fromJson(esrSdncStr, EsrThirdpartySdncDetail.class);
- ThirdpartySdncRegisterInfo registerInfo = new ThirdpartySdncManagerUtil().esrSdnc2SdncRegisterInfo(esrSdnc);
- String registerInfoStr = new ExtsysUtil().objectToString(registerInfo);
- String expectResult = "{\"thirdpartySdncId\":\"123456\","
- + "\"name\":\"SDNC_TEST\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1\","
- + "\"type\":\"SDNC\","
- + "\"location\":\"edge\","
- + "\"url\":\"http://127.0.0.1:8000\","
- + "\"userName\":\"nancy\","
- + "\"password\":\"123987\","
- + "\"productName\":\"thirdparty SDNC\","
- + "\"protocol\":\"protocol\"}";
- assertEquals(expectResult, registerInfoStr);
- }
+
+ @Test
+ public void sdncRegisterInfo2EsrSdncTest() {
+ ThirdpartySdncManagerUtil thirdpartySdncManagerUtil = new ThirdpartySdncManagerUtil();
+ ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ EsrThirdpartySdncDetail esrSdncDetail = new EsrThirdpartySdncDetail();
+ sdncRegisterInfo.setLocation("edge");
+ sdncRegisterInfo.setName("SDNC_TEST");
+ sdncRegisterInfo.setPassword("123987");
+ sdncRegisterInfo.setProductName("thirdparty SDNC");
+ sdncRegisterInfo.setProtocol("protocol");
+ sdncRegisterInfo.setThirdpartySdncId("123456");
+ sdncRegisterInfo.setType("SDNC");
+ sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
+ sdncRegisterInfo.setUserName("nancy");
+ sdncRegisterInfo.setVendor("zte");
+ sdncRegisterInfo.setVersion("v1");
+ esrSdncDetail = thirdpartySdncManagerUtil.sdncRegisterInfo2EsrSdnc(sdncRegisterInfo);
+ esrSdncDetail.setThirdpartySdncId("123456");
+ esrSdncDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0).setEsrSystemInfoId("987654");
+ String esrSdncDetailStr = new ExtsysUtil().objectToString(esrSdncDetail);
+ String expectResult = "{\"thirdparty-sdnc-id\":\"123456\"," + "\"location\":\"edge\","
+ + "\"product-name\":\"thirdparty SDNC\"," + "\"esr-system-info-list\":{" + "\"esr-system-info\":"
+ + "[{\"esr-system-info-id\":\"987654\"," + "\"system-name\":\"SDNC_TEST\"," + "\"type\":\"SDNC\","
+ + "\"vendor\":\"zte\"," + "\"version\":\"v1\"," + "\"service-url\":\"http://127.0.0.1:8000\","
+ + "\"user-name\":\"nancy\"," + "\"password\":\"123987\"," + "\"system-type\":\"thirdparty_SDNC\","
+ + "\"protocol\":\"protocol\"}]}}";
+ assertEquals(expectResult, esrSdncDetailStr);
+ }
+
+ @Test
+ public void esrSdnc2SdncRegisterInfoTest() {
+ EsrThirdpartySdncDetail esrSdnc = new EsrThirdpartySdncDetail();
+ String esrSdncStr = "{\"thirdparty-sdnc-id\":\"123456\"," + "\"location\":\"edge\","
+ + "\"product-name\":\"thirdparty SDNC\"," + "\"esr-system-info-list\":{" + "\"esr-system-info\":"
+ + "[{\"esr-system-info-id\":\"987654\"," + "\"system-name\":\"SDNC_TEST\"," + "\"type\":\"SDNC\","
+ + "\"vendor\":\"zte\"," + "\"version\":\"v1\"," + "\"service-url\":\"http://127.0.0.1:8000\","
+ + "\"user-name\":\"nancy\"," + "\"password\":\"123987\"," + "\"system-type\":\"thirdparty_SDNC\","
+ + "\"protocol\":\"protocol\"}]}}";
+ esrSdnc = new Gson().fromJson(esrSdncStr, EsrThirdpartySdncDetail.class);
+ ThirdpartySdncRegisterInfo registerInfo = new ThirdpartySdncManagerUtil().esrSdnc2SdncRegisterInfo(esrSdnc);
+ String registerInfoStr = new ExtsysUtil().objectToString(registerInfo);
+ String expectResult = "{\"thirdpartySdncId\":\"123456\"," + "\"name\":\"SDNC_TEST\"," + "\"vendor\":\"zte\","
+ + "\"version\":\"v1\"," + "\"type\":\"SDNC\"," + "\"location\":\"edge\","
+ + "\"url\":\"http://127.0.0.1:8000\"," + "\"userName\":\"nancy\"," + "\"password\":\"123987\","
+ + "\"productName\":\"thirdparty SDNC\"," + "\"protocol\":\"protocol\"}";
+ assertEquals(expectResult, registerInfoStr);
+ }
}
package org.onap.aai.esr.util;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import org.junit.Test;
import org.onap.aai.esr.entity.aai.CloudRegionDetail;
import org.onap.aai.esr.entity.rest.VimAuthInfo;
import org.onap.aai.esr.entity.rest.VimRegisterInfo;
-
import com.google.gson.Gson;
public class VimManagerUtilTest {
-
- @Test
- public void vimRegisterInfo2CloudRegionTest() {
- VimManagerUtil vimManagerUtil = new VimManagerUtil();
- CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- List<VimAuthInfo> vimAuthInfos = new ArrayList<>();
- VimAuthInfo vimAuthInfo = new VimAuthInfo();
- vimAuthInfo.setAuthUrl("http://10.11.22.33:5000/v3");
- vimAuthInfo.setCloudDomain("default");
- vimAuthInfo.setPassword("123456");
- vimAuthInfo.setSslCacert("test");
- vimAuthInfo.setSslInsecure(true);
- vimAuthInfo.setUserName("onap");
- vimAuthInfo.setDefaultTenant("admin");
- vimRegisterInfo.setCloudExtraInfo("{}");
- vimRegisterInfo.setCloudOwner("zte");
- vimRegisterInfo.setCloudRegionId("RegionOne");
- vimRegisterInfo.setCloudRegionVersion("mitaca");
- vimRegisterInfo.setCloudType("openstack");
- vimRegisterInfo.setCloudZone("default");
- vimRegisterInfo.setComplexName("complex");
- vimRegisterInfo.setOwnerDefinedType("test");
- vimRegisterInfo.setStatus("normal");
- vimAuthInfos.add(vimAuthInfo);
- vimRegisterInfo.setVimAuthInfos(vimAuthInfos);
- cloudRegionDetail = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
- cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0).setEsrSystemInfoId("123456");
- String cloudRegionDetailStr = new ExtsysUtil().objectToString(cloudRegionDetail);
- String expectResult = "{\"cloud-owner\":\"zte\","
- + "\"cloud-region-id\":\"RegionOne\","
- + "\"cloud-type\":\"openstack\","
- + "\"cloud-region-version\":\"mitaca\","
- + "\"owner-defined-type\":\"test\","
- + "\"cloud-zone\":\"default\","
- + "\"complex-name\":\"complex\","
- + "\"cloud-extra-info\":\"{}\","
- + "\"esr-system-info-list\":{"
- + "\"esr-system-info\":[{"
- + "\"esr-system-info-id\":\"123456\","
- + "\"service-url\":\"http://10.11.22.33:5000/v3\","
- + "\"user-name\":\"onap\","
- + "\"password\":\"123456\","
- + "\"system-type\":\"VIM\","
- + "\"ssl-cassert\":\"test\","
- + "\"ssl-insecure\":true,"
- + "\"cloud-domain\":\"default\","
- + "\"default-tenant\":\"admin\","
- + "\"system-status\":\"normal\"}]}}";
- assertEquals(expectResult, cloudRegionDetailStr);
- }
-
- @Test
- public void cloudRegion2VimRegisterInfoTest() {
- VimManagerUtil vimManagerUtil = new VimManagerUtil();
- CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
- VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
- String cloudRegionDetailStr = "{\"cloud-owner\":\"zte\","
- + "\"cloud-region-id\":\"RegionOne\","
- + "\"cloud-type\":\"openstack\","
- + "\"cloud-region-version\":\"mitaca\","
- + "\"owner-defined-type\":\"test\","
- + "\"cloud-zone\":\"default\","
- + "\"complex-name\":\"complex\","
- + "\"cloud-extra-info\":\"{}\","
- + "\"esr-system-info-list\":{"
- + "\"esr-system-info\":[{"
- + "\"esr-system-info-id\":\"123456\","
- + "\"service-url\":\"http://10.11.22.33:5000/v3\","
- + "\"user-name\":\"onap\","
- + "\"password\":\"123456\","
- + "\"default-tenant\":\"admin\","
- + "\"system-type\":\"VIM\","
- + "\"ssl-cassert\":\"test\","
- + "\"ssl-insecure\":true,"
- + "\"cloud-domain\":\"default\","
- + "\"system-status\":\"normal\"}]}}";
- cloudRegionDetail = new Gson().fromJson(cloudRegionDetailStr, CloudRegionDetail.class);
- vimRegisterInfo = vimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
- String vimRegisterInfoStr = new ExtsysUtil().objectToString(vimRegisterInfo);
- String expectResult = "{\"cloudOwner\":\"zte\","
- + "\"cloudRegionId\":\"RegionOne\","
- + "\"cloudType\":\"openstack\","
- + "\"cloudRegionVersion\":\"mitaca\","
- + "\"ownerDefinedType\":\"test\","
- + "\"cloudZone\":\"default\","
- + "\"complexName\":\"complex\","
- + "\"cloudExtraInfo\":\"{}\","
- + "\"status\":\"normal\","
- + "\"vimAuthInfos\":[{"
- + "\"cloudDomain\":\"default\","
- + "\"userName\":\"onap\","
- + "\"password\":\"123456\","
- + "\"authUrl\":\"http://10.11.22.33:5000/v3\","
- + "\"defaultTenant\":\"admin\","
- + "\"sslCacert\":\"test\","
- + "\"sslInsecure\":true}]}";
- assertEquals(expectResult, vimRegisterInfoStr);
- }
+
+ @Test
+ public void vimRegisterInfo2CloudRegionTest() {
+ VimManagerUtil vimManagerUtil = new VimManagerUtil();
+ CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ List<VimAuthInfo> vimAuthInfos = new ArrayList<>();
+ VimAuthInfo vimAuthInfo = new VimAuthInfo();
+ vimAuthInfo.setAuthUrl("http://10.11.22.33:5000/v3");
+ vimAuthInfo.setCloudDomain("default");
+ vimAuthInfo.setPassword("123456");
+ vimAuthInfo.setSslCacert("test");
+ vimAuthInfo.setSslInsecure(true);
+ vimAuthInfo.setUserName("onap");
+ vimAuthInfo.setDefaultTenant("admin");
+ vimRegisterInfo.setCloudExtraInfo("{}");
+ vimRegisterInfo.setCloudOwner("zte");
+ vimRegisterInfo.setCloudRegionId("RegionOne");
+ vimRegisterInfo.setCloudRegionVersion("mitaca");
+ vimRegisterInfo.setCloudType("openstack");
+ vimRegisterInfo.setCloudZone("default");
+ vimRegisterInfo.setComplexName("complex");
+ vimRegisterInfo.setOwnerDefinedType("test");
+ vimRegisterInfo.setStatus("normal");
+ vimAuthInfos.add(vimAuthInfo);
+ vimRegisterInfo.setVimAuthInfos(vimAuthInfos);
+ cloudRegionDetail = vimManagerUtil.vimRegisterInfo2CloudRegion(vimRegisterInfo);
+ cloudRegionDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0).setEsrSystemInfoId("123456");
+ String cloudRegionDetailStr = new ExtsysUtil().objectToString(cloudRegionDetail);
+ String expectResult = "{\"cloud-owner\":\"zte\"," + "\"cloud-region-id\":\"RegionOne\","
+ + "\"cloud-type\":\"openstack\"," + "\"cloud-region-version\":\"mitaca\","
+ + "\"owner-defined-type\":\"test\"," + "\"cloud-zone\":\"default\"," + "\"complex-name\":\"complex\","
+ + "\"cloud-extra-info\":\"{}\"," + "\"esr-system-info-list\":{" + "\"esr-system-info\":[{"
+ + "\"esr-system-info-id\":\"123456\"," + "\"service-url\":\"http://10.11.22.33:5000/v3\","
+ + "\"user-name\":\"onap\"," + "\"password\":\"123456\"," + "\"system-type\":\"VIM\","
+ + "\"ssl-cassert\":\"test\"," + "\"ssl-insecure\":true," + "\"cloud-domain\":\"default\","
+ + "\"default-tenant\":\"admin\"," + "\"system-status\":\"normal\"}]}}";
+ assertEquals(expectResult, cloudRegionDetailStr);
+ }
+
+ @Test
+ public void cloudRegion2VimRegisterInfoTest() {
+ VimManagerUtil vimManagerUtil = new VimManagerUtil();
+ CloudRegionDetail cloudRegionDetail = new CloudRegionDetail();
+ VimRegisterInfo vimRegisterInfo = new VimRegisterInfo();
+ String cloudRegionDetailStr = "{\"cloud-owner\":\"zte\"," + "\"cloud-region-id\":\"RegionOne\","
+ + "\"cloud-type\":\"openstack\"," + "\"cloud-region-version\":\"mitaca\","
+ + "\"owner-defined-type\":\"test\"," + "\"cloud-zone\":\"default\"," + "\"complex-name\":\"complex\","
+ + "\"cloud-extra-info\":\"{}\"," + "\"esr-system-info-list\":{" + "\"esr-system-info\":[{"
+ + "\"esr-system-info-id\":\"123456\"," + "\"service-url\":\"http://10.11.22.33:5000/v3\","
+ + "\"user-name\":\"onap\"," + "\"password\":\"123456\"," + "\"default-tenant\":\"admin\","
+ + "\"system-type\":\"VIM\"," + "\"ssl-cassert\":\"test\"," + "\"ssl-insecure\":true,"
+ + "\"cloud-domain\":\"default\"," + "\"system-status\":\"normal\"}]}}";
+ cloudRegionDetail = new Gson().fromJson(cloudRegionDetailStr, CloudRegionDetail.class);
+ vimRegisterInfo = vimManagerUtil.cloudRegion2VimRegisterInfo(cloudRegionDetail);
+ String vimRegisterInfoStr = new ExtsysUtil().objectToString(vimRegisterInfo);
+ String expectResult = "{\"cloudOwner\":\"zte\"," + "\"cloudRegionId\":\"RegionOne\","
+ + "\"cloudType\":\"openstack\"," + "\"cloudRegionVersion\":\"mitaca\","
+ + "\"ownerDefinedType\":\"test\"," + "\"cloudZone\":\"default\"," + "\"complexName\":\"complex\","
+ + "\"cloudExtraInfo\":\"{}\"," + "\"status\":\"normal\"," + "\"vimAuthInfos\":[{"
+ + "\"cloudDomain\":\"default\"," + "\"userName\":\"onap\"," + "\"password\":\"123456\","
+ + "\"authUrl\":\"http://10.11.22.33:5000/v3\"," + "\"defaultTenant\":\"admin\","
+ + "\"sslCacert\":\"test\"," + "\"sslInsecure\":true}]}";
+ assertEquals(expectResult, vimRegisterInfoStr);
+ }
}
package org.onap.aai.esr.util;
import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
import org.onap.aai.esr.entity.aai.EsrVnfmDetail;
import org.onap.aai.esr.entity.rest.VnfmRegisterInfo;
-
import com.google.gson.Gson;
public class VnfmManagerUtilTest {
- @Test
- public void vnfmRegisterInfo2EsrVnfmTest() {
- VnfmManagerUtil vnfmManagerUtil = new VnfmManagerUtil();
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
- vnfmRegisterInfo.setVimId("987654");
- vnfmRegisterInfo.setVersion("v1");
- vnfmRegisterInfo.setVendor("zte");
- vnfmRegisterInfo.setUserName("onap");
- vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
- vnfmRegisterInfo.setType("vnfm");
- vnfmRegisterInfo.setPassword("987654");
- vnfmRegisterInfo.setName("ONAP VNFM");
- vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
- esrVnfmDetail = vnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfmRegisterInfo);
- esrVnfmDetail.setVnfmId("123456");
- esrVnfmDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0).setEsrSystemInfoId("qwerty");
- String esrVnfmDetailStr = new ExtsysUtil().objectToString(esrVnfmDetail);
- String expectResult = "{\"vnfm-id\":\"123456\","
- + "\"vim-id\":\"987654\","
- + "\"certificate-url\":\"http://11.22.33.44:5000/v3\","
- + "\"esr-system-info-list\":{"
- + "\"esr-system-info\":[{"
- + "\"esr-system-info-id\":\"qwerty\","
- + "\"system-name\":\"ONAP VNFM\","
- + "\"type\":\"vnfm\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1\","
- + "\"service-url\":\"http://10.11.22.33:8000\","
- + "\"user-name\":\"onap\","
- + "\"password\":\"987654\","
- + "\"system-type\":\"VNFM\"}]}}";
- assertEquals(expectResult, esrVnfmDetailStr);
- }
-
- @Test
- public void esrVnfm2VnfmRegisterInfoTest() {
- VnfmManagerUtil vnfmManagerUtil = new VnfmManagerUtil();
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
- String esrVnfmDetailStr = "{\"vnfm-id\":\"123456\","
- + "\"vim-id\":\"987654\","
- + "\"certificate-url\":\"http://11.22.33.44:5000/v3\","
- + "\"esr-system-info-list\":{"
- + "\"esr-system-info\":[{"
- + "\"esr-system-info-id\":\"qwerty\","
- + "\"system-name\":\"ONAP VNFM\","
- + "\"type\":\"vnfm\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1\","
- + "\"service-url\":\"http://10.11.22.33:8000\","
- + "\"user-name\":\"onap\","
- + "\"password\":\"987654\","
- + "\"system-type\":\"VNFM\"}]}}";
- esrVnfmDetail = new Gson().fromJson(esrVnfmDetailStr, EsrVnfmDetail.class);
- vnfmRegisterInfo = vnfmManagerUtil.esrVnfm2VnfmRegisterInfo(esrVnfmDetail);
- String vnfmRegisterInfoStr = new ExtsysUtil().objectToString(vnfmRegisterInfo);
- String expectResult = "{\"vnfmId\":\"123456\","
- + "\"name\":\"ONAP VNFM\","
- + "\"type\":\"vnfm\","
- + "\"vimId\":\"987654\","
- + "\"vendor\":\"zte\","
- + "\"version\":\"v1\","
- + "\"certificateUrl\":\"http://11.22.33.44:5000/v3\","
- + "\"url\":\"http://10.11.22.33:8000\","
- + "\"userName\":\"onap\","
- + "\"password\":\"987654\"}";
- assertEquals(expectResult, vnfmRegisterInfoStr);
- }
+ @Test
+ public void vnfmRegisterInfo2EsrVnfmTest() {
+ VnfmManagerUtil vnfmManagerUtil = new VnfmManagerUtil();
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
+ vnfmRegisterInfo.setVimId("987654");
+ vnfmRegisterInfo.setVersion("v1");
+ vnfmRegisterInfo.setVendor("zte");
+ vnfmRegisterInfo.setUserName("onap");
+ vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
+ vnfmRegisterInfo.setType("vnfm");
+ vnfmRegisterInfo.setPassword("987654");
+ vnfmRegisterInfo.setName("ONAP VNFM");
+ vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
+ esrVnfmDetail = vnfmManagerUtil.vnfmRegisterInfo2EsrVnfm(vnfmRegisterInfo);
+ esrVnfmDetail.setVnfmId("123456");
+ esrVnfmDetail.getEsrSystemInfoList().getEsrSystemInfo().get(0).setEsrSystemInfoId("qwerty");
+ String esrVnfmDetailStr = new ExtsysUtil().objectToString(esrVnfmDetail);
+ String expectResult = "{\"vnfm-id\":\"123456\"," + "\"vim-id\":\"987654\","
+ + "\"certificate-url\":\"http://11.22.33.44:5000/v3\"," + "\"esr-system-info-list\":{"
+ + "\"esr-system-info\":[{" + "\"esr-system-info-id\":\"qwerty\"," + "\"system-name\":\"ONAP VNFM\","
+ + "\"type\":\"vnfm\"," + "\"vendor\":\"zte\"," + "\"version\":\"v1\","
+ + "\"service-url\":\"http://10.11.22.33:8000\"," + "\"user-name\":\"onap\","
+ + "\"password\":\"987654\"," + "\"system-type\":\"VNFM\"}]}}";
+ assertEquals(expectResult, esrVnfmDetailStr);
+ }
+
+ @Test
+ public void esrVnfm2VnfmRegisterInfoTest() {
+ VnfmManagerUtil vnfmManagerUtil = new VnfmManagerUtil();
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ EsrVnfmDetail esrVnfmDetail = new EsrVnfmDetail();
+ String esrVnfmDetailStr = "{\"vnfm-id\":\"123456\"," + "\"vim-id\":\"987654\","
+ + "\"certificate-url\":\"http://11.22.33.44:5000/v3\"," + "\"esr-system-info-list\":{"
+ + "\"esr-system-info\":[{" + "\"esr-system-info-id\":\"qwerty\"," + "\"system-name\":\"ONAP VNFM\","
+ + "\"type\":\"vnfm\"," + "\"vendor\":\"zte\"," + "\"version\":\"v1\","
+ + "\"service-url\":\"http://10.11.22.33:8000\"," + "\"user-name\":\"onap\","
+ + "\"password\":\"987654\"," + "\"system-type\":\"VNFM\"}]}}";
+ esrVnfmDetail = new Gson().fromJson(esrVnfmDetailStr, EsrVnfmDetail.class);
+ vnfmRegisterInfo = vnfmManagerUtil.esrVnfm2VnfmRegisterInfo(esrVnfmDetail);
+ String vnfmRegisterInfoStr = new ExtsysUtil().objectToString(vnfmRegisterInfo);
+ String expectResult = "{\"vnfmId\":\"123456\"," + "\"name\":\"ONAP VNFM\"," + "\"type\":\"vnfm\","
+ + "\"vimId\":\"987654\"," + "\"vendor\":\"zte\"," + "\"version\":\"v1\","
+ + "\"certificateUrl\":\"http://11.22.33.44:5000/v3\"," + "\"url\":\"http://10.11.22.33:8000\","
+ + "\"userName\":\"onap\"," + "\"password\":\"987654\"}";
+ assertEquals(expectResult, vnfmRegisterInfoStr);
+ }
}
--- /dev/null
+/**
+ * Copyright 2018 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.wrapper;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.aai.esr.common.MsbConfig;
+
+public class EmsManagerWrapperTest {
+ private static EmsManagerWrapper emsManagerWrapper;
+ static {
+ MsbConfig.setMsbServerAddr("http://127.0.0.1:80");
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ emsManagerWrapper = EmsManagerWrapper.getInstance();
+ }
+
+ @Test
+ public void test_registerEms() {
+
+ }
+}
/**
- * Copyright 2017 ZTE Corporation.
+ * Copyright 2018 ZTE Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.aai.esr.wrapper;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import javax.ws.rs.core.Response;
-
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class ThirdpartySdncWrapperTest {
- private static ThirdpartySdncWrapper thirdpartySdncWrapper;
- static {
- MsbConfig.setMsbServerAddr("http://127.0.0.1:80");
- }
-
- @Before
- public void setUp() throws Exception {
- thirdpartySdncWrapper = ThirdpartySdncWrapper.getInstance();
- }
-
- @Test
- public void test_registerThirdpartySdnc() {
- ExternalSystemProxy.isTest = true;
- ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- sdncRegisterInfo.setLocation("edge");
- sdncRegisterInfo.setName("SDNC_TEST");
- sdncRegisterInfo.setPassword("123987");
- sdncRegisterInfo.setProductName("thirdparty SDNC");
- sdncRegisterInfo.setProtocol("protocol");
- sdncRegisterInfo.setThirdpartySdncId("123456");
- sdncRegisterInfo.setType("SDNC");
- sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
- sdncRegisterInfo.setUserName("nancy");
- sdncRegisterInfo.setVendor("zte");
- sdncRegisterInfo.setVersion("v1");
- Response response = thirdpartySdncWrapper.registerThirdpartySdnc(sdncRegisterInfo);
- if (response != null) {
- Assert.assertTrue(response.getStatus() == 200);
+ private static ThirdpartySdncWrapper thirdpartySdncWrapper;
+ static {
+ MsbConfig.setMsbServerAddr("http://127.0.0.1:80");
}
- ExternalSystemProxy.isTest = false;
- }
-
- @Test
- public void test_delThirdpartySdnc() {
- ExternalSystemProxy.isTest = true;
- Response response = thirdpartySdncWrapper.delThirdpartySdnc("123456");
- if (response != null) {
- Assert.assertTrue(response.getStatus() == 204);
+
+ @Before
+ public void setUp() throws Exception {
+ thirdpartySdncWrapper = ThirdpartySdncWrapper.getInstance();
}
- ExternalSystemProxy.isTest = false;
- }
-
- @Test
- public void test_queryThirdpartySdncById() {
- ExternalSystemProxy.isTest = true;
- ExtsysUtil extsysUtil = new ExtsysUtil();
- ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- sdncRegisterInfo.setLocation("edge");
- sdncRegisterInfo.setName("SDNC_TEST");
- sdncRegisterInfo.setPassword("123987");
- sdncRegisterInfo.setProductName("thirdparty SDNC");
- sdncRegisterInfo.setProtocol("protocol");
- sdncRegisterInfo.setThirdpartySdncId("123456");
- sdncRegisterInfo.setType("SDNC");
- sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
- sdncRegisterInfo.setUserName("nancy");
- sdncRegisterInfo.setVendor("zte");
- sdncRegisterInfo.setVersion("v1");
- Response response = thirdpartySdncWrapper.queryThirdpartySdncById("123456");
- if (response != null) {
- Assert.assertTrue(response.getStatus() == 200);
- assertEquals(extsysUtil.objectToString(sdncRegisterInfo), extsysUtil.objectToString(response.getEntity()));
+
+ @Test
+ public void test_registerThirdpartySdnc() {
+ ExternalSystemProxy.isTest = true;
+ ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ sdncRegisterInfo.setLocation("edge");
+ sdncRegisterInfo.setName("SDNC_TEST");
+ sdncRegisterInfo.setPassword("123987");
+ sdncRegisterInfo.setProductName("thirdparty SDNC");
+ sdncRegisterInfo.setProtocol("protocol");
+ sdncRegisterInfo.setThirdpartySdncId("123456");
+ sdncRegisterInfo.setType("SDNC");
+ sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
+ sdncRegisterInfo.setUserName("nancy");
+ sdncRegisterInfo.setVendor("zte");
+ sdncRegisterInfo.setVersion("v1");
+ Response response = thirdpartySdncWrapper.registerThirdpartySdnc(sdncRegisterInfo);
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 200);
+ }
+ ExternalSystemProxy.isTest = false;
}
- ExternalSystemProxy.isTest = false;
- }
-
- @Test
- public void test_queryThirdpartySdncList() {
- ExternalSystemProxy.isTest = true;
- ExtsysUtil extsysUtil = new ExtsysUtil();
- List<ThirdpartySdncRegisterInfo> sdncList = new ArrayList<>();
- ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- sdncRegisterInfo.setLocation("edge");
- sdncRegisterInfo.setName("SDNC_TEST");
- sdncRegisterInfo.setPassword("123987");
- sdncRegisterInfo.setProductName("thirdparty SDNC");
- sdncRegisterInfo.setProtocol("protocol");
- sdncRegisterInfo.setThirdpartySdncId("123456");
- sdncRegisterInfo.setType("SDNC");
- sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
- sdncRegisterInfo.setUserName("nancy");
- sdncRegisterInfo.setVendor("zte");
- sdncRegisterInfo.setVersion("v1");
- sdncList.add(sdncRegisterInfo);
- Response response = thirdpartySdncWrapper.queryThirdpartySdncList();
- if (response != null) {
- Assert.assertTrue(response.getStatus() == 200);
- assertEquals(extsysUtil.objectToString(sdncList), extsysUtil.objectToString(response.getEntity()));
+
+ @Test
+ public void test_delThirdpartySdnc() {
+ ExternalSystemProxy.isTest = true;
+ Response response = thirdpartySdncWrapper.delThirdpartySdnc("123456");
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 204);
+ }
+ ExternalSystemProxy.isTest = false;
}
- ExternalSystemProxy.isTest = false;
- }
-
- @Test
- public void test_updateThirdpartySdnc() {
- ExternalSystemProxy.isTest = true;
- ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
- sdncRegisterInfo.setLocation("edge");
- sdncRegisterInfo.setName("SDNC_TEST");
- sdncRegisterInfo.setPassword("123987");
- sdncRegisterInfo.setProductName("thirdparty SDNC");
- sdncRegisterInfo.setProtocol("protocol");
- sdncRegisterInfo.setThirdpartySdncId("123456");
- sdncRegisterInfo.setType("SDNC");
- sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
- sdncRegisterInfo.setUserName("nancy");
- sdncRegisterInfo.setVendor("zte");
- sdncRegisterInfo.setVersion("v1");
- Response response = thirdpartySdncWrapper.updateThirdpartySdnc(sdncRegisterInfo, "123456");
- if (response != null) {
- Assert.assertTrue(response.getStatus() == 200);
+
+ @Test
+ public void test_queryThirdpartySdncById() {
+ ExternalSystemProxy.isTest = true;
+ ExtsysUtil extsysUtil = new ExtsysUtil();
+ ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ sdncRegisterInfo.setLocation("edge");
+ sdncRegisterInfo.setName("SDNC_TEST");
+ sdncRegisterInfo.setPassword("123987");
+ sdncRegisterInfo.setProductName("thirdparty SDNC");
+ sdncRegisterInfo.setProtocol("protocol");
+ sdncRegisterInfo.setThirdpartySdncId("123456");
+ sdncRegisterInfo.setType("SDNC");
+ sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
+ sdncRegisterInfo.setUserName("nancy");
+ sdncRegisterInfo.setVendor("zte");
+ sdncRegisterInfo.setVersion("v1");
+ Response response = thirdpartySdncWrapper.queryThirdpartySdncById("123456");
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 200);
+ assertEquals(extsysUtil.objectToString(sdncRegisterInfo), extsysUtil.objectToString(response.getEntity()));
+ }
+ ExternalSystemProxy.isTest = false;
+ }
+
+ @Test
+ public void test_queryThirdpartySdncList() {
+ ExternalSystemProxy.isTest = true;
+ ExtsysUtil extsysUtil = new ExtsysUtil();
+ List<ThirdpartySdncRegisterInfo> sdncList = new ArrayList<>();
+ ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ sdncRegisterInfo.setLocation("edge");
+ sdncRegisterInfo.setName("SDNC_TEST");
+ sdncRegisterInfo.setPassword("123987");
+ sdncRegisterInfo.setProductName("thirdparty SDNC");
+ sdncRegisterInfo.setProtocol("protocol");
+ sdncRegisterInfo.setThirdpartySdncId("123456");
+ sdncRegisterInfo.setType("SDNC");
+ sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
+ sdncRegisterInfo.setUserName("nancy");
+ sdncRegisterInfo.setVendor("zte");
+ sdncRegisterInfo.setVersion("v1");
+ sdncList.add(sdncRegisterInfo);
+ Response response = thirdpartySdncWrapper.queryThirdpartySdncList();
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 200);
+ assertEquals(extsysUtil.objectToString(sdncList), extsysUtil.objectToString(response.getEntity()));
+ }
+ ExternalSystemProxy.isTest = false;
+ }
+
+ @Test
+ public void test_updateThirdpartySdnc() {
+ ExternalSystemProxy.isTest = true;
+ ThirdpartySdncRegisterInfo sdncRegisterInfo = new ThirdpartySdncRegisterInfo();
+ sdncRegisterInfo.setLocation("edge");
+ sdncRegisterInfo.setName("SDNC_TEST");
+ sdncRegisterInfo.setPassword("123987");
+ sdncRegisterInfo.setProductName("thirdparty SDNC");
+ sdncRegisterInfo.setProtocol("protocol");
+ sdncRegisterInfo.setThirdpartySdncId("123456");
+ sdncRegisterInfo.setType("SDNC");
+ sdncRegisterInfo.setUrl("http://127.0.0.1:8000");
+ sdncRegisterInfo.setUserName("nancy");
+ sdncRegisterInfo.setVendor("zte");
+ sdncRegisterInfo.setVersion("v1");
+ Response response = thirdpartySdncWrapper.updateThirdpartySdnc(sdncRegisterInfo, "123456");
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 200);
+ }
+ ExternalSystemProxy.isTest = false;
}
- ExternalSystemProxy.isTest = false;
- }
}
/**
- * Copyright 2017 ZTE Corporation.
+ * Copyright 2018 ZTE Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.aai.esr.wrapper;
import static org.junit.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.List;
-
import javax.ws.rs.core.Response;
-
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class VnfmManagerWrapperTest {
- private static VnfmManagerWrapper vnfmManagerWrapper;
- static {
- MsbConfig.setMsbServerAddr("http://127.0.0.1:80");
- }
+ private static VnfmManagerWrapper vnfmManagerWrapper;
+ static {
+ MsbConfig.setMsbServerAddr("http://127.0.0.1:80");
+ }
- @Before
- public void setUp() throws Exception {
- vnfmManagerWrapper = VnfmManagerWrapper.getInstance();
- }
+ @Before
+ public void setUp() throws Exception {
+ vnfmManagerWrapper = VnfmManagerWrapper.getInstance();
+ }
- @Test
- public void test_registerVnfm() {
- ExternalSystemProxy.isTest = true;
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setVimId("987654");
- vnfmRegisterInfo.setVersion("v1");
- vnfmRegisterInfo.setVendor("zte");
- vnfmRegisterInfo.setUserName("onap");
- vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
- vnfmRegisterInfo.setType("vnfm");
- vnfmRegisterInfo.setPassword("987654");
- vnfmRegisterInfo.setName("ONAP VNFM");
- vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
- Response response = vnfmManagerWrapper.registerVnfm(vnfmRegisterInfo);
- if (response != null) {
- Assert.assertTrue(response.getStatus() == 200);
+ @Test
+ public void test_registerVnfm() {
+ ExternalSystemProxy.isTest = true;
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setVimId("987654");
+ vnfmRegisterInfo.setVersion("v1");
+ vnfmRegisterInfo.setVendor("zte");
+ vnfmRegisterInfo.setUserName("onap");
+ vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
+ vnfmRegisterInfo.setType("vnfm");
+ vnfmRegisterInfo.setPassword("987654");
+ vnfmRegisterInfo.setName("ONAP VNFM");
+ vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
+ Response response = vnfmManagerWrapper.registerVnfm(vnfmRegisterInfo);
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 200);
+ }
+ ExternalSystemProxy.isTest = false;
}
- ExternalSystemProxy.isTest = false;
- }
-
- @Test
- public void test_queryVnfmById() {
- ExternalSystemProxy.isTest = true;
- ExtsysUtil extsysUtil = new ExtsysUtil();
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setVimId("987654");
- vnfmRegisterInfo.setVersion("v1");
- vnfmRegisterInfo.setVendor("zte");
- vnfmRegisterInfo.setUserName("onap");
- vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
- vnfmRegisterInfo.setType("vnfm");
- vnfmRegisterInfo.setPassword("987654");
- vnfmRegisterInfo.setName("ONAP VNFM");
- vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
- vnfmRegisterInfo.setVnfmId("123456");
- Response response = vnfmManagerWrapper.queryVnfmById("123456");
- if (response != null) {
- Assert.assertTrue(response.getStatus() == 200);
- assertEquals(extsysUtil.objectToString(vnfmRegisterInfo), extsysUtil.objectToString(response.getEntity()));
+
+ @Test
+ public void test_queryVnfmById() {
+ ExternalSystemProxy.isTest = true;
+ ExtsysUtil extsysUtil = new ExtsysUtil();
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setVimId("987654");
+ vnfmRegisterInfo.setVersion("v1");
+ vnfmRegisterInfo.setVendor("zte");
+ vnfmRegisterInfo.setUserName("onap");
+ vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
+ vnfmRegisterInfo.setType("vnfm");
+ vnfmRegisterInfo.setPassword("987654");
+ vnfmRegisterInfo.setName("ONAP VNFM");
+ vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
+ vnfmRegisterInfo.setVnfmId("123456");
+ Response response = vnfmManagerWrapper.queryVnfmById("123456");
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 200);
+ assertEquals(extsysUtil.objectToString(vnfmRegisterInfo), extsysUtil.objectToString(response.getEntity()));
+ }
+ ExternalSystemProxy.isTest = false;
}
- ExternalSystemProxy.isTest = false;
- }
-
- @Test
- public void test_queryVnfmList() {
- ExternalSystemProxy.isTest = true;
- ExtsysUtil extsysUtil = new ExtsysUtil();
- List<VnfmRegisterInfo> vnfmList = new ArrayList<>();
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setVimId("987654");
- vnfmRegisterInfo.setVersion("v1");
- vnfmRegisterInfo.setVendor("zte");
- vnfmRegisterInfo.setUserName("onap");
- vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
- vnfmRegisterInfo.setType("vnfm");
- vnfmRegisterInfo.setPassword("987654");
- vnfmRegisterInfo.setName("ONAP VNFM");
- vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
- vnfmRegisterInfo.setVnfmId("123456");
- vnfmList.add(vnfmRegisterInfo);
- Response response = vnfmManagerWrapper.queryVnfmList();
- if (response != null) {
- Assert.assertTrue(response.getStatus() == 200);
- assertEquals(extsysUtil.objectToString(vnfmList), extsysUtil.objectToString(response.getEntity()));
+
+ @Test
+ public void test_queryVnfmList() {
+ ExternalSystemProxy.isTest = true;
+ ExtsysUtil extsysUtil = new ExtsysUtil();
+ List<VnfmRegisterInfo> vnfmList = new ArrayList<>();
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setVimId("987654");
+ vnfmRegisterInfo.setVersion("v1");
+ vnfmRegisterInfo.setVendor("zte");
+ vnfmRegisterInfo.setUserName("onap");
+ vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
+ vnfmRegisterInfo.setType("vnfm");
+ vnfmRegisterInfo.setPassword("987654");
+ vnfmRegisterInfo.setName("ONAP VNFM");
+ vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
+ vnfmRegisterInfo.setVnfmId("123456");
+ vnfmList.add(vnfmRegisterInfo);
+ Response response = vnfmManagerWrapper.queryVnfmList();
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 200);
+ assertEquals(extsysUtil.objectToString(vnfmList), extsysUtil.objectToString(response.getEntity()));
+ }
+ ExternalSystemProxy.isTest = false;
}
- ExternalSystemProxy.isTest = false;
- }
-
- @Test
- public void test_delVnfm() {
- ExternalSystemProxy.isTest = true;
- Response response = vnfmManagerWrapper.delVnfm("123456");
- if(response != null) {
- Assert.assertTrue(response.getStatus() == 204);
+
+ @Test
+ public void test_delVnfm() {
+ ExternalSystemProxy.isTest = true;
+ Response response = vnfmManagerWrapper.delVnfm("123456");
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 204);
+ }
+ ExternalSystemProxy.isTest = false;
}
- ExternalSystemProxy.isTest = false;
- }
-
- @Test
- public void test_updateVnfm() {
- ExternalSystemProxy.isTest = true;
- VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
- vnfmRegisterInfo.setVimId("987654");
- vnfmRegisterInfo.setVersion("v1");
- vnfmRegisterInfo.setVendor("zte");
- vnfmRegisterInfo.setUserName("onap");
- vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
- vnfmRegisterInfo.setType("vnfm");
- vnfmRegisterInfo.setPassword("987654");
- vnfmRegisterInfo.setName("ONAP VNFM");
- vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
- vnfmRegisterInfo.setVnfmId("123456");
- Response response = vnfmManagerWrapper.updateVnfm(vnfmRegisterInfo, "123456");
- if(response != null) {
- Assert.assertTrue(response.getStatus() == 200);
+
+ @Test
+ public void test_updateVnfm() {
+ ExternalSystemProxy.isTest = true;
+ VnfmRegisterInfo vnfmRegisterInfo = new VnfmRegisterInfo();
+ vnfmRegisterInfo.setVimId("987654");
+ vnfmRegisterInfo.setVersion("v1");
+ vnfmRegisterInfo.setVendor("zte");
+ vnfmRegisterInfo.setUserName("onap");
+ vnfmRegisterInfo.setUrl("http://10.11.22.33:8000");
+ vnfmRegisterInfo.setType("vnfm");
+ vnfmRegisterInfo.setPassword("987654");
+ vnfmRegisterInfo.setName("ONAP VNFM");
+ vnfmRegisterInfo.setCertificateUrl("http://11.22.33.44:5000/v3");
+ vnfmRegisterInfo.setVnfmId("123456");
+ Response response = vnfmManagerWrapper.updateVnfm(vnfmRegisterInfo, "123456");
+ if (response != null) {
+ Assert.assertTrue(response.getStatus() == 200);
+ }
+ ExternalSystemProxy.isTest = false;
}
- ExternalSystemProxy.isTest = false;
- }
}