diff options
Diffstat (limited to 'adapters/mso-network-adapter/src/main/java')
7 files changed, 66 insertions, 66 deletions
diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/BpelRestClient.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/BpelRestClient.java index b7ab5043f3..6c571f3e06 100644 --- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/BpelRestClient.java +++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/BpelRestClient.java @@ -166,7 +166,7 @@ public class BpelRestClient { } public String getRetryList() { - if (retryList.size() == 0) + if (retryList.isEmpty()) return ""; String t = retryList.toString(); return t.substring(1, t.length()-1); diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailPolicyRef.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailPolicyRef.java index 699e89b03d..0504627377 100644 --- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailPolicyRef.java +++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailPolicyRef.java @@ -22,17 +22,14 @@ package org.openecomp.mso.adapters.network; import org.codehaus.jackson.JsonNode; -import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.openecomp.mso.logger.MessageEnum; import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.openstack.exceptions.MsoAdapterException; public class ContrailPolicyRef { - private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); + private static MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); @JsonProperty("network_policy_refs_data_sequence") private ContrailPolicyRefSeq seq; @@ -47,7 +44,7 @@ public class ContrailPolicyRef { } catch (Exception e) { - LOGGER.error (MessageEnum.RA_MARSHING_ERROR, "Error creating JsonString for Contrail Policy Ref", "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Policy Ref", e); + logger.error (MessageEnum.RA_MARSHING_ERROR, "Error creating JsonString for Contrail Policy Ref", "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Policy Ref", e); } return node; @@ -63,7 +60,7 @@ public class ContrailPolicyRef { } catch (Exception e) { - LOGGER.error (MessageEnum.RA_MARSHING_ERROR, "Error creating JsonString for Contrail Policy Ref", "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Policy Ref", e); + logger.error (MessageEnum.RA_MARSHING_ERROR, "Error creating JsonString for Contrail Policy Ref", "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Policy Ref", e); } return jsonString; diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailPolicyRefSeq.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailPolicyRefSeq.java index 9db00dffa9..c07678be85 100644 --- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailPolicyRefSeq.java +++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailPolicyRefSeq.java @@ -32,6 +32,7 @@ public class ContrailPolicyRefSeq { private String minor; public ContrailPolicyRefSeq() { + /* To be done */ } public ContrailPolicyRefSeq(String major, String minor) { diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnet.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnet.java index 80b6754656..ec523b87d9 100644 --- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnet.java +++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnet.java @@ -34,22 +34,22 @@ import org.openecomp.mso.openstack.beans.Subnet; import static org.openecomp.mso.openstack.utils.MsoCommonUtils.isNullOrEmpty; public class ContrailSubnet { - private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); + private static MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet") private ContrailSubnetIp subnet = new ContrailSubnetIp(); @JsonProperty("network_ipam_refs_data_ipam_subnets_default_gateway") - private String default_gateway; + private String defaultGateway; @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_name") - private String subnet_name; + private String subnetName; @JsonProperty("network_ipam_refs_data_ipam_subnets_enable_dhcp") - private Boolean enable_dhcp; + private Boolean enableDhcp; @JsonProperty("network_ipam_refs_data_ipam_subnets_addr_from_start") - private Boolean addr_from_start = true; + private Boolean addrFromStart = true; /** future - leave this commented private String subnet_uuid; @@ -60,18 +60,18 @@ public class ContrailSubnet { **/ @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools") - private List<ContrailSubnetPool> allocation_pools = new ArrayList <ContrailSubnetPool> (); + private List<ContrailSubnetPool> allocationPools = new ArrayList <> (); public ContrailSubnet() { super(); } - public String getDefault_gateway() { - return default_gateway; + public String getDefaultGateway() { + return defaultGateway; } - public void setDefault_gateway(String default_gateway) { - this.default_gateway = default_gateway; + public void setDefaultGateway(String defaultGateway) { + this.defaultGateway = defaultGateway; } public ContrailSubnetIp getSubnet() { @@ -82,36 +82,36 @@ public class ContrailSubnet { this.subnet = subnet; } - public Boolean isEnable_dhcp() { - return enable_dhcp; + public Boolean isEnableDhcp() { + return enableDhcp; } - public void setEnable_dhcp(Boolean enable_dhcp) { - this.enable_dhcp = enable_dhcp; + public void setEnableDhcp(Boolean enableDhcp) { + this.enableDhcp = enableDhcp; } - public String getSubnet_name() { - return subnet_name; + public String getSubnetName() { + return subnetName; } - public void setSubnet_name(String subnet_name) { - this.subnet_name = subnet_name; + public void setSubnetName(String subnetName) { + this.subnetName = subnetName; } - public List<ContrailSubnetPool> getAllocation_pools() { - return allocation_pools; + public List<ContrailSubnetPool> getAllocationPools() { + return allocationPools; } - public void setPools(List<ContrailSubnetPool> allocation_pools) { - this.allocation_pools = allocation_pools; + public void setPools(List<ContrailSubnetPool> allocationPools) { + this.allocationPools = allocationPools; } - public Boolean isAddr_from_start() { - return addr_from_start; + public Boolean isAddrFromStart() { + return addrFromStart; } - public void setAddr_from_start(Boolean addr_from_start) { - this.addr_from_start = addr_from_start; + public void setAddrFromStart(Boolean addrFromStart) { + this.addrFromStart = addrFromStart; } public JsonNode toJsonNode() @@ -124,8 +124,8 @@ public class ContrailSubnet { } catch (Exception e) { - String error = "Error creating JsonNode for Contrail Subnet:" + subnet_name; - LOGGER.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonNode for Contrail Subnet", e); + String error = "Error creating JsonNode for Contrail Subnet:" + subnetName; + logger.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonNode for Contrail Subnet", e); } return node; @@ -141,41 +141,41 @@ public class ContrailSubnet { } catch (Exception e) { - String error = "Error creating JsonString for Contrail Subnet:" + subnet_name; - LOGGER.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Subnet", e); + String error = "Error creating JsonString for Contrail Subnet:" + subnetName; + logger.error (MessageEnum.RA_MARSHING_ERROR, error, "", "", MsoLogger.ErrorCode.SchemaError, "Exception creating JsonString for Contrail Subnet", e); } return jsonString; } //poulate contrail subnet with input(from bopel) subnet - public void populateWith(Subnet i_subnet) + public void populateWith(Subnet inputSubnet) { - if (i_subnet != null) + if (inputSubnet != null) { - if (!isNullOrEmpty(i_subnet.getSubnetName())) - subnet_name = i_subnet.getSubnetName(); + if (!isNullOrEmpty(inputSubnet.getSubnetName())) + subnetName = inputSubnet.getSubnetName(); else - subnet_name = i_subnet.getSubnetId(); - enable_dhcp = i_subnet.getEnableDHCP(); - default_gateway = i_subnet.getGatewayIp(); - if (!isNullOrEmpty(i_subnet.getCidr()) ) + subnetName = inputSubnet.getSubnetId(); + enableDhcp = inputSubnet.getEnableDHCP(); + defaultGateway = inputSubnet.getGatewayIp(); + if (!isNullOrEmpty(inputSubnet.getCidr()) ) { - int idx = i_subnet.getCidr().indexOf("/"); + int idx = inputSubnet.getCidr().indexOf("/"); if (idx != -1) { - subnet.setIp_prefix(i_subnet.getCidr().substring(0, idx)); - subnet.setIp_prefix_len(i_subnet.getCidr().substring(idx+1)); + subnet.setIpPrefix(inputSubnet.getCidr().substring(0, idx)); + subnet.setIpPrefixLen(inputSubnet.getCidr().substring(idx+1)); } } - if (i_subnet.getAllocationPools() != null) + if (inputSubnet.getAllocationPools() != null) { - for (Pool pool : i_subnet.getAllocationPools()) + for (Pool pool : inputSubnet.getAllocationPools()) { if ( !isNullOrEmpty(pool.getStart()) && !isNullOrEmpty(pool.getEnd()) ) { ContrailSubnetPool csp = new ContrailSubnetPool(); csp.populateWith(pool); - allocation_pools.add (csp); + allocationPools.add (csp); } } } @@ -186,11 +186,11 @@ public class ContrailSubnet { public String toString() { StringBuilder buf = new StringBuilder (); - for (ContrailSubnetPool pool : allocation_pools) + for (ContrailSubnetPool pool : allocationPools) { buf.append(pool.toString()); } - return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + default_gateway - + " enable_dhcp=" + enable_dhcp + " addr_from_start=" + addr_from_start + " subnet_name=" + subnet_name + " allocation_pools=" + buf + " ]"; + 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-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetIp.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetIp.java index ce7fec392c..b7af894f8b 100644 --- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetIp.java +++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetIp.java @@ -26,33 +26,34 @@ import org.codehaus.jackson.annotate.JsonProperty; public class ContrailSubnetIp { @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix") - private String ip_prefix; + private String ipPrefix; @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len") - private String ip_prefix_len; + private String ipPrefixLen; public ContrailSubnetIp() { + /* Empty constructor */ } - public String getIp_prefix() { - return ip_prefix; + public String getIpPrefix() { + return ipPrefix; } - public void setIp_prefix(String ip_prefix) { - this.ip_prefix = ip_prefix; + public void setIpPrefix(String ipPrefix) { + this.ipPrefix = ipPrefix; } - public String getIp_prefix_len() { - return ip_prefix_len; + public String getIpPrefixLen() { + return ipPrefixLen; } - public void setIp_prefix_len(String ip_prefix_len) { - this.ip_prefix_len = ip_prefix_len; + public void setIpPrefixLen(String ipPrefixLen) { + this.ipPrefixLen = ipPrefixLen; } @Override public String toString() { - return "ContrailSubnetIp [ip_prefix=" + ip_prefix + ", ip_prefix_len=" + ip_prefix_len + "]"; + return "ContrailSubnetIp [ip_prefix=" + ipPrefix + ", ip_prefix_len=" + ipPrefixLen + "]"; } } diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetPool.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetPool.java index 71b9ebb4e2..6429e49e41 100644 --- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetPool.java +++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/ContrailSubnetPool.java @@ -32,6 +32,7 @@ public class ContrailSubnetPool { private String end; public ContrailSubnetPool() { + /* Empty constructor */ } public String getStart() { diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterImpl.java index ccac38a58c..687930673b 100644 --- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterImpl.java +++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterImpl.java @@ -444,7 +444,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException (me); } - if (heatStack != null && !(heatStack.getStatus () == HeatStatus.NOTFOUND)) { + if (heatStack != null && (heatStack.getStatus () != HeatStatus.NOTFOUND)) { // Stack exists. Return success or error depending on input directive if (failIfExists != null && failIfExists) { String error = "CreateNetwork: Stack " + networkName |