From f47919f1fe367b612fa9c96d34c59f01a541e882 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Mon, 8 Apr 2019 14:14:34 -0400 Subject: Replaced all tabs with spaces in java and pom.xml Added in maven plugins to enforce coding style rules Added in eclipse java formatting xml Change-Id: I3727bbf4ce8dc66abfd8ad21b6cfd0890c5d3ff0 Issue-ID: SO-1765 Signed-off-by: Benjamin, Max (mb388a) --- .../adapters/network/beans/ContrailPolicyRef.java | 36 +- .../network/beans/ContrailPolicyRefSeq.java | 60 ++- .../so/adapters/network/beans/ContrailSubnet.java | 193 +++++----- .../network/beans/ContrailSubnetHostRoute.java | 57 +-- .../network/beans/ContrailSubnetHostRoutes.java | 48 ++- .../adapters/network/beans/ContrailSubnetIp.java | 54 +-- .../adapters/network/beans/ContrailSubnetPool.java | 56 +-- .../mappers/ContrailSubnetHostRouteMapper.java | 33 +- .../network/mappers/ContrailSubnetMapper.java | 197 +++++----- .../network/mappers/ContrailSubnetPoolMapper.java | 30 +- .../onap/so/adapters/nwrest/ContrailNetwork.java | 135 ++++--- .../so/adapters/nwrest/CreateNetworkError.java | 22 +- .../so/adapters/nwrest/CreateNetworkRequest.java | 318 ++++++++-------- .../so/adapters/nwrest/CreateNetworkResponse.java | 177 +++++---- .../so/adapters/nwrest/DeleteNetworkError.java | 22 +- .../so/adapters/nwrest/DeleteNetworkRequest.java | 144 ++++---- .../so/adapters/nwrest/DeleteNetworkResponse.java | 55 ++- .../adapters/nwrest/NetworkExceptionResponse.java | 71 ++-- .../so/adapters/nwrest/NetworkRequestCommon.java | 119 +++--- .../so/adapters/nwrest/NetworkResponseCommon.java | 80 ++-- .../onap/so/adapters/nwrest/NetworkTechnology.java | 2 +- .../so/adapters/nwrest/ProviderVlanNetwork.java | 66 ++-- .../onap/so/adapters/nwrest/QueryNetworkError.java | 3 +- .../so/adapters/nwrest/QueryNetworkResponse.java | 200 +++++----- .../so/adapters/nwrest/RollbackNetworkError.java | 22 +- .../so/adapters/nwrest/RollbackNetworkRequest.java | 36 +- .../adapters/nwrest/RollbackNetworkResponse.java | 45 ++- .../so/adapters/nwrest/UpdateNetworkError.java | 22 +- .../so/adapters/nwrest/UpdateNetworkRequest.java | 312 ++++++++-------- .../so/adapters/nwrest/UpdateNetworkResponse.java | 74 ++-- .../so/adapters/sdncrest/RequestInformation.java | 223 ++++++------ .../onap/so/adapters/sdncrest/SDNCErrorCommon.java | 15 +- .../org/onap/so/adapters/sdncrest/SDNCEvent.java | 185 +++++----- .../so/adapters/sdncrest/SDNCRequestCommon.java | 150 ++++---- .../so/adapters/sdncrest/SDNCResponseCommon.java | 169 +++++---- .../so/adapters/sdncrest/SDNCServiceError.java | 21 +- .../so/adapters/sdncrest/SDNCServiceRequest.java | 196 +++++----- .../so/adapters/sdncrest/SDNCServiceResponse.java | 58 ++- .../so/adapters/sdncrest/ServiceInformation.java | 145 ++++---- .../so/adapters/tenantrest/CreateTenantError.java | 82 ++--- .../adapters/tenantrest/CreateTenantRequest.java | 132 ++++--- .../adapters/tenantrest/CreateTenantResponse.java | 108 +++--- .../so/adapters/tenantrest/DeleteTenantError.java | 82 ++--- .../adapters/tenantrest/DeleteTenantRequest.java | 51 ++- .../adapters/tenantrest/DeleteTenantResponse.java | 18 +- .../so/adapters/tenantrest/QueryTenantError.java | 48 ++- .../adapters/tenantrest/QueryTenantResponse.java | 68 ++-- .../adapters/tenantrest/RollbackTenantError.java | 58 ++- .../adapters/tenantrest/RollbackTenantRequest.java | 16 +- .../tenantrest/RollbackTenantResponse.java | 18 +- .../tenantrest/TenantExceptionResponse.java | 56 ++- .../adapters/tenantrest/TenantRequestCommon.java | 58 ++- .../so/adapters/tenantrest/TenantRollback.java | 89 ++--- .../java/org/onap/so/adapters/vdu/CloudInfo.java | 79 ++-- .../org/onap/so/adapters/vdu/PluginAction.java | 79 ++-- .../java/org/onap/so/adapters/vdu/VduArtifact.java | 117 +++--- .../org/onap/so/adapters/vdu/VduException.java | 57 +-- .../java/org/onap/so/adapters/vdu/VduInstance.java | 77 ++-- .../org/onap/so/adapters/vdu/VduModelInfo.java | 57 +-- .../org/onap/so/adapters/vdu/VduStateType.java | 11 +- .../java/org/onap/so/adapters/vdu/VduStatus.java | 78 ++-- .../so/adapters/vnfrest/CreateVfModuleRequest.java | 352 +++++++++--------- .../adapters/vnfrest/CreateVfModuleResponse.java | 142 ++++---- .../adapters/vnfrest/CreateVolumeGroupRequest.java | 257 +++++++------ .../vnfrest/CreateVolumeGroupResponse.java | 126 +++---- .../so/adapters/vnfrest/DeleteVfModuleRequest.java | 147 ++++---- .../adapters/vnfrest/DeleteVfModuleResponse.java | 81 +++-- .../adapters/vnfrest/DeleteVolumeGroupRequest.java | 94 +++-- .../vnfrest/DeleteVolumeGroupResponse.java | 29 +- .../so/adapters/vnfrest/QueryVfModuleResponse.java | 125 ++++--- .../adapters/vnfrest/QueryVolumeGroupResponse.java | 130 +++---- .../adapters/vnfrest/RollbackVfModuleRequest.java | 21 +- .../adapters/vnfrest/RollbackVfModuleResponse.java | 29 +- .../vnfrest/RollbackVolumeGroupRequest.java | 21 +- .../vnfrest/RollbackVolumeGroupResponse.java | 29 +- .../so/adapters/vnfrest/UpdateVfModuleRequest.java | 273 +++++++------- .../adapters/vnfrest/UpdateVfModuleResponse.java | 102 +++--- .../adapters/vnfrest/UpdateVolumeGroupRequest.java | 159 ++++---- .../vnfrest/UpdateVolumeGroupResponse.java | 70 ++-- .../vnfrest/VfModuleExceptionResponse.java | 81 ++--- .../onap/so/adapters/vnfrest/VfModuleRollback.java | 215 +++++------ .../onap/so/adapters/vnfrest/VfRequestCommon.java | 46 +-- .../onap/so/adapters/vnfrest/VfResponseCommon.java | 85 +++-- .../vnfrest/VolumeGroupExceptionResponse.java | 24 +- .../so/adapters/vnfrest/VolumeGroupRollback.java | 218 +++++------ .../org/onap/so/openstack/beans/HeatStatus.java | 2 +- .../org/onap/so/openstack/beans/HostRoute.java | 68 ++-- .../org/onap/so/openstack/beans/MsoTenant.java | 70 ++-- .../org/onap/so/openstack/beans/NetworkInfo.java | 162 ++++----- .../onap/so/openstack/beans/NetworkRollback.java | 246 +++++++------ .../org/onap/so/openstack/beans/NetworkStatus.java | 5 +- .../java/org/onap/so/openstack/beans/Pool.java | 94 ++--- .../org/onap/so/openstack/beans/RouteTarget.java | 65 ++-- .../org/onap/so/openstack/beans/StackInfo.java | 149 ++++---- .../java/org/onap/so/openstack/beans/Subnet.java | 118 +++--- .../org/onap/so/openstack/beans/VnfRollback.java | 403 +++++++++++---------- .../org/onap/so/openstack/beans/VnfStatus.java | 2 +- .../openstack/exceptions/MsoAdapterException.java | 27 +- .../exceptions/MsoCloudIdentityNotFound.java | 11 +- .../openstack/exceptions/MsoCloudSiteNotFound.java | 11 +- .../onap/so/openstack/exceptions/MsoException.java | 82 +++-- .../openstack/exceptions/MsoExceptionCategory.java | 2 +- .../exceptions/MsoHeatNotFoundException.java | 9 +- .../so/openstack/exceptions/MsoIOException.java | 35 +- .../exceptions/MsoNetworkAlreadyExists.java | 14 +- .../openstack/exceptions/MsoNetworkNotFound.java | 14 +- .../exceptions/MsoOpenstackException.java | 85 +++-- .../exceptions/MsoStackAlreadyExists.java | 14 +- .../so/openstack/exceptions/MsoStackNotFound.java | 21 +- .../exceptions/MsoTenantAlreadyExists.java | 14 +- .../so/openstack/exceptions/MsoTenantNotFound.java | 17 +- .../org/onap/so/openstack/mappers/MapAdapter.java | 50 +-- .../org/onap/so/openstack/mappers/MapElements.java | 20 +- .../org/onap/so/openstack/mappers/MapEntry.java | 14 +- .../so/openstack/mappers/NetworkInfoMapper.java | 134 ++++--- .../onap/so/openstack/mappers/StackInfoMapper.java | 130 +++---- 116 files changed, 5076 insertions(+), 5158 deletions(-) (limited to 'adapters/mso-adapters-rest-interface/src/main/java') diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRef.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRef.java index f207c6185e..d03246b366 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRef.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRef.java @@ -24,22 +24,22 @@ package org.onap.so.adapters.network.beans; import com.fasterxml.jackson.annotation.JsonProperty; public class ContrailPolicyRef { - - @JsonProperty("network_policy_refs_data_sequence") - private ContrailPolicyRefSeq seq; - - - public ContrailPolicyRefSeq getSeq() { - return seq; - } - - public void setSeq(ContrailPolicyRefSeq seq) { - this.seq = seq; - } - - public ContrailPolicyRef withRefSeq(ContrailPolicyRefSeq seq) { - this.seq = seq; - return this; - } - + + @JsonProperty("network_policy_refs_data_sequence") + private ContrailPolicyRefSeq seq; + + + public ContrailPolicyRefSeq getSeq() { + return seq; + } + + public void setSeq(ContrailPolicyRefSeq seq) { + this.seq = seq; + } + + public ContrailPolicyRef withRefSeq(ContrailPolicyRefSeq seq) { + this.seq = seq; + return this; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRefSeq.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRefSeq.java index a3a5a710ed..c0ec000874 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRefSeq.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailPolicyRefSeq.java @@ -24,42 +24,40 @@ package org.onap.so.adapters.network.beans; import com.fasterxml.jackson.annotation.JsonProperty; public class ContrailPolicyRefSeq { - - @JsonProperty("network_policy_refs_data_sequence_major") - private String major; - - @JsonProperty("network_policy_refs_data_sequence_minor") - private String minor; - public ContrailPolicyRefSeq() { - } - - public ContrailPolicyRefSeq(String major, String minor) { - super(); - this.major = major; - this.minor = minor; - } + @JsonProperty("network_policy_refs_data_sequence_major") + private String major; - public String getMajor() { - return major; - } + @JsonProperty("network_policy_refs_data_sequence_minor") + private String minor; - public void setMajor(String major) { - this.major = major; - } + public ContrailPolicyRefSeq() {} - public String getMinor() { - return minor; - } + public ContrailPolicyRefSeq(String major, String minor) { + super(); + this.major = major; + this.minor = minor; + } - public void setMinor(String minor) { - this.minor = minor; - } + public String getMajor() { + return major; + } - @Override - public String toString() { - return "ContrailPolicyRefSeq [major=" + major + ", minor=" + minor - + "]"; - } + public void setMajor(String major) { + this.major = major; + } + + public String getMinor() { + return minor; + } + + public void setMinor(String minor) { + this.minor = minor; + } + + @Override + public String toString() { + return "ContrailPolicyRefSeq [major=" + major + ", minor=" + minor + "]"; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnet.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnet.java index fc674a0416..487fe804c5 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnet.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnet.java @@ -22,107 +22,104 @@ package org.onap.so.adapters.network.beans; import java.util.ArrayList; import java.util.List; - import com.fasterxml.jackson.annotation.JsonProperty; public class ContrailSubnet { - @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet") - private ContrailSubnetIp subnet = new ContrailSubnetIp(); - - @JsonProperty("network_ipam_refs_data_ipam_subnets_default_gateway") - private String defaultGateway; - - @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_name") - private String subnetName; - - @JsonProperty("network_ipam_refs_data_ipam_subnets_enable_dhcp") - private Boolean enableDhcp; - - @JsonProperty("network_ipam_refs_data_ipam_subnets_addr_from_start") - private Boolean addrFromStart = true; - /** future - leave this commented - private String subnet_uuid; - private String dns_server_address; - private List dns_nameservers; - private String dhcp_option_list; - **/ - - @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools") - private List allocationPools = new ArrayList<>(); - - @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes") - private ContrailSubnetHostRoutes hostRoutes = new ContrailSubnetHostRoutes(); - - public ContrailSubnet() { - super(); - } - - public String getDefaultGateway() { - return defaultGateway; - } - - public void setDefaultGateway(String defaultGateway) { - this.defaultGateway = defaultGateway; - } - - public ContrailSubnetIp getSubnet() { - return subnet; - } - - public void setSubnet(ContrailSubnetIp subnet) { - this.subnet = subnet; - } - - public Boolean isEnableDhcp() { - return enableDhcp; - } - - public void setEnableDhcp(Boolean enableDhcp) { - this.enableDhcp = enableDhcp; - } - - public String getSubnetName() { - return subnetName; - } - - public void setSubnetName(String subnetName) { - this.subnetName = subnetName; - } - - public List getAllocationPools() { - return allocationPools; - } - - public void setAllocationPools(List allocationPools) { - this.allocationPools = allocationPools; - } - - public Boolean isAddrFromStart() { - return addrFromStart; - } - - public void setAddrFromStart(Boolean addrFromStart) { - this.addrFromStart = addrFromStart; - } - - public ContrailSubnetHostRoutes getHostRoutes() { - return hostRoutes; - } - - public void setHostRoutes(ContrailSubnetHostRoutes hostRoutes) { - this.hostRoutes = hostRoutes; - } - - @Override - public String toString() { - StringBuilder buf = new StringBuilder (); - for (ContrailSubnetPool pool : allocationPools) - { - buf.append(pool.toString()); - } - return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + defaultGateway - + " enable_dhcp=" + enableDhcp + " addr_from_start=" + addrFromStart + " subnet_name=" + subnetName + " allocation_pools=" + buf + " ]"; - } + @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet") + private ContrailSubnetIp subnet = new ContrailSubnetIp(); + + @JsonProperty("network_ipam_refs_data_ipam_subnets_default_gateway") + private String defaultGateway; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_name") + private String subnetName; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_enable_dhcp") + private Boolean enableDhcp; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_addr_from_start") + private Boolean addrFromStart = true; + /** + * future - leave this commented private String subnet_uuid; private String dns_server_address; private List + * dns_nameservers; private String dhcp_option_list; + **/ + + @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools") + private List allocationPools = new ArrayList<>(); + + @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes") + private ContrailSubnetHostRoutes hostRoutes = new ContrailSubnetHostRoutes(); + + public ContrailSubnet() { + super(); + } + + public String getDefaultGateway() { + return defaultGateway; + } + + public void setDefaultGateway(String defaultGateway) { + this.defaultGateway = defaultGateway; + } + + public ContrailSubnetIp getSubnet() { + return subnet; + } + + public void setSubnet(ContrailSubnetIp subnet) { + this.subnet = subnet; + } + + public Boolean isEnableDhcp() { + return enableDhcp; + } + + public void setEnableDhcp(Boolean enableDhcp) { + this.enableDhcp = enableDhcp; + } + + public String getSubnetName() { + return subnetName; + } + + public void setSubnetName(String subnetName) { + this.subnetName = subnetName; + } + + public List getAllocationPools() { + return allocationPools; + } + + public void setAllocationPools(List allocationPools) { + this.allocationPools = allocationPools; + } + + public Boolean isAddrFromStart() { + return addrFromStart; + } + + public void setAddrFromStart(Boolean addrFromStart) { + this.addrFromStart = addrFromStart; + } + + public ContrailSubnetHostRoutes getHostRoutes() { + return hostRoutes; + } + + public void setHostRoutes(ContrailSubnetHostRoutes hostRoutes) { + this.hostRoutes = hostRoutes; + } + + @Override + public String toString() { + StringBuilder buf = new StringBuilder(); + for (ContrailSubnetPool pool : allocationPools) { + buf.append(pool.toString()); + } + return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + defaultGateway + " enable_dhcp=" + + enableDhcp + " addr_from_start=" + addrFromStart + " subnet_name=" + subnetName + " allocation_pools=" + + buf + " ]"; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoute.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoute.java index 7d53715e3c..4d0fe40e49 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoute.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoute.java @@ -22,33 +22,34 @@ package org.onap.so.adapters.network.beans; import com.fasterxml.jackson.annotation.JsonProperty; + public class ContrailSubnetHostRoute { - - @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route_prefix") - private String prefix; - - @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route_next_hop") - private String nextHop; - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - public String getNextHop() { - return nextHop; - } - - public void setNextHop(String nextHop) { - this.nextHop = nextHop; - } - - @Override - public String toString() { - return "ContrailSubnetHostRoute [prefix=" + prefix + ", nextHop=" + nextHop + "]"; - } - + + @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route_prefix") + private String prefix; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route_next_hop") + private String nextHop; + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public String getNextHop() { + return nextHop; + } + + public void setNextHop(String nextHop) { + this.nextHop = nextHop; + } + + @Override + public String toString() { + return "ContrailSubnetHostRoute [prefix=" + prefix + ", nextHop=" + nextHop + "]"; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoutes.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoutes.java index cd7192b6e2..e7bb8275d3 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoutes.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetHostRoutes.java @@ -23,31 +23,29 @@ package org.onap.so.adapters.network.beans; import java.util.ArrayList; import java.util.List; - import com.fasterxml.jackson.annotation.JsonProperty; + public class ContrailSubnetHostRoutes { - - @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route") - private List hostRoutes = new ArrayList<>(); - - public List getHostRoutes() { - return hostRoutes; - } - - public void setHostRoutes(List hostRoutes) { - this.hostRoutes = hostRoutes; - } - - @Override - public String toString() { - StringBuilder buf = new StringBuilder (); - if (hostRoutes != null) - { - for (ContrailSubnetHostRoute hr : hostRoutes) - { - buf.append(hr.toString()); - } - } - return "ContrailSubnetHostRoutes [" + buf.toString() + "]"; - } + + @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes_route") + private List hostRoutes = new ArrayList<>(); + + public List getHostRoutes() { + return hostRoutes; + } + + public void setHostRoutes(List hostRoutes) { + this.hostRoutes = hostRoutes; + } + + @Override + public String toString() { + StringBuilder buf = new StringBuilder(); + if (hostRoutes != null) { + for (ContrailSubnetHostRoute hr : hostRoutes) { + buf.append(hr.toString()); + } + } + return "ContrailSubnetHostRoutes [" + buf.toString() + "]"; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetIp.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetIp.java index 3986592dde..064b8733cb 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetIp.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetIp.java @@ -24,32 +24,32 @@ package org.onap.so.adapters.network.beans; import com.fasterxml.jackson.annotation.JsonProperty; public class ContrailSubnetIp { - - @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix") - private String ipPrefix; - - @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len") - private String ipPrefixLen; - - public String getIpPrefix() { - return ipPrefix; - } - - public void setIpPrefix(String ipPrefix) { - this.ipPrefix = ipPrefix; - } - - public String getIpPrefixLen() { - return ipPrefixLen; - } - - public void setIpPrefixLen(String ipPrefixLen) { - this.ipPrefixLen = ipPrefixLen; - } - - @Override - public String toString() { - return "ContrailSubnetIp [ip_prefix=" + ipPrefix + ", ip_prefix_len=" + ipPrefixLen + "]"; - } + + @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix") + private String ipPrefix; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len") + private String ipPrefixLen; + + public String getIpPrefix() { + return ipPrefix; + } + + public void setIpPrefix(String ipPrefix) { + this.ipPrefix = ipPrefix; + } + + public String getIpPrefixLen() { + return ipPrefixLen; + } + + public void setIpPrefixLen(String ipPrefixLen) { + this.ipPrefixLen = ipPrefixLen; + } + + @Override + public String toString() { + return "ContrailSubnetIp [ip_prefix=" + ipPrefix + ", ip_prefix_len=" + ipPrefixLen + "]"; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetPool.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetPool.java index 11a06c69d5..434416c7ed 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetPool.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/beans/ContrailSubnetPool.java @@ -24,32 +24,32 @@ package org.onap.so.adapters.network.beans; import com.fasterxml.jackson.annotation.JsonProperty; public class ContrailSubnetPool { - - @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools_start") - private String start; - - @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools_end") - private String end; - - public String getStart() { - return start; - } - - public void setStart(String start) { - this.start = start; - } - - public String getEnd() { - return end; - } - - public void setEnd(String end) { - this.end = end; - } - - @Override - public String toString() { - return "ContrailSubnetPool [start=" + start + ", end=" + end + "]"; - } - + + @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools_start") + private String start; + + @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools_end") + private String end; + + public String getStart() { + return start; + } + + public void setStart(String start) { + this.start = start; + } + + public String getEnd() { + return end; + } + + public void setEnd(String end) { + this.end = end; + } + + @Override + public String toString() { + return "ContrailSubnetPool [start=" + start + ", end=" + end + "]"; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetHostRouteMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetHostRouteMapper.java index 03800de5b8..f711c25172 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetHostRouteMapper.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetHostRouteMapper.java @@ -25,20 +25,21 @@ import org.onap.so.openstack.beans.HostRoute; public class ContrailSubnetHostRouteMapper { - private final HostRoute hostRoute; - public ContrailSubnetHostRouteMapper(HostRoute hostRoute) { - this.hostRoute = hostRoute; - } - - public ContrailSubnetHostRoute map() { - - final ContrailSubnetHostRoute contrailSubnetHostRoute = new ContrailSubnetHostRoute(); - - if (hostRoute != null) { - contrailSubnetHostRoute.setNextHop(hostRoute.getNextHop()); - contrailSubnetHostRoute.setPrefix(hostRoute.getPrefix()); - } - return contrailSubnetHostRoute; - } - + private final HostRoute hostRoute; + + public ContrailSubnetHostRouteMapper(HostRoute hostRoute) { + this.hostRoute = hostRoute; + } + + public ContrailSubnetHostRoute map() { + + final ContrailSubnetHostRoute contrailSubnetHostRoute = new ContrailSubnetHostRoute(); + + if (hostRoute != null) { + contrailSubnetHostRoute.setNextHop(hostRoute.getNextHop()); + contrailSubnetHostRoute.setPrefix(hostRoute.getPrefix()); + } + return contrailSubnetHostRoute; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetMapper.java index d3ccb35a60..be0ad5c078 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetMapper.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetMapper.java @@ -23,7 +23,6 @@ package org.onap.so.adapters.network.mappers; import java.util.ArrayList; import java.util.List; import java.util.Optional; - import org.onap.so.adapters.network.beans.ContrailSubnet; import org.onap.so.adapters.network.beans.ContrailSubnetHostRoute; import org.onap.so.adapters.network.beans.ContrailSubnetHostRoutes; @@ -35,101 +34,103 @@ import org.onap.so.openstack.beans.Subnet; public class ContrailSubnetMapper { - private final Subnet inputSubnet; - public ContrailSubnetMapper(Subnet inputSubnet) { - this.inputSubnet = inputSubnet; - } - - public ContrailSubnet map() { - - final ContrailSubnet result = new ContrailSubnet(); - if (inputSubnet != null) { - final String subnetname = this.getSubnetName(inputSubnet); - result.setSubnetName(subnetname); - result.setEnableDhcp(inputSubnet.getEnableDHCP()); - result.setDefaultGateway(inputSubnet.getGatewayIp()); - - Optional csIp = createSubnet(inputSubnet); - if (csIp.isPresent()) { - result.setSubnet(csIp.get()); - } - Optional> pools = this.createContrailSubnetPool(inputSubnet); - if (pools.isPresent()) { - result.setAllocationPools(pools.get()); - } - Optional routes = this.createContrailSubnetHostRoutes(inputSubnet); - if (routes.isPresent()) { - result.setHostRoutes(routes.get()); - } - } - - return result; - } - - protected String getSubnetName(Subnet subnet) { - final String result; - if (!isNullOrEmpty(subnet.getSubnetName())) { - result = subnet.getSubnetName(); - } else { - result = subnet.getSubnetId(); - } - - return result; - } - - protected Optional> createContrailSubnetPool(final Subnet subnet) { - Optional> result = Optional.empty(); - if (subnet.getAllocationPools() != null) { - List pools = new ArrayList<>(); - for (Pool pool : subnet.getAllocationPools()) { - if ( !isNullOrEmpty(pool.getStart()) && !isNullOrEmpty(pool.getEnd()) ) { - - pools.add(new ContrailSubnetPoolMapper(pool).map()); - } - } - if (!pools.isEmpty()) { - result = Optional.of(pools); - } - } - - return result; - } - - protected Optional createContrailSubnetHostRoutes(final Subnet subnet) { - Optional result = Optional.empty(); - if (subnet.getHostRoutes() != null) { - ContrailSubnetHostRoutes hostRoutesObj = new ContrailSubnetHostRoutes(); - List hrList = new ArrayList<>(); - for (HostRoute hr : subnet.getHostRoutes()) { - if ( !isNullOrEmpty(hr.getPrefix()) || !isNullOrEmpty(hr.getNextHop()) ) { - hrList.add(new ContrailSubnetHostRouteMapper(hr).map()); - } - } - if (!hrList.isEmpty()) { - hostRoutesObj.setHostRoutes(hrList); - result = Optional.of(hostRoutesObj); - } - } - - return result; - - } - protected Optional createSubnet(final Subnet subnet) { - Optional result = Optional.empty(); - if (!isNullOrEmpty(subnet.getCidr()) ) { - int idx = subnet.getCidr().indexOf("/"); - final ContrailSubnetIp csIp = new ContrailSubnetIp(); - if (idx != -1) { - csIp.setIpPrefix(subnet.getCidr().substring(0, idx)); - csIp.setIpPrefixLen(subnet.getCidr().substring(idx+1)); - result = Optional.of(csIp); - } - } - - return result; - } - - protected boolean isNullOrEmpty (String s) { - return s == null || s.isEmpty(); - } + private final Subnet inputSubnet; + + public ContrailSubnetMapper(Subnet inputSubnet) { + this.inputSubnet = inputSubnet; + } + + public ContrailSubnet map() { + + final ContrailSubnet result = new ContrailSubnet(); + if (inputSubnet != null) { + final String subnetname = this.getSubnetName(inputSubnet); + result.setSubnetName(subnetname); + result.setEnableDhcp(inputSubnet.getEnableDHCP()); + result.setDefaultGateway(inputSubnet.getGatewayIp()); + + Optional csIp = createSubnet(inputSubnet); + if (csIp.isPresent()) { + result.setSubnet(csIp.get()); + } + Optional> pools = this.createContrailSubnetPool(inputSubnet); + if (pools.isPresent()) { + result.setAllocationPools(pools.get()); + } + Optional routes = this.createContrailSubnetHostRoutes(inputSubnet); + if (routes.isPresent()) { + result.setHostRoutes(routes.get()); + } + } + + return result; + } + + protected String getSubnetName(Subnet subnet) { + final String result; + if (!isNullOrEmpty(subnet.getSubnetName())) { + result = subnet.getSubnetName(); + } else { + result = subnet.getSubnetId(); + } + + return result; + } + + protected Optional> createContrailSubnetPool(final Subnet subnet) { + Optional> result = Optional.empty(); + if (subnet.getAllocationPools() != null) { + List pools = new ArrayList<>(); + for (Pool pool : subnet.getAllocationPools()) { + if (!isNullOrEmpty(pool.getStart()) && !isNullOrEmpty(pool.getEnd())) { + + pools.add(new ContrailSubnetPoolMapper(pool).map()); + } + } + if (!pools.isEmpty()) { + result = Optional.of(pools); + } + } + + return result; + } + + protected Optional createContrailSubnetHostRoutes(final Subnet subnet) { + Optional result = Optional.empty(); + if (subnet.getHostRoutes() != null) { + ContrailSubnetHostRoutes hostRoutesObj = new ContrailSubnetHostRoutes(); + List hrList = new ArrayList<>(); + for (HostRoute hr : subnet.getHostRoutes()) { + if (!isNullOrEmpty(hr.getPrefix()) || !isNullOrEmpty(hr.getNextHop())) { + hrList.add(new ContrailSubnetHostRouteMapper(hr).map()); + } + } + if (!hrList.isEmpty()) { + hostRoutesObj.setHostRoutes(hrList); + result = Optional.of(hostRoutesObj); + } + } + + return result; + + } + + protected Optional createSubnet(final Subnet subnet) { + Optional result = Optional.empty(); + if (!isNullOrEmpty(subnet.getCidr())) { + int idx = subnet.getCidr().indexOf("/"); + final ContrailSubnetIp csIp = new ContrailSubnetIp(); + if (idx != -1) { + csIp.setIpPrefix(subnet.getCidr().substring(0, idx)); + csIp.setIpPrefixLen(subnet.getCidr().substring(idx + 1)); + result = Optional.of(csIp); + } + } + + return result; + } + + protected boolean isNullOrEmpty(String s) { + return s == null || s.isEmpty(); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetPoolMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetPoolMapper.java index a492cd30c0..39b02cd6d5 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetPoolMapper.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/network/mappers/ContrailSubnetPoolMapper.java @@ -25,19 +25,19 @@ import org.onap.so.openstack.beans.Pool; public class ContrailSubnetPoolMapper { - private final Pool pool; - - public ContrailSubnetPoolMapper(Pool pool) { - this.pool = pool; - } - - public ContrailSubnetPool map() { - - ContrailSubnetPool result = new ContrailSubnetPool(); - if (pool != null) { - result.setStart(pool.getStart()); - result.setEnd(pool.getEnd()); - } - return result; - } + private final Pool pool; + + public ContrailSubnetPoolMapper(Pool pool) { + this.pool = pool; + } + + public ContrailSubnetPool map() { + + ContrailSubnetPool result = new ContrailSubnetPool(); + if (pool != null) { + result.setStart(pool.getStart()); + result.setEnd(pool.getEnd()); + } + return result; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ContrailNetwork.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ContrailNetwork.java index 9a7431130d..c80712a07e 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ContrailNetwork.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ContrailNetwork.java @@ -23,76 +23,75 @@ package org.onap.so.adapters.nwrest; import java.io.Serializable; import java.util.List; - import org.onap.so.openstack.beans.RouteTarget; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("contrailNetwork") -public class ContrailNetwork implements Serializable{ - - - /** - * - */ - private static final long serialVersionUID = 6879356795950005963L; - private String shared = "false"; - private String external = "false"; - private List routeTargets; - private List policyFqdns; - private List routeTableFqdns; - - public ContrailNetwork() { - super(); - } - - public ContrailNetwork(String shared, String external, List routeTargets, List policyFqdns, List routeTableFqdns) { - super(); - this.shared = shared; - this.external = external; - this.routeTargets = routeTargets; - this.policyFqdns = policyFqdns; - this.routeTableFqdns = routeTableFqdns; - } - - public String getShared() { - return shared; - } - - public void setShared(String shared) { - this.shared = shared; - } - - public String getExternal() { - return external; - } - - public void setExternal(String external) { - this.external = external; - } - - public List getRouteTargets() { - return routeTargets; - } - - public void setRouteTargets(List routeTargets) { - this.routeTargets = routeTargets; - } - - public List getPolicyFqdns() { - return policyFqdns; - } - - public void setPolicyFqdns(List policyFqdns) { - this.policyFqdns = policyFqdns; - } - - public List getRouteTableFqdns() { - return routeTableFqdns; - } - - public void setRouteTableFqdns(List routeTableFqdns) { - this.routeTableFqdns = routeTableFqdns; - } - +public class ContrailNetwork implements Serializable { + + + /** + * + */ + private static final long serialVersionUID = 6879356795950005963L; + private String shared = "false"; + private String external = "false"; + private List routeTargets; + private List policyFqdns; + private List routeTableFqdns; + + public ContrailNetwork() { + super(); + } + + public ContrailNetwork(String shared, String external, List routeTargets, List policyFqdns, + List routeTableFqdns) { + super(); + this.shared = shared; + this.external = external; + this.routeTargets = routeTargets; + this.policyFqdns = policyFqdns; + this.routeTableFqdns = routeTableFqdns; + } + + public String getShared() { + return shared; + } + + public void setShared(String shared) { + this.shared = shared; + } + + public String getExternal() { + return external; + } + + public void setExternal(String external) { + this.external = external; + } + + public List getRouteTargets() { + return routeTargets; + } + + public void setRouteTargets(List routeTargets) { + this.routeTargets = routeTargets; + } + + public List getPolicyFqdns() { + return policyFqdns; + } + + public void setPolicyFqdns(List policyFqdns) { + this.policyFqdns = policyFqdns; + } + + public List getRouteTableFqdns() { + return routeTableFqdns; + } + + public void setRouteTableFqdns(List routeTableFqdns) { + this.routeTableFqdns = routeTableFqdns; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkError.java index fec9b474dd..4833625a6b 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkError.java @@ -22,24 +22,22 @@ package org.onap.so.adapters.nwrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "createNetworkError") public class CreateNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = -4283402447149144456L; + private static final long serialVersionUID = -4283402447149144456L; - public CreateNetworkError() { - super(""); - } + public CreateNetworkError() { + super(""); + } - public CreateNetworkError(String message) { - super(message); - } + public CreateNetworkError(String message) { + super(message); + } - public CreateNetworkError(String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { - super(message, category, rolledBack, messageid); - } + public CreateNetworkError(String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { + super(message, category, rolledBack, messageid); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java index 153ee78cb0..4f3ed4c96e 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkRequest.java @@ -25,175 +25,173 @@ package org.onap.so.adapters.nwrest; import java.util.HashMap; import java.util.List; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; import org.onap.so.openstack.beans.Subnet; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; -/* README - Map elements when marshalled to XML produce a list of ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. -*/ +/* + * README Map elements when marshalled to XML produce a list of + * ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. When + * marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. + */ @JsonRootName("createNetworkRequest") @XmlRootElement(name = "createNetworkRequest") public class CreateNetworkRequest extends NetworkRequestCommon { - /** - * - */ - private static final long serialVersionUID = -8984362978831333521L; - private String cloudSiteId; - private String tenantId; - private String networkId; - private String networkName; - private String networkType; - private String networkTypeVersion; - private String modelCustomizationUuid; - private String networkTechnology = "NEUTRON"; - private List subnets; - private ProviderVlanNetwork providerVlanNetwork; - private ContrailNetwork contrailNetwork; - private Boolean failIfExists = false; - private Boolean backout = true; - private Map networkParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - private boolean contrailRequest; - - public CreateNetworkRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNetworkName() { - return networkName; - } - - public void setNetworkName(String networkName) { - this.networkName = networkName; - } - - public String getNetworkType() { - return networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public String getNetworkTypeVersion() { - return networkTypeVersion; - } - - public void setNetworkTypeVersion(String networkTypeVersion) { - this.networkTypeVersion = networkTypeVersion; - } - - public String getNetworkTechnology() { - return networkTechnology; - } - - public void setNetworkTechnology(String networkTechnology) { - this.networkTechnology = networkTechnology; - } - - public List getSubnets() { - return subnets; - } - - public void setSubnets(List subnets) { - this.subnets = subnets; - } - - public ProviderVlanNetwork getProviderVlanNetwork() { - return providerVlanNetwork; - } - - public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { - this.providerVlanNetwork = providerVlanNetwork; - } - - public ContrailNetwork getContrailNetwork() { - return contrailNetwork; - } - - public void setContrailNetwork(ContrailNetwork contrailNetwork) { - this.contrailNetwork = contrailNetwork; - } - - public Boolean getFailIfExists() { - return failIfExists; - } - - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } - - public Boolean getBackout() { - return backout; - } - - public void setBackout(Boolean backout) { - this.backout = backout; - } - - public Map getNetworkParams() { - return networkParams; - } - - public void setNetworkParams(Map networkParams) { - this.networkParams = networkParams; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - - public boolean isContrailRequest() { - return this.contrailRequest; - } - - public void setContrailRequest(boolean contrailRequest) { - this.contrailRequest = contrailRequest; - } - + /** + * + */ + private static final long serialVersionUID = -8984362978831333521L; + private String cloudSiteId; + private String tenantId; + private String networkId; + private String networkName; + private String networkType; + private String networkTypeVersion; + private String modelCustomizationUuid; + private String networkTechnology = "NEUTRON"; + private List subnets; + private ProviderVlanNetwork providerVlanNetwork; + private ContrailNetwork contrailNetwork; + private Boolean failIfExists = false; + private Boolean backout = true; + private Map networkParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + private boolean contrailRequest; + + public CreateNetworkRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public String getNetworkTypeVersion() { + return networkTypeVersion; + } + + public void setNetworkTypeVersion(String networkTypeVersion) { + this.networkTypeVersion = networkTypeVersion; + } + + public String getNetworkTechnology() { + return networkTechnology; + } + + public void setNetworkTechnology(String networkTechnology) { + this.networkTechnology = networkTechnology; + } + + public List getSubnets() { + return subnets; + } + + public void setSubnets(List subnets) { + this.subnets = subnets; + } + + public ProviderVlanNetwork getProviderVlanNetwork() { + return providerVlanNetwork; + } + + public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { + this.providerVlanNetwork = providerVlanNetwork; + } + + public ContrailNetwork getContrailNetwork() { + return contrailNetwork; + } + + public void setContrailNetwork(ContrailNetwork contrailNetwork) { + this.contrailNetwork = contrailNetwork; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map getNetworkParams() { + return networkParams; + } + + public void setNetworkParams(Map networkParams) { + this.networkParams = networkParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + public boolean isContrailRequest() { + return this.contrailRequest; + } + + public void setContrailRequest(boolean contrailRequest) { + this.contrailRequest = contrailRequest; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkResponse.java index 763732213d..7968348d8d 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/CreateNetworkResponse.java @@ -23,105 +23,96 @@ package org.onap.so.adapters.nwrest; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.beans.NetworkRollback; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("createNetworkResponse") @XmlRootElement(name = "createNetworkResponse") public class CreateNetworkResponse extends NetworkResponseCommon { - /** - * - */ - private static final long serialVersionUID = -7730406297031948309L; - - private String networkId; - private String neutronNetworkId; - private String networkStackId; - private String networkFqdn; - private Boolean networkCreated; - private Map subnetMap; - private NetworkRollback rollback = new NetworkRollback(); - - public CreateNetworkResponse() { - super(); - } - - public CreateNetworkResponse(String networkId, - String neutronNetworkId, - String networkStackId, - String networkFqdn, - Boolean networkCreated, - Map subnetIdMap, - NetworkRollback rollback, - String messageId) { - super(messageId); - this.networkId = networkId; - this.neutronNetworkId = neutronNetworkId; - this.networkStackId = networkStackId; - this.networkFqdn = networkFqdn; - this.networkCreated = networkCreated; - this.subnetMap = subnetIdMap; - this.rollback = rollback; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNeutronNetworkId() { - return neutronNetworkId; - } - - public void setNeutronNetworkId(String neutronNetworkId) { - this.neutronNetworkId = neutronNetworkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - - public String getNetworkFqdn() { - return networkFqdn; - } - - public void setNetworkFqdn(String networkFqdn) { - this.networkFqdn = networkFqdn; - } - - public Boolean getNetworkCreated() { - return networkCreated; - } - - public void setNetworkCreated(Boolean networkCreated) { - this.networkCreated = networkCreated; - } - - public Map getSubnetMap() { - return subnetMap; - } - - public void setSubnetMap(Map subnetMap) { - this.subnetMap = subnetMap; - } - - public NetworkRollback getRollback() { - return rollback; - } - - public void setRollback(NetworkRollback rollback) { - this.rollback = rollback; - } + /** + * + */ + private static final long serialVersionUID = -7730406297031948309L; + + private String networkId; + private String neutronNetworkId; + private String networkStackId; + private String networkFqdn; + private Boolean networkCreated; + private Map subnetMap; + private NetworkRollback rollback = new NetworkRollback(); + + public CreateNetworkResponse() { + super(); + } + + public CreateNetworkResponse(String networkId, String neutronNetworkId, String networkStackId, String networkFqdn, + Boolean networkCreated, Map subnetIdMap, NetworkRollback rollback, String messageId) { + super(messageId); + this.networkId = networkId; + this.neutronNetworkId = neutronNetworkId; + this.networkStackId = networkStackId; + this.networkFqdn = networkFqdn; + this.networkCreated = networkCreated; + this.subnetMap = subnetIdMap; + this.rollback = rollback; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getNetworkFqdn() { + return networkFqdn; + } + + public void setNetworkFqdn(String networkFqdn) { + this.networkFqdn = networkFqdn; + } + + public Boolean getNetworkCreated() { + return networkCreated; + } + + public void setNetworkCreated(Boolean networkCreated) { + this.networkCreated = networkCreated; + } + + public Map getSubnetMap() { + return subnetMap; + } + + public void setSubnetMap(Map subnetMap) { + this.subnetMap = subnetMap; + } + + public NetworkRollback getRollback() { + return rollback; + } + + public void setRollback(NetworkRollback rollback) { + this.rollback = rollback; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkError.java index f874be56a3..a08c584fe6 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkError.java @@ -22,24 +22,22 @@ package org.onap.so.adapters.nwrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "deleteNetworkError") public class DeleteNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = 2735474165790444180L; + private static final long serialVersionUID = 2735474165790444180L; - public DeleteNetworkError() { - super(""); - } + public DeleteNetworkError() { + super(""); + } - public DeleteNetworkError(String message) { - super(message); - } + public DeleteNetworkError(String message) { + super(message); + } - public DeleteNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { - super(message, category, unused, messageid); - } + public DeleteNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { + super(message, category, unused, messageid); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkRequest.java index 7c3669d7d7..eec960c5a5 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkRequest.java @@ -25,9 +25,7 @@ package org.onap.so.adapters.nwrest; import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; - import com.fasterxml.jackson.annotation.JsonRootName; @@ -35,75 +33,75 @@ import com.fasterxml.jackson.annotation.JsonRootName; @XmlRootElement(name = "deleteNetworkRequest") public class DeleteNetworkRequest extends NetworkRequestCommon { - /** - * - */ - private static final long serialVersionUID = -2445072708572065058L; - private String cloudSiteId; - private String tenantId; - private String networkId; - private String networkStackId; - private String networkType; - private String modelCustomizationUuid; - private MsoRequest msoRequest = new MsoRequest(); - - public DeleteNetworkRequest() { - //empty default constructor - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - - public String getNetworkType() { - return networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } + /** + * + */ + private static final long serialVersionUID = -2445072708572065058L; + private String cloudSiteId; + private String tenantId; + private String networkId; + private String networkStackId; + private String networkType; + private String modelCustomizationUuid; + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteNetworkRequest() { + // empty default constructor + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkResponse.java index 1de7f8be76..720fb87940 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/DeleteNetworkResponse.java @@ -23,43 +23,42 @@ package org.onap.so.adapters.nwrest; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("deleteNetworkResponse") @XmlRootElement(name = "deleteNetworkResponse") public class DeleteNetworkResponse extends NetworkResponseCommon { - /** - * - */ - private static final long serialVersionUID = 68336086339501537L; - private String networkId; - private Boolean networkDeleted; + /** + * + */ + private static final long serialVersionUID = 68336086339501537L; + private String networkId; + private Boolean networkDeleted; + + public DeleteNetworkResponse() { + super(); + } - public DeleteNetworkResponse() { - super(); - } + public DeleteNetworkResponse(String networkId, Boolean networkDeleted, String messageId) { + super(messageId); + this.networkId = networkId; + this.networkDeleted = networkDeleted; + } - public DeleteNetworkResponse(String networkId, Boolean networkDeleted, String messageId) { - super(messageId); - this.networkId = networkId; - this.networkDeleted = networkDeleted; - } - - public String getNetworkId() { - return networkId; - } + public String getNetworkId() { + return networkId; + } - public void setNetworkId(String networkId) { - this.networkId = networkId; - } + public void setNetworkId(String networkId) { + this.networkId = networkId; + } - public Boolean getNetworkDeleted() { - return networkDeleted; - } + public Boolean getNetworkDeleted() { + return networkDeleted; + } - public void setNetworkDeleted(Boolean networkDeleted) { - this.networkDeleted = networkDeleted; - } + public void setNetworkDeleted(Boolean networkDeleted) { + this.networkDeleted = networkDeleted; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkExceptionResponse.java index 4b9f283e20..9d86c0ee87 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkExceptionResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkExceptionResponse.java @@ -26,48 +26,49 @@ import org.onap.so.openstack.exceptions.MsoExceptionCategory; public class NetworkExceptionResponse extends NetworkResponseCommon { /** - * - */ - private static final long serialVersionUID = -7160401922983004097L; - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; + * + */ + private static final long serialVersionUID = -7160401922983004097L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; - public NetworkExceptionResponse () {} + public NetworkExceptionResponse() {} - public NetworkExceptionResponse (String message) { - super(); - this.message = message; - } + public NetworkExceptionResponse(String message) { + super(); + this.message = message; + } - public NetworkExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { - super(messageid); - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } + public NetworkExceptionResponse(String message, MsoExceptionCategory category, boolean rolledBack, + String messageid) { + super(messageid); + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } - public void setMessage(String message) { - this.message = message; - } + public void setMessage(String message) { + this.message = message; + } - public MsoExceptionCategory getCategory () { - return category; - } + public MsoExceptionCategory getCategory() { + return category; + } - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } + public void setCategory(MsoExceptionCategory category) { + this.category = category; + } - public Boolean getRolledBack() { - return rolledBack; - } + public Boolean getRolledBack() { + return rolledBack; + } - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java index 5e4e015556..3629b3fda7 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java @@ -26,10 +26,8 @@ package org.onap.so.adapters.nwrest; import java.io.ByteArrayOutputStream; import java.io.Serializable; - import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; @@ -41,70 +39,71 @@ import org.slf4j.LoggerFactory; * Everything that is common between all Network Requests. */ public abstract class NetworkRequestCommon implements Serializable { - private static final long serialVersionUID = -6732431343649282079L; - private static final Logger logger = LoggerFactory.getLogger(NetworkRequestCommon.class); - private Boolean skipAAI = false; - private String messageId; - private String notificationUrl; - @JsonProperty - private boolean synchronous = true; - public Boolean getSkipAAI() { - return skipAAI; - } + private static final long serialVersionUID = -6732431343649282079L; + private static final Logger logger = LoggerFactory.getLogger(NetworkRequestCommon.class); + private Boolean skipAAI = false; + private String messageId; + private String notificationUrl; + @JsonProperty + private boolean synchronous = true; + + public Boolean getSkipAAI() { + return skipAAI; + } + + public void setSkipAAI(Boolean skipAAI) { + this.skipAAI = skipAAI; + } - public void setSkipAAI(Boolean skipAAI) { - this.skipAAI = skipAAI; - } + public String getMessageId() { + return messageId; + } - public String getMessageId() { - return messageId; - } + public void setMessageId(String messageId) { + this.messageId = messageId; + } - public void setMessageId(String messageId) { - this.messageId = messageId; - } + public String getNotificationUrl() { + return notificationUrl; + } - public String getNotificationUrl() { - return notificationUrl; - } + public void setNotificationUrl(String notificationUrl) { + this.notificationUrl = notificationUrl; + this.synchronous = notificationUrl == null || (notificationUrl.isEmpty()); + } - public void setNotificationUrl(String notificationUrl) { - this.notificationUrl = notificationUrl; - this.synchronous = notificationUrl == null || (notificationUrl.isEmpty()); - } + public boolean isSynchronous() { + return this.synchronous; + } - public boolean isSynchronous() { - return this.synchronous; - } - - @JsonIgnore - protected void setSynchronous(boolean synchronous) { - this.synchronous = synchronous; - } + @JsonIgnore + protected void setSynchronous(boolean synchronous) { + this.synchronous = synchronous; + } - public String toJsonString() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - } catch (Exception e) { - logger.debug("Exception:", e); - } - return jsonString; - } + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + } catch (Exception e) { + logger.debug("Exception:", e); + } + return jsonString; + } - public String toXmlString() { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - JAXBContext context = JAXBContext.newInstance(this.getClass()); - Marshaller marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML - marshaller.marshal(this, bs); - return bs.toString(); - } catch (Exception e) { - logger.debug("Exception:", e); - return ""; - } - } + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); // pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + logger.debug("Exception:", e); + return ""; + } + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java index d1907a237e..54eccb34e4 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java @@ -26,10 +26,8 @@ package org.onap.so.adapters.nwrest; import java.io.ByteArrayOutputStream; import java.io.Serializable; - import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; - import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import org.slf4j.Logger; @@ -40,49 +38,49 @@ import org.slf4j.LoggerFactory; */ public abstract class NetworkResponseCommon implements Serializable { - private static final long serialVersionUID = 1233520856935129726L; - private String messageId; - private static final Logger logger = LoggerFactory.getLogger(NetworkResponseCommon.class); + private static final long serialVersionUID = 1233520856935129726L; + private String messageId; + private static final Logger logger = LoggerFactory.getLogger(NetworkResponseCommon.class); - public NetworkResponseCommon() { - messageId = null; - } + public NetworkResponseCommon() { + messageId = null; + } - public NetworkResponseCommon(String messageId) { - this.messageId = messageId; - } + public NetworkResponseCommon(String messageId) { + this.messageId = messageId; + } - public String getMessageId() { - return messageId; - } + public String getMessageId() { + return messageId; + } - public void setMessageId(String messageId) { - this.messageId = messageId; - } + public void setMessageId(String messageId) { + this.messageId = messageId; + } - public String toJsonString() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - } catch (Exception e) { - logger.debug("Exception:", e); - } - return jsonString; - } + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + } catch (Exception e) { + logger.debug("Exception:", e); + } + return jsonString; + } - public String toXmlString() { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - JAXBContext context = JAXBContext.newInstance(this.getClass()); - Marshaller marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML - marshaller.marshal(this, bs); - return bs.toString(); - } catch (Exception e) { - logger.debug("Exception:", e); - return ""; - } - } + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); // pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + logger.debug("Exception:", e); + return ""; + } + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkTechnology.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkTechnology.java index cade9b44c8..963dc18d06 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkTechnology.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkTechnology.java @@ -22,5 +22,5 @@ package org.onap.so.adapters.nwrest; public enum NetworkTechnology { - NEUTRON, VMWARE, CONTRAIL + NEUTRON, VMWARE, CONTRAIL } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ProviderVlanNetwork.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ProviderVlanNetwork.java index fbd21b8197..f6ac9f2f87 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ProviderVlanNetwork.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/ProviderVlanNetwork.java @@ -25,37 +25,37 @@ package org.onap.so.adapters.nwrest; import java.io.Serializable; import java.util.List; -public class ProviderVlanNetwork implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 6744949861614446315L; - private String physicalNetworkName; - private List vlans; - - public ProviderVlanNetwork() { - super(); - } - - public ProviderVlanNetwork(String physicalNetworkName, List vlans) { - super(); - this.physicalNetworkName = physicalNetworkName; - this.vlans = vlans; - } - - public String getPhysicalNetworkName() { - return physicalNetworkName; - } - - public void setPhysicalNetworkName(String physicalNetworkName) { - this.physicalNetworkName = physicalNetworkName; - } - - public List getVlans() { - return vlans; - } - - public void setVlans(List vlans) { - this.vlans = vlans; - } +public class ProviderVlanNetwork implements Serializable { + /** + * + */ + private static final long serialVersionUID = 6744949861614446315L; + private String physicalNetworkName; + private List vlans; + + public ProviderVlanNetwork() { + super(); + } + + public ProviderVlanNetwork(String physicalNetworkName, List vlans) { + super(); + this.physicalNetworkName = physicalNetworkName; + this.vlans = vlans; + } + + public String getPhysicalNetworkName() { + return physicalNetworkName; + } + + public void setPhysicalNetworkName(String physicalNetworkName) { + this.physicalNetworkName = physicalNetworkName; + } + + public List getVlans() { + return vlans; + } + + public void setVlans(List vlans) { + this.vlans = vlans; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkError.java index 6e8ace9cf0..22f883008b 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkError.java @@ -22,10 +22,9 @@ package org.onap.so.adapters.nwrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "queryNetworkError") public class QueryNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = -6125469596399867146L; + private static final long serialVersionUID = -6125469596399867146L; } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkResponse.java index 98b0c8ebec..7fd0f34828 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/QueryNetworkResponse.java @@ -25,111 +25,109 @@ package org.onap.so.adapters.nwrest; import java.util.List; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.beans.NetworkStatus; import org.onap.so.openstack.beans.RouteTarget; @XmlRootElement(name = "queryNetworkResponse") public class QueryNetworkResponse extends NetworkResponseCommon { - /** - * - */ - private static final long serialVersionUID = -5251191073081795026L; - private String networkId; - private String neutronNetworkId; - private String networkStackId; - private Boolean networkExists; - private NetworkStatus networkStatus; - private List vlans; - private List routeTargets; - private Map subnetIdMap; - private Map networkOutputs; - - public QueryNetworkResponse() { - super(); - } - - public QueryNetworkResponse(String networkId, String neutronNetworkId, String networkStackId, - NetworkStatus networkStatus, Map networkOutputs) { - super(); - this.networkId = networkId; - this.neutronNetworkId = neutronNetworkId; - this.networkStackId = networkStackId; - this.networkStatus = networkStatus; - this.networkOutputs = networkOutputs; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNeutronNetworkId() { - return neutronNetworkId; - } - - public void setNeutronNetworkId(String neutronNetworkId) { - this.neutronNetworkId = neutronNetworkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - - public NetworkStatus getNetworkStatus() { - return networkStatus; - } - - public void setNetworkStatus(NetworkStatus networkStatus) { - this.networkStatus = networkStatus; - } - - public Boolean getNetworkExists() { - return networkExists; - } - - public void setNetworkExists(Boolean networkExists) { - this.networkExists = networkExists; - } - - public List getVlans() { - return vlans; - } - - public void setVlans(List vlans) { - this.vlans = vlans; - } - - public List getRouteTargets() { - return routeTargets; - } - - public void setRouteTargets(List routeTargets) { - this.routeTargets = routeTargets; - } - - public Map getSubnetIdMap() { - return subnetIdMap; - } - - public void setSubnetIdMap(Map subnetIdMap) { - this.subnetIdMap = subnetIdMap; - } - - public Map getNetworkOutputs() { - return networkOutputs; - } - - public void setNetworkOutputs(Map networkOutputs) { - this.networkOutputs = networkOutputs; - } + /** + * + */ + private static final long serialVersionUID = -5251191073081795026L; + private String networkId; + private String neutronNetworkId; + private String networkStackId; + private Boolean networkExists; + private NetworkStatus networkStatus; + private List vlans; + private List routeTargets; + private Map subnetIdMap; + private Map networkOutputs; + + public QueryNetworkResponse() { + super(); + } + + public QueryNetworkResponse(String networkId, String neutronNetworkId, String networkStackId, + NetworkStatus networkStatus, Map networkOutputs) { + super(); + this.networkId = networkId; + this.neutronNetworkId = neutronNetworkId; + this.networkStackId = networkStackId; + this.networkStatus = networkStatus; + this.networkOutputs = networkOutputs; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public NetworkStatus getNetworkStatus() { + return networkStatus; + } + + public void setNetworkStatus(NetworkStatus networkStatus) { + this.networkStatus = networkStatus; + } + + public Boolean getNetworkExists() { + return networkExists; + } + + public void setNetworkExists(Boolean networkExists) { + this.networkExists = networkExists; + } + + public List getVlans() { + return vlans; + } + + public void setVlans(List vlans) { + this.vlans = vlans; + } + + public List getRouteTargets() { + return routeTargets; + } + + public void setRouteTargets(List routeTargets) { + this.routeTargets = routeTargets; + } + + public Map getSubnetIdMap() { + return subnetIdMap; + } + + public void setSubnetIdMap(Map subnetIdMap) { + this.subnetIdMap = subnetIdMap; + } + + public Map getNetworkOutputs() { + return networkOutputs; + } + + public void setNetworkOutputs(Map networkOutputs) { + this.networkOutputs = networkOutputs; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkError.java index cb148dfcef..1cdc48fc69 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkError.java @@ -22,24 +22,22 @@ package org.onap.so.adapters.nwrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "rollbackNetworkError") public class RollbackNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = -3954464103037391980L; + private static final long serialVersionUID = -3954464103037391980L; - public RollbackNetworkError() { - super(""); - } + public RollbackNetworkError() { + super(""); + } - public RollbackNetworkError(String message) { - super(message); - } + public RollbackNetworkError(String message) { + super(message); + } - public RollbackNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { - super(message, category, unused, messageid); - } + public RollbackNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { + super(message, category, unused, messageid); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkRequest.java index 494d3123d1..a53d578da2 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkRequest.java @@ -23,29 +23,27 @@ package org.onap.so.adapters.nwrest; import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.beans.NetworkRollback; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("rollbackNetworkRequest") @XmlRootElement(name = "rollbackNetworkRequest") public class RollbackNetworkRequest extends NetworkRequestCommon { - /** - * - */ - private static final long serialVersionUID = -8705660877263749940L; - private NetworkRollback networkRollback; - - public RollbackNetworkRequest() { - super(); - } - - public NetworkRollback getNetworkRollback() { - return networkRollback; - } - - public void setNetworkRollback(NetworkRollback networkRollback) { - this.networkRollback = networkRollback; - } + /** + * + */ + private static final long serialVersionUID = -8705660877263749940L; + private NetworkRollback networkRollback; + + public RollbackNetworkRequest() { + super(); + } + + public NetworkRollback getNetworkRollback() { + return networkRollback; + } + + public void setNetworkRollback(NetworkRollback networkRollback) { + this.networkRollback = networkRollback; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkResponse.java index 9be8bb3a69..b9632cc7d9 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/RollbackNetworkResponse.java @@ -23,7 +23,6 @@ package org.onap.so.adapters.nwrest; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @@ -31,26 +30,26 @@ import com.fasterxml.jackson.annotation.JsonRootName; @XmlRootElement(name = "rollbackNetworkResponse") public class RollbackNetworkResponse extends NetworkResponseCommon { - /** - * - */ - private static final long serialVersionUID = 3115905123337163846L; - private Boolean networkRolledBack; - - public RollbackNetworkResponse() { - super(); - } - - public RollbackNetworkResponse(Boolean networkRolledBack, String messageId) { - super(messageId); - this.networkRolledBack = networkRolledBack; - } - - public Boolean getNetworkRolledBack() { - return networkRolledBack; - } - - public void setNetworkRolledBack(Boolean networkRolledBack) { - this.networkRolledBack = networkRolledBack; - } + /** + * + */ + private static final long serialVersionUID = 3115905123337163846L; + private Boolean networkRolledBack; + + public RollbackNetworkResponse() { + super(); + } + + public RollbackNetworkResponse(Boolean networkRolledBack, String messageId) { + super(messageId); + this.networkRolledBack = networkRolledBack; + } + + public Boolean getNetworkRolledBack() { + return networkRolledBack; + } + + public void setNetworkRolledBack(Boolean networkRolledBack) { + this.networkRolledBack = networkRolledBack; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkError.java index 642ac4cc64..59122f3d8d 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkError.java @@ -22,24 +22,22 @@ package org.onap.so.adapters.nwrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "updateNetworkError") public class UpdateNetworkError extends NetworkExceptionResponse implements Serializable { - private static final long serialVersionUID = 46820809807914392L; + private static final long serialVersionUID = 46820809807914392L; - public UpdateNetworkError() { - super(""); - } + public UpdateNetworkError() { + super(""); + } - public UpdateNetworkError(String message) { - super(message); - } + public UpdateNetworkError(String message) { + super(message); + } - public UpdateNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { - super(message, category, unused, messageid); - } + public UpdateNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { + super(message, category, unused, messageid); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java index 595662251f..9d01697e32 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkRequest.java @@ -27,12 +27,9 @@ package org.onap.so.adapters.nwrest; import java.util.HashMap; import java.util.List; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; import org.onap.so.openstack.beans.Subnet; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; @@ -40,157 +37,160 @@ import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("updateNetworkRequest") @XmlRootElement(name = "updateNetworkRequest") public class UpdateNetworkRequest extends NetworkRequestCommon { - /** - * - */ - private static final long serialVersionUID = -1219693235726357143L; - private String cloudSiteId; - private String tenantId; - private String networkId; - private String networkStackId; - private String networkName; - private String networkType; - private String networkTypeVersion; - private String modelCustomizationUuid; - private String networkTechnology = "NEUTRON"; - private List subnets; - private ProviderVlanNetwork providerVlanNetwork; - private ContrailNetwork contrailNetwork; - private Boolean backout = true; - private Map networkParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - - @JsonProperty - private boolean contrailRequest; - public UpdateNetworkRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - - public String getNetworkName() { - return networkName; - } - - public void setNetworkName(String networkName) { - this.networkName = networkName; - } - - public String getNetworkType() { - return networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public String getNetworkTypeVersion() { - return networkTypeVersion; - } - - public void setNetworkTypeVersion(String networkTypeVersion) { - this.networkTypeVersion = networkTypeVersion; - } - - public String getNetworkTechnology() { - return networkTechnology; - } - - public void setNetworkTechnology(String networkTechnology) { - this.networkTechnology = networkTechnology; - } - - public List getSubnets() { - return subnets; - } - - public void setSubnets(List subnets) { - this.subnets = subnets; - } - - public ProviderVlanNetwork getProviderVlanNetwork() { - return providerVlanNetwork; - } - - public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { - this.providerVlanNetwork = providerVlanNetwork; - } - - public ContrailNetwork getContrailNetwork() { - return contrailNetwork; - } - - public void setContrailNetwork(ContrailNetwork contrailNetwork) { - this.contrailNetwork = contrailNetwork; - } - - public Boolean getBackout() { - return backout; - } - - public void setBackout(Boolean backout) { - this.backout = backout; - } - - public Map getNetworkParams() { - return networkParams; - } - - public void setNetworkParams(Map networkParams) { - this.networkParams = networkParams; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - @JsonIgnore - protected void setContrailRequest(boolean contrailRequest) { - this.contrailRequest = contrailRequest; - } - public boolean isContrailRequest() { - return contrailRequest; - } - + /** + * + */ + private static final long serialVersionUID = -1219693235726357143L; + private String cloudSiteId; + private String tenantId; + private String networkId; + private String networkStackId; + private String networkName; + private String networkType; + private String networkTypeVersion; + private String modelCustomizationUuid; + private String networkTechnology = "NEUTRON"; + private List subnets; + private ProviderVlanNetwork providerVlanNetwork; + private ContrailNetwork contrailNetwork; + private Boolean backout = true; + private Map networkParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + + @JsonProperty + private boolean contrailRequest; + + public UpdateNetworkRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public String getNetworkTypeVersion() { + return networkTypeVersion; + } + + public void setNetworkTypeVersion(String networkTypeVersion) { + this.networkTypeVersion = networkTypeVersion; + } + + public String getNetworkTechnology() { + return networkTechnology; + } + + public void setNetworkTechnology(String networkTechnology) { + this.networkTechnology = networkTechnology; + } + + public List getSubnets() { + return subnets; + } + + public void setSubnets(List subnets) { + this.subnets = subnets; + } + + public ProviderVlanNetwork getProviderVlanNetwork() { + return providerVlanNetwork; + } + + public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { + this.providerVlanNetwork = providerVlanNetwork; + } + + public ContrailNetwork getContrailNetwork() { + return contrailNetwork; + } + + public void setContrailNetwork(ContrailNetwork contrailNetwork) { + this.contrailNetwork = contrailNetwork; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map getNetworkParams() { + return networkParams; + } + + public void setNetworkParams(Map networkParams) { + this.networkParams = networkParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @JsonIgnore + protected void setContrailRequest(boolean contrailRequest) { + this.contrailRequest = contrailRequest; + } + + public boolean isContrailRequest() { + return contrailRequest; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkResponse.java index 7ce66ba58e..3dee803786 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/UpdateNetworkResponse.java @@ -23,56 +23,54 @@ package org.onap.so.adapters.nwrest; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("updateNetworkResponse") @XmlRootElement(name = "updateNetworkResponse") public class UpdateNetworkResponse extends NetworkResponseCommon { - - /** - * - */ - private static final long serialVersionUID = -7528214382414366136L; - private String networkId; - private String neutronNetworkId; - private Map subnetMap; - public UpdateNetworkResponse() { - /* Empty Constructor */ - } + /** + * + */ + private static final long serialVersionUID = -7528214382414366136L; + private String networkId; + private String neutronNetworkId; + private Map subnetMap; + + public UpdateNetworkResponse() { + /* Empty Constructor */ + } - public UpdateNetworkResponse(String networkId, String neutronNetworkId, - Map subnetMap, String messageId) { - super(messageId); - this.networkId = networkId; - this.neutronNetworkId = neutronNetworkId; - this.subnetMap = subnetMap; - } + public UpdateNetworkResponse(String networkId, String neutronNetworkId, Map subnetMap, + String messageId) { + super(messageId); + this.networkId = networkId; + this.neutronNetworkId = neutronNetworkId; + this.subnetMap = subnetMap; + } - public String getNetworkId() { - return networkId; - } + public String getNetworkId() { + return networkId; + } - public void setNetworkId(String networkId) { - this.networkId = networkId; - } + public void setNetworkId(String networkId) { + this.networkId = networkId; + } - public String getNeutronNetworkId() { - return neutronNetworkId; - } + public String getNeutronNetworkId() { + return neutronNetworkId; + } - public void setNeutronNetworkId(String neutronNetworkId) { - this.neutronNetworkId = neutronNetworkId; - } + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } - public Map getSubnetMap() { - return subnetMap; - } + public Map getSubnetMap() { + return subnetMap; + } - public void setSubnetMap(Map subnetMap) { - this.subnetMap = subnetMap; - } + public void setSubnetMap(Map subnetMap) { + this.subnetMap = subnetMap; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/RequestInformation.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/RequestInformation.java index ae7ff27bed..7c4018b591 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/RequestInformation.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/RequestInformation.java @@ -21,123 +21,120 @@ package org.onap.so.adapters.sdncrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlElement; - import com.fasterxml.jackson.annotation.JsonProperty; /** * Request Information specified by the SDNC "agnostic" API. */ public class RequestInformation implements Serializable { - private static final long serialVersionUID = 1L; - - // Identifies the transaction MSO has with the calling system. - private String requestId; - - // Identifies the calling system, e.g. CCD. - private String source; - - // The calling system's endpoint for receiving notifications from MSO. - private String notificationUrl; - - // NOTE: these are defined in the SDNC AID, but not used by MSO: - // request-action - // request-sub-action - - // Identifies the request action - private String requestAction; - - // Identifies the request sub action - private String requestSubAction; - - @JsonProperty("orderNumber") - @XmlElement(name = "orderNumber") - private String orderNumber; - - @JsonProperty("orderVersion") - @XmlElement(name = "orderVersion") - private String orderVersion; - - public RequestInformation(String requestId, String source, String notificationUrl) { - this.requestId = requestId; - this.source = source; - this.notificationUrl = notificationUrl; - } - - public RequestInformation() { - } - - @JsonProperty("requestId") - @XmlElement(name = "requestId") - public String getRequestId() { - return requestId; - } - - @JsonProperty("requestId") - public void setRequestId(String requestId) { - this.requestId = requestId; - } - - @JsonProperty("source") - @XmlElement(name = "source") - public String getSource() { - return source; - } - - @JsonProperty("source") - public void setSource(String source) { - this.source = source; - } - - @JsonProperty("notificationUrl") - @XmlElement(name = "notificationUrl") - public String getNotificationUrl() { - return notificationUrl; - } - - @JsonProperty("notificationUrl") - public void setNotificationUrl(String notificationUrl) { - this.notificationUrl = notificationUrl; - } - - @JsonProperty("requestAction") - @XmlElement(name = "requestAction") - public String getRequestAction() { - return requestAction; - } - - @JsonProperty("requestAction") - public void setRequestAction(String requestAction) { - this.requestAction = requestAction; - } - - @JsonProperty("requestSubAction") - @XmlElement(name = "requestSubAction") - public String getRequestSubAction() { - return requestSubAction; - } - - @JsonProperty("requestSubAction") - public void setRequestSubAction(String requestSubAction) { - this.requestSubAction = requestSubAction; - } - - public String getOrderNumber() { - return orderNumber; - } - - public void setOrderNumber(String orderNumber) { - this.orderNumber = orderNumber; - } - - public String getOrderVersion() { - return orderVersion; - } - - public void setOrderVersion(String orderVersion) { - this.orderVersion = orderVersion; - } - - -} \ No newline at end of file + private static final long serialVersionUID = 1L; + + // Identifies the transaction MSO has with the calling system. + private String requestId; + + // Identifies the calling system, e.g. CCD. + private String source; + + // The calling system's endpoint for receiving notifications from MSO. + private String notificationUrl; + + // NOTE: these are defined in the SDNC AID, but not used by MSO: + // request-action + // request-sub-action + + // Identifies the request action + private String requestAction; + + // Identifies the request sub action + private String requestSubAction; + + @JsonProperty("orderNumber") + @XmlElement(name = "orderNumber") + private String orderNumber; + + @JsonProperty("orderVersion") + @XmlElement(name = "orderVersion") + private String orderVersion; + + public RequestInformation(String requestId, String source, String notificationUrl) { + this.requestId = requestId; + this.source = source; + this.notificationUrl = notificationUrl; + } + + public RequestInformation() {} + + @JsonProperty("requestId") + @XmlElement(name = "requestId") + public String getRequestId() { + return requestId; + } + + @JsonProperty("requestId") + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + @JsonProperty("source") + @XmlElement(name = "source") + public String getSource() { + return source; + } + + @JsonProperty("source") + public void setSource(String source) { + this.source = source; + } + + @JsonProperty("notificationUrl") + @XmlElement(name = "notificationUrl") + public String getNotificationUrl() { + return notificationUrl; + } + + @JsonProperty("notificationUrl") + public void setNotificationUrl(String notificationUrl) { + this.notificationUrl = notificationUrl; + } + + @JsonProperty("requestAction") + @XmlElement(name = "requestAction") + public String getRequestAction() { + return requestAction; + } + + @JsonProperty("requestAction") + public void setRequestAction(String requestAction) { + this.requestAction = requestAction; + } + + @JsonProperty("requestSubAction") + @XmlElement(name = "requestSubAction") + public String getRequestSubAction() { + return requestSubAction; + } + + @JsonProperty("requestSubAction") + public void setRequestSubAction(String requestSubAction) { + this.requestSubAction = requestSubAction; + } + + public String getOrderNumber() { + return orderNumber; + } + + public void setOrderNumber(String orderNumber) { + this.orderNumber = orderNumber; + } + + public String getOrderVersion() { + return orderVersion; + } + + public void setOrderVersion(String orderVersion) { + this.orderVersion = orderVersion; + } + + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCErrorCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCErrorCommon.java index b6cd6a1eed..e80976c99e 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCErrorCommon.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCErrorCommon.java @@ -26,13 +26,12 @@ import java.io.Serializable; * Base class for all SDNC adapter error responses. */ public abstract class SDNCErrorCommon extends SDNCResponseCommon implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public SDNCErrorCommon(String sdncRequestId, String responseCode, - String responseMessage, String ackFinalIndicator) { - super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); - } + public SDNCErrorCommon(String sdncRequestId, String responseCode, String responseMessage, + String ackFinalIndicator) { + super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); + } - public SDNCErrorCommon() { - } -} \ No newline at end of file + public SDNCErrorCommon() {} +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java index f577fa9b59..b79102857b 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java @@ -26,10 +26,8 @@ import java.io.IOException; import java.io.Serializable; import java.util.LinkedHashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; @@ -40,104 +38,103 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; // NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, -// even though we are using JSON exclusively. The @NoJackson annotation -// is also required in this environment. +// even though we are using JSON exclusively. The @NoJackson annotation +// is also required in this environment. /** - Map elements when marshalled to XML produce a list of ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. + * Map elements when marshalled to XML produce a list of + * ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. When + * marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. * */ @JsonRootName("SDNCEvent") @JsonInclude(Include.NON_NULL) @XmlRootElement(name = "SDNCEvent") public class SDNCEvent implements Serializable { - private static final long serialVersionUID = 1L; - - private static final Logger logger = LoggerFactory.getLogger(SDNCEvent.class); - - // Event type - private String eventType; - - // Event correlator type - private String eventCorrelatorType; - - // Event correlator value. - private String eventCorrelator; - - // Map of response parameters (possibly none). - private Map params = null; - - public SDNCEvent(String eventType, String eventCorrelatorType, String eventCorrelator) { - this.eventType = eventType; - this.eventCorrelatorType = eventCorrelatorType; - this.eventCorrelator = eventCorrelator; - } - - public SDNCEvent() { - } - - @JsonProperty("eventType") - @XmlElement(name = "eventType") - public String getEventType() { - return eventType; - } - - @JsonProperty("eventType") - public void setEventType(String eventType) { - this.eventType = eventType; - } - - @JsonProperty("eventCorrelatorType") - @XmlElement(name = "eventCorrelatorType") - public String getEventCorrelatorType() { - return eventCorrelatorType; - } - - @JsonProperty("eventCorrelatorType") - public void setEventCorrelatorType(String eventCorrelatorType) { - this.eventCorrelatorType = eventCorrelatorType; - } - - @JsonProperty("eventCorrelator") - @XmlElement(name = "eventCorrelator") - public String getEventCorrelator() { - return eventCorrelator; - } - - @JsonProperty("eventCorrelator") - public void setEventCorrelator(String eventCorrelator) { - this.eventCorrelator = eventCorrelator; - } - - @JsonProperty("params") - @XmlElement(name = "params") - public Map getParams() { - return params; - } - - @JsonProperty("params") - public void setParams(Map params) { - this.params = params; - } - - public void addParam(String name, String value) { - if (params == null) { - params = new LinkedHashMap<>(); - } - params.put(name, value); - } - - public String toJson() { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - mapper.setSerializationInclusion(Include.NON_NULL); - return mapper.writeValueAsString(this); - } catch (IOException e) { - logger.debug("Exception:", e); - throw new UnsupportedOperationException("Cannot convert " - + getClass().getSimpleName() + " to JSON", e); - } - } + private static final long serialVersionUID = 1L; + + private static final Logger logger = LoggerFactory.getLogger(SDNCEvent.class); + + // Event type + private String eventType; + + // Event correlator type + private String eventCorrelatorType; + + // Event correlator value. + private String eventCorrelator; + + // Map of response parameters (possibly none). + private Map params = null; + + public SDNCEvent(String eventType, String eventCorrelatorType, String eventCorrelator) { + this.eventType = eventType; + this.eventCorrelatorType = eventCorrelatorType; + this.eventCorrelator = eventCorrelator; + } + + public SDNCEvent() {} + + @JsonProperty("eventType") + @XmlElement(name = "eventType") + public String getEventType() { + return eventType; + } + + @JsonProperty("eventType") + public void setEventType(String eventType) { + this.eventType = eventType; + } + + @JsonProperty("eventCorrelatorType") + @XmlElement(name = "eventCorrelatorType") + public String getEventCorrelatorType() { + return eventCorrelatorType; + } + + @JsonProperty("eventCorrelatorType") + public void setEventCorrelatorType(String eventCorrelatorType) { + this.eventCorrelatorType = eventCorrelatorType; + } + + @JsonProperty("eventCorrelator") + @XmlElement(name = "eventCorrelator") + public String getEventCorrelator() { + return eventCorrelator; + } + + @JsonProperty("eventCorrelator") + public void setEventCorrelator(String eventCorrelator) { + this.eventCorrelator = eventCorrelator; + } + + @JsonProperty("params") + @XmlElement(name = "params") + public Map getParams() { + return params; + } + + @JsonProperty("params") + public void setParams(Map params) { + this.params = params; + } + + public void addParam(String name, String value) { + if (params == null) { + params = new LinkedHashMap<>(); + } + params.put(name, value); + } + + public String toJson() { + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + mapper.setSerializationInclusion(Include.NON_NULL); + return mapper.writeValueAsString(this); + } catch (IOException e) { + logger.debug("Exception:", e); + throw new UnsupportedOperationException("Cannot convert " + getClass().getSimpleName() + " to JSON", e); + } + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java index 4080705551..60e1ce088c 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java @@ -24,15 +24,12 @@ package org.onap.so.adapters.sdncrest; import java.io.IOException; import java.io.Serializable; - import javax.xml.bind.annotation.XmlElement; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,79 +37,76 @@ import org.slf4j.LoggerFactory; * Base class for all SDNC adapter requests. */ public abstract class SDNCRequestCommon implements Serializable { - private static final long serialVersionUID = 1L; - - private static final Logger logger = LoggerFactory.getLogger(SDNCRequestCommon.class); - - // Endpoint on which BPMN can receive notifications from the SDNC adapter. - private String bpNotificationUrl; - - // BPMN flow timeout value in ISO 8601 format, e.g. PT5M. - // Not currently used by the SDNC adapter. - private String bpTimeout; - - // Identifies the MSO transaction with SDNC. - // Maps to sdnc-request-header/requestId in the SDNC request. - private String sdncRequestId; - - public SDNCRequestCommon(String sdncRequestId, String bpNotificationUrl, - String bpTimeout) { - this.sdncRequestId = sdncRequestId; - this.bpNotificationUrl = bpNotificationUrl; - this.bpTimeout = bpTimeout; - } - - public SDNCRequestCommon() { - } - - @JsonProperty("bpNotificationUrl") - @XmlElement(name = "bpNotificationUrl") - public String getBPNotificationUrl() { - return bpNotificationUrl; - } - - @JsonProperty("bpNotificationUrl") - public void setBPNotificationUrl(String bpNotificationUrl) { - this.bpNotificationUrl = bpNotificationUrl; - } - - @JsonProperty("bpTimeout") - @XmlElement(name = "bpTimeout") - public String getBPTimeout() { - return bpTimeout; - } - - @JsonProperty("bpTimeout") - public void setBPTimeout(String bpTimeout) { - this.bpTimeout = bpTimeout; - } - - @JsonProperty("sdncRequestId") - @XmlElement(name = "sdncRequestId") - public String getSdncRequestId() { - return sdncRequestId; - } - - @JsonProperty("sdncRequestId") - public void setSdncRequestId(String sdncRequestId) { - this.sdncRequestId = sdncRequestId; - } - - @JsonIgnore - public boolean isSynchronous() { - return bpNotificationUrl == null || bpNotificationUrl.isEmpty(); - } - - public String toJson() { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - mapper.setSerializationInclusion(Include.NON_NULL); - return mapper.writeValueAsString(this); - } catch (IOException e) { - logger.debug("Exception:", e); - throw new UnsupportedOperationException("Cannot convert " - + getClass().getSimpleName() + " to JSON", e); - } - } + private static final long serialVersionUID = 1L; + + private static final Logger logger = LoggerFactory.getLogger(SDNCRequestCommon.class); + + // Endpoint on which BPMN can receive notifications from the SDNC adapter. + private String bpNotificationUrl; + + // BPMN flow timeout value in ISO 8601 format, e.g. PT5M. + // Not currently used by the SDNC adapter. + private String bpTimeout; + + // Identifies the MSO transaction with SDNC. + // Maps to sdnc-request-header/requestId in the SDNC request. + private String sdncRequestId; + + public SDNCRequestCommon(String sdncRequestId, String bpNotificationUrl, String bpTimeout) { + this.sdncRequestId = sdncRequestId; + this.bpNotificationUrl = bpNotificationUrl; + this.bpTimeout = bpTimeout; + } + + public SDNCRequestCommon() {} + + @JsonProperty("bpNotificationUrl") + @XmlElement(name = "bpNotificationUrl") + public String getBPNotificationUrl() { + return bpNotificationUrl; + } + + @JsonProperty("bpNotificationUrl") + public void setBPNotificationUrl(String bpNotificationUrl) { + this.bpNotificationUrl = bpNotificationUrl; + } + + @JsonProperty("bpTimeout") + @XmlElement(name = "bpTimeout") + public String getBPTimeout() { + return bpTimeout; + } + + @JsonProperty("bpTimeout") + public void setBPTimeout(String bpTimeout) { + this.bpTimeout = bpTimeout; + } + + @JsonProperty("sdncRequestId") + @XmlElement(name = "sdncRequestId") + public String getSdncRequestId() { + return sdncRequestId; + } + + @JsonProperty("sdncRequestId") + public void setSdncRequestId(String sdncRequestId) { + this.sdncRequestId = sdncRequestId; + } + + @JsonIgnore + public boolean isSynchronous() { + return bpNotificationUrl == null || bpNotificationUrl.isEmpty(); + } + + public String toJson() { + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + mapper.setSerializationInclusion(Include.NON_NULL); + return mapper.writeValueAsString(this); + } catch (IOException e) { + logger.debug("Exception:", e); + throw new UnsupportedOperationException("Cannot convert " + getClass().getSimpleName() + " to JSON", e); + } + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java index a7d14cce69..5851493fea 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java @@ -24,14 +24,11 @@ package org.onap.so.adapters.sdncrest; import java.io.IOException; import java.io.Serializable; - import javax.xml.bind.annotation.XmlElement; - import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,88 +36,86 @@ import org.slf4j.LoggerFactory; * Base class for all SDNC adapter responses, including errors. */ public abstract class SDNCResponseCommon implements Serializable { - private static final long serialVersionUID = 1L; - - private static final Logger logger = LoggerFactory.getLogger(SDNCResponseCommon.class); - - // Identifies the MSO transaction with SDNC. - private String sdncRequestId; - - // Response code, either from SDNC, or generated by the SDNC adapter. - // 2XX responses are considered success responses. - private String responseCode; - - // Response message, either from SDNC, or generated by the SDNC adapter. - private String responseMessage; - - // Indicates if the response is final (Y or N). - private String ackFinalIndicator; - - public SDNCResponseCommon(String sdncRequestId, String responseCode, - String responseMessage, String ackFinalIndicator) { - this.sdncRequestId = sdncRequestId; - this.responseCode = responseCode; - this.responseMessage = responseMessage; - this.ackFinalIndicator = ackFinalIndicator; - } - - public SDNCResponseCommon() { - } - - @JsonProperty("sdncRequestId") - @XmlElement(name = "sdncRequestId") - public String getSdncRequestId() { - return sdncRequestId; - } - - @JsonProperty("sdncRequestId") - public void setSdncRequestId(String sdncRequestId) { - this.sdncRequestId = sdncRequestId; - } - - @JsonProperty("responseCode") - @XmlElement(name = "responseCode") - public String getResponseCode() { - return responseCode; - } - - @JsonProperty("responseCode") - public void setResponseCode(String responseCode) { - this.responseCode = responseCode; - } - - @JsonProperty("responseMessage") - @XmlElement(name = "responseMessage") - public String getResponseMessage() { - return responseMessage; - } - - @JsonProperty("responseMessage") - public void setResponseMessage(String responseMessage) { - this.responseMessage = responseMessage; - } - - @JsonProperty("ackFinalIndicator") - @XmlElement(name = "ackFinalIndicator") - public String getAckFinalIndicator() { - return ackFinalIndicator; - } - - @JsonProperty("ackFinalIndicator") - public void setAckFinalIndicator(String ackFinalIndicator) { - this.ackFinalIndicator = ackFinalIndicator; - } - - public String toJson() { - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - mapper.setSerializationInclusion(Include.NON_NULL); - return mapper.writeValueAsString(this); - } catch (IOException e) { - logger.debug("Exception:", e); - throw new UnsupportedOperationException("Cannot convert " - + getClass().getSimpleName() + " to JSON", e); - } - } + private static final long serialVersionUID = 1L; + + private static final Logger logger = LoggerFactory.getLogger(SDNCResponseCommon.class); + + // Identifies the MSO transaction with SDNC. + private String sdncRequestId; + + // Response code, either from SDNC, or generated by the SDNC adapter. + // 2XX responses are considered success responses. + private String responseCode; + + // Response message, either from SDNC, or generated by the SDNC adapter. + private String responseMessage; + + // Indicates if the response is final (Y or N). + private String ackFinalIndicator; + + public SDNCResponseCommon(String sdncRequestId, String responseCode, String responseMessage, + String ackFinalIndicator) { + this.sdncRequestId = sdncRequestId; + this.responseCode = responseCode; + this.responseMessage = responseMessage; + this.ackFinalIndicator = ackFinalIndicator; + } + + public SDNCResponseCommon() {} + + @JsonProperty("sdncRequestId") + @XmlElement(name = "sdncRequestId") + public String getSdncRequestId() { + return sdncRequestId; + } + + @JsonProperty("sdncRequestId") + public void setSdncRequestId(String sdncRequestId) { + this.sdncRequestId = sdncRequestId; + } + + @JsonProperty("responseCode") + @XmlElement(name = "responseCode") + public String getResponseCode() { + return responseCode; + } + + @JsonProperty("responseCode") + public void setResponseCode(String responseCode) { + this.responseCode = responseCode; + } + + @JsonProperty("responseMessage") + @XmlElement(name = "responseMessage") + public String getResponseMessage() { + return responseMessage; + } + + @JsonProperty("responseMessage") + public void setResponseMessage(String responseMessage) { + this.responseMessage = responseMessage; + } + + @JsonProperty("ackFinalIndicator") + @XmlElement(name = "ackFinalIndicator") + public String getAckFinalIndicator() { + return ackFinalIndicator; + } + + @JsonProperty("ackFinalIndicator") + public void setAckFinalIndicator(String ackFinalIndicator) { + this.ackFinalIndicator = ackFinalIndicator; + } + + public String toJson() { + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + mapper.setSerializationInclusion(Include.NON_NULL); + return mapper.writeValueAsString(this); + } catch (IOException e) { + logger.debug("Exception:", e); + throw new UnsupportedOperationException("Cannot convert " + getClass().getSimpleName() + " to JSON", e); + } + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceError.java index fdb735891c..9d61db046f 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceError.java @@ -21,16 +21,14 @@ package org.onap.so.adapters.sdncrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonRootName; // NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, -// even though we are using JSON exclusively. The @NoJackson annotation -// is also required in this environment. +// even though we are using JSON exclusively. The @NoJackson annotation +// is also required in this environment. /** * SDNC adapter error response for "agnostic" API services. @@ -39,13 +37,12 @@ import com.fasterxml.jackson.annotation.JsonRootName; @JsonInclude(Include.NON_NULL) @XmlRootElement(name = "SDNCServiceError") public class SDNCServiceError extends SDNCErrorCommon implements Serializable { - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1; - public SDNCServiceError(String sdncRequestId, String responseCode, - String responseMessage, String ackFinalIndicator) { - super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); - } + public SDNCServiceError(String sdncRequestId, String responseCode, String responseMessage, + String ackFinalIndicator) { + super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); + } - public SDNCServiceError() { - } -} \ No newline at end of file + public SDNCServiceError() {} +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java index 950362e986..c9f42d1550 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceRequest.java @@ -21,127 +21,121 @@ package org.onap.so.adapters.sdncrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; // NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, -// even though we are using JSON exclusively. The @NoJackson annotation -// is also required in this environment. +// even though we are using JSON exclusively. The @NoJackson annotation +// is also required in this environment. /** - * SDNC adapter request for "agnostic" API services. - * The target action is determined by a service type and an operation. + * SDNC adapter request for "agnostic" API services. The target action is determined by a service type and an operation. */ @JsonRootName("SDNCServiceRequest") @JsonInclude(Include.NON_NULL) @XmlRootElement(name = "SDNCServiceRequest") public class SDNCServiceRequest extends SDNCRequestCommon implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // Request Information specified by SDNC "agnostic" API - private RequestInformation requestInformation; + // Request Information specified by SDNC "agnostic" API + private RequestInformation requestInformation; - // Service Information specified by: SDNC "agnostic" API - private ServiceInformation serviceInformation; + // Service Information specified by: SDNC "agnostic" API + private ServiceInformation serviceInformation; - // The SDNC service type specified by SDNC "agnostic" API - private String sdncService; + // The SDNC service type specified by SDNC "agnostic" API + private String sdncService; - // The SDNC operation specified by SDNC "agnostic" API - private String sdncOperation; + // The SDNC operation specified by SDNC "agnostic" API + private String sdncOperation; - // The SDNC service data type specified by SDNC "agnostic" API - private String sdncServiceDataType; + // The SDNC service data type specified by SDNC "agnostic" API + private String sdncServiceDataType; - // The SDNC service data specified by SDNC "agnostic" API + // The SDNC service data specified by SDNC "agnostic" API private String sdncServiceData; - public SDNCServiceRequest() { - } - - public SDNCServiceRequest(String bpNotificationUrl, String bpTimeout, - String sdncRequestId, String sdncService, String sdncOperation, - RequestInformation requestInformation, - ServiceInformation serviceInformation, String sdncServiceDataType, - String sndcServiceData) { - super(bpNotificationUrl, bpTimeout, sdncRequestId); - this.requestInformation = requestInformation; - this.serviceInformation = serviceInformation; - this.sdncService = sdncService; - this.sdncOperation = sdncOperation; - this.sdncServiceDataType = sdncServiceDataType; - this.sdncServiceData = sndcServiceData; - } - - @JsonProperty("requestInformation") - @XmlElement(name = "requestInformation") - public RequestInformation getRequestInformation() { - return requestInformation; - } - - @JsonProperty("requestInformation") - public void setRequestInformation(RequestInformation requestInformation) { - this.requestInformation = requestInformation; - } - - @JsonProperty("serviceInformation") - @XmlElement(name = "serviceInformation") - public ServiceInformation getServiceInformation() { - return serviceInformation; - } - - @JsonProperty("serviceInformation") - public void setServiceInformation(ServiceInformation serviceInformation) { - this.serviceInformation = serviceInformation; - } - - @JsonProperty("sdncService") - @XmlElement(name = "sdncService") - public String getSdncService() { - return sdncService; - } - - @JsonProperty("sdncService") - public void setSdncService(String sdncService) { - this.sdncService = sdncService; - } - - @JsonProperty("sdncOperation") - @XmlElement(name = "sdncOperation") - public String getSdncOperation() { - return sdncOperation; - } - - @JsonProperty("sdncOperation") - public void setSdncOperation(String sdncOperation) { - this.sdncOperation = sdncOperation; - } - - @JsonProperty("sdncServiceDataType") - @XmlElement(name = "sdncServiceDataType") - public String getSdncServiceDataType() { - return sdncServiceDataType; - } - - @JsonProperty("sdncServiceDataType") - public void setSdncServiceDataType(String sdncServiceDataType) { - this.sdncServiceDataType = sdncServiceDataType; - } - - @JsonProperty("sdncServiceData") - @XmlElement(name = "sdncServiceData") - public String getSdncServiceData() { - return sdncServiceData; - } - - @JsonProperty("sdncServiceData") - public void setSdncServiceData(String sndcServiceData) { - this.sdncServiceData = sndcServiceData; - } -} \ No newline at end of file + public SDNCServiceRequest() {} + + public SDNCServiceRequest(String bpNotificationUrl, String bpTimeout, String sdncRequestId, String sdncService, + String sdncOperation, RequestInformation requestInformation, ServiceInformation serviceInformation, + String sdncServiceDataType, String sndcServiceData) { + super(bpNotificationUrl, bpTimeout, sdncRequestId); + this.requestInformation = requestInformation; + this.serviceInformation = serviceInformation; + this.sdncService = sdncService; + this.sdncOperation = sdncOperation; + this.sdncServiceDataType = sdncServiceDataType; + this.sdncServiceData = sndcServiceData; + } + + @JsonProperty("requestInformation") + @XmlElement(name = "requestInformation") + public RequestInformation getRequestInformation() { + return requestInformation; + } + + @JsonProperty("requestInformation") + public void setRequestInformation(RequestInformation requestInformation) { + this.requestInformation = requestInformation; + } + + @JsonProperty("serviceInformation") + @XmlElement(name = "serviceInformation") + public ServiceInformation getServiceInformation() { + return serviceInformation; + } + + @JsonProperty("serviceInformation") + public void setServiceInformation(ServiceInformation serviceInformation) { + this.serviceInformation = serviceInformation; + } + + @JsonProperty("sdncService") + @XmlElement(name = "sdncService") + public String getSdncService() { + return sdncService; + } + + @JsonProperty("sdncService") + public void setSdncService(String sdncService) { + this.sdncService = sdncService; + } + + @JsonProperty("sdncOperation") + @XmlElement(name = "sdncOperation") + public String getSdncOperation() { + return sdncOperation; + } + + @JsonProperty("sdncOperation") + public void setSdncOperation(String sdncOperation) { + this.sdncOperation = sdncOperation; + } + + @JsonProperty("sdncServiceDataType") + @XmlElement(name = "sdncServiceDataType") + public String getSdncServiceDataType() { + return sdncServiceDataType; + } + + @JsonProperty("sdncServiceDataType") + public void setSdncServiceDataType(String sdncServiceDataType) { + this.sdncServiceDataType = sdncServiceDataType; + } + + @JsonProperty("sdncServiceData") + @XmlElement(name = "sdncServiceData") + public String getSdncServiceData() { + return sdncServiceData; + } + + @JsonProperty("sdncServiceData") + public void setSdncServiceData(String sndcServiceData) { + this.sdncServiceData = sndcServiceData; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceResponse.java index 18c9d49939..842bcfcc02 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCServiceResponse.java @@ -23,56 +23,54 @@ package org.onap.so.adapters.sdncrest; import java.io.Serializable; import java.util.LinkedHashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; // NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy, -// even though we are using JSON exclusively. The @NoJackson annotation -// is also required in this environment. +// even though we are using JSON exclusively. The @NoJackson annotation +// is also required in this environment. /** - Map elements when marshalled to XML produce a list of ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. + * Map elements when marshalled to XML produce a list of + * ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. When + * marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. * */ @JsonRootName("SDNCServiceResponse") @JsonInclude(Include.NON_NULL) @XmlRootElement(name = "SDNCServiceResponse") public class SDNCServiceResponse extends SDNCResponseCommon implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // Map of response parameters (possibly none). - private Map params = null; + // Map of response parameters (possibly none). + private Map params = null; - public SDNCServiceResponse(String sdncRequestId, String responseCode, - String responseMessage, String ackFinalIndicator) { - super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); - } + public SDNCServiceResponse(String sdncRequestId, String responseCode, String responseMessage, + String ackFinalIndicator) { + super(sdncRequestId, responseCode, responseMessage, ackFinalIndicator); + } - public SDNCServiceResponse() { - } + public SDNCServiceResponse() {} - @JsonProperty("params") - @XmlElement(name = "params") - public Map getParams() { - return params; - } + @JsonProperty("params") + @XmlElement(name = "params") + public Map getParams() { + return params; + } - @JsonProperty("params") - public void setParams(Map params) { - this.params = params; - } + @JsonProperty("params") + public void setParams(Map params) { + this.params = params; + } - public void addParam(String name, String value) { - if (params == null) { - params = new LinkedHashMap<>(); - } - params.put(name, value); - } + public void addParam(String name, String value) { + if (params == null) { + params = new LinkedHashMap<>(); + } + params.put(name, value); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/ServiceInformation.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/ServiceInformation.java index b4fe26ac00..da055cbcb3 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/ServiceInformation.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/ServiceInformation.java @@ -21,84 +21,81 @@ package org.onap.so.adapters.sdncrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlElement; - import com.fasterxml.jackson.annotation.JsonProperty; /** * Service Information specified by the SDNC "agnostic" API. */ public class ServiceInformation implements Serializable { - private static final long serialVersionUID = 1L; - - // The subscription's service type for the target service instance. - private String serviceType; - - // Identifies the target service instance for this particular SDNC request. - // NOTE: this could be a child of the parent model instance, i.e. this - // service instance ID may be different from the service instance ID - // associated with the transaction MSO has with the system that invoked it. - private String serviceInstanceId; - - // The subscriber name. - private String subscriberName; - - // The subscriber global ID (customer ID). - private String subscriberGlobalId; - - public ServiceInformation(String serviceType, String serviceInstanceId, - String subscriberName, String subscriberGlobalId) { - this.serviceType = serviceType; - this.serviceInstanceId = serviceInstanceId; - this.subscriberName = subscriberName; - this.subscriberGlobalId = subscriberGlobalId; - } - - public ServiceInformation() { - } - - @JsonProperty("serviceType") - @XmlElement(name = "serviceType") - public String getServiceType() { - return serviceType; - } - - @JsonProperty("serviceType") - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - @JsonProperty("serviceInstanceId") - @XmlElement(name = "serviceInstanceId") - public String getServiceInstanceId() { - return serviceInstanceId; - } - - @JsonProperty("serviceInstanceId") - public void setServiceInstanceId(String serviceInstanceId) { - this.serviceInstanceId = serviceInstanceId; - } - - @JsonProperty("subscriberName") - @XmlElement(name = "subscriberName") - public String getSubscriberName() { - return subscriberName; - } - - @JsonProperty("subscriberName") - public void setSubscriberName(String subscriberName) { - this.subscriberName = subscriberName; - } - - @JsonProperty("subscriberGlobalId") - @XmlElement(name = "subscriberGlobalId") - public String getSubscriberGlobalId() { - return subscriberGlobalId; - } - - @JsonProperty("subscriberGlobalId") - public void setSubscriberGlobalId(String subscriberGlobalId) { - this.subscriberGlobalId = subscriberGlobalId; - } -} \ No newline at end of file + private static final long serialVersionUID = 1L; + + // The subscription's service type for the target service instance. + private String serviceType; + + // Identifies the target service instance for this particular SDNC request. + // NOTE: this could be a child of the parent model instance, i.e. this + // service instance ID may be different from the service instance ID + // associated with the transaction MSO has with the system that invoked it. + private String serviceInstanceId; + + // The subscriber name. + private String subscriberName; + + // The subscriber global ID (customer ID). + private String subscriberGlobalId; + + public ServiceInformation(String serviceType, String serviceInstanceId, String subscriberName, + String subscriberGlobalId) { + this.serviceType = serviceType; + this.serviceInstanceId = serviceInstanceId; + this.subscriberName = subscriberName; + this.subscriberGlobalId = subscriberGlobalId; + } + + public ServiceInformation() {} + + @JsonProperty("serviceType") + @XmlElement(name = "serviceType") + public String getServiceType() { + return serviceType; + } + + @JsonProperty("serviceType") + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + @JsonProperty("serviceInstanceId") + @XmlElement(name = "serviceInstanceId") + public String getServiceInstanceId() { + return serviceInstanceId; + } + + @JsonProperty("serviceInstanceId") + public void setServiceInstanceId(String serviceInstanceId) { + this.serviceInstanceId = serviceInstanceId; + } + + @JsonProperty("subscriberName") + @XmlElement(name = "subscriberName") + public String getSubscriberName() { + return subscriberName; + } + + @JsonProperty("subscriberName") + public void setSubscriberName(String subscriberName) { + this.subscriberName = subscriberName; + } + + @JsonProperty("subscriberGlobalId") + @XmlElement(name = "subscriberGlobalId") + public String getSubscriberGlobalId() { + return subscriberGlobalId; + } + + @JsonProperty("subscriberGlobalId") + public void setSubscriberGlobalId(String subscriberGlobalId) { + this.subscriberGlobalId = subscriberGlobalId; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantError.java index 34da8c6292..06f0f87622 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantError.java @@ -23,51 +23,49 @@ package org.onap.so.adapters.tenantrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "createTenantError") public class CreateTenantError implements Serializable { - private static final long serialVersionUID = 7305288262646805568L; - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; - - public CreateTenantError () {} - - public CreateTenantError (String message) { - this.message = message; - } - - public CreateTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public Boolean getRolledBack() { - return rolledBack; - } - - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } + private static final long serialVersionUID = 7305288262646805568L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public CreateTenantError() {} + + public CreateTenantError(String message) { + this.message = message; + } + + public CreateTenantError(String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory() { + return category; + } + + public void setCategory(MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantRequest.java index 1f4b872ab9..8aba765908 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantRequest.java @@ -26,77 +26,73 @@ package org.onap.so.adapters.tenantrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; @XmlRootElement(name = "createTenantRequest") public class CreateTenantRequest extends TenantRequestCommon { - private String cloudSiteId; - private String tenantName; - private Boolean failIfExists; - private Boolean backout; - private Map metadata = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - - public CreateTenantRequest() { - //empty constructor - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantName() { - return tenantName; - } - - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - public Boolean getFailIfExists() { - return failIfExists; - } - - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } - - public Boolean getBackout() { - return backout; - } - - public void setBackout(Boolean backout) { - this.backout = backout; - } - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - - @Override - public String toString() { - return "CreateTenantRequest [cloudSiteId=" + cloudSiteId - + ", tenantName=" + tenantName + ", failIfExists=" - + failIfExists + ", backout=" + backout + ", metadata=" - + metadata + "]"; - } + private String cloudSiteId; + private String tenantName; + private Boolean failIfExists; + private Boolean backout; + private Map metadata = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + + public CreateTenantRequest() { + // empty constructor + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @Override + public String toString() { + return "CreateTenantRequest [cloudSiteId=" + cloudSiteId + ", tenantName=" + tenantName + ", failIfExists=" + + failIfExists + ", backout=" + backout + ", metadata=" + metadata + "]"; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantResponse.java index ec304cec41..853f0acb67 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/CreateTenantResponse.java @@ -23,63 +23,61 @@ package org.onap.so.adapters.tenantrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "createTenantResponse") public class CreateTenantResponse implements Serializable { - private static final long serialVersionUID = -456155026754759682L; - private String cloudSiteId; - private String tenantId; - private Boolean tenantCreated; - private TenantRollback tenantRollback = new TenantRollback(); - - public CreateTenantResponse() {} - - public CreateTenantResponse(String cloudSiteId, String tenantId, - Boolean tenantCreated, TenantRollback tenantRollback) { - this.cloudSiteId = cloudSiteId; - this.tenantId = tenantId; - this.tenantCreated = tenantCreated; - this.tenantRollback = tenantRollback; - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public Boolean getTenantCreated() { - return tenantCreated; - } - - public void setTenantCreated(Boolean tenantCreated) { - this.tenantCreated = tenantCreated; - } - - public TenantRollback getTenantRollback() { - return tenantRollback; - } - - public void setTenantRollback(TenantRollback tenantRollback) { - this.tenantRollback = tenantRollback; - } - - @Override - public String toString() { - return "CreateTenantResponse [cloudSiteId=" + cloudSiteId - + ", tenantId=" + tenantId + ", tenantCreated=" + tenantCreated - + ", tenantRollback=" + tenantRollback.toString() + "]"; - } + private static final long serialVersionUID = -456155026754759682L; + private String cloudSiteId; + private String tenantId; + private Boolean tenantCreated; + private TenantRollback tenantRollback = new TenantRollback(); + + public CreateTenantResponse() {} + + public CreateTenantResponse(String cloudSiteId, String tenantId, Boolean tenantCreated, + TenantRollback tenantRollback) { + this.cloudSiteId = cloudSiteId; + this.tenantId = tenantId; + this.tenantCreated = tenantCreated; + this.tenantRollback = tenantRollback; + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public Boolean getTenantCreated() { + return tenantCreated; + } + + public void setTenantCreated(Boolean tenantCreated) { + this.tenantCreated = tenantCreated; + } + + public TenantRollback getTenantRollback() { + return tenantRollback; + } + + public void setTenantRollback(TenantRollback tenantRollback) { + this.tenantRollback = tenantRollback; + } + + @Override + public String toString() { + return "CreateTenantResponse [cloudSiteId=" + cloudSiteId + ", tenantId=" + tenantId + ", tenantCreated=" + + tenantCreated + ", tenantRollback=" + tenantRollback.toString() + "]"; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantError.java index d2c22e8506..b16fdd3c81 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantError.java @@ -23,51 +23,49 @@ package org.onap.so.adapters.tenantrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "deleteTenantError") public class DeleteTenantError implements Serializable { - private static final long serialVersionUID = -5778340182805870809L; - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; - - public DeleteTenantError () {} - - public DeleteTenantError (String message) { - this.message = message; - } - - public DeleteTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public Boolean getRolledBack() { - return rolledBack; - } - - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } + private static final long serialVersionUID = -5778340182805870809L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public DeleteTenantError() {} + + public DeleteTenantError(String message) { + this.message = message; + } + + public DeleteTenantError(String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory() { + return category; + } + + public void setCategory(MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantRequest.java index b2d521b050..281e172378 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantRequest.java @@ -25,42 +25,41 @@ package org.onap.so.adapters.tenantrest; import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; @XmlRootElement(name = "deleteTenantRequest") public class DeleteTenantRequest extends TenantRequestCommon { - private String cloudSiteId; - private String tenantId; + private String cloudSiteId; + private String tenantId; + + private MsoRequest msoRequest = new MsoRequest(); - private MsoRequest msoRequest = new MsoRequest(); + public DeleteTenantRequest() { + // empty constructor + } - public DeleteTenantRequest() { - //empty constructor - } - - public String getCloudSiteId() { - return cloudSiteId; - } + public String getCloudSiteId() { + return cloudSiteId; + } - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } - public String getTenantId() { - return tenantId; - } + public String getTenantId() { + return tenantId; + } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } - public MsoRequest getMsoRequest() { - return msoRequest; - } + public MsoRequest getMsoRequest() { + return msoRequest; + } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantResponse.java index e7961d4607..23174145fa 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/DeleteTenantResponse.java @@ -27,15 +27,15 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "deleteTenantResponse") public class DeleteTenantResponse { - private Boolean tenantDeleted; + private Boolean tenantDeleted; - public DeleteTenantResponse() {} - - public Boolean getTenantDeleted() { - return tenantDeleted; - } + public DeleteTenantResponse() {} - public void setTenantDeleted(Boolean tenantDeleted) { - this.tenantDeleted = tenantDeleted; - } + public Boolean getTenantDeleted() { + return tenantDeleted; + } + + public void setTenantDeleted(Boolean tenantDeleted) { + this.tenantDeleted = tenantDeleted; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantError.java index 10f4b70a07..ef0bfb99a5 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantError.java @@ -23,41 +23,39 @@ package org.onap.so.adapters.tenantrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "queryTenantError") public class QueryTenantError implements Serializable { - private static final long serialVersionUID = 7358240830662453507L; - private String message; - private MsoExceptionCategory category; + private static final long serialVersionUID = 7358240830662453507L; + private String message; + private MsoExceptionCategory category; - public QueryTenantError () {} + public QueryTenantError() {} - public QueryTenantError (String message) { - this.message = message; - } + public QueryTenantError(String message) { + this.message = message; + } - public QueryTenantError (String message, MsoExceptionCategory category) { - this.message = message; - this.category = category; - } + public QueryTenantError(String message, MsoExceptionCategory category) { + this.message = message; + this.category = category; + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } - public void setMessage(String message) { - this.message = message; - } + public void setMessage(String message) { + this.message = message; + } - public MsoExceptionCategory getCategory () { - return category; - } + public MsoExceptionCategory getCategory() { + return category; + } - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } + public void setCategory(MsoExceptionCategory category) { + this.category = category; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantResponse.java index 8d478cd393..f0e1d88bd3 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/QueryTenantResponse.java @@ -23,41 +23,43 @@ package org.onap.so.adapters.tenantrest; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "queryTenantResponse") public class QueryTenantResponse extends TenantRequestCommon { - private String tenantId; - private String tenantName; - private Map metadata; - - public QueryTenantResponse() {} - - public QueryTenantResponse (String id, String name, Map metadata) { - this.tenantId = id; - this.tenantName = name; - this.metadata = metadata; - } - - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getTenantName() { - return tenantName; - } - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - public Map getMetadata() { - return metadata; - } - public void setMetadata(Map metadata) { - this.metadata = metadata; - } + private String tenantId; + private String tenantName; + private Map metadata; + + public QueryTenantResponse() {} + + public QueryTenantResponse(String id, String name, Map metadata) { + this.tenantId = id; + this.tenantName = name; + this.metadata = metadata; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantError.java index 725b40549d..58d322f5d4 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantError.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantError.java @@ -23,47 +23,45 @@ package org.onap.so.adapters.tenantrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "rollbackTenantError") public class RollbackTenantError implements Serializable { - private static final long serialVersionUID = -5313713674529615223L; - private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; + private static final long serialVersionUID = -5313713674529615223L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; - public RollbackTenantError () {} + public RollbackTenantError() {} - public RollbackTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } + public RollbackTenantError(String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } - public void setMessage(String message) { - this.message = message; - } + public void setMessage(String message) { + this.message = message; + } - public MsoExceptionCategory getCategory () { - return category; - } + public MsoExceptionCategory getCategory() { + return category; + } - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } + public void setCategory(MsoExceptionCategory category) { + this.category = category; + } - public Boolean getRolledBack() { - return rolledBack; - } + public Boolean getRolledBack() { + return rolledBack; + } - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantRequest.java index d99150fc47..20f079184c 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantRequest.java @@ -27,15 +27,15 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "rollbackTenantRequest") public class RollbackTenantRequest extends TenantRequestCommon { - private TenantRollback tenantRollback; + private TenantRollback tenantRollback; - public RollbackTenantRequest() {} + public RollbackTenantRequest() {} - public TenantRollback getTenantRollback() { - return tenantRollback; - } + public TenantRollback getTenantRollback() { + return tenantRollback; + } - public void setTenantRollback(TenantRollback tenantRollback) { - this.tenantRollback = tenantRollback; - } + public void setTenantRollback(TenantRollback tenantRollback) { + this.tenantRollback = tenantRollback; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantResponse.java index 25b77b3490..a64f8893c7 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/RollbackTenantResponse.java @@ -27,15 +27,15 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "rollbackTenantResponse") public class RollbackTenantResponse { - private Boolean tenantRolledback; + private Boolean tenantRolledback; - public RollbackTenantResponse() {} - - public Boolean getTenantRolledback() { - return tenantRolledback; - } + public RollbackTenantResponse() {} - public void setTenantRolledback(Boolean tenantRolledback) { - this.tenantRolledback = tenantRolledback; - } + public Boolean getTenantRolledback() { + return tenantRolledback; + } + + public void setTenantRolledback(Boolean tenantRolledback) { + this.tenantRolledback = tenantRolledback; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantExceptionResponse.java index f4dd7f9499..18b8c817d4 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantExceptionResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantExceptionResponse.java @@ -23,9 +23,7 @@ package org.onap.so.adapters.tenantrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "createTenantResponse") @@ -34,39 +32,39 @@ public class TenantExceptionResponse implements Serializable { private static final long serialVersionUID = -9062290006520066109L; private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public TenantExceptionResponse() {} - public TenantExceptionResponse () {} + public TenantExceptionResponse(String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } - public TenantExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack) { - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } + public String getMessage() { + return message; + } - public String getMessage() { - return message; - } + public void setMessage(String message) { + this.message = message; + } - public void setMessage(String message) { - this.message = message; - } + public MsoExceptionCategory getCategory() { + return category; + } - public MsoExceptionCategory getCategory () { - return category; - } + public void setCategory(MsoExceptionCategory category) { + this.category = category; + } - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } + public Boolean getRolledBack() { + return rolledBack; + } - public Boolean getRolledBack() { - return rolledBack; - } + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } - } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java index 7d629cb554..f35149d1db 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java @@ -25,44 +25,42 @@ package org.onap.so.adapters.tenantrest; import java.io.ByteArrayOutputStream; import java.io.Serializable; - import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; - import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; public abstract class TenantRequestCommon implements Serializable { - private static final long serialVersionUID = 1486834308868170854L; - private static Logger logger = LoggerFactory.getLogger(TenantRequestCommon.class); - public String toJsonString() { - try { - String jsonString; - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - return jsonString; - } catch (Exception e) { - logger.debug("Exception :", e); - return ""; - } - } + private static final long serialVersionUID = 1486834308868170854L; + private static Logger logger = LoggerFactory.getLogger(TenantRequestCommon.class); + + public String toJsonString() { + try { + String jsonString; + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + return jsonString; + } catch (Exception e) { + logger.debug("Exception :", e); + return ""; + } + } - public String toXmlString() { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - JAXBContext context = JAXBContext.newInstance(this.getClass()); - Marshaller marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML - marshaller.marshal(this, bs); - return bs.toString(); - } catch (Exception e) { - logger.debug("Exception :", e); - return ""; - } - } + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); // pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + logger.debug("Exception :", e); + return ""; + } + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRollback.java index 195628167e..009ee60991 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRollback.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRollback.java @@ -23,58 +23,59 @@ package org.onap.so.adapters.tenantrest; import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; /** - * Javabean representing the rollback criteria following a "Create Tenant" - * operation. This structure can be passed back to the "Rollback Tenant" - * operation to undo the effects of the create. + * Javabean representing the rollback criteria following a "Create Tenant" operation. This structure can be passed back + * to the "Rollback Tenant" operation to undo the effects of the create. * * */ @XmlRootElement(name = "rollbackTenantRequest") public class TenantRollback extends TenantRequestCommon { - private static final long serialVersionUID = -4540810517355635993L; - private String tenantId; - private String cloudId; - private boolean tenantCreated = false; - private MsoRequest msoRequest; - - public TenantRollback() {} - - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getCloudId() { - return cloudId; - } - public void setCloudId(String cloudId) { - this.cloudId = cloudId; - } - - public boolean getTenantCreated() { - return tenantCreated; - } - public void setTenantCreated(boolean tenantCreated) { - this.tenantCreated = tenantCreated; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest (MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - - @Override + private static final long serialVersionUID = -4540810517355635993L; + private String tenantId; + private String cloudId; + private boolean tenantCreated = false; + private MsoRequest msoRequest; + + public TenantRollback() {} + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getCloudId() { + return cloudId; + } + + public void setCloudId(String cloudId) { + this.cloudId = cloudId; + } + + public boolean getTenantCreated() { + return tenantCreated; + } + + public void setTenantCreated(boolean tenantCreated) { + this.tenantCreated = tenantCreated; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @Override public String toString() { - return "VnfRollback: cloud=" + cloudId + ", tenant=" + tenantId + - ", tenantCreated=" + tenantCreated; - } + return "VnfRollback: cloud=" + cloudId + ", tenant=" + tenantId + ", tenantCreated=" + tenantCreated; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/CloudInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/CloudInfo.java index f7db785deb..f03c9d381b 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/CloudInfo.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/CloudInfo.java @@ -21,57 +21,60 @@ package org.onap.so.adapters.vdu; /** - * Cloud information structure for deploying/managing a VDU. Includes the cloud site - * as well as tenant information within the site. Currently this is defined as a - * cloud site ID. which would map to a CloudConfig entry. - * Perhaps the CloudConfig entry itself should be provided, instead of requiring each - * plug-in to query it. + * Cloud information structure for deploying/managing a VDU. Includes the cloud site as well as tenant information + * within the site. Currently this is defined as a cloud site ID. which would map to a CloudConfig entry. Perhaps the + * CloudConfig entry itself should be provided, instead of requiring each plug-in to query it. * - * The meaning of 'tenant' may differ by cloud provider, but every cloud supports some - * sort of tenant partitioning. + * The meaning of 'tenant' may differ by cloud provider, but every cloud supports some sort of tenant partitioning. * */ public class CloudInfo { - private String cloudSiteId; - private String cloudOwner; - private String tenantId; - private String tenantName;//bpmn query and pass + private String cloudSiteId; + private String cloudOwner; + private String tenantId; + private String tenantName;// bpmn query and pass - public CloudInfo() { - } + public CloudInfo() {} - public CloudInfo (String cloudSiteId, String cloudOwner, String tenantId, String tenantName) { - this.cloudSiteId = cloudSiteId; - this.cloudOwner = cloudOwner; - this.tenantId = tenantId; - this.tenantName = tenantName; - } + public CloudInfo(String cloudSiteId, String cloudOwner, String tenantId, String tenantName) { + this.cloudSiteId = cloudSiteId; + this.cloudOwner = cloudOwner; + this.tenantId = tenantId; + this.tenantName = tenantName; + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } - public String getCloudSiteId() { - return cloudSiteId; - } - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } public String getCloudOwner() { return cloudOwner; } + public void setCloudOwner(String cloudOwner) { this.cloudOwner = cloudOwner; } - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public String getTenantName() { - return tenantName; - } - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } -} \ No newline at end of file +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/PluginAction.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/PluginAction.java index 1f097ddd68..634b2ad60d 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/PluginAction.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/PluginAction.java @@ -21,43 +21,46 @@ package org.onap.so.adapters.vdu; /** - * Java beam representing a detailed action performed within a plugin during VDU - * orchestration. This allows the plugin to convey more detailed information about - * recent activities it has performed. It is primarily intended for logging and - * troubleshooting, so plugins are free to populate this as desired. + * Java beam representing a detailed action performed within a plugin during VDU orchestration. This allows the plugin + * to convey more detailed information about recent activities it has performed. It is primarily intended for logging + * and troubleshooting, so plugins are free to populate this as desired. */ public class PluginAction { - - private String action; - private String status; - private String rawMessage; - - public PluginAction () { - } - - public PluginAction (String action, String status, String rawMessage) { - this.action = action; - this.status = status; - this.rawMessage = rawMessage; - } - - public String getAction() { - return action; - } - public void setAction(String action) { - this.action = action; - } - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - public String getRawMessage() { - return rawMessage; - } - public void setRawMessage(String rawMessage) { - this.rawMessage = rawMessage; - } - -} \ No newline at end of file + + private String action; + private String status; + private String rawMessage; + + public PluginAction() {} + + public PluginAction(String action, String status, String rawMessage) { + this.action = action; + this.status = status; + this.rawMessage = rawMessage; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getRawMessage() { + return rawMessage; + } + + public void setRawMessage(String rawMessage) { + this.rawMessage = rawMessage; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java index 8701aa4a7d..2f99fed875 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduArtifact.java @@ -26,60 +26,65 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.EqualsBuilder; public class VduArtifact { - - // Enumerate the types of artifacts permitted. This may need to be a variable string - // value if arbitrary (cloud-specific) artifacts may be attached to VDUs in ASDC. - public enum ArtifactType { - MAIN_TEMPLATE, NESTED_TEMPLATE, CONFIG_FILE, SCRIPT_FILE, TEXT_FILE, ENVIRONMENT - } - - private String name; - private byte[] content; - private ArtifactType type; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VduArtifact)) { - return false; - } - VduArtifact castOther = (VduArtifact) other; - return new EqualsBuilder().append(name, castOther.name).append(content, castOther.content) - .append(type, castOther.type).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(name).append(content).append(type).toHashCode(); - } - - // Default constructor - public VduArtifact() {} - - // Fully specified constructor - public VduArtifact (String name, byte[] content, ArtifactType type) { - this.name = name; - this.content = content; - this.type = type; - } - - public String getName() { - return name; - } - public void setName (String name) { - this.name = name; - } - public byte[] getContent() { - return content; - } - public void setContent(byte[] content) { - this.content = content; - } - public ArtifactType getType() { - return type; - } - public void setType(ArtifactType type) { - this.type = type; - } - - + + // Enumerate the types of artifacts permitted. This may need to be a variable string + // value if arbitrary (cloud-specific) artifacts may be attached to VDUs in ASDC. + public enum ArtifactType { + MAIN_TEMPLATE, NESTED_TEMPLATE, CONFIG_FILE, SCRIPT_FILE, TEXT_FILE, ENVIRONMENT + } + + private String name; + private byte[] content; + private ArtifactType type; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VduArtifact)) { + return false; + } + VduArtifact castOther = (VduArtifact) other; + return new EqualsBuilder().append(name, castOther.name).append(content, castOther.content) + .append(type, castOther.type).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(name).append(content).append(type).toHashCode(); + } + + // Default constructor + public VduArtifact() {} + + // Fully specified constructor + public VduArtifact(String name, byte[] content, ArtifactType type) { + this.name = name; + this.content = content; + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public byte[] getContent() { + return content; + } + + public void setContent(byte[] content) { + this.content = content; + } + + public ArtifactType getType() { + return type; + } + + public void setType(ArtifactType type) { + this.type = type; + } + + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduException.java index c611b87e5c..acb2e6172a 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduException.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduException.java @@ -26,35 +26,36 @@ import org.onap.so.openstack.exceptions.MsoExceptionCategory; /** * OpenStack exception. */ -public class VduException extends MsoException -{ - - /** +public class VduException extends MsoException { + + /** * Serialization id. */ private static final long serialVersionUID = 3313636124141766495L; - - /** - * Constructor to create a new VduException instance - * @param detail error details - */ - public VduException (String detail) { - // Set the detailed error as the Exception 'message' - super(detail); - // TODO: Need a more generic category than OPENSTACK - super.category = MsoExceptionCategory.OPENSTACK; - } - - /** - * Constructor to create a new VduException instance - * @param detail error details - * @param e the cause - */ - public VduException (String detail, Exception e) { - // Set the detailed error as the Exception 'message' - super(detail, e); - // TODO: Need a more generic category than OPENSTACK - super.category = MsoExceptionCategory.OPENSTACK; - } -} \ No newline at end of file + /** + * Constructor to create a new VduException instance + * + * @param detail error details + */ + public VduException(String detail) { + // Set the detailed error as the Exception 'message' + super(detail); + // TODO: Need a more generic category than OPENSTACK + super.category = MsoExceptionCategory.OPENSTACK; + } + + /** + * Constructor to create a new VduException instance + * + * @param detail error details + * @param e the cause + */ + public VduException(String detail, Exception e) { + // Set the detailed error as the Exception 'message' + super(detail, e); + // TODO: Need a more generic category than OPENSTACK + super.category = MsoExceptionCategory.OPENSTACK; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduInstance.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduInstance.java index 8f5f0f9745..0c625e5534 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduInstance.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduInstance.java @@ -26,55 +26,54 @@ import java.util.HashMap; /* * This Java bean class relays VDU status information in a cloud-agnostic format. * - * This bean is returned by all implementors of the VduPlugin interface operations - * (instantiate, query, delete). + * This bean is returned by all implementors of the VduPlugin interface operations (instantiate, query, delete). */ public class VduInstance { - // Set defaults for everything - protected String vduInstanceId; - protected String vduInstanceName; - protected VduStatus status; - protected Map outputs = new HashMap<>(); - protected Map inputs = new HashMap<>(); + // Set defaults for everything + protected String vduInstanceId; + protected String vduInstanceName; + protected VduStatus status; + protected Map outputs = new HashMap<>(); + protected Map inputs = new HashMap<>(); - public String getVduInstanceId() { - return vduInstanceId; - } + public String getVduInstanceId() { + return vduInstanceId; + } - public void setVduInstanceId(String vduInstanceId) { - this.vduInstanceId = vduInstanceId; - } + public void setVduInstanceId(String vduInstanceId) { + this.vduInstanceId = vduInstanceId; + } - public String getVduInstanceName() { - return vduInstanceName; - } + public String getVduInstanceName() { + return vduInstanceName; + } - public void setVduInstanceName(String vduInstanceName) { - this.vduInstanceName = vduInstanceName; - } + public void setVduInstanceName(String vduInstanceName) { + this.vduInstanceName = vduInstanceName; + } - public VduStatus getStatus() { - return status; - } + public VduStatus getStatus() { + return status; + } - public void setStatus(VduStatus status) { - this.status = status; - } + public void setStatus(VduStatus status) { + this.status = status; + } - public Map getOutputs() { - return outputs; - } + public Map getOutputs() { + return outputs; + } - public void setOutputs(Map outputs) { - this.outputs = outputs; - } + public void setOutputs(Map outputs) { + this.outputs = outputs; + } - public Map getInputs() { - return inputs; - } + public Map getInputs() { + return inputs; + } - public void setInputs(Map inputs) { - this.inputs = inputs; - } -} \ No newline at end of file + public void setInputs(Map inputs) { + this.inputs = inputs; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduModelInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduModelInfo.java index a3ce1b5a6c..d22b735ff6 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduModelInfo.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduModelInfo.java @@ -24,41 +24,50 @@ import java.util.ArrayList; import java.util.List; public class VduModelInfo { - private String modelCustomizationUUID; - private String modelUUID; - private String modelInvariantUUID; - private int timeoutMinutes; - private List artifacts = new ArrayList<>(); + private String modelCustomizationUUID; + private String modelUUID; + private String modelInvariantUUID; + private int timeoutMinutes; + private List artifacts = new ArrayList<>(); + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } public String getModelUUID() { return modelUUID; } + public void setModelUUID(String modelUUID) { this.modelUUID = modelUUID; } + public String getModelInvariantUUID() { return modelInvariantUUID; } + public void setModelInvariantUUID(String modelInvariantUUID) { this.modelInvariantUUID = modelInvariantUUID; } - public int getTimeoutMinutes() { - return timeoutMinutes; - } - public void setTimeoutMinutes(int timeoutMinutes) { - this.timeoutMinutes = timeoutMinutes; - } - public List getArtifacts() { - return artifacts; - } - public void setArtifacts(List artifacts) { - this.artifacts = artifacts; - } -} \ No newline at end of file + public int getTimeoutMinutes() { + return timeoutMinutes; + } + + public void setTimeoutMinutes(int timeoutMinutes) { + this.timeoutMinutes = timeoutMinutes; + } + + public List getArtifacts() { + return artifacts; + } + + public void setArtifacts(List artifacts) { + this.artifacts = artifacts; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStateType.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStateType.java index 0b95b392f6..8870f5c7b5 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStateType.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStateType.java @@ -25,12 +25,7 @@ package org.onap.so.adapters.vdu; * Enum status values to capture the state of a generic (cloud-agnostic) VDU. */ public enum VduStateType { - NOTFOUND, - INSTANTIATING, - INSTANTIATED, - DELETING, - DELETED, // Note - only returned in success response to deleteVdu call. - UPDATING, - FAILED, - UNKNOWN + NOTFOUND, INSTANTIATING, INSTANTIATED, DELETING, DELETED, // Note - only returned in success response to deleteVdu + // call. + UPDATING, FAILED, UNKNOWN } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStatus.java index 7797c997a5..331b7e7584 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStatus.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vdu/VduStatus.java @@ -21,38 +21,46 @@ package org.onap.so.adapters.vdu; public class VduStatus { - - private VduStateType state; - private String errorMessage; - private PluginAction lastAction; - - public VduStatus(){} - public VduStatus( VduStateType state) { - this.state = state; - } - public VduStateType getState() { - return state; - } - public void setState(VduStateType state) { - this.state = state; - } - public String getErrorMessage() { - return errorMessage; - } - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - public PluginAction getLastAction() { - return lastAction; - } - public void setLastAction(PluginAction lastAction) { - this.lastAction = lastAction; - } - public void setLastAction (String action, String status, String rawCloudMessage) { - lastAction = new PluginAction(); - lastAction.setAction (action); - lastAction.setStatus (status); - lastAction.setRawMessage(rawCloudMessage); - } - -} \ No newline at end of file + + private VduStateType state; + private String errorMessage; + private PluginAction lastAction; + + public VduStatus() {} + + public VduStatus(VduStateType state) { + this.state = state; + } + + public VduStateType getState() { + return state; + } + + public void setState(VduStateType state) { + this.state = state; + } + + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public PluginAction getLastAction() { + return lastAction; + } + + public void setLastAction(PluginAction lastAction) { + this.lastAction = lastAction; + } + + public void setLastAction(String action, String status, String rawCloudMessage) { + lastAction = new PluginAction(); + lastAction.setAction(action); + lastAction.setStatus(status); + lastAction.setRawMessage(rawCloudMessage); + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleRequest.java index 80e0a95b27..fb8fb2ed84 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleRequest.java @@ -22,209 +22,207 @@ package org.onap.so.adapters.vnfrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - import org.onap.so.entity.MsoRequest; import org.onap.so.openstack.mappers.MapAdapter; - import com.fasterxml.jackson.annotation.JsonRootName; -/* README - Map elements when marshalled to XML produce a list of ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. -*/ +/* + * README Map elements when marshalled to XML produce a list of + * ${MsoUtils.xmlEscape(key)}${MsoUtils.xmlEscape(value)} elements. When + * marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. + */ @JsonRootName("createVfModuleRequest") @XmlRootElement(name = "createVfModuleRequest") @XmlAccessorType(XmlAccessType.FIELD) public class CreateVfModuleRequest extends VfRequestCommon { - private String cloudSiteId; - private String cloudOwner; - private String tenantId; - - private String vnfId; - private String vnfType; - private String vnfVersion; - - private String vfModuleId; - private String vfModuleName; - private String vfModuleType; - - private String volumeGroupId; - private String volumeGroupStackId; - private String baseVfModuleId; - private String baseVfModuleStackId; - private String modelCustomizationUuid; - - private String requestType; - private Boolean failIfExists = false; - private Boolean backout = true; - private Boolean enableBridge; - @XmlJavaTypeAdapter(MapAdapter.class) - private Map vfModuleParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getCloudOwner() { - return cloudOwner; - } - - public void setCloudOwner(String cloudOwner) { - this.cloudOwner = cloudOwner; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleName() { - return vfModuleName; - } - - public void setVfModuleName(String vfModuleName) { - this.vfModuleName = vfModuleName; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getVnfVersion() { - return vnfVersion; - } - - public void setVnfVersion(String vnfVersion) { - this.vnfVersion = vnfVersion; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleType() { - return vfModuleType; - } - - public void setVfModuleType(String vfModuleType) { - this.vfModuleType = vfModuleType; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public String getBaseVfModuleId() { - return baseVfModuleId; - } - - public void setBaseVfModuleId(String baseVfModuleId) { - this.baseVfModuleId = baseVfModuleId; - } - - public String getBaseVfModuleStackId() { - return baseVfModuleStackId; - } + private String cloudSiteId; + private String cloudOwner; + private String tenantId; + + private String vnfId; + private String vnfType; + private String vnfVersion; + + private String vfModuleId; + private String vfModuleName; + private String vfModuleType; + + private String volumeGroupId; + private String volumeGroupStackId; + private String baseVfModuleId; + private String baseVfModuleStackId; + private String modelCustomizationUuid; + + private String requestType; + private Boolean failIfExists = false; + private Boolean backout = true; + private Boolean enableBridge; + @XmlJavaTypeAdapter(MapAdapter.class) + private Map vfModuleParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getCloudOwner() { + return cloudOwner; + } + + public void setCloudOwner(String cloudOwner) { + this.cloudOwner = cloudOwner; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleName() { + return vfModuleName; + } + + public void setVfModuleName(String vfModuleName) { + this.vfModuleName = vfModuleName; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public String getBaseVfModuleId() { + return baseVfModuleId; + } + + public void setBaseVfModuleId(String baseVfModuleId) { + this.baseVfModuleId = baseVfModuleId; + } + + public String getBaseVfModuleStackId() { + return baseVfModuleStackId; + } - public void setBaseVfModuleStackId(String baseVfModuleStackId) { - this.baseVfModuleStackId = baseVfModuleStackId; - } + public void setBaseVfModuleStackId(String baseVfModuleStackId) { + this.baseVfModuleStackId = baseVfModuleStackId; + } - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } - public String getRequestType() { - return requestType; - } + public String getRequestType() { + return requestType; + } - public void setRequestType(String requestType) { - this.requestType = requestType; - } + public void setRequestType(String requestType) { + this.requestType = requestType; + } - public Boolean getFailIfExists() { - return failIfExists; - } + public Boolean getFailIfExists() { + return failIfExists; + } - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } - public Boolean getBackout() { - return backout; - } + public Boolean getBackout() { + return backout; + } - public void setBackout(Boolean backout) { - this.backout = backout; - } + public void setBackout(Boolean backout) { + this.backout = backout; + } - public Map getVfModuleParams() { - return vfModuleParams; - } + public Map getVfModuleParams() { + return vfModuleParams; + } - public void setVfModuleParams(Map vfModuleParams) { - this.vfModuleParams = vfModuleParams; - } + public void setVfModuleParams(Map vfModuleParams) { + this.vfModuleParams = vfModuleParams; + } - public MsoRequest getMsoRequest() { - return msoRequest; - } + public MsoRequest getMsoRequest() { + return msoRequest; + } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } - public Boolean getEnableBridge() { - return this.enableBridge; - } + public Boolean getEnableBridge() { + return this.enableBridge; + } - public void setEnableBridge(Boolean enableBridge) { - this.enableBridge = enableBridge; - } + public void setEnableBridge(Boolean enableBridge) { + this.enableBridge = enableBridge; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleResponse.java index b9d1f4c376..abcb6bdf1a 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVfModuleResponse.java @@ -23,83 +23,79 @@ package org.onap.so.adapters.vnfrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("createVfModuleResponse") @XmlRootElement(name = "createVfModuleResponse") public class CreateVfModuleResponse extends VfResponseCommon { - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - private Boolean vfModuleCreated; - private Map vfModuleOutputs = new HashMap<>(); - private VfModuleRollback rollback = new VfModuleRollback(); - - public CreateVfModuleResponse() { - super(); - } - - public CreateVfModuleResponse(String vnfId, String vfModuleId, - String vfModuleStackId, Boolean vfModuleCreated, - Map vfModuleOutputs, VfModuleRollback rollback, - String messageId) { - super(messageId); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vfModuleCreated = vfModuleCreated; - this.vfModuleOutputs = vfModuleOutputs; - this.rollback = rollback; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleStackId() { - return vfModuleStackId; - } - - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - - public Boolean getVfModuleCreated() { - return vfModuleCreated; - } - - public void setVfModuleCreated(Boolean vfModuleCreated) { - this.vfModuleCreated = vfModuleCreated; - } - - public Map getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } - - public VfModuleRollback getRollback() { - return rollback; - } - - public void setRollback(VfModuleRollback rollback) { - this.rollback = rollback; - } + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private Boolean vfModuleCreated; + private Map vfModuleOutputs = new HashMap<>(); + private VfModuleRollback rollback = new VfModuleRollback(); + + public CreateVfModuleResponse() { + super(); + } + + public CreateVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, Boolean vfModuleCreated, + Map vfModuleOutputs, VfModuleRollback rollback, String messageId) { + super(messageId); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleCreated = vfModuleCreated; + this.vfModuleOutputs = vfModuleOutputs; + this.rollback = rollback; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public Boolean getVfModuleCreated() { + return vfModuleCreated; + } + + public void setVfModuleCreated(Boolean vfModuleCreated) { + this.vfModuleCreated = vfModuleCreated; + } + + public Map getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } + + public VfModuleRollback getRollback() { + return rollback; + } + + public void setRollback(VfModuleRollback rollback) { + this.rollback = rollback; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupRequest.java index a1443f569a..2cb8c0a0ca 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupRequest.java @@ -23,150 +23,147 @@ package org.onap.so.adapters.vnfrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - import org.onap.so.entity.MsoRequest; import org.onap.so.openstack.mappers.MapAdapter; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("createVolumeGroupRequest") @XmlRootElement(name = "createVolumeGroupRequest") @XmlAccessorType(XmlAccessType.FIELD) public class CreateVolumeGroupRequest extends VfRequestCommon { - private String cloudSiteId; - private String cloudOwner; - private String tenantId; - private String volumeGroupName; - private String volumeGroupId; - private String vnfType; - private String vnfVersion; - private String vfModuleType; - private String modelCustomizationUuid; - @XmlJavaTypeAdapter(MapAdapter.class) - private Map volumeGroupParams = new HashMap<>(); - private Boolean failIfExists; - private Boolean enableBridge; - private Boolean suppressBackout; - private MsoRequest msoRequest = new MsoRequest(); - - public CreateVolumeGroupRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getCloudOwner() { - return cloudOwner; - } - - public void setCloudOwner(String cloudOwner) { - this.cloudOwner = cloudOwner; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getVnfVersion() { - return vnfVersion; - } - - public void setVnfVersion(String vnfVersion) { - this.vnfVersion = vnfVersion; - } - - public String getVfModuleType() { - return vfModuleType; - } - - public void setVfModuleType(String vfModuleType) { - this.vfModuleType = vfModuleType; - } - - public Map getVolumeGroupParams() { - return volumeGroupParams; - } - - public void setVolumeGroupParams(Map volumeGroupParams) { - this.volumeGroupParams = volumeGroupParams; - } - - public String getVolumeGroupName() { - return volumeGroupName; - } - - public void setVolumeGroupName(String volumeGroupName) { - this.volumeGroupName = volumeGroupName; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public Boolean getFailIfExists() { - return failIfExists; - } - - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } - - public Boolean getSuppressBackout() { - return suppressBackout; - } - - public void setSuppressBackout(Boolean suppressBackout) { - this.suppressBackout = suppressBackout; - } + private String cloudSiteId; + private String cloudOwner; + private String tenantId; + private String volumeGroupName; + private String volumeGroupId; + private String vnfType; + private String vnfVersion; + private String vfModuleType; + private String modelCustomizationUuid; + @XmlJavaTypeAdapter(MapAdapter.class) + private Map volumeGroupParams = new HashMap<>(); + private Boolean failIfExists; + private Boolean enableBridge; + private Boolean suppressBackout; + private MsoRequest msoRequest = new MsoRequest(); + + public CreateVolumeGroupRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getCloudOwner() { + return cloudOwner; + } + + public void setCloudOwner(String cloudOwner) { + this.cloudOwner = cloudOwner; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public Map getVolumeGroupParams() { + return volumeGroupParams; + } + + public void setVolumeGroupParams(Map volumeGroupParams) { + this.volumeGroupParams = volumeGroupParams; + } + + public String getVolumeGroupName() { + return volumeGroupName; + } + + public void setVolumeGroupName(String volumeGroupName) { + this.volumeGroupName = volumeGroupName; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getSuppressBackout() { + return suppressBackout; + } + + public void setSuppressBackout(Boolean suppressBackout) { + this.suppressBackout = suppressBackout; + } - public MsoRequest getMsoRequest() { - return msoRequest; - } + public MsoRequest getMsoRequest() { + return msoRequest; + } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } - public Boolean getEnableBridge() { - return enableBridge; - } + public Boolean getEnableBridge() { + return enableBridge; + } - public void setEnableBridge(Boolean enableBridge) { - this.enableBridge = enableBridge; - } + public void setEnableBridge(Boolean enableBridge) { + this.enableBridge = enableBridge; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupResponse.java index d98318d3e6..780aec38c0 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/CreateVolumeGroupResponse.java @@ -23,78 +23,70 @@ package org.onap.so.adapters.vnfrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("createVolumeGroupResponse") @XmlRootElement(name = "createVolumeGroupResponse") public class CreateVolumeGroupResponse extends VfResponseCommon { - private String volumeGroupId; - private String volumeGroupStackId; - private Boolean volumeGroupCreated; - private Map volumeGroupOutputs = new HashMap<>(); - private VolumeGroupRollback volumeGroupRollback = new VolumeGroupRollback(); - - public CreateVolumeGroupResponse() { - super(); - } - - public CreateVolumeGroupResponse( - String volumeGroupId, - String volumeGroupStackId, - Boolean volumeGroupCreated, - Map volumeGroupOutputs, - VolumeGroupRollback volumeGroupRollback, - String messageId) - { - super(messageId); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupCreated = volumeGroupCreated; - this.volumeGroupOutputs = volumeGroupOutputs; - this.volumeGroupRollback = volumeGroupRollback; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public Boolean getVolumeGroupCreated() { - return volumeGroupCreated; - } - - public void setVolumeGroupCreated(Boolean volumeGroupCreated) { - this.volumeGroupCreated = volumeGroupCreated; - } - - public Map getVolumeGroupOutputs() { - return volumeGroupOutputs; - } - - public void setVolumeGroupOutputs(Map volumeGroupOutputs) { - this.volumeGroupOutputs = volumeGroupOutputs; - } - - public VolumeGroupRollback getVolumeGroupRollback() { - return volumeGroupRollback; - } - - public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { - this.volumeGroupRollback = volumeGroupRollback; - } + private String volumeGroupId; + private String volumeGroupStackId; + private Boolean volumeGroupCreated; + private Map volumeGroupOutputs = new HashMap<>(); + private VolumeGroupRollback volumeGroupRollback = new VolumeGroupRollback(); + + public CreateVolumeGroupResponse() { + super(); + } + + public CreateVolumeGroupResponse(String volumeGroupId, String volumeGroupStackId, Boolean volumeGroupCreated, + Map volumeGroupOutputs, VolumeGroupRollback volumeGroupRollback, String messageId) { + super(messageId); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupCreated = volumeGroupCreated; + this.volumeGroupOutputs = volumeGroupOutputs; + this.volumeGroupRollback = volumeGroupRollback; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public Boolean getVolumeGroupCreated() { + return volumeGroupCreated; + } + + public void setVolumeGroupCreated(Boolean volumeGroupCreated) { + this.volumeGroupCreated = volumeGroupCreated; + } + + public Map getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map volumeGroupOutputs) { + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public VolumeGroupRollback getVolumeGroupRollback() { + return volumeGroupRollback; + } + + public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { + this.volumeGroupRollback = volumeGroupRollback; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java index d9825ddca2..6a979d754b 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleRequest.java @@ -22,86 +22,83 @@ package org.onap.so.adapters.vnfrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("deleteVfModuleRequest") @XmlRootElement(name = "deleteVfModuleRequest") public class DeleteVfModuleRequest extends VfRequestCommon implements Serializable { - /** - * - */ - private static final long serialVersionUID = -8504083539107392561L; - private String cloudSiteId; - private String cloudOwner; - private String tenantId; - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - - private MsoRequest msoRequest = new MsoRequest(); - - public DeleteVfModuleRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - - public String getCloudOwner() { - return cloudOwner; - } - - public void setCloudOwner(String cloudOwner) { - this.cloudOwner = cloudOwner; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleStackId() { - return vfModuleStackId; - } - - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } + /** + * + */ + private static final long serialVersionUID = -8504083539107392561L; + private String cloudSiteId; + private String cloudOwner; + private String tenantId; + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteVfModuleRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getCloudOwner() { + return cloudOwner; + } + + public void setCloudOwner(String cloudOwner) { + this.cloudOwner = cloudOwner; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleResponse.java index ca713d36a0..eac56e1ce9 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVfModuleResponse.java @@ -23,58 +23,59 @@ package org.onap.so.adapters.vnfrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("deleteVfModuleResponse") @XmlRootElement(name = "deleteVfModuleResponse") public class DeleteVfModuleResponse extends VfResponseCommon { - private String vnfId; - private String vfModuleId; - private Boolean vfModuleDeleted; - private Map vfModuleOutputs = new HashMap<>(); - public DeleteVfModuleResponse() { - super(); - } + private String vnfId; + private String vfModuleId; + private Boolean vfModuleDeleted; + private Map vfModuleOutputs = new HashMap<>(); + + public DeleteVfModuleResponse() { + super(); + } + + public DeleteVfModuleResponse(String vnfId, String vfModuleId, Boolean vfModuleDeleted, String messageId, + Map outputs) { + super(messageId); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleDeleted = vfModuleDeleted; + this.vfModuleOutputs = outputs; + } - public DeleteVfModuleResponse(String vnfId, String vfModuleId, Boolean vfModuleDeleted, String messageId, Map outputs) { - super(messageId); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleDeleted = vfModuleDeleted; - this.vfModuleOutputs = outputs; - } + public String getVnfId() { + return vnfId; + } - public String getVnfId() { - return vnfId; - } + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } + public String getVfModuleId() { + return vfModuleId; + } - public String getVfModuleId() { - return vfModuleId; - } + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } + public Boolean getVfModuleDeleted() { + return vfModuleDeleted; + } - public Boolean getVfModuleDeleted() { - return vfModuleDeleted; - } + public void setVfModuleDeleted(Boolean vfModuleDeleted) { + this.vfModuleDeleted = vfModuleDeleted; + } - public void setVfModuleDeleted(Boolean vfModuleDeleted) { - this.vfModuleDeleted = vfModuleDeleted; - } - public Map getVfModuleOutputs() { - return vfModuleOutputs; - } + public Map getVfModuleOutputs() { + return vfModuleOutputs; + } - public void setVfModuleOutputs(Map vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } + public void setVfModuleOutputs(Map vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupRequest.java index aba53a4dd3..88c283da16 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupRequest.java @@ -22,33 +22,31 @@ package org.onap.so.adapters.vnfrest; import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; - import com.fasterxml.jackson.annotation.JsonRootName; import org.apache.commons.lang3.builder.ToStringBuilder; @JsonRootName("deleteVolumeGroupRequest") @XmlRootElement(name = "deleteVolumeGroupRequest") public class DeleteVolumeGroupRequest extends VfRequestCommon { - private String cloudSiteId; - private String cloudOwner; - private String tenantId; - private String volumeGroupId; - private String volumeGroupStackId; - private MsoRequest msoRequest = new MsoRequest(); - - public DeleteVolumeGroupRequest() { - super(); - } + private String cloudSiteId; + private String cloudOwner; + private String tenantId; + private String volumeGroupId; + private String volumeGroupStackId; + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteVolumeGroupRequest() { + super(); + } - public String getCloudSiteId() { - return cloudSiteId; - } + public String getCloudSiteId() { + return cloudSiteId; + } - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } public String getCloudOwner() { return cloudOwner; @@ -58,42 +56,42 @@ public class DeleteVolumeGroupRequest extends VfRequestCommon { this.cloudOwner = cloudOwner; } - public String getTenantId() { - return tenantId; - } + public String getTenantId() { + return tenantId; + } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } - public String getVolumeGroupId() { - return volumeGroupId; - } + public String getVolumeGroupId() { + return volumeGroupId; + } - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } - public MsoRequest getMsoRequest() { - return msoRequest; - } + public MsoRequest getMsoRequest() { + return msoRequest; + } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } - @Override - public String toString() { - return new ToStringBuilder(this).appendSuper(super.toString()).append("cloudSiteId", cloudSiteId) - .append("tenantId", tenantId).append("volumeGroupId", volumeGroupId) - .append("volumeGroupStackId", volumeGroupStackId).append("msoRequest", msoRequest).toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).appendSuper(super.toString()).append("cloudSiteId", cloudSiteId) + .append("tenantId", tenantId).append("volumeGroupId", volumeGroupId) + .append("volumeGroupStackId", volumeGroupStackId).append("msoRequest", msoRequest).toString(); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupResponse.java index 4a7442108a..d75090a827 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/DeleteVolumeGroupResponse.java @@ -22,28 +22,27 @@ package org.onap.so.adapters.vnfrest; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("deleteVolumeGroupResponse") @XmlRootElement(name = "deleteVolumeGroupResponse") public class DeleteVolumeGroupResponse extends VfResponseCommon { - private Boolean volumeGroupDeleted; + private Boolean volumeGroupDeleted; - public DeleteVolumeGroupResponse() { - super(); - } + public DeleteVolumeGroupResponse() { + super(); + } - public DeleteVolumeGroupResponse(Boolean volumeGroupDeleted, String messageId) { - super(messageId); - this.volumeGroupDeleted = volumeGroupDeleted; - } + public DeleteVolumeGroupResponse(Boolean volumeGroupDeleted, String messageId) { + super(messageId); + this.volumeGroupDeleted = volumeGroupDeleted; + } - public Boolean getVolumeGroupDeleted() { - return volumeGroupDeleted; - } + public Boolean getVolumeGroupDeleted() { + return volumeGroupDeleted; + } - public void setVolumeGroupDeleted(Boolean volumeGroupDeleted) { - this.volumeGroupDeleted = volumeGroupDeleted; - } + public void setVolumeGroupDeleted(Boolean volumeGroupDeleted) { + this.volumeGroupDeleted = volumeGroupDeleted; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java index 3b480d8ea9..e48d99672a 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java @@ -23,7 +23,6 @@ package org.onap.so.adapters.vnfrest; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; import org.onap.so.openstack.beans.VnfStatus; import com.fasterxml.jackson.annotation.JsonRootName; @@ -32,66 +31,66 @@ import org.slf4j.LoggerFactory; @JsonRootName("queryVfModuleResponse") @XmlRootElement(name = "queryVfModuleResponse") -public class QueryVfModuleResponse extends VfResponseCommon{ - private static final Logger logger = LoggerFactory.getLogger(QueryVfModuleResponse.class); - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - private VnfStatus vnfStatus; - private Map vfModuleOutputs; - - public QueryVfModuleResponse() { - super(); - } - - public QueryVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, VnfStatus vnfStatus, - Map vfModuleOutputs) { - super(); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vnfStatus = vnfStatus; - this.vfModuleOutputs = vfModuleOutputs; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleStackId() { - return vfModuleStackId; - } - - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - - public VnfStatus getVnfStatus() { - return vnfStatus; - } - - public void setVnfStatus(VnfStatus vnfStatus) { - this.vnfStatus = vnfStatus; - } - - public Map getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } - +public class QueryVfModuleResponse extends VfResponseCommon { + private static final Logger logger = LoggerFactory.getLogger(QueryVfModuleResponse.class); + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private VnfStatus vnfStatus; + private Map vfModuleOutputs; + + public QueryVfModuleResponse() { + super(); + } + + public QueryVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, VnfStatus vnfStatus, + Map vfModuleOutputs) { + super(); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vnfStatus = vnfStatus; + this.vfModuleOutputs = vfModuleOutputs; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public VnfStatus getVnfStatus() { + return vnfStatus; + } + + public void setVnfStatus(VnfStatus vnfStatus) { + this.vnfStatus = vnfStatus; + } + + public Map getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java index f15c62493a..a95df93a27 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java @@ -24,83 +24,73 @@ package org.onap.so.adapters.vnfrest; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.beans.VnfStatus; - import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @XmlRootElement(name = "queryVolumeGroupResponse") public class QueryVolumeGroupResponse { - private static final Logger logger = LoggerFactory.getLogger(QueryVolumeGroupResponse.class); - private String volumeGroupId; - private String volumeGroupStackId; - private VnfStatus volumeGroupStatus; - private Map volumeGroupOutputs; - - public QueryVolumeGroupResponse() { - } - - public QueryVolumeGroupResponse( - String volumeGroupId, - String volumeGroupStackId, - VnfStatus volumeGroupStatus, - Map volumeGroupOutputs) - { - super(); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupStatus = volumeGroupStatus; - this.volumeGroupOutputs = volumeGroupOutputs; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - - public VnfStatus getVolumeGroupStatus() { - return volumeGroupStatus; - } - - public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) { - this.volumeGroupStatus = volumeGroupStatus; - } - - public Map getVolumeGroupOutputs() { - return volumeGroupOutputs; - } - - public void setVolumeGroupOutputs(Map volumeGroupOutputs) { - this.volumeGroupOutputs = volumeGroupOutputs; - } - - public String toJsonString() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - } - catch (Exception e) { - logger.debug("Exception :", e); - } - return jsonString; - } + private static final Logger logger = LoggerFactory.getLogger(QueryVolumeGroupResponse.class); + private String volumeGroupId; + private String volumeGroupStackId; + private VnfStatus volumeGroupStatus; + private Map volumeGroupOutputs; + + public QueryVolumeGroupResponse() {} + + public QueryVolumeGroupResponse(String volumeGroupId, String volumeGroupStackId, VnfStatus volumeGroupStatus, + Map volumeGroupOutputs) { + super(); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupStatus = volumeGroupStatus; + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public VnfStatus getVolumeGroupStatus() { + return volumeGroupStatus; + } + + public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) { + this.volumeGroupStatus = volumeGroupStatus; + } + + public Map getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map volumeGroupOutputs) { + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + } catch (Exception e) { + logger.debug("Exception :", e); + } + return jsonString; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleRequest.java index 4ad7a7a417..351782f1fa 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleRequest.java @@ -22,24 +22,23 @@ package org.onap.so.adapters.vnfrest; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("rollbackVfModuleRequest") @XmlRootElement(name = "rollbackVfModuleRequest") public class RollbackVfModuleRequest extends VfRequestCommon { - private VfModuleRollback vfModuleRollback; + private VfModuleRollback vfModuleRollback; - public RollbackVfModuleRequest() { - super(); - } + public RollbackVfModuleRequest() { + super(); + } - public VfModuleRollback getVfModuleRollback() { - return vfModuleRollback; - } + public VfModuleRollback getVfModuleRollback() { + return vfModuleRollback; + } - public void setVfModuleRollback(VfModuleRollback vfModuleRollback) { - this.vfModuleRollback = vfModuleRollback; - } + public void setVfModuleRollback(VfModuleRollback vfModuleRollback) { + this.vfModuleRollback = vfModuleRollback; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleResponse.java index 43db90c566..dc9f42de1d 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVfModuleResponse.java @@ -22,28 +22,27 @@ package org.onap.so.adapters.vnfrest; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("rollbackVfModuleResponse") @XmlRootElement(name = "rollbackVfModuleResponse") public class RollbackVfModuleResponse extends VfResponseCommon { - private Boolean vfModuleRolledback; + private Boolean vfModuleRolledback; - public RollbackVfModuleResponse() { - super(); - } + public RollbackVfModuleResponse() { + super(); + } - public RollbackVfModuleResponse(Boolean vfModuleRolledback, String messageId) { - super(messageId); - this.vfModuleRolledback = vfModuleRolledback; - } + public RollbackVfModuleResponse(Boolean vfModuleRolledback, String messageId) { + super(messageId); + this.vfModuleRolledback = vfModuleRolledback; + } - public Boolean getVfModuleRolledback() { - return vfModuleRolledback; - } + public Boolean getVfModuleRolledback() { + return vfModuleRolledback; + } - public void setVfModuleRolledback(Boolean vfModuleRolledback) { - this.vfModuleRolledback = vfModuleRolledback; - } + public void setVfModuleRolledback(Boolean vfModuleRolledback) { + this.vfModuleRolledback = vfModuleRolledback; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupRequest.java index 14c2c2a3d9..534d9595da 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupRequest.java @@ -22,23 +22,22 @@ package org.onap.so.adapters.vnfrest; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("rollbackVolumeGroupRequest") @XmlRootElement(name = "rollbackVolumeGroupRequest") public class RollbackVolumeGroupRequest extends VfRequestCommon { - private VolumeGroupRollback volumeGroupRollback; + private VolumeGroupRollback volumeGroupRollback; - public RollbackVolumeGroupRequest() { - super(); - } + public RollbackVolumeGroupRequest() { + super(); + } - public VolumeGroupRollback getVolumeGroupRollback() { - return volumeGroupRollback; - } + public VolumeGroupRollback getVolumeGroupRollback() { + return volumeGroupRollback; + } - public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { - this.volumeGroupRollback = volumeGroupRollback; - } + public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { + this.volumeGroupRollback = volumeGroupRollback; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupResponse.java index 46ac26825c..6038d9702a 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/RollbackVolumeGroupResponse.java @@ -22,28 +22,27 @@ package org.onap.so.adapters.vnfrest; import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("rollbackVolumeGroupResponse") @XmlRootElement(name = "rollbackVolumeGroupResponse") public class RollbackVolumeGroupResponse extends VfResponseCommon { - private Boolean volumeGroupRolledBack; + private Boolean volumeGroupRolledBack; - public RollbackVolumeGroupResponse() { - super(); - } + public RollbackVolumeGroupResponse() { + super(); + } - public RollbackVolumeGroupResponse(Boolean volumeGroupRolledBack, String messageId) { - super(messageId); - this.volumeGroupRolledBack = volumeGroupRolledBack; - } + public RollbackVolumeGroupResponse(Boolean volumeGroupRolledBack, String messageId) { + super(messageId); + this.volumeGroupRolledBack = volumeGroupRolledBack; + } - public Boolean getVolumeGroupRolledBack() { - return volumeGroupRolledBack; - } + public Boolean getVolumeGroupRolledBack() { + return volumeGroupRolledBack; + } - public void setVolumeGroupRolledBack(Boolean volumeGroupRolledBack) { - this.volumeGroupRolledBack = volumeGroupRolledBack; - } + public void setVolumeGroupRolledBack(Boolean volumeGroupRolledBack) { + this.volumeGroupRolledBack = volumeGroupRolledBack; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleRequest.java index a02dc1f94e..bb21502bc4 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleRequest.java @@ -23,15 +23,12 @@ package org.onap.so.adapters.vnfrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - import org.onap.so.entity.MsoRequest; import org.onap.so.openstack.mappers.MapAdapter; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("updateVfModuleRequest") @@ -39,42 +36,42 @@ import com.fasterxml.jackson.annotation.JsonRootName; @XmlAccessorType(XmlAccessType.FIELD) public class UpdateVfModuleRequest extends VfRequestCommon { - private String cloudSiteId; - private String cloudOwner; - private String tenantId; + private String cloudSiteId; + private String cloudOwner; + private String tenantId; - private String vnfId; - private String vnfType; - private String vnfVersion; + private String vnfId; + private String vnfType; + private String vnfVersion; - private String vfModuleName; - private String vfModuleType; - private String vfModuleId; - private String vfModuleStackId; + private String vfModuleName; + private String vfModuleType; + private String vfModuleId; + private String vfModuleStackId; - private String volumeGroupId; - private String volumeGroupStackId; + private String volumeGroupId; + private String volumeGroupStackId; - private String baseVfModuleId; - private String baseVfModuleStackId; + private String baseVfModuleId; + private String baseVfModuleStackId; - private String modelCustomizationUuid; + private String modelCustomizationUuid; - private String requestType; - private Boolean failIfExists; - private Boolean backout; + private String requestType; + private Boolean failIfExists; + private Boolean backout; - @XmlJavaTypeAdapter(MapAdapter.class) - private Map vfModuleParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); + @XmlJavaTypeAdapter(MapAdapter.class) + private Map vfModuleParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); - public String getCloudSiteId() { - return cloudSiteId; - } + public String getCloudSiteId() { + return cloudSiteId; + } - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } public String getCloudOwner() { return cloudOwner; @@ -84,147 +81,147 @@ public class UpdateVfModuleRequest extends VfRequestCommon { this.cloudOwner = cloudOwner; } - public String getTenantId() { - return tenantId; - } + public String getTenantId() { + return tenantId; + } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } - public String getVnfId() { - return vnfId; - } + public String getVnfId() { + return vnfId; + } - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } - public String getVfModuleName() { - return vfModuleName; - } + public String getVfModuleName() { + return vfModuleName; + } - public void setVfModuleName(String vfModuleName) { - this.vfModuleName = vfModuleName; - } + public void setVfModuleName(String vfModuleName) { + this.vfModuleName = vfModuleName; + } - public String getVnfType() { - return vnfType; - } + public String getVnfType() { + return vnfType; + } - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } - public String getVnfVersion() { - return vnfVersion; - } + public String getVnfVersion() { + return vnfVersion; + } - public void setVnfVersion(String vnfVersion) { - this.vnfVersion = vnfVersion; - } + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } - public String getVfModuleId() { - return vfModuleId; - } + public String getVfModuleId() { + return vfModuleId; + } - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } - public String getVfModuleType() { - return vfModuleType; - } + public String getVfModuleType() { + return vfModuleType; + } - public void setVfModuleType(String vfModuleType) { - this.vfModuleType = vfModuleType; - } + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } - public String getVfModuleStackId() { - return vfModuleStackId; - } + public String getVfModuleStackId() { + return vfModuleStackId; + } - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } - public String getVolumeGroupId() { - return volumeGroupId; - } + public String getVolumeGroupId() { + return volumeGroupId; + } - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } - public String getBaseVfModuleId() { - return baseVfModuleId; - } + public String getBaseVfModuleId() { + return baseVfModuleId; + } - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } - public void setBaseVfModuleId(String baseVfModuleId) { - this.baseVfModuleId = baseVfModuleId; - } + public void setBaseVfModuleId(String baseVfModuleId) { + this.baseVfModuleId = baseVfModuleId; + } - public String getBaseVfModuleStackId() { - return baseVfModuleStackId; - } + public String getBaseVfModuleStackId() { + return baseVfModuleStackId; + } - public void setBaseVfModuleStackId(String baseVfModuleStackId) { - this.baseVfModuleStackId = baseVfModuleStackId; - } + public void setBaseVfModuleStackId(String baseVfModuleStackId) { + this.baseVfModuleStackId = baseVfModuleStackId; + } - public String getRequestType() { - return requestType; - } + public String getRequestType() { + return requestType; + } - public void setRequestType(String requestType) { - this.requestType = requestType; - } + public void setRequestType(String requestType) { + this.requestType = requestType; + } - public Boolean getFailIfExists() { - return failIfExists; - } + public Boolean getFailIfExists() { + return failIfExists; + } - public void setFailIfExists(Boolean failIfExists) { - this.failIfExists = failIfExists; - } + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } - public Boolean getBackout() { - return backout; - } + public Boolean getBackout() { + return backout; + } - public void setBackout(Boolean backout) { - this.backout = backout; - } + public void setBackout(Boolean backout) { + this.backout = backout; + } - public Map getVfModuleParams() { - return vfModuleParams; - } + public Map getVfModuleParams() { + return vfModuleParams; + } - public void setVfModuleParams(Map vfModuleParams) { - this.vfModuleParams = vfModuleParams; - } + public void setVfModuleParams(Map vfModuleParams) { + this.vfModuleParams = vfModuleParams; + } - public MsoRequest getMsoRequest() { - return msoRequest; - } + public MsoRequest getMsoRequest() { + return msoRequest; + } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleResponse.java index 4504bf3461..ff5735af58 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVfModuleResponse.java @@ -23,63 +23,59 @@ package org.onap.so.adapters.vnfrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("updateVfModuleResponse") @XmlRootElement(name = "updateVfModuleResponse") public class UpdateVfModuleResponse extends VfResponseCommon { - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - private Map vfModuleOutputs = new HashMap<>(); - - public UpdateVfModuleResponse() { - super(); - } - - public UpdateVfModuleResponse(String vnfId, String vfModuleId, - String vfModuleStackId, - Map vfModuleOutputs, - String messageId) { - super(messageId); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vfModuleOutputs = vfModuleOutputs; - } - - public String getVnfId() { - return vnfId; - } - - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public String getVfModuleStackId() { - return vfModuleStackId; - } - - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - - public Map getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private Map vfModuleOutputs = new HashMap<>(); + + public UpdateVfModuleResponse() { + super(); + } + + public UpdateVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, + Map vfModuleOutputs, String messageId) { + super(messageId); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleOutputs = vfModuleOutputs; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public Map getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupRequest.java index e7c8171d6c..30d6bc9154 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupRequest.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupRequest.java @@ -23,45 +23,42 @@ package org.onap.so.adapters.vnfrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - import org.onap.so.entity.MsoRequest; import org.onap.so.openstack.mappers.MapAdapter; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("updateVolumeGroupRequest") @XmlRootElement(name = "updateVolumeGroupRequest") @XmlAccessorType(XmlAccessType.FIELD) public class UpdateVolumeGroupRequest extends VfRequestCommon { - private String cloudSiteId; - private String cloudOwner; - private String tenantId; - private String volumeGroupId; - private String volumeGroupStackId; - private String vnfType; - private String vnfVersion; - private String vfModuleType; - private String modelCustomizationUuid; - @XmlJavaTypeAdapter(MapAdapter.class) - private Map volumeGroupParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); - - public UpdateVolumeGroupRequest() { - super(); - } - - public String getCloudSiteId() { - return cloudSiteId; - } - - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } + private String cloudSiteId; + private String cloudOwner; + private String tenantId; + private String volumeGroupId; + private String volumeGroupStackId; + private String vnfType; + private String vnfVersion; + private String vfModuleType; + private String modelCustomizationUuid; + @XmlJavaTypeAdapter(MapAdapter.class) + private Map volumeGroupParams = new HashMap<>(); + private MsoRequest msoRequest = new MsoRequest(); + + public UpdateVolumeGroupRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } public String getCloudOwner() { return cloudOwner; @@ -71,75 +68,75 @@ public class UpdateVolumeGroupRequest extends VfRequestCommon { this.cloudOwner = cloudOwner; } - public String getTenantId() { - return tenantId; - } + public String getTenantId() { + return tenantId; + } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } - public String getVolumeGroupId() { - return volumeGroupId; - } + public String getVolumeGroupId() { + return volumeGroupId; + } - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } - public String getVnfType() { - return vnfType; - } + public String getVnfType() { + return vnfType; + } - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } - public String getVnfVersion() { - return vnfVersion; - } + public String getVnfVersion() { + return vnfVersion; + } - public void setVnfVersion(String vnfVersion) { - this.vnfVersion = vnfVersion; - } + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } - public String getVfModuleType() { - return vfModuleType; - } + public String getVfModuleType() { + return vfModuleType; + } - public void setVfModuleType(String vfModuleType) { - this.vfModuleType = vfModuleType; - } + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } - public Map getVolumeGroupParams() { - return volumeGroupParams; - } + public Map getVolumeGroupParams() { + return volumeGroupParams; + } - public void setVolumeGroupParams(Map volumeGroupParams) { - this.volumeGroupParams = volumeGroupParams; - } + public void setVolumeGroupParams(Map volumeGroupParams) { + this.volumeGroupParams = volumeGroupParams; + } - public MsoRequest getMsoRequest() { - return msoRequest; - } + public MsoRequest getMsoRequest() { + return msoRequest; + } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupResponse.java index 8c003b1835..f3bd29ef99 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/UpdateVolumeGroupResponse.java @@ -23,57 +23,51 @@ package org.onap.so.adapters.vnfrest; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.XmlRootElement; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("updateVolumeGroupResponse") @XmlRootElement(name = "updateVolumeGroupResponse") public class UpdateVolumeGroupResponse extends VfResponseCommon { - private String volumeGroupId; - private String volumeGroupStackId; - private Map volumeGroupOutputs; + private String volumeGroupId; + private String volumeGroupStackId; + private Map volumeGroupOutputs; - public UpdateVolumeGroupResponse() { - super(); - this.volumeGroupOutputs = new HashMap<>(); - } + public UpdateVolumeGroupResponse() { + super(); + this.volumeGroupOutputs = new HashMap<>(); + } - public UpdateVolumeGroupResponse( - String volumeGroupId, - String volumeGroupStackId, - Map volumeGroupOutputs, - String messageId) - { - super(messageId); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupOutputs = volumeGroupOutputs; - } + public UpdateVolumeGroupResponse(String volumeGroupId, String volumeGroupStackId, + Map volumeGroupOutputs, String messageId) { + super(messageId); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupOutputs = volumeGroupOutputs; + } - public String getVolumeGroupId() { - return volumeGroupId; - } + public String getVolumeGroupId() { + return volumeGroupId; + } - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } - public Map getVolumeGroupOutputs() { - return volumeGroupOutputs; - } + public Map getVolumeGroupOutputs() { + return volumeGroupOutputs; + } - public void setVolumeGroupOutputs(Map volumeGroupOutputs) { - this.volumeGroupOutputs = volumeGroupOutputs; - } + public void setVolumeGroupOutputs(Map volumeGroupOutputs) { + this.volumeGroupOutputs = volumeGroupOutputs; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleExceptionResponse.java index 4f53531585..c1e77dcd4c 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleExceptionResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleExceptionResponse.java @@ -22,9 +22,7 @@ package org.onap.so.adapters.vnfrest; import java.io.Serializable; - import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "vfModuleException") @@ -33,43 +31,44 @@ public class VfModuleExceptionResponse extends VfResponseCommon implements Seria private static final long serialVersionUID = -9062290006520066109L; private String message; - private MsoExceptionCategory category; - private Boolean rolledBack; - - public VfModuleExceptionResponse () {} - - public VfModuleExceptionResponse (String message) { - this.message = message; - } - - public VfModuleExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { - super(messageid); - this.message = message; - this.category = category; - this.rolledBack = rolledBack; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public MsoExceptionCategory getCategory () { - return category; - } - - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public Boolean getRolledBack() { - return rolledBack; - } - - public void setRolledBack(Boolean rolledBack) { - this.rolledBack = rolledBack; - } + private MsoExceptionCategory category; + private Boolean rolledBack; + + public VfModuleExceptionResponse() {} + + public VfModuleExceptionResponse(String message) { + this.message = message; + } + + public VfModuleExceptionResponse(String message, MsoExceptionCategory category, boolean rolledBack, + String messageid) { + super(messageid); + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory() { + return category; + } + + public void setCategory(MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleRollback.java index a6a988690c..5f93765688 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleRollback.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfModuleRollback.java @@ -22,119 +22,130 @@ package org.onap.so.adapters.vnfrest; import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; import org.onap.so.openstack.beans.VnfRollback; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("VfModuleRollback") @XmlRootElement(name = "VfModuleRollback") public class VfModuleRollback { - private String vnfId; - private String vfModuleId; - private String vfModuleStackId; - private boolean vfModuleCreated = false; - private String tenantId; - private String cloudOwner; - private String cloudSiteId; - private MsoRequest msoRequest; - private String messageId; - private String mode = "HEAT"; // default - - public VfModuleRollback() { - } - - public VfModuleRollback(VnfRollback vrb, String vfModuleId, String vfModuleStackId, String messageId) - { - this.vnfId = vrb.getVnfId(); - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vfModuleCreated = vrb.getVnfCreated(); - this.tenantId = vrb.getTenantId(); - this.cloudOwner = vrb.getCloudOwner(); - this.cloudSiteId = vrb.getCloudSiteId(); - this.msoRequest = vrb.getMsoRequest(); - this.messageId = messageId; - this.mode = vrb.getMode(); - } - - public VfModuleRollback(String vnfId, String vfModuleId, - String vfModuleStackId, boolean vfModuleCreated, String tenantId, - String cloudOwner, - String cloudSiteId, - MsoRequest msoRequest, - String messageId) { - super(); - this.vnfId = vnfId; - this.vfModuleId = vfModuleId; - this.vfModuleStackId = vfModuleStackId; - this.vfModuleCreated = vfModuleCreated; - this.tenantId = tenantId; - this.cloudOwner = cloudOwner; - this.cloudSiteId = cloudSiteId; - this.msoRequest = msoRequest; - this.messageId = messageId; - } - - public String getVnfId() { - return vnfId; - } - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - public String getVfModuleId() { - return vfModuleId; - } - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - public String getVfModuleStackId() { - return vfModuleStackId; - } - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - public boolean isVfModuleCreated() { - return vfModuleCreated; - } - public void setVfModuleCreated(boolean vfModuleCreated) { - this.vfModuleCreated = vfModuleCreated; - } - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public String getCloudSiteId() { - return cloudSiteId; - } - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private boolean vfModuleCreated = false; + private String tenantId; + private String cloudOwner; + private String cloudSiteId; + private MsoRequest msoRequest; + private String messageId; + private String mode = "HEAT"; // default + + public VfModuleRollback() {} + + public VfModuleRollback(VnfRollback vrb, String vfModuleId, String vfModuleStackId, String messageId) { + this.vnfId = vrb.getVnfId(); + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleCreated = vrb.getVnfCreated(); + this.tenantId = vrb.getTenantId(); + this.cloudOwner = vrb.getCloudOwner(); + this.cloudSiteId = vrb.getCloudSiteId(); + this.msoRequest = vrb.getMsoRequest(); + this.messageId = messageId; + this.mode = vrb.getMode(); + } + + public VfModuleRollback(String vnfId, String vfModuleId, String vfModuleStackId, boolean vfModuleCreated, + String tenantId, String cloudOwner, String cloudSiteId, MsoRequest msoRequest, String messageId) { + super(); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleCreated = vfModuleCreated; + this.tenantId = tenantId; + this.cloudOwner = cloudOwner; + this.cloudSiteId = cloudSiteId; + this.msoRequest = msoRequest; + this.messageId = messageId; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public boolean isVfModuleCreated() { + return vfModuleCreated; + } + + public void setVfModuleCreated(boolean vfModuleCreated) { + this.vfModuleCreated = vfModuleCreated; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + public String getCloudOwner() { return cloudOwner; } + public void setCloudOwner(String cloudOwner) { this.cloudOwner = cloudOwner; } - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - public String getMessageId() { - return messageId; - } - public void setMessageId(String messageId) { - this.messageId = messageId; - } - public String getMode() { - return mode; - } - public void setMode(String mode) { - this.mode = mode; - } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfRequestCommon.java index f934bc63d8..53c7f003bd 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfRequestCommon.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfRequestCommon.java @@ -28,34 +28,34 @@ import org.apache.commons.lang3.builder.ToStringBuilder; * Everything that is common between all VfModule and VolumeGroup Requests. */ public abstract class VfRequestCommon extends VfResponseCommon { - private Boolean skipAAI; - private String notificationUrl; + private Boolean skipAAI; + private String notificationUrl; - public Boolean getSkipAAI() { - return skipAAI; - } + public Boolean getSkipAAI() { + return skipAAI; + } - public void setSkipAAI(Boolean skipAAI) { - this.skipAAI = skipAAI; - } + public void setSkipAAI(Boolean skipAAI) { + this.skipAAI = skipAAI; + } - public String getNotificationUrl() { - return notificationUrl; - } + public String getNotificationUrl() { + return notificationUrl; + } - public void setNotificationUrl(String notificationUrl) { - this.notificationUrl = notificationUrl; - } + public void setNotificationUrl(String notificationUrl) { + this.notificationUrl = notificationUrl; + } - public boolean isSynchronous() { - return notificationUrl == null || notificationUrl.isEmpty(); - } + public boolean isSynchronous() { + return notificationUrl == null || notificationUrl.isEmpty(); + } - @Override - public String toString() { - return new ToStringBuilder(this).append("skipAAI", skipAAI).append("notificationUrl", notificationUrl) - .toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("skipAAI", skipAAI).append("notificationUrl", notificationUrl) + .toString(); + } - // getMessageId, setMessageId, toJsonString, toJsonString are all defined in VfResponseCommon. + // getMessageId, setMessageId, toJsonString, toJsonString are all defined in VfResponseCommon. } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java index 73414a370a..23bbbb3f43 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java @@ -24,64 +24,61 @@ package org.onap.so.adapters.vnfrest; import java.io.ByteArrayOutputStream; - import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; - import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Everything that is common between all VfModule and VolumeGroup Responses, - * except for QueryVfModuleResponse and QueryVolumeGroupResponse. + * Everything that is common between all VfModule and VolumeGroup Responses, except for QueryVfModuleResponse and + * QueryVolumeGroupResponse. */ public abstract class VfResponseCommon { - private static final Logger logger = LoggerFactory.getLogger(VfResponseCommon.class); - private String messageId; + private static final Logger logger = LoggerFactory.getLogger(VfResponseCommon.class); + private String messageId; - public VfResponseCommon() { - messageId = null; - } + public VfResponseCommon() { + messageId = null; + } - public VfResponseCommon(String messageId) { - this.messageId = messageId; - } + public VfResponseCommon(String messageId) { + this.messageId = messageId; + } - public String getMessageId() { - return messageId; - } + public String getMessageId() { + return messageId; + } - public void setMessageId(String messageId) { - this.messageId = messageId; - } + public void setMessageId(String messageId) { + this.messageId = messageId; + } - public String toJsonString() { - try { - String jsonString; - ObjectMapper mapper = new ObjectMapper(); - mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); - jsonString = mapper.writeValueAsString(this); - return jsonString; - } catch (Exception e) { - logger.debug("Exception :",e); - return ""; - } - } + public String toJsonString() { + try { + String jsonString; + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + return jsonString; + } catch (Exception e) { + logger.debug("Exception :", e); + return ""; + } + } - public String toXmlString() { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - JAXBContext context = JAXBContext.newInstance(this.getClass()); - Marshaller marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML - marshaller.marshal(this, bs); - return bs.toString(); - } catch (Exception e) { - logger.debug("Exception :",e); - return ""; - } - } + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); // pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + logger.debug("Exception :", e); + return ""; + } + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupExceptionResponse.java index 2e5801b4ae..6e7d8c1a03 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupExceptionResponse.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupExceptionResponse.java @@ -22,24 +22,24 @@ package org.onap.so.adapters.vnfrest; import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.openstack.exceptions.MsoExceptionCategory; @XmlRootElement(name = "volumeGroupException") public class VolumeGroupExceptionResponse extends VfModuleExceptionResponse { - // Exactly the same as a VfModuleExceptionResponse + // Exactly the same as a VfModuleExceptionResponse - private static final long serialVersionUID = 1168681288205898800L; + private static final long serialVersionUID = 1168681288205898800L; - public VolumeGroupExceptionResponse() { - super(); - } + public VolumeGroupExceptionResponse() { + super(); + } - public VolumeGroupExceptionResponse(String message) { - super(message); - } + public VolumeGroupExceptionResponse(String message) { + super(message); + } - public VolumeGroupExceptionResponse(String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { - super(message, category, rolledBack, messageid); - } + public VolumeGroupExceptionResponse(String message, MsoExceptionCategory category, boolean rolledBack, + String messageid) { + super(message, category, rolledBack, messageid); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupRollback.java index ea7ce582ad..4f57e7584f 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupRollback.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VolumeGroupRollback.java @@ -22,117 +22,121 @@ package org.onap.so.adapters.vnfrest; import javax.xml.bind.annotation.XmlRootElement; - import org.onap.so.entity.MsoRequest; - import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("VolumeGroupRollback") @XmlRootElement(name = "VolumeGroupRollback") public class VolumeGroupRollback { -// “volumeGroupRollback”: { -// “volumeGroupId”: “”, -// “volumeGroupStackId”: “”, -// “tenantId”: “”, -// "cloudOwnerId"" "", -// “cloudSiteId”: “”, -// “volumeGroupCreated”: TRUE|FALSE, -// “msoRequest”: { -// “requestId”: “”, -// “serviceInstanceId”: “” -// } -//}, - - private String volumeGroupId; - private String volumeGroupStackId; - private String tenantId; - private String cloudOwnerId; - private String cloudSiteId; - private boolean volumeGroupCreated = false; - private MsoRequest msoRequest; - private String messageId; - - public VolumeGroupRollback() { - } - - public VolumeGroupRollback(VolumeGroupRollback vrb, String volumeGroupStackId, String messageId) - { - this.volumeGroupId = vrb.getVolumeGroupId(); - this.volumeGroupStackId = volumeGroupStackId; - this.tenantId = vrb.getTenantId(); - this.cloudOwnerId = vrb.getCloudOwnerId(); - this.cloudSiteId = vrb.getCloudSiteId(); - this.volumeGroupCreated = vrb.isVolumeGroupCreated(); - this.msoRequest = vrb.getMsoRequest(); - this.messageId = messageId; - } - - public VolumeGroupRollback( - String volumeGroupId, - String volumeGroupStackId, - boolean volumeGroupCreated, - String tenantId, - String cloudOwnerId, - String cloudSiteId, - MsoRequest msoRequest, - String messageId) - { - super(); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupCreated = volumeGroupCreated; - this.tenantId = tenantId; - this.cloudOwnerId = cloudOwnerId; - this.cloudSiteId = cloudSiteId; - this.msoRequest = msoRequest; - this.messageId = messageId; - } - - public String getVolumeGroupId() { - return volumeGroupId; - } - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - public String getVolumeGroupStackId() { - return volumeGroupStackId; - } - public void setVolumeGroupStackId(String volumeGroupStackId) { - this.volumeGroupStackId = volumeGroupStackId; - } - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public String getCloudSiteId() { - return cloudSiteId; - } - public void setCloudSiteId(String cloudSiteId) { - this.cloudSiteId = cloudSiteId; - } - public String getCloudOwnerId() { - return cloudOwnerId; - } - public void setCloudOwnerId(String cloudOwnerId) { - this.cloudOwnerId = cloudOwnerId; - }public boolean isVolumeGroupCreated() { - return volumeGroupCreated; - } - public void setVolumeGroupCreated(boolean volumeGroupCreated) { - this.volumeGroupCreated = volumeGroupCreated; - } - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest(MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - public String getMessageId() { - return messageId; - } - public void setMessageId(String messageId) { - this.messageId = messageId; - } + // “volumeGroupRollback”: { + // “volumeGroupId”: “”, + // “volumeGroupStackId”: “”, + // “tenantId”: “”, + // "cloudOwnerId"" "", + // “cloudSiteId”: “”, + // “volumeGroupCreated”: TRUE|FALSE, + // “msoRequest”: { + // “requestId”: “”, + // “serviceInstanceId”: “” + // } + // }, + + private String volumeGroupId; + private String volumeGroupStackId; + private String tenantId; + private String cloudOwnerId; + private String cloudSiteId; + private boolean volumeGroupCreated = false; + private MsoRequest msoRequest; + private String messageId; + + public VolumeGroupRollback() {} + + public VolumeGroupRollback(VolumeGroupRollback vrb, String volumeGroupStackId, String messageId) { + this.volumeGroupId = vrb.getVolumeGroupId(); + this.volumeGroupStackId = volumeGroupStackId; + this.tenantId = vrb.getTenantId(); + this.cloudOwnerId = vrb.getCloudOwnerId(); + this.cloudSiteId = vrb.getCloudSiteId(); + this.volumeGroupCreated = vrb.isVolumeGroupCreated(); + this.msoRequest = vrb.getMsoRequest(); + this.messageId = messageId; + } + + public VolumeGroupRollback(String volumeGroupId, String volumeGroupStackId, boolean volumeGroupCreated, + String tenantId, String cloudOwnerId, String cloudSiteId, MsoRequest msoRequest, String messageId) { + super(); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupCreated = volumeGroupCreated; + this.tenantId = tenantId; + this.cloudOwnerId = cloudOwnerId; + this.cloudSiteId = cloudSiteId; + this.msoRequest = msoRequest; + this.messageId = messageId; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getCloudOwnerId() { + return cloudOwnerId; + } + + public void setCloudOwnerId(String cloudOwnerId) { + this.cloudOwnerId = cloudOwnerId; + } + + public boolean isVolumeGroupCreated() { + return volumeGroupCreated; + } + + public void setVolumeGroupCreated(boolean volumeGroupCreated) { + this.volumeGroupCreated = volumeGroupCreated; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HeatStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HeatStatus.java index dd68d37736..2d047a188a 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HeatStatus.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HeatStatus.java @@ -25,6 +25,6 @@ package org.onap.so.openstack.beans; * Enum status values to mirror the Openstack Heat stack status values */ public enum HeatStatus { - INIT, CREATED, NOTFOUND, FAILED, BUILDING, DELETING, UNKNOWN, UPDATING, UPDATED + INIT, CREATED, NOTFOUND, FAILED, BUILDING, DELETING, UNKNOWN, UPDATING, UPDATED } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HostRoute.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HostRoute.java index 228bb2c03d..431870ba9e 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HostRoute.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/HostRoute.java @@ -27,43 +27,43 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "prefix", - "nextHop" -}) +@XmlType(name = "", propOrder = {"prefix", "nextHop"}) public class HostRoute { - private String prefix; - private String nextHop; + private String prefix; + private String nextHop; - /** - * @return the prefix - */ - public String getPrefix() { - return prefix; - } - /** - * @param prefix the prefix to set - */ - public void setPrefix(String prefix) { - this.prefix = prefix; - } - /** - * @return the nextHop - */ - public String getNextHop() { - return nextHop; - } - /** - * @param nextHop the nextHop to set - */ - public void setNextHop(String nextHop) { - this.nextHop = nextHop; - } + /** + * @return the prefix + */ + public String getPrefix() { + return prefix; + } - @Override - public String toString() { - return "Host_route [prefix=" + prefix + ", nextHop=" + nextHop + "]"; - } + /** + * @param prefix the prefix to set + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + /** + * @return the nextHop + */ + public String getNextHop() { + return nextHop; + } + + /** + * @param nextHop the nextHop to set + */ + public void setNextHop(String nextHop) { + this.nextHop = nextHop; + } + + @Override + public String toString() { + return "Host_route [prefix=" + prefix + ", nextHop=" + nextHop + "]"; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/MsoTenant.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/MsoTenant.java index b06ea0e59f..df6d46cd31 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/MsoTenant.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/MsoTenant.java @@ -25,42 +25,44 @@ package org.onap.so.openstack.beans; import java.util.Map; /** - * This bean class represents the Openstack tenant properties that are - * needed by MSO. + * This bean class represents the Openstack tenant properties that are needed by MSO. * * */ public class MsoTenant { - private String tenantId; - private String tenantName; - private Map metadata; - - public MsoTenant() {} - - public MsoTenant (String id, String name, Map metadata) { - this.tenantId = id; - this.tenantName = name; - this.metadata = metadata; - } - - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getTenantName() { - return tenantName; - } - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - public Map getMetadata() { - return metadata; - } - public void setMetadata(Map metadata) { - this.metadata = metadata; - } + private String tenantId; + private String tenantName; + private Map metadata; + + public MsoTenant() {} + + public MsoTenant(String id, String name, Map metadata) { + this.tenantId = id; + this.tenantName = name; + this.metadata = metadata; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkInfo.java index 6110fa5073..722e2157e7 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkInfo.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkInfo.java @@ -32,89 +32,83 @@ import java.util.List; */ public class NetworkInfo { - // Set defaults for everything - private String name = ""; - private String id = ""; - private NetworkStatus status = NetworkStatus.UNKNOWN; - private String provider = ""; - private List vlans = new ArrayList<>(); - private List subnets = new ArrayList<>(); - private String shared = ""; - - public NetworkInfo () { - } - - public NetworkInfo (String name, NetworkStatus status) { - this.name = name; - this.id = name; // Don't have an ID, so just use name - this.status = status; - } - - public String getName() { - return name; - } - - public void setName (String name) { - this.name = name; - } - - public String getId() { - return id; - } - - public void setId (String id) { - this.id = id; - } - - public NetworkStatus getStatus() { - return status; - } - - public void setStatus (NetworkStatus status) { - this.status = status; - } - - public String getProvider() { - return provider; - } - - public void setProvider (String provider) { - this.provider = provider; - } - - public List getVlans () { - return vlans; - } - - public void setVlans (List vlans) { - this.vlans = vlans; - } - - public List getSubnets () { - return subnets; - } - - public void setSubnets (List subnets) { - this.subnets = subnets; - } - - public String getShared() { - return shared; - } - - public void setShared(String shared) { - this.shared = shared; - } - - @Override - public String toString() { - return "NetworkInfo{" + "name='" + name + '\'' + - ", id='" + id + '\'' + - ", status=" + status + - ", provider='" + provider + '\'' + - ", vlans=" + vlans + - ", subnets=" + subnets + - '}'; - } + // Set defaults for everything + private String name = ""; + private String id = ""; + private NetworkStatus status = NetworkStatus.UNKNOWN; + private String provider = ""; + private List vlans = new ArrayList<>(); + private List subnets = new ArrayList<>(); + private String shared = ""; + + public NetworkInfo() {} + + public NetworkInfo(String name, NetworkStatus status) { + this.name = name; + this.id = name; // Don't have an ID, so just use name + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public NetworkStatus getStatus() { + return status; + } + + public void setStatus(NetworkStatus status) { + this.status = status; + } + + public String getProvider() { + return provider; + } + + public void setProvider(String provider) { + this.provider = provider; + } + + public List getVlans() { + return vlans; + } + + public void setVlans(List vlans) { + this.vlans = vlans; + } + + public List getSubnets() { + return subnets; + } + + public void setSubnets(List subnets) { + this.subnets = subnets; + } + + public String getShared() { + return shared; + } + + public void setShared(String shared) { + this.shared = shared; + } + + @Override + public String toString() { + return "NetworkInfo{" + "name='" + name + '\'' + ", id='" + id + '\'' + ", status=" + status + ", provider='" + + provider + '\'' + ", vlans=" + vlans + ", subnets=" + subnets + '}'; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkRollback.java index e95c564f27..924ed8857e 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkRollback.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkRollback.java @@ -23,135 +23,141 @@ package org.onap.so.openstack.beans; import java.io.Serializable; import java.util.List; - import org.onap.so.entity.MsoRequest; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; /** - * Javabean representing the rollback criteria following a "Create Network" - * or "Update Network" operation. This structure can be passed back to the - * "Rollback Network" operation to undo the effects of the create/update. + * Javabean representing the rollback criteria following a "Create Network" or "Update Network" operation. This + * structure can be passed back to the "Rollback Network" operation to undo the effects of the create/update. * - * Once a network is created, the only possible update through MSO is to - * the set of VLANs supported by the network. The vlans attribute of the - * rollback object contains the previous VLANs before update. + * Once a network is created, the only possible update through MSO is to the set of VLANs supported by the network. The + * vlans attribute of the rollback object contains the previous VLANs before update. * * */ @JsonInclude(Include.NON_EMPTY) -public class NetworkRollback implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 11949663223019185L; - private String networkId; - private String neutronNetworkId; - private String networkStackId; - private String tenantId; - private String cloudId; - private String networkType; - private String modelCustomizationUuid; - private boolean networkCreated = false; - // Previous values for updates - private String networkName = null; - private String physicalNetwork = null; - private List vlans = null; - private MsoRequest msoRequest; - - public String getNetworkId() { - return networkId; - } - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNeutronNetworkId() { - return neutronNetworkId; - } - public void setNeutronNetworkId(String neutronNetworkId) { - this.neutronNetworkId = neutronNetworkId; - } - - public String getNetworkStackId() { - return networkStackId; - } - public void setNetworkStackId(String networkStackId) { - this.networkStackId = networkStackId; - } - public String getTenantId() { - return tenantId; - } - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public String getCloudId() { - return cloudId; - } - public void setCloudId(String cloudId) { - this.cloudId = cloudId; - } - - public String getNetworkType() { - return networkType; - } - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public boolean getNetworkCreated() { - return networkCreated; - } - public void setNetworkCreated(boolean networkCreated) { - this.networkCreated = networkCreated; - } - - public String getNetworkName() { - return networkName; - } - public void setNetworkName(String networkName) { - this.networkName = networkName; - } - - public String getPhysicalNetwork() { - return physicalNetwork; - } - public void setPhysicalNetwork(String physicalNetwork) { - this.physicalNetwork = physicalNetwork; - } - - public List getVlans () { - return vlans; - } - public void setVlans (List vlans) { - this.vlans = vlans; - } - - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest (MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - - @Override - public String toString() { - return "NetworkRollback [networkId=" + networkId - + ", neutronNetworkId=" + neutronNetworkId + ", networkStackId=" - + networkStackId + ", tenantId=" + tenantId + ", cloudId=" - + cloudId + ", networkType=" + networkType - + ", networkCreated=" + networkCreated + ", networkName=" + networkName - + ", physicalNetwork=" + physicalNetwork + "]"; - } +public class NetworkRollback implements Serializable { + /** + * + */ + private static final long serialVersionUID = 11949663223019185L; + private String networkId; + private String neutronNetworkId; + private String networkStackId; + private String tenantId; + private String cloudId; + private String networkType; + private String modelCustomizationUuid; + private boolean networkCreated = false; + // Previous values for updates + private String networkName = null; + private String physicalNetwork = null; + private List vlans = null; + private MsoRequest msoRequest; + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getCloudId() { + return cloudId; + } + + public void setCloudId(String cloudId) { + this.cloudId = cloudId; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public boolean getNetworkCreated() { + return networkCreated; + } + + public void setNetworkCreated(boolean networkCreated) { + this.networkCreated = networkCreated; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public String getPhysicalNetwork() { + return physicalNetwork; + } + + public void setPhysicalNetwork(String physicalNetwork) { + this.physicalNetwork = physicalNetwork; + } + + public List getVlans() { + return vlans; + } + + public void setVlans(List vlans) { + this.vlans = vlans; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @Override + public String toString() { + return "NetworkRollback [networkId=" + networkId + ", neutronNetworkId=" + neutronNetworkId + + ", networkStackId=" + networkStackId + ", tenantId=" + tenantId + ", cloudId=" + cloudId + + ", networkType=" + networkType + ", networkCreated=" + networkCreated + ", networkName=" + networkName + + ", physicalNetwork=" + physicalNetwork + "]"; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkStatus.java index b7b1366562..74b6e6bb9c 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkStatus.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/NetworkStatus.java @@ -22,10 +22,9 @@ package org.onap.so.openstack.beans; /** - * Enum status values to mirror the Openstack Neutron - * network status values + * Enum status values to mirror the Openstack Neutron network status values */ public enum NetworkStatus { - NOTFOUND, ACTIVE, DOWN, BUILD, ERROR, UNKNOWN + NOTFOUND, ACTIVE, DOWN, BUILD, ERROR, UNKNOWN } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java index ca3a9c5a8d..565ade770a 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java @@ -26,52 +26,56 @@ import org.apache.commons.lang3.builder.EqualsBuilder; public class Pool implements Serializable { - private String start; - private String end; - private static final long serialVersionUID = 768026109321305392L; + private String start; + private String end; + private static final long serialVersionUID = 768026109321305392L; - /** - * @return the start - */ - public String getStart() { - return start; - } - /** - * @param start the start to set - */ - public void setStart(String start) { - this.start = start; - } - /** - * @return the end - */ - public String getEnd() { - return end; - } - /** - * @param end the end to set - */ - public void setEnd(String end) { - this.end = end; - } + /** + * @return the start + */ + public String getStart() { + return start; + } + + /** + * @param start the start to set + */ + public void setStart(String start) { + this.start = start; + } + + /** + * @return the end + */ + public String getEnd() { + return end; + } + + /** + * @param end the end to set + */ + public void setEnd(String end) { + this.end = end; + } + + @Override + public String toString() { + return "Allocation_pool [start=" + start + ", end=" + end + "]"; + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof Pool)) { + return false; + } + Pool castOther = (Pool) other; + return new EqualsBuilder().append(start, castOther.start).append(end, castOther.end).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(start).append(end).toHashCode(); + } - @Override - public String toString() { - return "Allocation_pool [start=" + start + ", end=" + end + "]"; - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof Pool)) { - return false; - } - Pool castOther = (Pool) other; - return new EqualsBuilder().append(start, castOther.start).append(end, castOther.end).isEquals(); - } - @Override - public int hashCode() { - return new HashCodeBuilder().append(start).append(end).toHashCode(); - } - } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/RouteTarget.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/RouteTarget.java index fcea8796c2..ab816ddfe5 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/RouteTarget.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/RouteTarget.java @@ -21,42 +21,41 @@ package org.onap.so.openstack.beans; import java.io.Serializable; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "routeTarget", - "routeTargetRole" -}) -public class RouteTarget implements Serializable{ - - /** - * - */ - private static final long serialVersionUID = 5425083030715789604L; - private String routeTarget; - private String routeTargetRole; - - public String getRouteTarget() { - return routeTarget; - } - public void setRouteTarget(String routeTarget) { - this.routeTarget = routeTarget; - } - public String getRouteTargetRole() { - return routeTargetRole; - } - public void setRouteTargetRole(String routeTargetRole) { - this.routeTargetRole = routeTargetRole; - } - - - @Override - public String toString() { - return "RouteTarget [routeTarget=" + routeTarget + ", routeTargetRole=" + routeTargetRole + "]"; - } - +@XmlType(name = "", propOrder = {"routeTarget", "routeTargetRole"}) +public class RouteTarget implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 5425083030715789604L; + private String routeTarget; + private String routeTargetRole; + + public String getRouteTarget() { + return routeTarget; + } + + public void setRouteTarget(String routeTarget) { + this.routeTarget = routeTarget; + } + + public String getRouteTargetRole() { + return routeTargetRole; + } + + public void setRouteTargetRole(String routeTargetRole) { + this.routeTargetRole = routeTargetRole; + } + + + @Override + public String toString() { + return "RouteTarget [routeTarget=" + routeTarget + ", routeTargetRole=" + routeTargetRole + "]"; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/StackInfo.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/StackInfo.java index 028ec9ec8d..76d3667632 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/StackInfo.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/StackInfo.java @@ -31,79 +31,80 @@ import java.util.Map; */ public class StackInfo { - // Set defaults for everything - private String name = ""; - private String canonicalName = ""; - private HeatStatus status = HeatStatus.UNKNOWN; - private String statusMessage = ""; - private Map outputs = new HashMap<>(); - private Map parameters = new HashMap<>(); - - public StackInfo () { - } - - public StackInfo (String name, HeatStatus status, String statusMessage, Map outputs) { - this.name = name; - this.canonicalName = name; // Don't have an ID, so just use name - - this.status = status; - if (statusMessage != null) this.statusMessage = statusMessage; - if (outputs != null) this.outputs = outputs; - } - - public StackInfo (String name, HeatStatus status) { - this.name = name; - this.canonicalName = name; // Don't have an ID, so just use name - this.status = status; - } - - public String getName() { - return name; - } - - public void setName (String name) { - this.name = name; - } - - public String getCanonicalName() { - return canonicalName; - } - - public void setCanonicalName (String name) { - this.canonicalName = name; - } - - public HeatStatus getStatus() { - return status; - } - - public void setStatus (HeatStatus status) { - this.status = status; - } - - public String getStatusMessage() { - return statusMessage; - } - - public void setStatusMessage (String statusMessage) { - this.statusMessage = statusMessage; - } - - public Map getOutputs () { - return outputs; - } - - public void setOutputs (Map outputs) { - this.outputs = outputs; - } - - public Map getParameters () { - return parameters; - } - - public void setParameters (Map parameters) { - this.parameters = parameters; - } - + // Set defaults for everything + private String name = ""; + private String canonicalName = ""; + private HeatStatus status = HeatStatus.UNKNOWN; + private String statusMessage = ""; + private Map outputs = new HashMap<>(); + private Map parameters = new HashMap<>(); + + public StackInfo() {} + + public StackInfo(String name, HeatStatus status, String statusMessage, Map outputs) { + this.name = name; + this.canonicalName = name; // Don't have an ID, so just use name + + this.status = status; + if (statusMessage != null) + this.statusMessage = statusMessage; + if (outputs != null) + this.outputs = outputs; + } + + public StackInfo(String name, HeatStatus status) { + this.name = name; + this.canonicalName = name; // Don't have an ID, so just use name + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCanonicalName() { + return canonicalName; + } + + public void setCanonicalName(String name) { + this.canonicalName = name; + } + + public HeatStatus getStatus() { + return status; + } + + public void setStatus(HeatStatus status) { + this.status = status; + } + + public String getStatusMessage() { + return statusMessage; + } + + public void setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + } + + public Map getOutputs() { + return outputs; + } + + public void setOutputs(Map outputs) { + this.outputs = outputs; + } + + public Map getParameters() { + return parameters; + } + + public void setParameters(Map parameters) { + this.parameters = parameters; + } + } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Subnet.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Subnet.java index 4fcf46975d..8f55f7b262 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Subnet.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Subnet.java @@ -24,64 +24,62 @@ package org.onap.so.openstack.beans; import java.io.Serializable; import java.util.List; - import javax.xml.bind.annotation.XmlTransient; public class Subnet implements Serializable { - /** - * - */ - private static final long serialVersionUID = -530027355187604839L; + /** + * + */ + private static final long serialVersionUID = -530027355187604839L; - private String subnetName; - - private String neutronId; + private String subnetName; - private String subnetId; // value from aai + private String neutronId; - private String cidr; //Only field required + private String subnetId; // value from aai + + private String cidr; // Only field required private String gatewayIp; - private String ipVersion="4"; + private String ipVersion = "4"; + + private Boolean enableDHCP = false; - private Boolean enableDHCP=false; - - private Boolean addrFromStart=true; + private Boolean addrFromStart = true; private List hostRoutes; private List allocationPools; private List dnsNameServers; - + private Integer subnetSequence; public Integer getSubnetSequence() { - return subnetSequence; - } + return subnetSequence; + } + + public void setSubnetSequence(Integer subnetSequence) { + this.subnetSequence = subnetSequence; + } - public void setSubnetSequence(Integer subnetSequence) { - this.subnetSequence = subnetSequence; - } + public Subnet() {} - public Subnet () { + public String getSubnetName() { + return subnetName; } - public String getSubnetName() { - return subnetName; - } + public void setSubnetName(String subnetName) { + this.subnetName = subnetName; + } - public void setSubnetName(String subnetName) { - this.subnetName = subnetName; - } - - public List getAllocationPools() { - return allocationPools; - } + public List getAllocationPools() { + return allocationPools; + } - /** + /** * @return the cidr */ public String getCidr() { @@ -100,15 +98,15 @@ public class Subnet implements Serializable { return enableDHCP; } - public Boolean getAddrFromStart() { - return addrFromStart; - } + public Boolean getAddrFromStart() { + return addrFromStart; + } - public void setAddrFromStart(Boolean addrFromStart) { - this.addrFromStart = addrFromStart; - } + public void setAddrFromStart(Boolean addrFromStart) { + this.addrFromStart = addrFromStart; + } - /** + /** * @return the gw */ public String getGatewayIp() { @@ -145,79 +143,71 @@ public class Subnet implements Serializable { } public void setAllocationPools(List allocationPools) { - this.allocationPools = allocationPools; - } + this.allocationPools = allocationPools; + } /** - * @param cidr - * the cidr to set + * @param cidr the cidr to set */ public void setCidr(String cidr) { this.cidr = cidr; } /** - * @param dnsNames - * the dnsNames to set + * @param dnsNames the dnsNames to set */ public void setDnsNameServers(List dnsNameServers) { this.dnsNameServers = dnsNameServers; } /** - * @param enableDHCP - * the enableDHCP to set + * @param enableDHCP the enableDHCP to set */ public void setEnableDHCP(Boolean enableDHCP) { this.enableDHCP = enableDHCP; } /** - * @param gw - * the gw to set + * @param gw the gw to set */ public void setGatewayIp(String gatewayIp) { this.gatewayIp = gatewayIp; } /** - * @param hostRoutes - * the hostRoutes to set + * @param hostRoutes the hostRoutes to set */ public void setHostRoutes(List hostRoutes) { this.hostRoutes = hostRoutes; } /** - * @param neutronId - * the id to set + * @param neutronId the id to set */ public void setNeutronId(String neutronId) { this.neutronId = neutronId; } /** - * @param ipversion - * the ipversion to set + * @param ipversion the ipversion to set */ public void setIpVersion(String ipVersion) { this.ipVersion = ipVersion; } /** - * @param name - * the name to set + * @param name the name to set */ public void setSubnetId(String subnetId) { this.subnetId = subnetId; } - @Override - public String toString() { - return "Subnet [subnetName=" + subnetName + ", neutronId=" + neutronId + ", subnetId=" + subnetId + ", cidr=" - + cidr + ", gatewayIp=" + gatewayIp + ", ipVersion=" + ipVersion + ", enableDHCP=" + enableDHCP - + ", addrFromStart=" + addrFromStart + ", hostRoutes=" + hostRoutes + ", allocationPools=" - + allocationPools + ", dnsNameServers=" + dnsNameServers + "]"; - } + @Override + public String toString() { + return "Subnet [subnetName=" + subnetName + ", neutronId=" + neutronId + ", subnetId=" + subnetId + ", cidr=" + + cidr + ", gatewayIp=" + gatewayIp + ", ipVersion=" + ipVersion + ", enableDHCP=" + enableDHCP + + ", addrFromStart=" + addrFromStart + ", hostRoutes=" + hostRoutes + ", allocationPools=" + + allocationPools + ", dnsNameServers=" + dnsNameServers + "]"; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfRollback.java index 1c7164a0a0..c95c0b77fb 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfRollback.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfRollback.java @@ -21,204 +21,229 @@ package org.onap.so.openstack.beans; import org.onap.so.entity.MsoRequest; + /** - * Javabean representing the rollback criteria following a "Create VNF" - * operation. This structure can be passed back to the "Rollback VNF" - * operation to undo the effects of the create. + * Javabean representing the rollback criteria following a "Create VNF" operation. This structure can be passed back to + * the "Rollback VNF" operation to undo the effects of the create. * * */ public class VnfRollback { - private String vnfId; - private String tenantId; - private String cloudOwner; - private String cloudSiteId; - private boolean tenantCreated = false; - private boolean vnfCreated = false; - private MsoRequest msoRequest; - private String volumeGroupName; - private String volumeGroupId; - private String requestType; - private String volumeGroupHeatStackId; - private String baseGroupHeatStackId; - private boolean isBase = false; - private String vfModuleStackId; - private String modelCustomizationUuid; //NOTE: this is the vfModule's modelCustomizationUuid - private String mode = "HEAT"; - - public VnfRollback() {} - - /** - * For backwards compatibility... orchestration mode defaults to HEAT - * - * @param vnfId - * @param tenantId - * @param cloudOwner - * @param cloudSiteId - * @param tenantCreated - * @param vnfCreated - * @param msoRequest - * @param volumeGroupName - * @param volumeGroupId - * @param requestType - * @param modelCustomizationUuid - */ - public VnfRollback(String vnfId, String tenantId, String cloudOwner, String cloudSiteId, - boolean tenantCreated, boolean vnfCreated, - MsoRequest msoRequest, - String volumeGroupName, String volumeGroupId, String requestType, String modelCustomizationUuid) { - super(); - this.vnfId = vnfId; - this.tenantId = tenantId; - this.cloudOwner = cloudOwner; - this.cloudSiteId = cloudSiteId; - this.tenantCreated = tenantCreated; - this.vnfCreated = vnfCreated; - this.msoRequest = msoRequest; - this.volumeGroupName = volumeGroupName; - this.volumeGroupId = volumeGroupId; - this.requestType = requestType; - this.modelCustomizationUuid = modelCustomizationUuid; - } - - /** - * - * @param vnfId - * @param tenantId - * @param cloudOwner - * @param cloudSiteId - * @param tenantCreated - * @param vnfCreated - * @param msoRequest - * @param volumeGroupName - * @param volumeGroupId - * @param requestType - * @param modelCustomizationUuid - */ - public VnfRollback(String vnfId, String tenantId, String cloudOwner, String cloudSiteId, - boolean tenantCreated, boolean vnfCreated, - MsoRequest msoRequest, String volumeGroupName, String volumeGroupId, - String requestType, String modelCustomizationUuid, String orchestrationMode) { - super(); - this.vnfId = vnfId; - this.tenantId = tenantId; - this.cloudOwner = cloudOwner; - this.cloudSiteId = cloudSiteId; - this.tenantCreated = tenantCreated; - this.vnfCreated = vnfCreated; - this.msoRequest = msoRequest; - this.volumeGroupName = volumeGroupName; - this.volumeGroupId = volumeGroupId; - this.requestType = requestType; - this.modelCustomizationUuid = modelCustomizationUuid; - this.mode = orchestrationMode; - } - - public String getVnfId() { - return vnfId; - } - public void setVnfId(String vnfId) { - this.vnfId = vnfId; - } - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - public String getCloudSiteId() { - return cloudSiteId; - } - public void setCloudSiteId(String cloudId) { - this.cloudSiteId = cloudId; - } + private String vnfId; + private String tenantId; + private String cloudOwner; + private String cloudSiteId; + private boolean tenantCreated = false; + private boolean vnfCreated = false; + private MsoRequest msoRequest; + private String volumeGroupName; + private String volumeGroupId; + private String requestType; + private String volumeGroupHeatStackId; + private String baseGroupHeatStackId; + private boolean isBase = false; + private String vfModuleStackId; + private String modelCustomizationUuid; // NOTE: this is the vfModule's modelCustomizationUuid + private String mode = "HEAT"; + + public VnfRollback() {} + + /** + * For backwards compatibility... orchestration mode defaults to HEAT + * + * @param vnfId + * @param tenantId + * @param cloudOwner + * @param cloudSiteId + * @param tenantCreated + * @param vnfCreated + * @param msoRequest + * @param volumeGroupName + * @param volumeGroupId + * @param requestType + * @param modelCustomizationUuid + */ + public VnfRollback(String vnfId, String tenantId, String cloudOwner, String cloudSiteId, boolean tenantCreated, + boolean vnfCreated, MsoRequest msoRequest, String volumeGroupName, String volumeGroupId, String requestType, + String modelCustomizationUuid) { + super(); + this.vnfId = vnfId; + this.tenantId = tenantId; + this.cloudOwner = cloudOwner; + this.cloudSiteId = cloudSiteId; + this.tenantCreated = tenantCreated; + this.vnfCreated = vnfCreated; + this.msoRequest = msoRequest; + this.volumeGroupName = volumeGroupName; + this.volumeGroupId = volumeGroupId; + this.requestType = requestType; + this.modelCustomizationUuid = modelCustomizationUuid; + } + + /** + * + * @param vnfId + * @param tenantId + * @param cloudOwner + * @param cloudSiteId + * @param tenantCreated + * @param vnfCreated + * @param msoRequest + * @param volumeGroupName + * @param volumeGroupId + * @param requestType + * @param modelCustomizationUuid + */ + public VnfRollback(String vnfId, String tenantId, String cloudOwner, String cloudSiteId, boolean tenantCreated, + boolean vnfCreated, MsoRequest msoRequest, String volumeGroupName, String volumeGroupId, String requestType, + String modelCustomizationUuid, String orchestrationMode) { + super(); + this.vnfId = vnfId; + this.tenantId = tenantId; + this.cloudOwner = cloudOwner; + this.cloudSiteId = cloudSiteId; + this.tenantCreated = tenantCreated; + this.vnfCreated = vnfCreated; + this.msoRequest = msoRequest; + this.volumeGroupName = volumeGroupName; + this.volumeGroupId = volumeGroupId; + this.requestType = requestType; + this.modelCustomizationUuid = modelCustomizationUuid; + this.mode = orchestrationMode; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudId) { + this.cloudSiteId = cloudId; + } + public String getCloudOwner() { return cloudOwner; } + public void setCloudOwner(String cloudOwner) { this.cloudOwner = cloudOwner; } - public boolean getTenantCreated() { - return tenantCreated; - } - public void setTenantCreated(boolean tenantCreated) { - this.tenantCreated = tenantCreated; - } - public boolean getVnfCreated() { - return vnfCreated; - } - public void setVnfCreated(boolean vnfCreated) { - this.vnfCreated = vnfCreated; - } - public MsoRequest getMsoRequest() { - return msoRequest; - } - public void setMsoRequest (MsoRequest msoRequest) { - this.msoRequest = msoRequest; - } - public String getVolumeGroupName() { - return this.volumeGroupName; - } - public void setVolumeGroupName(String volumeGroupName) { - this.volumeGroupName = volumeGroupName; - } - public String getVolumeGroupId() { - return this.volumeGroupId; - } - public void setVolumeGroupId(String volumeGroupId) { - this.volumeGroupId = volumeGroupId; - } - public String getRequestType() { - return this.requestType; - } - public void setRequestType(String requestType) { - this.requestType = requestType; - } - public String getVolumeGroupHeatStackId() { - return this.volumeGroupHeatStackId; - } - public void setVolumeGroupHeatStackId(String volumeGroupHeatStackId) { - this.volumeGroupHeatStackId = volumeGroupHeatStackId; - } - - public String getBaseGroupHeatStackId() { - return this.baseGroupHeatStackId; - } - public void setBaseGroupHeatStackId(String baseGroupHeatStackId) { - this.baseGroupHeatStackId = baseGroupHeatStackId; - } - - public boolean isBase() { - return this.isBase; - } - public void setIsBase(boolean isBase) { - this.isBase = isBase; - } - public String getVfModuleStackId() { - return this.vfModuleStackId; - } - public void setVfModuleStackId(String vfModuleStackId) { - this.vfModuleStackId = vfModuleStackId; - } - public String getModelCustomizationUuid() { - return this.modelCustomizationUuid; - } - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - public String getMode() { - return this.mode; - } - public void setMode(String mode) { - this.mode = mode; - } - @Override + + public boolean getTenantCreated() { + return tenantCreated; + } + + public void setTenantCreated(boolean tenantCreated) { + this.tenantCreated = tenantCreated; + } + + public boolean getVnfCreated() { + return vnfCreated; + } + + public void setVnfCreated(boolean vnfCreated) { + this.vnfCreated = vnfCreated; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + public String getVolumeGroupName() { + return this.volumeGroupName; + } + + public void setVolumeGroupName(String volumeGroupName) { + this.volumeGroupName = volumeGroupName; + } + + public String getVolumeGroupId() { + return this.volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getRequestType() { + return this.requestType; + } + + public void setRequestType(String requestType) { + this.requestType = requestType; + } + + public String getVolumeGroupHeatStackId() { + return this.volumeGroupHeatStackId; + } + + public void setVolumeGroupHeatStackId(String volumeGroupHeatStackId) { + this.volumeGroupHeatStackId = volumeGroupHeatStackId; + } + + public String getBaseGroupHeatStackId() { + return this.baseGroupHeatStackId; + } + + public void setBaseGroupHeatStackId(String baseGroupHeatStackId) { + this.baseGroupHeatStackId = baseGroupHeatStackId; + } + + public boolean isBase() { + return this.isBase; + } + + public void setIsBase(boolean isBase) { + this.isBase = isBase; + } + + public String getVfModuleStackId() { + return this.vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public String getModelCustomizationUuid() { + return this.modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public String getMode() { + return this.mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + @Override public String toString() { - return "VnfRollback: owner=" + cloudOwner + ", cloud=" + cloudSiteId + ", tenant=" + tenantId + - ", vnf=" + vnfId + ", tenantCreated=" + tenantCreated + - ", vnfCreated=" + vnfCreated + ", requestType = " + requestType - + ", modelCustomizationUuid=" + this.modelCustomizationUuid - + ", mode=" + mode; - } -} \ No newline at end of file + return "VnfRollback: owner=" + cloudOwner + ", cloud=" + cloudSiteId + ", tenant=" + tenantId + ", vnf=" + vnfId + + ", tenantCreated=" + tenantCreated + ", vnfCreated=" + vnfCreated + ", requestType = " + requestType + + ", modelCustomizationUuid=" + this.modelCustomizationUuid + ", mode=" + mode; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfStatus.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfStatus.java index 9f1ae8813d..e657dfe3bc 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfStatus.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/VnfStatus.java @@ -25,6 +25,6 @@ package org.onap.so.openstack.beans; * Enum status values to mirror the Openstack Heat stack status values */ public enum VnfStatus { - ACTIVE, FAILED, NOTFOUND, UNKNOWN + ACTIVE, FAILED, NOTFOUND, UNKNOWN } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoAdapterException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoAdapterException.java index 31c4727934..ab93d4cca2 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoAdapterException.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoAdapterException.java @@ -27,19 +27,18 @@ package org.onap.so.openstack.exceptions; * * */ -public class MsoAdapterException extends MsoException -{ - private static final long serialVersionUID = 1L; - - // Constructor to create a new MsoException instance - public MsoAdapterException (String message) { - super(message); - super.category = MsoExceptionCategory.INTERNAL; - } +public class MsoAdapterException extends MsoException { + private static final long serialVersionUID = 1L; - // Constructor to wrap a nested exception - public MsoAdapterException (String message, Throwable t) { - super(message, t); - super.category = MsoExceptionCategory.INTERNAL; - } + // Constructor to create a new MsoException instance + public MsoAdapterException(String message) { + super(message); + super.category = MsoExceptionCategory.INTERNAL; + } + + // Constructor to wrap a nested exception + public MsoAdapterException(String message, Throwable t) { + super(message, t); + super.category = MsoExceptionCategory.INTERNAL; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFound.java index 31f3f6f7dd..5892d00573 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFound.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFound.java @@ -34,23 +34,24 @@ public class MsoCloudIdentityNotFound extends MsoException { /** * Default constructor (needed for BPEL/JAXB) */ - public MsoCloudIdentityNotFound () { + public MsoCloudIdentityNotFound() { super("Cloud Identity not found"); - super.category=MsoExceptionCategory.USERDATA; + super.category = MsoExceptionCategory.USERDATA; } /** * Constructor to create a new MsoOpenstackException instance + * * @param cloudSite the cloud site */ - public MsoCloudIdentityNotFound (String cloudIdentity) { + public MsoCloudIdentityNotFound(String cloudIdentity) { // Set the detailed error as the Exception 'message' super("Cloud Identity [" + cloudIdentity + "] not found"); - super.category=MsoExceptionCategory.USERDATA; + super.category = MsoExceptionCategory.USERDATA; } @Override - public String toString () { + public String toString() { return getMessage(); } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFound.java index ceb08d8ccb..1d30aa2b94 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFound.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFound.java @@ -34,23 +34,24 @@ public class MsoCloudSiteNotFound extends MsoException { /** * Default constructor (needed for BPEL/JAXB) */ - public MsoCloudSiteNotFound () { + public MsoCloudSiteNotFound() { super("Cloud site not found"); - super.category=MsoExceptionCategory.USERDATA; + super.category = MsoExceptionCategory.USERDATA; } /** * Constructor to create a new MsoOpenstackException instance + * * @param cloudSite the cloud site */ - public MsoCloudSiteNotFound (String cloudSite) { + public MsoCloudSiteNotFound(String cloudSite) { // Set the detailed error as the Exception 'message' super("Cloud Site [" + cloudSite + "] not found"); - super.category=MsoExceptionCategory.USERDATA; + super.category = MsoExceptionCategory.USERDATA; } @Override - public String toString () { + public String toString() { return getMessage(); } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoException.java index 625914e820..901575d995 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoException.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoException.java @@ -22,45 +22,47 @@ package org.onap.so.openstack.exceptions; -public abstract class MsoException extends Exception -{ - private static final long serialVersionUID = 1L; +public abstract class MsoException extends Exception { + private static final long serialVersionUID = 1L; - protected MsoExceptionCategory category = MsoExceptionCategory.INTERNAL; - protected String context = null; - - protected MsoException (String message) { - super(message); - } - - protected MsoException (String message, Throwable t) { - super(message,t); - } - - public MsoExceptionCategory getCategory() { - return category; - } - public void setCategory (MsoExceptionCategory category) { - this.category = category; - } - - public String getContext () { - return context; - } - public void setContext (String context) { - this.context = context; - } - public void addContext (String ctx) { - if (this.context != null) - this.context = ctx + ":" + this.context; - else - this.context = ctx; - } - - public String getContextMessage () { - if (this.context == null) - return getMessage(); - else - return "[" + context + "] " + getMessage(); - } + protected MsoExceptionCategory category = MsoExceptionCategory.INTERNAL; + protected String context = null; + + protected MsoException(String message) { + super(message); + } + + protected MsoException(String message, Throwable t) { + super(message, t); + } + + public MsoExceptionCategory getCategory() { + return category; + } + + public void setCategory(MsoExceptionCategory category) { + this.category = category; + } + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + public void addContext(String ctx) { + if (this.context != null) + this.context = ctx + ":" + this.context; + else + this.context = ctx; + } + + public String getContextMessage() { + if (this.context == null) + return getMessage(); + else + return "[" + context + "] " + getMessage(); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoExceptionCategory.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoExceptionCategory.java index ed57488301..735f49d486 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoExceptionCategory.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoExceptionCategory.java @@ -23,5 +23,5 @@ package org.onap.so.openstack.exceptions; public enum MsoExceptionCategory { - OPENSTACK, IO, INTERNAL, USERDATA + OPENSTACK, IO, INTERNAL, USERDATA } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoHeatNotFoundException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoHeatNotFoundException.java index dda7384d9e..026a06094f 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoHeatNotFoundException.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoHeatNotFoundException.java @@ -25,11 +25,11 @@ package org.onap.so.openstack.exceptions; */ public class MsoHeatNotFoundException extends MsoException { /** - * Serialization id. - */ - private static final long serialVersionUID = 6547134336163166841L; + * Serialization id. + */ + private static final long serialVersionUID = 6547134336163166841L; - /** + /** * Default constructor (needed for BPEL/JAXB) */ public MsoHeatNotFoundException() { @@ -39,6 +39,7 @@ public class MsoHeatNotFoundException extends MsoException { /** * Constructor to create a new MsoHeatNotFoundException instance + * * @param heat the heat parameter */ public MsoHeatNotFoundException(String heat) { diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoIOException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoIOException.java index 35f2445d41..33377f447b 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoIOException.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoIOException.java @@ -24,30 +24,31 @@ package org.onap.so.openstack.exceptions; /** * I/O exception */ -public class MsoIOException extends MsoException -{ +public class MsoIOException extends MsoException { - /** + /** * Serialization id. */ private static final long serialVersionUID = 6752445132721635760L; /** * Basic constructor with message + * + * @param message the error message + */ + public MsoIOException(String message) { + super(message); + super.category = MsoExceptionCategory.IO; + } + + /** + * Constructor to wrap a nested exception + * * @param message the error message + * @param t the cause */ - public MsoIOException (String message) { - super(message); - super.category = MsoExceptionCategory.IO; - } - - /** - * Constructor to wrap a nested exception - * @param message the error message - * @param t the cause - */ - public MsoIOException (String message, Throwable t) { - super (message, t); - super.category = MsoExceptionCategory.IO; - } + public MsoIOException(String message, Throwable t) { + super(message, t); + super.category = MsoExceptionCategory.IO; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExists.java index dd7817d310..ddbafa7307 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExists.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExists.java @@ -24,12 +24,12 @@ package org.onap.so.openstack.exceptions; public class MsoNetworkAlreadyExists extends MsoOpenstackException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + // Constructor to create a new MsoOpenstackException instance + public MsoNetworkAlreadyExists(String stack, String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(409, "Conflict", "Stack " + stack + " already exists in Tenant " + tenant + " in Cloud " + cloud); + } - // Constructor to create a new MsoOpenstackException instance - public MsoNetworkAlreadyExists (String stack, String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(409, "Conflict", "Stack " + stack + " already exists in Tenant " + tenant + " in Cloud " + cloud); - } - } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkNotFound.java index 7306142cd0..ca8294196f 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkNotFound.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoNetworkNotFound.java @@ -24,12 +24,12 @@ package org.onap.so.openstack.exceptions; public class MsoNetworkNotFound extends MsoOpenstackException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + // Constructor to create a new MsoOpenstackException instance + public MsoNetworkNotFound(String networkId, String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(404, "Not Found", "Network " + networkId + " does not exist in Cloud/Tenant " + cloud + "/" + tenant); + } - // Constructor to create a new MsoOpenstackException instance - public MsoNetworkNotFound (String networkId, String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(404, "Not Found", "Network " + networkId + " does not exist in Cloud/Tenant " + cloud + "/" + tenant); - } - } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoOpenstackException.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoOpenstackException.java index 1410650dd2..f5b6c7b4f9 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoOpenstackException.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoOpenstackException.java @@ -24,57 +24,54 @@ package org.onap.so.openstack.exceptions; /** * OpenStack exception. */ -public class MsoOpenstackException extends MsoException -{ - - /** +public class MsoOpenstackException extends MsoException { + + /** * Serialization id. */ private static final long serialVersionUID = 3313636124141766495L; - + private int statusCode; - private String statusMessage; - private String errorDetail; + private String statusMessage; + private String errorDetail; + + /** + * Constructor to create a new MsoOpenstackException instance + * + * @param code the error code + * @param message the error message + * @param detail error details + */ + public MsoOpenstackException(int code, String message, String detail) { + // Set the detailed error as the Exception 'message' + super(detail); + super.category = MsoExceptionCategory.OPENSTACK; + + this.statusCode = code; + this.statusMessage = message; + this.errorDetail = detail; + } - /** - * Constructor to create a new MsoOpenstackException instance - * @param code the error code - * @param message the error message - * @param detail error details - */ - public MsoOpenstackException (int code, String message, String detail) { - // Set the detailed error as the Exception 'message' - super(detail); - super.category = MsoExceptionCategory.OPENSTACK; - - this.statusCode = code; - this.statusMessage = message; - this.errorDetail = detail; - } - - /** - * Constructor to propagate the caught exception (mostly for stack trace) + /** + * Constructor to propagate the caught exception (mostly for stack trace) + * * @param code the error code * @param message the error message * @param detail error details - * @param e the cause - */ - public MsoOpenstackException (int code, String message, String detail, Exception e) { - // Set the detailed error as the Exception 'message' - super(detail, e); - super.category = MsoExceptionCategory.OPENSTACK; - - this.statusCode = code; - this.statusMessage = message; - this.errorDetail = detail; - } + * @param e the cause + */ + public MsoOpenstackException(int code, String message, String detail, Exception e) { + // Set the detailed error as the Exception 'message' + super(detail, e); + super.category = MsoExceptionCategory.OPENSTACK; + + this.statusCode = code; + this.statusMessage = message; + this.errorDetail = detail; + } - @Override - public String toString() { - return statusCode + - " " + - statusMessage + - ": " + - errorDetail; - } + @Override + public String toString() { + return statusCode + " " + statusMessage + ": " + errorDetail; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExists.java index fc98ee95ed..fec9363fd4 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExists.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExists.java @@ -24,12 +24,12 @@ package org.onap.so.openstack.exceptions; public class MsoStackAlreadyExists extends MsoOpenstackException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + // Constructor to create a new MsoOpenstackException instance + public MsoStackAlreadyExists(String stack, String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(409, "Conflict", "Stack " + stack + " already exists in Tenant " + tenant + " in Cloud " + cloud); + } - // Constructor to create a new MsoOpenstackException instance - public MsoStackAlreadyExists (String stack, String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(409, "Conflict", "Stack " + stack + " already exists in Tenant " + tenant + " in Cloud " + cloud); - } - } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackNotFound.java index 1cd6b9650a..9925b62d12 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackNotFound.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoStackNotFound.java @@ -26,19 +26,20 @@ package org.onap.so.openstack.exceptions; */ public class MsoStackNotFound extends MsoOpenstackException { - /** + /** * Serialization id. */ private static final long serialVersionUID = 7354069716354359246L; /** - * Constructor to create a new MsoOpenstackException instance. - * @param stack the stack name - * @param tenant the tenant name - * @param cloud the cloud name - */ - public MsoStackNotFound (String stack, String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(404, "Not Found", "Stack " + stack + " does not exist in Cloud/Tenant " + cloud + "/" + tenant); - } + * Constructor to create a new MsoOpenstackException instance. + * + * @param stack the stack name + * @param tenant the tenant name + * @param cloud the cloud name + */ + public MsoStackNotFound(String stack, String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(404, "Not Found", "Stack " + stack + " does not exist in Cloud/Tenant " + cloud + "/" + tenant); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExists.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExists.java index 5da32847b1..58585470a6 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExists.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExists.java @@ -24,12 +24,12 @@ package org.onap.so.openstack.exceptions; public class MsoTenantAlreadyExists extends MsoOpenstackException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + // Constructor to create a new MsoOpenstackException instance + public MsoTenantAlreadyExists(String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(409, "Conflict", "Tenant " + tenant + " already exists in Cloud " + cloud); + } - // Constructor to create a new MsoOpenstackException instance - public MsoTenantAlreadyExists (String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(409, "Conflict", "Tenant " + tenant + " already exists in Cloud " + cloud); - } - } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantNotFound.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantNotFound.java index 9b135b61b2..6f4ce1d213 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantNotFound.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/exceptions/MsoTenantNotFound.java @@ -32,12 +32,13 @@ public class MsoTenantNotFound extends MsoOpenstackException { private static final long serialVersionUID = 5640069939645577063L; /** - * Constructor to create the exception - * @param tenant the tenant id - * @param cloud the cloud id - */ - public MsoTenantNotFound (String tenant, String cloud) { - // Set the detailed error as the Exception 'message' - super(404, "Not Found", "Tenant " + tenant + " does not exist in Cloud " + cloud); - } + * Constructor to create the exception + * + * @param tenant the tenant id + * @param cloud the cloud id + */ + public MsoTenantNotFound(String tenant, String cloud) { + // Set the detailed error as the Exception 'message' + super(404, "Not Found", "Tenant " + tenant + " does not exist in Cloud " + cloud); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapAdapter.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapAdapter.java index e816646e1c..ef5d4316d7 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapAdapter.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapAdapter.java @@ -22,41 +22,43 @@ package org.onap.so.openstack.mappers; import java.util.HashMap; import java.util.Map; - import javax.xml.bind.annotation.adapters.XmlAdapter; - import org.w3c.dom.Element; public class MapAdapter extends XmlAdapter> { - @Override - public MapEntry marshal(Map v) throws Exception { + @Override + public MapEntry marshal(Map v) throws Exception { - if (v == null || v.isEmpty()) {return null;} + if (v == null || v.isEmpty()) { + return null; + } - MapEntry map = new MapEntry(); + MapEntry map = new MapEntry(); - for (String key : v.keySet()) { - map.addEntry(key, v.get(key)); - } + for (String key : v.keySet()) { + map.addEntry(key, v.get(key)); + } - return map; - } + return map; + } - @Override - public Map unmarshal(MapEntry v) throws Exception { - if (v == null) {return null;} + @Override + public Map unmarshal(MapEntry v) throws Exception { + if (v == null) { + return null; + } - Map map = new HashMap<>(v.entry.size()); + Map map = new HashMap<>(v.entry.size()); - for(MapElements entry: v.entry) { - if (entry.value instanceof Element) { - map.put(entry.key, ((Element)entry.value).getTextContent()); - } else { - map.put(entry.key, entry.value); - } - } + for (MapElements entry : v.entry) { + if (entry.value instanceof Element) { + map.put(entry.key, ((Element) entry.value).getTextContent()); + } else { + map.put(entry.key, entry.value); + } + } - return map; - } + return map; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapElements.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapElements.java index 709393bb84..d20d2b7758 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapElements.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapElements.java @@ -22,16 +22,16 @@ package org.onap.so.openstack.mappers; import javax.xml.bind.annotation.XmlElement; -public class MapElements -{ - @XmlElement public String key; - @XmlElement public Object value; +public class MapElements { + @XmlElement + public String key; + @XmlElement + public Object value; - public MapElements() {} //Required by JAXB + public MapElements() {} // Required by JAXB - public MapElements(String key, Object value) - { - this.key = key; - this.value = value; - } + public MapElements(String key, Object value) { + this.key = key; + this.value = value; + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapEntry.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapEntry.java index e6dc0e0538..489e11e111 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapEntry.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/MapEntry.java @@ -24,13 +24,13 @@ import java.util.ArrayList; import java.util.List; public class MapEntry { - - public List entry = new ArrayList<>(); - - public MapEntry() {} //Required by JAXB - public void addEntry(String key, Object value) { - entry.add(new MapElements(key, value)); - } + public List entry = new ArrayList<>(); + + public MapEntry() {} // Required by JAXB + + public void addEntry(String key, Object value) { + entry.add(new MapElements(key, value)); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/NetworkInfoMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/NetworkInfoMapper.java index aa0f17810e..279620ac31 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/NetworkInfoMapper.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/NetworkInfoMapper.java @@ -25,83 +25,79 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; - import org.javatuples.Pair; import org.onap.so.openstack.beans.NetworkInfo; import org.onap.so.openstack.beans.NetworkStatus; - import com.woorea.openstack.quantum.model.Network; import com.woorea.openstack.quantum.model.Segment; public class NetworkInfoMapper { - private final Network network; - private final Map networkStatusMap = new HashMap<>(); + private final Network network; + private final Map networkStatusMap = new HashMap<>(); + + public NetworkInfoMapper(Network network) { + this.network = network; + configureNetworkStatusMap(); + } + + /** + * Capture the data from a Neutron Network object. + * + * For MSO, there are assumptions regarding all networks. - Everything will be a provider network - All provider + * networks are VLANs - Multiple VLANs are supported, and indicated by multi-provider segments. Each will have the + * same physical network & network type "vlan". + * + * @param network + */ + public NetworkInfo map() { + final NetworkInfo info = new NetworkInfo(); + if (network == null) { + info.setStatus(NetworkStatus.NOTFOUND); + } else { + info.setName(network.getName()); + info.setId(network.getId()); + info.setStatus(this.mapStatus(network.getStatus())); + Pair, List> result = locateVlanInformation(network); + Optional value0 = result.getValue0(); + if (value0.isPresent()) { + info.setProvider(value0.get()); + } + info.setVlans(result.getValue1()); + info.setSubnets(network.getSubnets()); + } + return info; + } + + protected NetworkStatus mapStatus(String status) { + return networkStatusMap.getOrDefault(status, NetworkStatus.UNKNOWN); + } + + protected Pair, List> locateVlanInformation(Network network) { + final List vlans = new ArrayList<>(); + Optional provider = Optional.empty(); + if (network.getProviderPhysicalNetwork() != null) { + provider = Optional.ofNullable(network.getProviderPhysicalNetwork()); + if ("vlan".equals(network.getProviderNetworkType())) { + vlans.add(network.getProviderSegmentationId()); + } + } else if (network.getSegments() != null && !network.getSegments().isEmpty()) { + Segment s = network.getSegments().get(0); + provider = Optional.ofNullable(s.getProviderPhysicalNetwork()); + if ("vlan".equals(s.getProviderNetworkType())) { + for (Segment s1 : network.getSegments()) { + vlans.add(s1.getProviderSegmentationId()); + } + } + } - public NetworkInfoMapper(Network network) { - this.network = network; - configureNetworkStatusMap(); - } - - /** - * Capture the data from a Neutron Network object. - * - * For MSO, there are assumptions regarding all networks. - * - Everything will be a provider network - * - All provider networks are VLANs - * - Multiple VLANs are supported, and indicated by multi-provider segments. - * Each will have the same physical network & network type "vlan". - * - * @param network - */ - public NetworkInfo map() { - final NetworkInfo info = new NetworkInfo(); - if (network == null) { - info.setStatus(NetworkStatus.NOTFOUND); - } else { - info.setName(network.getName()); - info.setId(network.getId()); - info.setStatus(this.mapStatus(network.getStatus())); - Pair, List> result = locateVlanInformation(network); - Optional value0 = result.getValue0(); - if (value0.isPresent()) { - info.setProvider(value0.get()); - } - info.setVlans(result.getValue1()); - info.setSubnets(network.getSubnets()); - } - return info; - } + return Pair.with(provider, vlans); + } - protected NetworkStatus mapStatus(String status) { - return networkStatusMap.getOrDefault(status, NetworkStatus.UNKNOWN); - } - - protected Pair, List> locateVlanInformation(Network network) { - final List vlans = new ArrayList<>(); - Optional provider = Optional.empty(); - if (network.getProviderPhysicalNetwork() != null) { - provider = Optional.ofNullable(network.getProviderPhysicalNetwork()); - if ("vlan".equals(network.getProviderNetworkType())) { - vlans.add(network.getProviderSegmentationId()); - } - } else if (network.getSegments() != null && !network.getSegments().isEmpty()) { - Segment s = network.getSegments().get(0); - provider = Optional.ofNullable(s.getProviderPhysicalNetwork()); - if ("vlan".equals(s.getProviderNetworkType())) { - for (Segment s1 : network.getSegments()) { - vlans.add(s1.getProviderSegmentationId()); - } - } - } - - return Pair.with(provider, vlans); - } - - private void configureNetworkStatusMap() { - networkStatusMap.put("ACTIVE", NetworkStatus.ACTIVE); - networkStatusMap.put("DOWN", NetworkStatus.DOWN); - networkStatusMap.put("BUILD", NetworkStatus.BUILD); - networkStatusMap.put("ERROR", NetworkStatus.ERROR); - } + private void configureNetworkStatusMap() { + networkStatusMap.put("ACTIVE", NetworkStatus.ACTIVE); + networkStatusMap.put("DOWN", NetworkStatus.DOWN); + networkStatusMap.put("BUILD", NetworkStatus.BUILD); + networkStatusMap.put("ERROR", NetworkStatus.ERROR); + } } diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/StackInfoMapper.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/StackInfoMapper.java index 85fd6cc279..8efa48ce79 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/StackInfoMapper.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/mappers/StackInfoMapper.java @@ -24,76 +24,76 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; - import org.onap.so.openstack.beans.HeatStatus; import org.onap.so.openstack.beans.StackInfo; - import com.woorea.openstack.heat.model.Stack; import com.woorea.openstack.heat.model.Stack.Output; public class StackInfoMapper { - private final Stack stack; - private final Map heatStatusMap = new HashMap<>(); - public StackInfoMapper(Stack stack) { - this.stack = stack; - configureHeatStatusMap(); - } - - public StackInfo map() { - final StackInfo info = new StackInfo(); - if (stack == null) { - info.setStatus(HeatStatus.NOTFOUND); - } else { - info.setName(stack.getStackName()); - info.setCanonicalName(stack.getStackName() + "/" + stack.getId()); - info.setStatus(this.mapStatus(stack.getStackStatus())); - - info.setStatusMessage(stack.getStackStatusReason()); - - Optional> result = this.mapOutputToMap(stack.getOutputs()); - if (result.isPresent()) { - info.setOutputs(result.get()); - } - - info.setParameters(stack.getParameters()); - } - - return info; - } - - protected HeatStatus mapStatus(String status) { - final HeatStatus result; - if (status == null) { - result = HeatStatus.INIT; - } else { - result = heatStatusMap.getOrDefault(status, HeatStatus.UNKNOWN); - } - - return result; - } - - protected Optional> mapOutputToMap(List outputs) { - Optional> result = Optional.empty(); - if (outputs != null) { - final HashMap map = new HashMap<>(); - for (Output output : outputs) { - map.put(output.getOutputKey(), output.getOutputValue()); - } - result = Optional.of(map); - } - - return result; - } - private void configureHeatStatusMap() { - heatStatusMap.put("CREATE_IN_PROGRESS", HeatStatus.BUILDING); - heatStatusMap.put("CREATE_COMPLETE", HeatStatus.CREATED); - heatStatusMap.put("CREATE_FAILED", HeatStatus.FAILED); - heatStatusMap.put("DELETE_IN_PROGRESS", HeatStatus.DELETING); - heatStatusMap.put("DELETE_COMPLETE", HeatStatus.NOTFOUND); - heatStatusMap.put("DELETE_FAILED", HeatStatus.FAILED); - heatStatusMap.put("UPDATE_IN_PROGRESS", HeatStatus.UPDATING); - heatStatusMap.put("UPDATE_FAILED", HeatStatus.FAILED); - heatStatusMap.put("UPDATE_COMPLETE", HeatStatus.UPDATED); - } + private final Stack stack; + private final Map heatStatusMap = new HashMap<>(); + + public StackInfoMapper(Stack stack) { + this.stack = stack; + configureHeatStatusMap(); + } + + public StackInfo map() { + final StackInfo info = new StackInfo(); + if (stack == null) { + info.setStatus(HeatStatus.NOTFOUND); + } else { + info.setName(stack.getStackName()); + info.setCanonicalName(stack.getStackName() + "/" + stack.getId()); + info.setStatus(this.mapStatus(stack.getStackStatus())); + + info.setStatusMessage(stack.getStackStatusReason()); + + Optional> result = this.mapOutputToMap(stack.getOutputs()); + if (result.isPresent()) { + info.setOutputs(result.get()); + } + + info.setParameters(stack.getParameters()); + } + + return info; + } + + protected HeatStatus mapStatus(String status) { + final HeatStatus result; + if (status == null) { + result = HeatStatus.INIT; + } else { + result = heatStatusMap.getOrDefault(status, HeatStatus.UNKNOWN); + } + + return result; + } + + protected Optional> mapOutputToMap(List outputs) { + Optional> result = Optional.empty(); + if (outputs != null) { + final HashMap map = new HashMap<>(); + for (Output output : outputs) { + map.put(output.getOutputKey(), output.getOutputValue()); + } + result = Optional.of(map); + } + + return result; + } + + private void configureHeatStatusMap() { + heatStatusMap.put("CREATE_IN_PROGRESS", HeatStatus.BUILDING); + heatStatusMap.put("CREATE_COMPLETE", HeatStatus.CREATED); + heatStatusMap.put("CREATE_FAILED", HeatStatus.FAILED); + heatStatusMap.put("DELETE_IN_PROGRESS", HeatStatus.DELETING); + heatStatusMap.put("DELETE_COMPLETE", HeatStatus.NOTFOUND); + heatStatusMap.put("DELETE_FAILED", HeatStatus.FAILED); + heatStatusMap.put("UPDATE_IN_PROGRESS", HeatStatus.UPDATING); + heatStatusMap.put("UPDATE_FAILED", HeatStatus.FAILED); + heatStatusMap.put("UPDATE_COMPLETE", HeatStatus.UPDATED); + } } -- cgit 1.2.3-korg