diff options
Diffstat (limited to 'adapters/mso-adapters-rest-interface')
134 files changed, 5510 insertions, 5602 deletions
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<String> dns_nameservers; - private String dhcp_option_list; - **/ - - @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools") - private List<ContrailSubnetPool> 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<ContrailSubnetPool> getAllocationPools() { - return allocationPools; - } - - public void setAllocationPools(List<ContrailSubnetPool> 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<String> + * dns_nameservers; private String dhcp_option_list; + **/ + + @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools") + private List<ContrailSubnetPool> 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<ContrailSubnetPool> getAllocationPools() { + return allocationPools; + } + + public void setAllocationPools(List<ContrailSubnetPool> 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<ContrailSubnetHostRoute> hostRoutes = new ArrayList<>(); - - public List<ContrailSubnetHostRoute> getHostRoutes() { - return hostRoutes; - } - - public void setHostRoutes(List<ContrailSubnetHostRoute> 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<ContrailSubnetHostRoute> hostRoutes = new ArrayList<>(); + + public List<ContrailSubnetHostRoute> getHostRoutes() { + return hostRoutes; + } + + public void setHostRoutes(List<ContrailSubnetHostRoute> 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<ContrailSubnetIp> csIp = createSubnet(inputSubnet); - if (csIp.isPresent()) { - result.setSubnet(csIp.get()); - } - Optional<List<ContrailSubnetPool>> pools = this.createContrailSubnetPool(inputSubnet); - if (pools.isPresent()) { - result.setAllocationPools(pools.get()); - } - Optional<ContrailSubnetHostRoutes> 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<List<ContrailSubnetPool>> createContrailSubnetPool(final Subnet subnet) { - Optional<List<ContrailSubnetPool>> result = Optional.empty(); - if (subnet.getAllocationPools() != null) { - List<ContrailSubnetPool> 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<ContrailSubnetHostRoutes> createContrailSubnetHostRoutes(final Subnet subnet) { - Optional<ContrailSubnetHostRoutes> result = Optional.empty(); - if (subnet.getHostRoutes() != null) { - ContrailSubnetHostRoutes hostRoutesObj = new ContrailSubnetHostRoutes(); - List<ContrailSubnetHostRoute> 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<ContrailSubnetIp> createSubnet(final Subnet subnet) { - Optional<ContrailSubnetIp> 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<ContrailSubnetIp> csIp = createSubnet(inputSubnet); + if (csIp.isPresent()) { + result.setSubnet(csIp.get()); + } + Optional<List<ContrailSubnetPool>> pools = this.createContrailSubnetPool(inputSubnet); + if (pools.isPresent()) { + result.setAllocationPools(pools.get()); + } + Optional<ContrailSubnetHostRoutes> 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<List<ContrailSubnetPool>> createContrailSubnetPool(final Subnet subnet) { + Optional<List<ContrailSubnetPool>> result = Optional.empty(); + if (subnet.getAllocationPools() != null) { + List<ContrailSubnetPool> 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<ContrailSubnetHostRoutes> createContrailSubnetHostRoutes(final Subnet subnet) { + Optional<ContrailSubnetHostRoutes> result = Optional.empty(); + if (subnet.getHostRoutes() != null) { + ContrailSubnetHostRoutes hostRoutesObj = new ContrailSubnetHostRoutes(); + List<ContrailSubnetHostRoute> 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<ContrailSubnetIp> createSubnet(final Subnet subnet) { + Optional<ContrailSubnetIp> 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<RouteTarget> routeTargets; - private List<String> policyFqdns; - private List<String> routeTableFqdns; - - public ContrailNetwork() { - super(); - } - - public ContrailNetwork(String shared, String external, List<RouteTarget> routeTargets, List<String> policyFqdns, List<String> 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<RouteTarget> getRouteTargets() { - return routeTargets; - } - - public void setRouteTargets(List<RouteTarget> routeTargets) { - this.routeTargets = routeTargets; - } - - public List<String> getPolicyFqdns() { - return policyFqdns; - } - - public void setPolicyFqdns(List<String> policyFqdns) { - this.policyFqdns = policyFqdns; - } - - public List<String> getRouteTableFqdns() { - return routeTableFqdns; - } - - public void setRouteTableFqdns(List<String> 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<RouteTarget> routeTargets; + private List<String> policyFqdns; + private List<String> routeTableFqdns; + + public ContrailNetwork() { + super(); + } + + public ContrailNetwork(String shared, String external, List<RouteTarget> routeTargets, List<String> policyFqdns, + List<String> 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<RouteTarget> getRouteTargets() { + return routeTargets; + } + + public void setRouteTargets(List<RouteTarget> routeTargets) { + this.routeTargets = routeTargets; + } + + public List<String> getPolicyFqdns() { + return policyFqdns; + } + + public void setPolicyFqdns(List<String> policyFqdns) { + this.policyFqdns = policyFqdns; + } + + public List<String> getRouteTableFqdns() { + return routeTableFqdns; + } + + public void setRouteTableFqdns(List<String> 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<String, String> elements when marshalled to XML produce a list of <entry><key>${MsoUtils.xmlEscape(key)}</key><value>${MsoUtils.xmlEscape(value)}</value></entry> elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. -*/ +/* + * README Map<String, String> elements when marshalled to XML produce a list of + * <entry><key>${MsoUtils.xmlEscape(key)}</key><value>${MsoUtils.xmlEscape(value)}</value></entry> 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<Subnet> subnets; - private ProviderVlanNetwork providerVlanNetwork; - private ContrailNetwork contrailNetwork; - private Boolean failIfExists = false; - private Boolean backout = true; - private Map<String,String> 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<Subnet> getSubnets() { - return subnets; - } - - public void setSubnets(List<Subnet> 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<String, String> getNetworkParams() { - return networkParams; - } - - public void setNetworkParams(Map<String, String> 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<Subnet> subnets; + private ProviderVlanNetwork providerVlanNetwork; + private ContrailNetwork contrailNetwork; + private Boolean failIfExists = false; + private Boolean backout = true; + private Map<String, String> 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<Subnet> getSubnets() { + return subnets; + } + + public void setSubnets(List<Subnet> 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<String, String> getNetworkParams() { + return networkParams; + } + + public void setNetworkParams(Map<String, String> 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<String, String> subnetMap; - private NetworkRollback rollback = new NetworkRollback(); - - public CreateNetworkResponse() { - super(); - } - - public CreateNetworkResponse(String networkId, - String neutronNetworkId, - String networkStackId, - String networkFqdn, - Boolean networkCreated, - Map<String, String> 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<String, String> getSubnetMap() { - return subnetMap; - } - - public void setSubnetMap(Map<String, String> 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<String, String> subnetMap; + private NetworkRollback rollback = new NetworkRollback(); + + public CreateNetworkResponse() { + super(); + } + + public CreateNetworkResponse(String networkId, String neutronNetworkId, String networkStackId, String networkFqdn, + Boolean networkCreated, Map<String, String> 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<String, String> getSubnetMap() { + return subnetMap; + } + + public void setSubnetMap(Map<String, String> 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<Integer> vlans; - - public ProviderVlanNetwork() { - super(); - } - - public ProviderVlanNetwork(String physicalNetworkName, List<Integer> vlans) { - super(); - this.physicalNetworkName = physicalNetworkName; - this.vlans = vlans; - } - - public String getPhysicalNetworkName() { - return physicalNetworkName; - } - - public void setPhysicalNetworkName(String physicalNetworkName) { - this.physicalNetworkName = physicalNetworkName; - } - - public List<Integer> getVlans() { - return vlans; - } - - public void setVlans(List<Integer> vlans) { - this.vlans = vlans; - } +public class ProviderVlanNetwork implements Serializable { + /** + * + */ + private static final long serialVersionUID = 6744949861614446315L; + private String physicalNetworkName; + private List<Integer> vlans; + + public ProviderVlanNetwork() { + super(); + } + + public ProviderVlanNetwork(String physicalNetworkName, List<Integer> vlans) { + super(); + this.physicalNetworkName = physicalNetworkName; + this.vlans = vlans; + } + + public String getPhysicalNetworkName() { + return physicalNetworkName; + } + + public void setPhysicalNetworkName(String physicalNetworkName) { + this.physicalNetworkName = physicalNetworkName; + } + + public List<Integer> getVlans() { + return vlans; + } + + public void setVlans(List<Integer> 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<Integer> vlans; - private List<RouteTarget> routeTargets; - private Map<String, String> subnetIdMap; - private Map<String, String> networkOutputs; - - public QueryNetworkResponse() { - super(); - } - - public QueryNetworkResponse(String networkId, String neutronNetworkId, String networkStackId, - NetworkStatus networkStatus, Map<String, String> 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<Integer> getVlans() { - return vlans; - } - - public void setVlans(List<Integer> vlans) { - this.vlans = vlans; - } - - public List<RouteTarget> getRouteTargets() { - return routeTargets; - } - - public void setRouteTargets(List<RouteTarget> routeTargets) { - this.routeTargets = routeTargets; - } - - public Map<String, String> getSubnetIdMap() { - return subnetIdMap; - } - - public void setSubnetIdMap(Map<String, String> subnetIdMap) { - this.subnetIdMap = subnetIdMap; - } - - public Map<String, String> getNetworkOutputs() { - return networkOutputs; - } - - public void setNetworkOutputs(Map<String, String> 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<Integer> vlans; + private List<RouteTarget> routeTargets; + private Map<String, String> subnetIdMap; + private Map<String, String> networkOutputs; + + public QueryNetworkResponse() { + super(); + } + + public QueryNetworkResponse(String networkId, String neutronNetworkId, String networkStackId, + NetworkStatus networkStatus, Map<String, String> 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<Integer> getVlans() { + return vlans; + } + + public void setVlans(List<Integer> vlans) { + this.vlans = vlans; + } + + public List<RouteTarget> getRouteTargets() { + return routeTargets; + } + + public void setRouteTargets(List<RouteTarget> routeTargets) { + this.routeTargets = routeTargets; + } + + public Map<String, String> getSubnetIdMap() { + return subnetIdMap; + } + + public void setSubnetIdMap(Map<String, String> subnetIdMap) { + this.subnetIdMap = subnetIdMap; + } + + public Map<String, String> getNetworkOutputs() { + return networkOutputs; + } + + public void setNetworkOutputs(Map<String, String> 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<Subnet> subnets; - private ProviderVlanNetwork providerVlanNetwork; - private ContrailNetwork contrailNetwork; - private Boolean backout = true; - private Map<String,String> 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<Subnet> getSubnets() { - return subnets; - } - - public void setSubnets(List<Subnet> 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<String, String> getNetworkParams() { - return networkParams; - } - - public void setNetworkParams(Map<String, String> 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<Subnet> subnets; + private ProviderVlanNetwork providerVlanNetwork; + private ContrailNetwork contrailNetwork; + private Boolean backout = true; + private Map<String, String> 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<Subnet> getSubnets() { + return subnets; + } + + public void setSubnets(List<Subnet> 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<String, String> getNetworkParams() { + return networkParams; + } + + public void setNetworkParams(Map<String, String> 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<String, String> subnetMap; - public UpdateNetworkResponse() { - /* Empty Constructor */ - } + /** + * + */ + private static final long serialVersionUID = -7528214382414366136L; + private String networkId; + private String neutronNetworkId; + private Map<String, String> subnetMap; + + public UpdateNetworkResponse() { + /* Empty Constructor */ + } - public UpdateNetworkResponse(String networkId, String neutronNetworkId, - Map<String, String> subnetMap, String messageId) { - super(messageId); - this.networkId = networkId; - this.neutronNetworkId = neutronNetworkId; - this.subnetMap = subnetMap; - } + public UpdateNetworkResponse(String networkId, String neutronNetworkId, Map<String, String> 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<String, String> getSubnetMap() { - return subnetMap; - } + public Map<String, String> getSubnetMap() { + return subnetMap; + } - public void setSubnetMap(Map<String, String> subnetMap) { - this.subnetMap = subnetMap; - } + public void setSubnetMap(Map<String, String> 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<String, String> elements when marshalled to XML produce a list of <entry><key>${MsoUtils.xmlEscape(key)}</key><value>${MsoUtils.xmlEscape(value)}</value></entry> elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. + * Map<String, String> elements when marshalled to XML produce a list of + * <entry><key>${MsoUtils.xmlEscape(key)}</key><value>${MsoUtils.xmlEscape(value)}</value></entry> elements. When + * marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. * </pre> */ @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<String, String> 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<String, String> getParams() { - return params; - } - - @JsonProperty("params") - public void setParams(Map<String, String> 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<String, String> 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<String, String> getParams() { + return params; + } + + @JsonProperty("params") + public void setParams(Map<String, String> 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<String, String> elements when marshalled to XML produce a list of <entry><key>${MsoUtils.xmlEscape(key)}</key><value>${MsoUtils.xmlEscape(value)}</value></entry> elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. + * Map<String, String> elements when marshalled to XML produce a list of + * <entry><key>${MsoUtils.xmlEscape(key)}</key><value>${MsoUtils.xmlEscape(value)}</value></entry> elements. When + * marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. * </pre> */ @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<String, String> params = null; + // Map of response parameters (possibly none). + private Map<String, String> 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<String, String> getParams() { - return params; - } + @JsonProperty("params") + @XmlElement(name = "params") + public Map<String, String> getParams() { + return params; + } - @JsonProperty("params") - public void setParams(Map<String, String> params) { - this.params = params; - } + @JsonProperty("params") + public void setParams(Map<String, String> 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<String,String> 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<String, String> getMetadata() { - return metadata; - } - - public void setMetadata(Map<String, String> 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<String, String> 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<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(Map<String, String> 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<String,String> metadata; - - public QueryTenantResponse() {} - - public QueryTenantResponse (String id, String name, Map<String,String> 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<String, String> getMetadata() { - return metadata; - } - public void setMetadata(Map<String, String> metadata) { - this.metadata = metadata; - } + private String tenantId; + private String tenantName; + private Map<String, String> metadata; + + public QueryTenantResponse() {} + + public QueryTenantResponse(String id, String name, Map<String, String> 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<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(Map<String, String> 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<String, Object> outputs = new HashMap<>(); - protected Map<String, Object> inputs = new HashMap<>(); + // Set defaults for everything + protected String vduInstanceId; + protected String vduInstanceName; + protected VduStatus status; + protected Map<String, Object> outputs = new HashMap<>(); + protected Map<String, Object> 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<String, Object> getOutputs() { - return outputs; - } + public Map<String, Object> getOutputs() { + return outputs; + } - public void setOutputs(Map<String, Object> outputs) { - this.outputs = outputs; - } + public void setOutputs(Map<String, Object> outputs) { + this.outputs = outputs; + } - public Map<String, Object> getInputs() { - return inputs; - } + public Map<String, Object> getInputs() { + return inputs; + } - public void setInputs(Map<String, Object> inputs) { - this.inputs = inputs; - } -}
\ No newline at end of file + public void setInputs(Map<String, Object> 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<VduArtifact> artifacts = new ArrayList<>(); + private String modelCustomizationUUID; + private String modelUUID; + private String modelInvariantUUID; + private int timeoutMinutes; + private List<VduArtifact> 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<VduArtifact> getArtifacts() { - return artifacts; - } - public void setArtifacts(List<VduArtifact> 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<VduArtifact> getArtifacts() { + return artifacts; + } + + public void setArtifacts(List<VduArtifact> 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<String, String> elements when marshalled to XML produce a list of <entry><key>${MsoUtils.xmlEscape(key)}</key><value>${MsoUtils.xmlEscape(value)}</value></entry> elements. - When marshalling to JSON they create a list of "${key}" : "${value}" pairs with no extra wrappers. -*/ +/* + * README Map<String, String> elements when marshalled to XML produce a list of + * <entry><key>${MsoUtils.xmlEscape(key)}</key><value>${MsoUtils.xmlEscape(value)}</value></entry> 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<String, Object> 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<String, Object> 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<String, Object> getVfModuleParams() { - return vfModuleParams; - } + public Map<String, Object> getVfModuleParams() { + return vfModuleParams; + } - public void setVfModuleParams(Map<String, Object> vfModuleParams) { - this.vfModuleParams = vfModuleParams; - } + public void setVfModuleParams(Map<String, Object> 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<String,String> vfModuleOutputs = new HashMap<>(); - private VfModuleRollback rollback = new VfModuleRollback(); - - public CreateVfModuleResponse() { - super(); - } - - public CreateVfModuleResponse(String vnfId, String vfModuleId, - String vfModuleStackId, Boolean vfModuleCreated, - Map<String, String> 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<String, String> getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map<String, String> 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<String, String> vfModuleOutputs = new HashMap<>(); + private VfModuleRollback rollback = new VfModuleRollback(); + + public CreateVfModuleResponse() { + super(); + } + + public CreateVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, Boolean vfModuleCreated, + Map<String, String> 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<String, String> getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map<String, String> 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<String,Object> 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<String, Object> getVolumeGroupParams() { - return volumeGroupParams; - } - - public void setVolumeGroupParams(Map<String, Object> 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<String, Object> 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<String, Object> getVolumeGroupParams() { + return volumeGroupParams; + } + + public void setVolumeGroupParams(Map<String, Object> 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<String,String> volumeGroupOutputs = new HashMap<>(); - private VolumeGroupRollback volumeGroupRollback = new VolumeGroupRollback(); - - public CreateVolumeGroupResponse() { - super(); - } - - public CreateVolumeGroupResponse( - String volumeGroupId, - String volumeGroupStackId, - Boolean volumeGroupCreated, - Map<String, String> 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<String, String> getVolumeGroupOutputs() { - return volumeGroupOutputs; - } - - public void setVolumeGroupOutputs(Map<String, String> 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<String, String> volumeGroupOutputs = new HashMap<>(); + private VolumeGroupRollback volumeGroupRollback = new VolumeGroupRollback(); + + public CreateVolumeGroupResponse() { + super(); + } + + public CreateVolumeGroupResponse(String volumeGroupId, String volumeGroupStackId, Boolean volumeGroupCreated, + Map<String, String> 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<String, String> getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map<String, String> 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<String,String> vfModuleOutputs = new HashMap<>(); - public DeleteVfModuleResponse() { - super(); - } + private String vnfId; + private String vfModuleId; + private Boolean vfModuleDeleted; + private Map<String, String> vfModuleOutputs = new HashMap<>(); + + public DeleteVfModuleResponse() { + super(); + } + + public DeleteVfModuleResponse(String vnfId, String vfModuleId, Boolean vfModuleDeleted, String messageId, + Map<String, String> 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<String,String> 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<String, String> getVfModuleOutputs() { - return vfModuleOutputs; - } + public Map<String, String> getVfModuleOutputs() { + return vfModuleOutputs; + } - public void setVfModuleOutputs(Map<String, String> vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } + public void setVfModuleOutputs(Map<String, String> 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<String, String> vfModuleOutputs; - - public QueryVfModuleResponse() { - super(); - } - - public QueryVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, VnfStatus vnfStatus, - Map<String, String> 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<String, String> getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map<String, String> 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<String, String> vfModuleOutputs; + + public QueryVfModuleResponse() { + super(); + } + + public QueryVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, VnfStatus vnfStatus, + Map<String, String> 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<String, String> getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map<String, String> 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<String,String> volumeGroupOutputs; - - public QueryVolumeGroupResponse() { - } - - public QueryVolumeGroupResponse( - String volumeGroupId, - String volumeGroupStackId, - VnfStatus volumeGroupStatus, - Map<String, String> 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<String, String> getVolumeGroupOutputs() { - return volumeGroupOutputs; - } - - public void setVolumeGroupOutputs(Map<String, String> 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<String, String> volumeGroupOutputs; + + public QueryVolumeGroupResponse() {} + + public QueryVolumeGroupResponse(String volumeGroupId, String volumeGroupStackId, VnfStatus volumeGroupStatus, + Map<String, String> 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<String, String> getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map<String, String> 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<String,Object> vfModuleParams = new HashMap<>(); - private MsoRequest msoRequest = new MsoRequest(); + @XmlJavaTypeAdapter(MapAdapter.class) + private Map<String, Object> 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<String, Object> getVfModuleParams() { - return vfModuleParams; - } + public Map<String, Object> getVfModuleParams() { + return vfModuleParams; + } - public void setVfModuleParams(Map<String, Object> vfModuleParams) { - this.vfModuleParams = vfModuleParams; - } + public void setVfModuleParams(Map<String, Object> 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<String,String> vfModuleOutputs = new HashMap<>(); - - public UpdateVfModuleResponse() { - super(); - } - - public UpdateVfModuleResponse(String vnfId, String vfModuleId, - String vfModuleStackId, - Map<String, String> 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<String, String> getVfModuleOutputs() { - return vfModuleOutputs; - } - - public void setVfModuleOutputs(Map<String, String> vfModuleOutputs) { - this.vfModuleOutputs = vfModuleOutputs; - } + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private Map<String, String> vfModuleOutputs = new HashMap<>(); + + public UpdateVfModuleResponse() { + super(); + } + + public UpdateVfModuleResponse(String vnfId, String vfModuleId, String vfModuleStackId, + Map<String, String> 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<String, String> getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map<String, String> 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<String,Object> 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<String, Object> 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<String, Object> getVolumeGroupParams() { - return volumeGroupParams; - } + public Map<String, Object> getVolumeGroupParams() { + return volumeGroupParams; + } - public void setVolumeGroupParams(Map<String, Object> volumeGroupParams) { - this.volumeGroupParams = volumeGroupParams; - } + public void setVolumeGroupParams(Map<String, Object> 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<String,String> volumeGroupOutputs; + private String volumeGroupId; + private String volumeGroupStackId; + private Map<String, String> volumeGroupOutputs; - public UpdateVolumeGroupResponse() { - super(); - this.volumeGroupOutputs = new HashMap<>(); - } + public UpdateVolumeGroupResponse() { + super(); + this.volumeGroupOutputs = new HashMap<>(); + } - public UpdateVolumeGroupResponse( - String volumeGroupId, - String volumeGroupStackId, - Map<String, String> volumeGroupOutputs, - String messageId) - { - super(messageId); - this.volumeGroupId = volumeGroupId; - this.volumeGroupStackId = volumeGroupStackId; - this.volumeGroupOutputs = volumeGroupOutputs; - } + public UpdateVolumeGroupResponse(String volumeGroupId, String volumeGroupStackId, + Map<String, String> 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<String, String> getVolumeGroupOutputs() { - return volumeGroupOutputs; - } + public Map<String, String> getVolumeGroupOutputs() { + return volumeGroupOutputs; + } - public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) { - this.volumeGroupOutputs = volumeGroupOutputs; - } + public void setVolumeGroupOutputs(Map<String, String> 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”: “<A&AI_ VOLUME_GROUP_ID>”, -// “volumeGroupStackId”: “<VOLUME_GROUP _STACK_ID>”, -// “tenantId”: “<TENANT_ID>”, -// "cloudOwnerId"" "<CLOUD_OWNER>", -// “cloudSiteId”: “<CLOUD_CLLI>”, -// “volumeGroupCreated”: TRUE|FALSE, -// “msoRequest”: { -// “requestId”: “<REQUEST_ID>”, -// “serviceInstanceId”: “<SERVICE_INSTANCE_ID>” -// } -//}, - - 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”: “<A&AI_ VOLUME_GROUP_ID>”, + // “volumeGroupStackId”: “<VOLUME_GROUP _STACK_ID>”, + // “tenantId”: “<TENANT_ID>”, + // "cloudOwnerId"" "<CLOUD_OWNER>", + // “cloudSiteId”: “<CLOUD_CLLI>”, + // “volumeGroupCreated”: TRUE|FALSE, + // “msoRequest”: { + // “requestId”: “<REQUEST_ID>”, + // “serviceInstanceId”: “<SERVICE_INSTANCE_ID>” + // } + // }, + + 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<String,String> metadata; - - public MsoTenant() {} - - public MsoTenant (String id, String name, Map<String,String> 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<String, String> getMetadata() { - return metadata; - } - public void setMetadata(Map<String, String> metadata) { - this.metadata = metadata; - } + private String tenantId; + private String tenantName; + private Map<String, String> metadata; + + public MsoTenant() {} + + public MsoTenant(String id, String name, Map<String, String> 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<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(Map<String, String> 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<Integer> vlans = new ArrayList<>(); - private List<String> 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<Integer> getVlans () { - return vlans; - } - - public void setVlans (List<Integer> vlans) { - this.vlans = vlans; - } - - public List<String> getSubnets () { - return subnets; - } - - public void setSubnets (List<String> 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<Integer> vlans = new ArrayList<>(); + private List<String> 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<Integer> getVlans() { + return vlans; + } + + public void setVlans(List<Integer> vlans) { + this.vlans = vlans; + } + + public List<String> getSubnets() { + return subnets; + } + + public void setSubnets(List<String> 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<Integer> 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<Integer> getVlans () { - return vlans; - } - public void setVlans (List<Integer> 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<Integer> 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<Integer> getVlans() { + return vlans; + } + + public void setVlans(List<Integer> 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<String,Object> outputs = new HashMap<>(); - private Map<String,Object> parameters = new HashMap<>(); - - public StackInfo () { - } - - public StackInfo (String name, HeatStatus status, String statusMessage, Map<String,Object> 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<String,Object> getOutputs () { - return outputs; - } - - public void setOutputs (Map<String,Object> outputs) { - this.outputs = outputs; - } - - public Map<String,Object> getParameters () { - return parameters; - } - - public void setParameters (Map<String,Object> parameters) { - this.parameters = parameters; - } - + // Set defaults for everything + private String name = ""; + private String canonicalName = ""; + private HeatStatus status = HeatStatus.UNKNOWN; + private String statusMessage = ""; + private Map<String, Object> outputs = new HashMap<>(); + private Map<String, Object> parameters = new HashMap<>(); + + public StackInfo() {} + + public StackInfo(String name, HeatStatus status, String statusMessage, Map<String, Object> 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<String, Object> getOutputs() { + return outputs; + } + + public void setOutputs(Map<String, Object> outputs) { + this.outputs = outputs; + } + + public Map<String, Object> getParameters() { + return parameters; + } + + public void setParameters(Map<String, Object> 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<HostRoute> hostRoutes; private List<Pool> allocationPools; private List<String> 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<Pool> getAllocationPools() { - return allocationPools; - } + public List<Pool> 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<Pool> 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<String> 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<HostRoute> 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<MapEntry, Map<String, Object>> { - @Override - public MapEntry marshal(Map<String, Object> v) throws Exception { + @Override + public MapEntry marshal(Map<String, Object> 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<String, Object> unmarshal(MapEntry v) throws Exception { - if (v == null) {return null;} + @Override + public Map<String, Object> unmarshal(MapEntry v) throws Exception { + if (v == null) { + return null; + } - Map<String, Object> map = new HashMap<>(v.entry.size()); + Map<String, Object> 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<MapElements> entry = new ArrayList<>(); - - public MapEntry() {} //Required by JAXB - public void addEntry(String key, Object value) { - entry.add(new MapElements(key, value)); - } + public List<MapElements> 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<String,NetworkStatus> networkStatusMap = new HashMap<>(); + private final Network network; + private final Map<String, NetworkStatus> 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<Optional<String>, List<Integer>> result = locateVlanInformation(network); + Optional<String> 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<Optional<String>, List<Integer>> locateVlanInformation(Network network) { + final List<Integer> vlans = new ArrayList<>(); + Optional<String> 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<Optional<String>, List<Integer>> result = locateVlanInformation(network); - Optional<String> 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<Optional<String>, List<Integer>> locateVlanInformation(Network network) { - final List<Integer> vlans = new ArrayList<>(); - Optional<String> 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<String,HeatStatus> 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<Map<String, Object>> 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<Map<String, Object>> mapOutputToMap(List<Output> outputs) { - Optional<Map<String, Object>> result = Optional.empty(); - if (outputs != null) { - final HashMap<String, Object> 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<String, HeatStatus> 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<Map<String, Object>> 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<Map<String, Object>> mapOutputToMap(List<Output> outputs) { + Optional<Map<String, Object>> result = Optional.empty(); + if (outputs != null) { + final HashMap<String, Object> 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); + } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/BeansTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/BeansTest.java index e3474009c9..3ef91d3dbe 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/BeansTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/BeansTest.java @@ -21,7 +21,6 @@ package org.onap.so.adapters; import org.junit.Test; - import com.openpojo.reflection.PojoClass; import com.openpojo.reflection.PojoClassFilter; import com.openpojo.reflection.filters.FilterNonConcrete; @@ -35,31 +34,27 @@ import com.openpojo.validation.test.impl.SetterTester; public class BeansTest { - private PojoClassFilter filterTestClasses = new FilterTestClasses(); + private PojoClassFilter filterTestClasses = new FilterTestClasses(); + + @Test + public void pojoStructure() { + test("org.onap.so.adapters.nwrest"); + test("org.onap.so.adapters.sdncrest"); + test("org.onap.so.adapters.tenantrest"); + test("org.onap.so.adapters.vnfrest"); + test("org.onap.so.adapters.network.beans"); + test("org.onap.so.openstack.beans"); + } + + private void test(String pojoPackage) { + Validator validator = ValidatorBuilder.create().with(new GetterMustExistRule()).with(new SetterMustExistRule()) + .with(new SetterTester()).with(new GetterTester()).build(); + validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses, new FilterNonConcrete()); + } - @Test - public void pojoStructure() { - test("org.onap.so.adapters.nwrest"); - test("org.onap.so.adapters.sdncrest"); - test("org.onap.so.adapters.tenantrest"); - test("org.onap.so.adapters.vnfrest"); - test("org.onap.so.adapters.network.beans"); - test("org.onap.so.openstack.beans"); - } - - private void test(String pojoPackage) { - Validator validator = ValidatorBuilder.create() - .with(new GetterMustExistRule()) - .with(new SetterMustExistRule()) - .with(new SetterTester()) - .with(new GetterTester()) - .build(); - validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses, new FilterNonConcrete()); - } - - private static class FilterTestClasses implements PojoClassFilter { - public boolean include(PojoClass pojoClass) { - return !pojoClass.getSourcePath().contains("/test-classes/"); - } - } -}
\ No newline at end of file + private static class FilterTestClasses implements PojoClassFilter { + public boolean include(PojoClass pojoClass) { + return !pojoClass.getSourcePath().contains("/test-classes/"); + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/network/mappers/ContrailSubnetMappersTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/network/mappers/ContrailSubnetMappersTest.java index 240074bca7..61beceb922 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/network/mappers/ContrailSubnetMappersTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/network/mappers/ContrailSubnetMappersTest.java @@ -21,11 +21,9 @@ package org.onap.so.adapters.network.mappers; import static org.junit.Assert.assertEquals; - import java.util.ArrayList; import java.util.List; import java.util.Optional; - import org.junit.Test; import org.onap.so.adapters.network.beans.ContrailSubnet; import org.onap.so.adapters.network.beans.ContrailSubnetHostRoute; @@ -38,199 +36,200 @@ import org.onap.so.openstack.beans.Subnet; public class ContrailSubnetMappersTest { - - - @Test - public void contrailSubnetHostRouteMapperTest() { - HostRoute hostRoute = new HostRoute(); - hostRoute.setNextHop("hop"); - hostRoute.setPrefix("prefix"); - ContrailSubnetHostRouteMapper mapper = new ContrailSubnetHostRouteMapper(hostRoute); - ContrailSubnetHostRoute cshr = mapper.map(); - assertEquals("hop", cshr.getNextHop()); - assertEquals("prefix", cshr.getPrefix()); - } - - @Test - public void contrailSubnetPoolMapperTest() { - Pool pool = new Pool(); - pool.setStart("start"); - pool.setEnd("end"); - ContrailSubnetPoolMapper mapper = new ContrailSubnetPoolMapper(pool); - ContrailSubnetPool csPool = mapper.map(); - assertEquals("start", csPool.getStart()); - assertEquals("end", csPool.getEnd()); - } - - @Test - public void checkIsNullOrEmpty() { - ContrailSubnetMapper mapper = new ContrailSubnetMapper(null); - assertEquals(true, mapper.isNullOrEmpty("")); - assertEquals(true, mapper.isNullOrEmpty(null)); - assertEquals(false, mapper.isNullOrEmpty("hello")); - } - - @Test - public void createSubnetTestValidCidr() { - Subnet subnet = new Subnet(); - subnet.setCidr("test/value"); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - - assertEquals("test",result.getSubnet().getIpPrefix()); - assertEquals("value", result.getSubnet().getIpPrefixLen()); - } - - @Test - public void createSubnetTestInvalidCidr() { - Subnet subnet = new Subnet(); - subnet.setCidr("test"); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - assertEquals(null, result.getSubnet().getIpPrefix()); - assertEquals(null, result.getSubnet().getIpPrefixLen()); - - } - - @Test - public void createSubnetTestNullCidr() { - Subnet subnet = new Subnet(); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - assertEquals(null, result.getSubnet().getIpPrefix()); - assertEquals(null, result.getSubnet().getIpPrefixLen()); - } - - @Test - public void createContrailSubnetPoolTest() { - List<Pool> pools = new ArrayList<>(); - Pool pool1 = new Pool(); - pool1.setStart("start1"); - pool1.setEnd("end1"); - Pool pool2 = new Pool(); - pool2.setStart("start2"); - pool2.setEnd("end2"); - pools.add(pool1); - pools.add(pool2); - - Subnet subnet = new Subnet(); - subnet.setAllocationPools(pools); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - List<ContrailSubnetPool> cspools = result.getAllocationPools(); - assertEquals(2, cspools.size()); - assertEquals("start2", cspools.get(1).getStart()); - assertEquals("end2", cspools.get(1).getEnd()); - } - - @Test - public void createContrailSubnetPoolInvalidTest() { - List<Pool> pools = new ArrayList<>(); - Pool pool1 = new Pool(); - pool1.setStart("start1"); - pool1.setEnd("end1"); - Pool pool2 = new Pool(); - pool2.setStart("start2"); - pools.add(pool1); - pools.add(pool2); - - Subnet subnet = new Subnet(); - subnet.setAllocationPools(pools); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - List<ContrailSubnetPool> cspools = result.getAllocationPools(); - assertEquals(1, cspools.size()); - assertEquals("start1", cspools.get(0).getStart()); - assertEquals("end1", cspools.get(0).getEnd()); - } - - @Test - public void createContrailSubnetPoolEmptyTest() { - - Subnet subnet = new Subnet(); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - List<ContrailSubnetPool> cspools = result.getAllocationPools(); - assertEquals(true, cspools.isEmpty()); - - } - - @Test - public void createContrailSubnetHostRoutesTest() { - List<HostRoute> hostRoutes = new ArrayList<>(); - HostRoute hostRoute1 = new HostRoute(); - hostRoute1.setNextHop("next-hop1"); - hostRoute1.setPrefix("prefix1"); - HostRoute hostRoute2 = new HostRoute(); - hostRoute2.setNextHop("next-hop2"); - hostRoute2.setPrefix("prefix2"); - hostRoutes.add(hostRoute1); - hostRoutes.add(hostRoute2); - - Subnet subnet = new Subnet(); - subnet.setHostRoutes(hostRoutes); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - ContrailSubnetHostRoutes routes = result.getHostRoutes(); - assertEquals(2, routes.getHostRoutes().size()); - assertEquals("next-hop2", routes.getHostRoutes().get(1).getNextHop()); - assertEquals("prefix2", routes.getHostRoutes().get(1).getPrefix()); - } - - @Test - public void createContrailSubnetHostRoutesMissingFieldTest() { - List<HostRoute> hostRoutes = new ArrayList<>(); - HostRoute hostRoute1 = new HostRoute(); - hostRoute1.setNextHop("next-hop1"); - HostRoute hostRoute2 = new HostRoute(); - hostRoute2.setNextHop("next-hop2"); - hostRoute2.setPrefix("prefix2"); - hostRoutes.add(hostRoute1); - hostRoutes.add(hostRoute2); - - Subnet subnet = new Subnet(); - subnet.setHostRoutes(hostRoutes); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - ContrailSubnetHostRoutes routes = result.getHostRoutes(); - assertEquals(2, routes.getHostRoutes().size()); - assertEquals("next-hop1", routes.getHostRoutes().get(0).getNextHop()); - assertEquals("prefix2", routes.getHostRoutes().get(1).getPrefix()); - } - - @Test - public void createContrailSubnetHostRoutesEmptyTest() { - List<HostRoute> hostRoutes = new ArrayList<>(); - Subnet subnet = new Subnet(); - subnet.setHostRoutes(hostRoutes); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - ContrailSubnetHostRoutes routes = result.getHostRoutes(); - assertEquals(true, routes.getHostRoutes().isEmpty()); - } - - @Test - public void getSubnetNameTest() { - Subnet subnet = new Subnet(); - subnet.setSubnetName("name"); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - assertEquals("if subnetName is populated map", "name", mapper.getSubnetName(subnet)); - subnet = new Subnet(); - subnet.setSubnetId("id"); - mapper = new ContrailSubnetMapper(subnet); - assertEquals("choose id when name is null", "id", mapper.getSubnetName(subnet)); - subnet = new Subnet(); - mapper = new ContrailSubnetMapper(subnet); - assertEquals("expect null", null, mapper.getSubnetName(subnet)); - } - @Test - public void mapRemainingFields() { - Subnet subnet = new Subnet(); - subnet.setEnableDHCP(true); - subnet.setGatewayIp("gateway-ip"); - ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); - ContrailSubnet result = mapper.map(); - assertEquals(true, result.isEnableDhcp()); - assertEquals("gateway-ip", result.getDefaultGateway()); - } + + + @Test + public void contrailSubnetHostRouteMapperTest() { + HostRoute hostRoute = new HostRoute(); + hostRoute.setNextHop("hop"); + hostRoute.setPrefix("prefix"); + ContrailSubnetHostRouteMapper mapper = new ContrailSubnetHostRouteMapper(hostRoute); + ContrailSubnetHostRoute cshr = mapper.map(); + assertEquals("hop", cshr.getNextHop()); + assertEquals("prefix", cshr.getPrefix()); + } + + @Test + public void contrailSubnetPoolMapperTest() { + Pool pool = new Pool(); + pool.setStart("start"); + pool.setEnd("end"); + ContrailSubnetPoolMapper mapper = new ContrailSubnetPoolMapper(pool); + ContrailSubnetPool csPool = mapper.map(); + assertEquals("start", csPool.getStart()); + assertEquals("end", csPool.getEnd()); + } + + @Test + public void checkIsNullOrEmpty() { + ContrailSubnetMapper mapper = new ContrailSubnetMapper(null); + assertEquals(true, mapper.isNullOrEmpty("")); + assertEquals(true, mapper.isNullOrEmpty(null)); + assertEquals(false, mapper.isNullOrEmpty("hello")); + } + + @Test + public void createSubnetTestValidCidr() { + Subnet subnet = new Subnet(); + subnet.setCidr("test/value"); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + + assertEquals("test", result.getSubnet().getIpPrefix()); + assertEquals("value", result.getSubnet().getIpPrefixLen()); + } + + @Test + public void createSubnetTestInvalidCidr() { + Subnet subnet = new Subnet(); + subnet.setCidr("test"); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + assertEquals(null, result.getSubnet().getIpPrefix()); + assertEquals(null, result.getSubnet().getIpPrefixLen()); + + } + + @Test + public void createSubnetTestNullCidr() { + Subnet subnet = new Subnet(); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + assertEquals(null, result.getSubnet().getIpPrefix()); + assertEquals(null, result.getSubnet().getIpPrefixLen()); + } + + @Test + public void createContrailSubnetPoolTest() { + List<Pool> pools = new ArrayList<>(); + Pool pool1 = new Pool(); + pool1.setStart("start1"); + pool1.setEnd("end1"); + Pool pool2 = new Pool(); + pool2.setStart("start2"); + pool2.setEnd("end2"); + pools.add(pool1); + pools.add(pool2); + + Subnet subnet = new Subnet(); + subnet.setAllocationPools(pools); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + List<ContrailSubnetPool> cspools = result.getAllocationPools(); + assertEquals(2, cspools.size()); + assertEquals("start2", cspools.get(1).getStart()); + assertEquals("end2", cspools.get(1).getEnd()); + } + + @Test + public void createContrailSubnetPoolInvalidTest() { + List<Pool> pools = new ArrayList<>(); + Pool pool1 = new Pool(); + pool1.setStart("start1"); + pool1.setEnd("end1"); + Pool pool2 = new Pool(); + pool2.setStart("start2"); + pools.add(pool1); + pools.add(pool2); + + Subnet subnet = new Subnet(); + subnet.setAllocationPools(pools); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + List<ContrailSubnetPool> cspools = result.getAllocationPools(); + assertEquals(1, cspools.size()); + assertEquals("start1", cspools.get(0).getStart()); + assertEquals("end1", cspools.get(0).getEnd()); + } + + @Test + public void createContrailSubnetPoolEmptyTest() { + + Subnet subnet = new Subnet(); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + List<ContrailSubnetPool> cspools = result.getAllocationPools(); + assertEquals(true, cspools.isEmpty()); + + } + + @Test + public void createContrailSubnetHostRoutesTest() { + List<HostRoute> hostRoutes = new ArrayList<>(); + HostRoute hostRoute1 = new HostRoute(); + hostRoute1.setNextHop("next-hop1"); + hostRoute1.setPrefix("prefix1"); + HostRoute hostRoute2 = new HostRoute(); + hostRoute2.setNextHop("next-hop2"); + hostRoute2.setPrefix("prefix2"); + hostRoutes.add(hostRoute1); + hostRoutes.add(hostRoute2); + + Subnet subnet = new Subnet(); + subnet.setHostRoutes(hostRoutes); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + ContrailSubnetHostRoutes routes = result.getHostRoutes(); + assertEquals(2, routes.getHostRoutes().size()); + assertEquals("next-hop2", routes.getHostRoutes().get(1).getNextHop()); + assertEquals("prefix2", routes.getHostRoutes().get(1).getPrefix()); + } + + @Test + public void createContrailSubnetHostRoutesMissingFieldTest() { + List<HostRoute> hostRoutes = new ArrayList<>(); + HostRoute hostRoute1 = new HostRoute(); + hostRoute1.setNextHop("next-hop1"); + HostRoute hostRoute2 = new HostRoute(); + hostRoute2.setNextHop("next-hop2"); + hostRoute2.setPrefix("prefix2"); + hostRoutes.add(hostRoute1); + hostRoutes.add(hostRoute2); + + Subnet subnet = new Subnet(); + subnet.setHostRoutes(hostRoutes); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + ContrailSubnetHostRoutes routes = result.getHostRoutes(); + assertEquals(2, routes.getHostRoutes().size()); + assertEquals("next-hop1", routes.getHostRoutes().get(0).getNextHop()); + assertEquals("prefix2", routes.getHostRoutes().get(1).getPrefix()); + } + + @Test + public void createContrailSubnetHostRoutesEmptyTest() { + List<HostRoute> hostRoutes = new ArrayList<>(); + Subnet subnet = new Subnet(); + subnet.setHostRoutes(hostRoutes); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + ContrailSubnetHostRoutes routes = result.getHostRoutes(); + assertEquals(true, routes.getHostRoutes().isEmpty()); + } + + @Test + public void getSubnetNameTest() { + Subnet subnet = new Subnet(); + subnet.setSubnetName("name"); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + assertEquals("if subnetName is populated map", "name", mapper.getSubnetName(subnet)); + subnet = new Subnet(); + subnet.setSubnetId("id"); + mapper = new ContrailSubnetMapper(subnet); + assertEquals("choose id when name is null", "id", mapper.getSubnetName(subnet)); + subnet = new Subnet(); + mapper = new ContrailSubnetMapper(subnet); + assertEquals("expect null", null, mapper.getSubnetName(subnet)); + } + + @Test + public void mapRemainingFields() { + Subnet subnet = new Subnet(); + subnet.setEnableDHCP(true); + subnet.setGatewayIp("gateway-ip"); + ContrailSubnetMapper mapper = new ContrailSubnetMapper(subnet); + ContrailSubnet result = mapper.map(); + assertEquals(true, result.isEnableDhcp()); + assertEquals("gateway-ip", result.getDefaultGateway()); + } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/nwrest/NetworkRequestTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/nwrest/NetworkRequestTest.java index 5e04fc49ee..f0f1565cf3 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/nwrest/NetworkRequestTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/nwrest/NetworkRequestTest.java @@ -21,21 +21,20 @@ package org.onap.so.adapters.nwrest; import static org.junit.Assert.assertEquals; - import org.junit.Test; public class NetworkRequestTest { - - @Test - public void isSynchronousTrue() { - CreateNetworkRequest networkResponse = new CreateNetworkRequest(); - assertEquals(true, networkResponse.isSynchronous()); - //flip synchronous to false in the background - networkResponse.setNotificationUrl("testtest"); - assertEquals(false, networkResponse.isSynchronous()); - networkResponse.setNotificationUrl(""); - assertEquals(true, networkResponse.isSynchronous()); - } - + + @Test + public void isSynchronousTrue() { + CreateNetworkRequest networkResponse = new CreateNetworkRequest(); + assertEquals(true, networkResponse.isSynchronous()); + // flip synchronous to false in the background + networkResponse.setNotificationUrl("testtest"); + assertEquals(false, networkResponse.isSynchronous()); + networkResponse.setNotificationUrl(""); + assertEquals(true, networkResponse.isSynchronous()); + } + } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/vdu/BeansTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/vdu/BeansTest.java index e681d43256..d7704a46d6 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/vdu/BeansTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/adapters/vdu/BeansTest.java @@ -21,7 +21,6 @@ package org.onap.so.adapters.vdu; import org.junit.Test; - import com.openpojo.reflection.PojoClass; import com.openpojo.reflection.PojoClassFilter; import com.openpojo.reflection.filters.FilterPackageInfo; @@ -33,24 +32,22 @@ import com.openpojo.validation.test.impl.SetterTester; public class BeansTest { - private PojoClassFilter filterTestClasses = new FilterTestClasses(); + private PojoClassFilter filterTestClasses = new FilterTestClasses(); + + @Test + public void pojoStructure() { + test("org.onap.so.adapters.vdu"); + } - @Test - public void pojoStructure() { - test("org.onap.so.adapters.vdu"); - } + private void test(String pojoPackage) { + Validator validator = ValidatorBuilder.create().with(new GetterMustExistRule()).with(new SetterTester()) + .with(new GetterTester()).build(); + validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses); + } - private void test(String pojoPackage) { - Validator validator = ValidatorBuilder.create() - .with(new GetterMustExistRule()) - .with(new SetterTester()) - .with(new GetterTester()) - .build(); - validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses); - } - private static class FilterTestClasses implements PojoClassFilter { - public boolean include(PojoClass pojoClass) { - return !pojoClass.getSourcePath().contains("/test-classes/"); - } - } + private static class FilterTestClasses implements PojoClassFilter { + public boolean include(PojoClass pojoClass) { + return !pojoClass.getSourcePath().contains("/test-classes/"); + } + } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoAdapterExceptionTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoAdapterExceptionTest.java index 28a4a8302f..4c864a72b7 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoAdapterExceptionTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoAdapterExceptionTest.java @@ -28,14 +28,14 @@ public class MsoAdapterExceptionTest { @Test public void testConstructor() { MsoAdapterException msoAdapterException = new MsoAdapterException("test"); - Assert.assertEquals("test",msoAdapterException.getMessage()); + Assert.assertEquals("test", msoAdapterException.getMessage()); Assert.assertEquals(MsoExceptionCategory.INTERNAL, msoAdapterException.category); } @Test public void testOverloadedConstructor() { - MsoAdapterException msoAdapterException = new MsoAdapterException("test" , new Throwable()); - Assert.assertEquals("test",msoAdapterException.getMessage()); + MsoAdapterException msoAdapterException = new MsoAdapterException("test", new Throwable()); + Assert.assertEquals("test", msoAdapterException.getMessage()); Assert.assertEquals(MsoExceptionCategory.INTERNAL, msoAdapterException.category); Assert.assertNotNull(msoAdapterException.getCause()); } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFoundTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFoundTest.java index e7befed71a..050c784c51 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFoundTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoCloudIdentityNotFoundTest.java @@ -27,16 +27,16 @@ public class MsoCloudIdentityNotFoundTest { @Test public void testConstructor() { MsoCloudIdentityNotFound msoCloudIdentityNotFound = new MsoCloudIdentityNotFound(); - Assert.assertEquals("Cloud Identity not found",msoCloudIdentityNotFound.getMessage()); - Assert.assertEquals("Cloud Identity not found",msoCloudIdentityNotFound.toString()); + Assert.assertEquals("Cloud Identity not found", msoCloudIdentityNotFound.getMessage()); + Assert.assertEquals("Cloud Identity not found", msoCloudIdentityNotFound.toString()); Assert.assertEquals(MsoExceptionCategory.USERDATA, msoCloudIdentityNotFound.category); } @Test public void testOverloadedConstructor() { MsoCloudIdentityNotFound msoCloudIdentityNotFound = new MsoCloudIdentityNotFound("test"); - Assert.assertEquals("Cloud Identity [test] not found",msoCloudIdentityNotFound.getMessage()); - Assert.assertEquals("Cloud Identity [test] not found",msoCloudIdentityNotFound.toString()); + Assert.assertEquals("Cloud Identity [test] not found", msoCloudIdentityNotFound.getMessage()); + Assert.assertEquals("Cloud Identity [test] not found", msoCloudIdentityNotFound.toString()); Assert.assertEquals(MsoExceptionCategory.USERDATA, msoCloudIdentityNotFound.category); } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFoundTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFoundTest.java index c75a66e100..d6c57bb267 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFoundTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoCloudSiteNotFoundTest.java @@ -27,16 +27,16 @@ public class MsoCloudSiteNotFoundTest { @Test public void testConstructor() { MsoCloudSiteNotFound msoCloudSiteNotFound = new MsoCloudSiteNotFound(); - Assert.assertEquals("Cloud site not found",msoCloudSiteNotFound.getMessage()); - Assert.assertEquals("Cloud site not found",msoCloudSiteNotFound.toString()); + Assert.assertEquals("Cloud site not found", msoCloudSiteNotFound.getMessage()); + Assert.assertEquals("Cloud site not found", msoCloudSiteNotFound.toString()); Assert.assertEquals(MsoExceptionCategory.USERDATA, msoCloudSiteNotFound.category); } @Test public void testOverloadedConstructor() { MsoCloudSiteNotFound msoCloudSiteNotFound = new MsoCloudSiteNotFound("test"); - Assert.assertEquals("Cloud Site [test] not found",msoCloudSiteNotFound.getMessage()); - Assert.assertEquals("Cloud Site [test] not found",msoCloudSiteNotFound.toString()); + Assert.assertEquals("Cloud Site [test] not found", msoCloudSiteNotFound.getMessage()); + Assert.assertEquals("Cloud Site [test] not found", msoCloudSiteNotFound.toString()); Assert.assertEquals(MsoExceptionCategory.USERDATA, msoCloudSiteNotFound.category); } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoIOExceptionTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoIOExceptionTest.java index e257e52cd4..58425ed7d1 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoIOExceptionTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoIOExceptionTest.java @@ -27,14 +27,14 @@ public class MsoIOExceptionTest { @Test public void testConstructor() { MsoIOException msoIOException = new MsoIOException("test"); - Assert.assertEquals("test",msoIOException.getMessage()); + Assert.assertEquals("test", msoIOException.getMessage()); Assert.assertEquals(MsoExceptionCategory.IO, msoIOException.category); } @Test public void testOverloadedConstructor() { MsoIOException msoIOException = new MsoIOException("test", new Throwable()); - Assert.assertEquals("test",msoIOException.getMessage()); + Assert.assertEquals("test", msoIOException.getMessage()); Assert.assertEquals(MsoExceptionCategory.IO, msoIOException.category); Assert.assertNotNull(msoIOException.getCause()); } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExistsTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExistsTest.java index 96ff89c094..f19fd57947 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExistsTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoNetworkAlreadyExistsTest.java @@ -27,9 +27,11 @@ public class MsoNetworkAlreadyExistsTest { @Test public void testConstructor() { - MsoNetworkAlreadyExists msoNetworkAlreadyExists = new MsoNetworkAlreadyExists("test","test","test"); - Assert.assertEquals("Stack test already exists in Tenant test in Cloud test",msoNetworkAlreadyExists.getMessage()); - Assert.assertEquals("409 Conflict: Stack test already exists in Tenant test in Cloud test",msoNetworkAlreadyExists.toString()); + MsoNetworkAlreadyExists msoNetworkAlreadyExists = new MsoNetworkAlreadyExists("test", "test", "test"); + Assert.assertEquals("Stack test already exists in Tenant test in Cloud test", + msoNetworkAlreadyExists.getMessage()); + Assert.assertEquals("409 Conflict: Stack test already exists in Tenant test in Cloud test", + msoNetworkAlreadyExists.toString()); } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoNetworkNotFoundTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoNetworkNotFoundTest.java index 5991e55915..e35214f191 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoNetworkNotFoundTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoNetworkNotFoundTest.java @@ -27,9 +27,10 @@ public class MsoNetworkNotFoundTest { @Test public void testConstructor() { - MsoNetworkNotFound msoNetworkNotFound =new MsoNetworkNotFound("test","test","test"); - Assert.assertEquals("Network test does not exist in Cloud/Tenant test/test",msoNetworkNotFound.getMessage()); - Assert.assertEquals("404 Not Found: Network test does not exist in Cloud/Tenant test/test",msoNetworkNotFound.toString()); + MsoNetworkNotFound msoNetworkNotFound = new MsoNetworkNotFound("test", "test", "test"); + Assert.assertEquals("Network test does not exist in Cloud/Tenant test/test", msoNetworkNotFound.getMessage()); + Assert.assertEquals("404 Not Found: Network test does not exist in Cloud/Tenant test/test", + msoNetworkNotFound.toString()); } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoOpenstackExceptionTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoOpenstackExceptionTest.java index 7bdb2283e8..f9022c3f57 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoOpenstackExceptionTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoOpenstackExceptionTest.java @@ -27,17 +27,17 @@ public class MsoOpenstackExceptionTest { @Test public void testConstructor() { - MsoOpenstackException msoOpenstackException= new MsoOpenstackException(404,"test","test"); - Assert.assertEquals("test",msoOpenstackException.getMessage()); - Assert.assertEquals("404 test: test",msoOpenstackException.toString()); + MsoOpenstackException msoOpenstackException = new MsoOpenstackException(404, "test", "test"); + Assert.assertEquals("test", msoOpenstackException.getMessage()); + Assert.assertEquals("404 test: test", msoOpenstackException.toString()); Assert.assertEquals(MsoExceptionCategory.OPENSTACK, msoOpenstackException.category); } @Test public void testOverloadedConstructor() { - MsoOpenstackException msoOpenstackExceptionEx= new MsoOpenstackException(404,"test","test",new Exception()); - Assert.assertEquals("test",msoOpenstackExceptionEx.getMessage()); - Assert.assertEquals("404 test: test",msoOpenstackExceptionEx.toString()); + MsoOpenstackException msoOpenstackExceptionEx = new MsoOpenstackException(404, "test", "test", new Exception()); + Assert.assertEquals("test", msoOpenstackExceptionEx.getMessage()); + Assert.assertEquals("404 test: test", msoOpenstackExceptionEx.toString()); Assert.assertEquals(MsoExceptionCategory.OPENSTACK, msoOpenstackExceptionEx.category); Assert.assertNotNull(msoOpenstackExceptionEx.getCause()); diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExistsTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExistsTest.java index 4b44f0db93..6a9f05d853 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExistsTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoStackAlreadyExistsTest.java @@ -28,7 +28,9 @@ public class MsoStackAlreadyExistsTest { @Test public void testConstructor() { MsoStackAlreadyExists msoStackAlreadyExists = new MsoStackAlreadyExists("test", "test", "test"); - Assert.assertEquals("Stack test already exists in Tenant test in Cloud test",msoStackAlreadyExists.getMessage()); - Assert.assertEquals("409 Conflict: Stack test already exists in Tenant test in Cloud test",msoStackAlreadyExists.toString()); + Assert.assertEquals("Stack test already exists in Tenant test in Cloud test", + msoStackAlreadyExists.getMessage()); + Assert.assertEquals("409 Conflict: Stack test already exists in Tenant test in Cloud test", + msoStackAlreadyExists.toString()); } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoStackNotFoundTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoStackNotFoundTest.java index 8ce5a33cc4..1dd07b72e5 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoStackNotFoundTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoStackNotFoundTest.java @@ -28,7 +28,8 @@ public class MsoStackNotFoundTest { @Test public void testConstructor() { MsoStackNotFound msoStackNotFound = new MsoStackNotFound("test", "test", "test"); - Assert.assertEquals("Stack test does not exist in Cloud/Tenant test/test",msoStackNotFound.getMessage()); - Assert.assertEquals("404 Not Found: Stack test does not exist in Cloud/Tenant test/test",msoStackNotFound.toString()); + Assert.assertEquals("Stack test does not exist in Cloud/Tenant test/test", msoStackNotFound.getMessage()); + Assert.assertEquals("404 Not Found: Stack test does not exist in Cloud/Tenant test/test", + msoStackNotFound.toString()); } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExistsTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExistsTest.java index 5999a587a5..5bfdbd38e4 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExistsTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoTenantAlreadyExistsTest.java @@ -27,8 +27,9 @@ public class MsoTenantAlreadyExistsTest { @Test public void testConstructor() { - MsoTenantAlreadyExists msoTenantAlreadyExists = new MsoTenantAlreadyExists("test","test"); - Assert.assertEquals("Tenant test already exists in Cloud test",msoTenantAlreadyExists.getMessage()); - Assert.assertEquals("409 Conflict: Tenant test already exists in Cloud test",msoTenantAlreadyExists.toString()); + MsoTenantAlreadyExists msoTenantAlreadyExists = new MsoTenantAlreadyExists("test", "test"); + Assert.assertEquals("Tenant test already exists in Cloud test", msoTenantAlreadyExists.getMessage()); + Assert.assertEquals("409 Conflict: Tenant test already exists in Cloud test", + msoTenantAlreadyExists.toString()); } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoTenantNotFoundTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoTenantNotFoundTest.java index 23df616573..f45cddc676 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoTenantNotFoundTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/exceptions/MsoTenantNotFoundTest.java @@ -27,9 +27,9 @@ public class MsoTenantNotFoundTest { @Test public void testConstructor() { - MsoTenantNotFound msoTenantNotFound = new MsoTenantNotFound("test","test"); - Assert.assertEquals("Tenant test does not exist in Cloud test",msoTenantNotFound.getMessage()); - Assert.assertEquals("404 Not Found: Tenant test does not exist in Cloud test",msoTenantNotFound.toString()); + MsoTenantNotFound msoTenantNotFound = new MsoTenantNotFound("test", "test"); + Assert.assertEquals("Tenant test does not exist in Cloud test", msoTenantNotFound.getMessage()); + Assert.assertEquals("404 Not Found: Tenant test does not exist in Cloud test", msoTenantNotFound.toString()); } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/JAXBMarshallingTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/JAXBMarshallingTest.java index 038e88317d..8d27e54892 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/JAXBMarshallingTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/JAXBMarshallingTest.java @@ -21,14 +21,11 @@ package org.onap.so.openstack.mappers; import static org.junit.Assert.assertEquals; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; - import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; - import org.junit.Test; import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; @@ -36,16 +33,17 @@ import org.onap.so.adapters.vnfrest.CreateVfModuleRequest; public class JAXBMarshallingTest { - @Test - public void xmlMarshalTest() throws IOException, JAXBException { - JAXBContext context = JAXBContext.newInstance(CreateVfModuleRequest.class); + @Test + public void xmlMarshalTest() throws IOException, JAXBException { + JAXBContext context = JAXBContext.newInstance(CreateVfModuleRequest.class); - CreateVfModuleRequest request = (CreateVfModuleRequest) context.createUnmarshaller().unmarshal(Files.newBufferedReader(Paths.get("src/test/resources/createVfModuleRequest-with-params.xml"))); + CreateVfModuleRequest request = (CreateVfModuleRequest) context.createUnmarshaller().unmarshal( + Files.newBufferedReader(Paths.get("src/test/resources/createVfModuleRequest-with-params.xml"))); - assertEquals("ubuntu-16-04-cloud-amd64", request.getVfModuleParams().get("vcpe_image_name")); - assertEquals("10.2.0.0/24", request.getVfModuleParams().get("cpe_public_net_cidr")); - assertEquals("", request.getVfModuleParams().get("workload_context")); + assertEquals("ubuntu-16-04-cloud-amd64", request.getVfModuleParams().get("vcpe_image_name")); + assertEquals("10.2.0.0/24", request.getVfModuleParams().get("cpe_public_net_cidr")); + assertEquals("", request.getVfModuleParams().get("workload_context")); - } + } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/NetworkInfoMapperTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/NetworkInfoMapperTest.java index 90e15f8ba5..0af0efccd2 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/NetworkInfoMapperTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/NetworkInfoMapperTest.java @@ -21,104 +21,101 @@ package org.onap.so.openstack.mappers; import static org.junit.Assert.assertEquals; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Optional; - import org.javatuples.Pair; import org.junit.Test; 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 NetworkInfoMapperTest { - @Test - public void checkNetworkStatusMap() { - NetworkInfoMapper mapper = new NetworkInfoMapper(new Network()); - assertEquals(NetworkStatus.ACTIVE, mapper.mapStatus("ACTIVE")); - assertEquals(NetworkStatus.BUILD, mapper.mapStatus("BUILD")); - assertEquals(NetworkStatus.ERROR, mapper.mapStatus("ERROR")); - assertEquals(NetworkStatus.DOWN, mapper.mapStatus("DOWN")); - assertEquals(NetworkStatus.UNKNOWN, mapper.mapStatus("NOT IN MAP")); - assertEquals(NetworkStatus.UNKNOWN, mapper.mapStatus(null)); - } - - @Test - public void checkLocateVlanInformationNoSegments() { - Network network = new Network(); - network.setProviderPhysicalNetwork("test-physical-network"); - network.setProviderNetworkType("vlan"); - network.setProviderSegmentationId(2); - NetworkInfoMapper mapper = new NetworkInfoMapper(network); - NetworkInfo result = mapper.map(); - assertEquals("test-physical-network", result.getProvider()); - assertEquals(1, result.getVlans().size()); - assertEquals(2, result.getVlans().get(0).intValue()); - } - - @Test - public void checkLocateVlanInformationSegments() { - Network network = new Network(); - addSegments(network); + @Test + public void checkNetworkStatusMap() { + NetworkInfoMapper mapper = new NetworkInfoMapper(new Network()); + assertEquals(NetworkStatus.ACTIVE, mapper.mapStatus("ACTIVE")); + assertEquals(NetworkStatus.BUILD, mapper.mapStatus("BUILD")); + assertEquals(NetworkStatus.ERROR, mapper.mapStatus("ERROR")); + assertEquals(NetworkStatus.DOWN, mapper.mapStatus("DOWN")); + assertEquals(NetworkStatus.UNKNOWN, mapper.mapStatus("NOT IN MAP")); + assertEquals(NetworkStatus.UNKNOWN, mapper.mapStatus(null)); + } + + @Test + public void checkLocateVlanInformationNoSegments() { + Network network = new Network(); + network.setProviderPhysicalNetwork("test-physical-network"); + network.setProviderNetworkType("vlan"); + network.setProviderSegmentationId(2); + NetworkInfoMapper mapper = new NetworkInfoMapper(network); + NetworkInfo result = mapper.map(); + assertEquals("test-physical-network", result.getProvider()); + assertEquals(1, result.getVlans().size()); + assertEquals(2, result.getVlans().get(0).intValue()); + } + + @Test + public void checkLocateVlanInformationSegments() { + Network network = new Network(); + addSegments(network); + + NetworkInfoMapper mapper = new NetworkInfoMapper(network); + NetworkInfo result = mapper.map(); + assertEquals("type1", result.getProvider()); + assertEquals(2, result.getVlans().size()); + assertEquals(Arrays.asList(1, 2).toString(), result.getVlans().toString()); + } + + @Test + public void checkLocateVlanInformationSegmentsAndPhysical() { + Network network = new Network(); + addSegments(network); + network.setProviderPhysicalNetwork("test-physical-network"); + network.setProviderNetworkType("vlan"); + network.setProviderSegmentationId(2); + NetworkInfoMapper mapper = new NetworkInfoMapper(network); + NetworkInfo result = mapper.map(); + assertEquals("test-physical-network", result.getProvider()); + assertEquals(1, result.getVlans().size()); + assertEquals(2, result.getVlans().get(0).intValue()); + } + + @Test + public void nullNetwork() { + NetworkInfoMapper mapper = new NetworkInfoMapper(null); + assertEquals(NetworkStatus.NOTFOUND, mapper.map().getStatus()); + } + + @Test + public void mapFields() { + Network network = new Network(); + network.setId("id"); + network.setName("name"); + network.setSubnets(Arrays.asList("string1", "string2")); + NetworkInfoMapper mapper = new NetworkInfoMapper(network); + NetworkInfo mapped = mapper.map(); + assertEquals("name", mapped.getName()); + assertEquals("id", mapped.getId()); + assertEquals(network.getSubnets(), mapped.getSubnets()); + } - NetworkInfoMapper mapper = new NetworkInfoMapper(network); - NetworkInfo result = mapper.map(); - assertEquals("type1", result.getProvider()); - assertEquals(2, result.getVlans().size()); - assertEquals(Arrays.asList(1, 2).toString(), result.getVlans().toString()); - } - - @Test - public void checkLocateVlanInformationSegmentsAndPhysical() { - Network network = new Network(); - addSegments(network); - network.setProviderPhysicalNetwork("test-physical-network"); - network.setProviderNetworkType("vlan"); - network.setProviderSegmentationId(2); - NetworkInfoMapper mapper = new NetworkInfoMapper(network); - NetworkInfo result = mapper.map(); - assertEquals("test-physical-network", result.getProvider()); - assertEquals(1, result.getVlans().size()); - assertEquals(2, result.getVlans().get(0).intValue()); - } - - @Test - public void nullNetwork() { - NetworkInfoMapper mapper = new NetworkInfoMapper(null); - assertEquals(NetworkStatus.NOTFOUND, mapper.map().getStatus()); - } - - @Test - public void mapFields() { - Network network = new Network(); - network.setId("id"); - network.setName("name"); - network.setSubnets(Arrays.asList("string1", "string2")); - NetworkInfoMapper mapper = new NetworkInfoMapper(network); - NetworkInfo mapped = mapper.map(); - assertEquals("name", mapped.getName()); - assertEquals("id", mapped.getId()); - assertEquals(network.getSubnets(), mapped.getSubnets()); - } - - private Network addSegments(Network network) { - List<Segment> segments = new ArrayList<>(); - Segment segment1 = new Segment(); - segment1.setProviderPhysicalNetwork("type1"); - segment1.setProviderNetworkType("vlan"); - segment1.setProviderSegmentationId(1); - segments.add(segment1); - Segment segment2 = new Segment(); - segment2.setProviderPhysicalNetwork("type2"); - segment2.setProviderNetworkType("vlan"); - segment2.setProviderSegmentationId(2); - segments.add(segment2); - network.setSegments(segments); - return network; - } + private Network addSegments(Network network) { + List<Segment> segments = new ArrayList<>(); + Segment segment1 = new Segment(); + segment1.setProviderPhysicalNetwork("type1"); + segment1.setProviderNetworkType("vlan"); + segment1.setProviderSegmentationId(1); + segments.add(segment1); + Segment segment2 = new Segment(); + segment2.setProviderPhysicalNetwork("type2"); + segment2.setProviderNetworkType("vlan"); + segment2.setProviderSegmentationId(2); + segments.add(segment2); + network.setSegments(segments); + return network; + } } diff --git a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/StackInfoMapperTest.java b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/StackInfoMapperTest.java index f01745f8c1..4ca0186a82 100644 --- a/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/StackInfoMapperTest.java +++ b/adapters/mso-adapters-rest-interface/src/test/java/org/onap/so/openstack/mappers/StackInfoMapperTest.java @@ -21,17 +21,14 @@ package org.onap.so.openstack.mappers; import static org.junit.Assert.assertEquals; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; - import org.junit.Test; import org.onap.so.openstack.beans.HeatStatus; import org.onap.so.openstack.beans.StackInfo; - import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -39,56 +36,57 @@ import com.woorea.openstack.heat.model.Stack; public class StackInfoMapperTest { - private static final String PATH = "src/test/resources/"; - @Test - public void nullStack() { - StackInfoMapper mapper = new StackInfoMapper(null); - assertEquals(HeatStatus.NOTFOUND, mapper.map().getStatus()); - } - - @Test - public void checkHeatStatusMap() { - StackInfoMapper mapper = new StackInfoMapper(null); - assertEquals(HeatStatus.BUILDING, mapper.mapStatus("CREATE_IN_PROGRESS")); - assertEquals(HeatStatus.CREATED, mapper.mapStatus("CREATE_COMPLETE")); - assertEquals(HeatStatus.FAILED, mapper.mapStatus("CREATE_FAILED")); - assertEquals(HeatStatus.DELETING, mapper.mapStatus("DELETE_IN_PROGRESS")); - assertEquals(HeatStatus.NOTFOUND, mapper.mapStatus("DELETE_COMPLETE")); - assertEquals(HeatStatus.FAILED, mapper.mapStatus("DELETE_FAILED")); - assertEquals(HeatStatus.UPDATING, mapper.mapStatus("UPDATE_IN_PROGRESS")); - assertEquals(HeatStatus.FAILED, mapper.mapStatus("UPDATE_FAILED")); - assertEquals(HeatStatus.UPDATED, mapper.mapStatus("UPDATE_COMPLETE")); - assertEquals(HeatStatus.INIT, mapper.mapStatus(null)); - assertEquals(HeatStatus.UNKNOWN, mapper.mapStatus("status-not-there")); - } - - @Test - public void checkOutputToMap() throws JsonParseException, JsonMappingException, IOException { - ObjectMapper jacksonMapper = new ObjectMapper(); - Stack sample = jacksonMapper.readValue(this.getJson("stack-example.json"), Stack.class); - StackInfoMapper mapper = new StackInfoMapper(sample); - StackInfo result = mapper.map(); - Map<String, Object> map = result.getOutputs(); - assertEquals(true, map.containsKey("key2")); - assertEquals("value1", map.get("key1")); - } - - @Test - public void mapRemainingFields() { - Stack stack = new Stack(); - stack.setStackName("name"); - stack.setId("id"); - stack.setStackStatusReason("message"); - stack.setParameters(new HashMap<String, Object>()); - StackInfoMapper mapper = new StackInfoMapper(stack); - StackInfo info = mapper.map(); - assertEquals("name", info.getName()); - assertEquals("name/id", info.getCanonicalName()); - assertEquals("message", info.getStatusMessage()); - assertEquals(stack.getParameters(), info.getParameters()); - } - - private String getJson(String filename) throws IOException { - return new String(Files.readAllBytes(Paths.get(PATH + filename))); - } + private static final String PATH = "src/test/resources/"; + + @Test + public void nullStack() { + StackInfoMapper mapper = new StackInfoMapper(null); + assertEquals(HeatStatus.NOTFOUND, mapper.map().getStatus()); + } + + @Test + public void checkHeatStatusMap() { + StackInfoMapper mapper = new StackInfoMapper(null); + assertEquals(HeatStatus.BUILDING, mapper.mapStatus("CREATE_IN_PROGRESS")); + assertEquals(HeatStatus.CREATED, mapper.mapStatus("CREATE_COMPLETE")); + assertEquals(HeatStatus.FAILED, mapper.mapStatus("CREATE_FAILED")); + assertEquals(HeatStatus.DELETING, mapper.mapStatus("DELETE_IN_PROGRESS")); + assertEquals(HeatStatus.NOTFOUND, mapper.mapStatus("DELETE_COMPLETE")); + assertEquals(HeatStatus.FAILED, mapper.mapStatus("DELETE_FAILED")); + assertEquals(HeatStatus.UPDATING, mapper.mapStatus("UPDATE_IN_PROGRESS")); + assertEquals(HeatStatus.FAILED, mapper.mapStatus("UPDATE_FAILED")); + assertEquals(HeatStatus.UPDATED, mapper.mapStatus("UPDATE_COMPLETE")); + assertEquals(HeatStatus.INIT, mapper.mapStatus(null)); + assertEquals(HeatStatus.UNKNOWN, mapper.mapStatus("status-not-there")); + } + + @Test + public void checkOutputToMap() throws JsonParseException, JsonMappingException, IOException { + ObjectMapper jacksonMapper = new ObjectMapper(); + Stack sample = jacksonMapper.readValue(this.getJson("stack-example.json"), Stack.class); + StackInfoMapper mapper = new StackInfoMapper(sample); + StackInfo result = mapper.map(); + Map<String, Object> map = result.getOutputs(); + assertEquals(true, map.containsKey("key2")); + assertEquals("value1", map.get("key1")); + } + + @Test + public void mapRemainingFields() { + Stack stack = new Stack(); + stack.setStackName("name"); + stack.setId("id"); + stack.setStackStatusReason("message"); + stack.setParameters(new HashMap<String, Object>()); + StackInfoMapper mapper = new StackInfoMapper(stack); + StackInfo info = mapper.map(); + assertEquals("name", info.getName()); + assertEquals("name/id", info.getCanonicalName()); + assertEquals("message", info.getStatusMessage()); + assertEquals(stack.getParameters(), info.getParameters()); + } + + private String getJson(String filename) throws IOException { + return new String(Files.readAllBytes(Paths.get(PATH + filename))); + } } |