diff options
51 files changed, 882 insertions, 5142 deletions
diff --git a/adapters/mso-openstack-adapters/pom.xml b/adapters/mso-openstack-adapters/pom.xml index 6dcc1a43bf..aa6e5041e3 100644 --- a/adapters/mso-openstack-adapters/pom.xml +++ b/adapters/mso-openstack-adapters/pom.xml @@ -139,10 +139,12 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-spring-boot-starter-jaxws</artifactId> + <exclusions> + <exclusion> + <groupId>org.apache.tomcat</groupId> + <artifactId>tomcat-jdbc</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.cxf</groupId> diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java deleted file mode 100644 index 214cebb338..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRef.java +++ /dev/null @@ -1,72 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.MessageEnum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ContrailPolicyRef { - - private static final Logger logger = LoggerFactory.getLogger(ContrailPolicyRef.class); - - @JsonProperty("network_policy_refs_data_sequence") - private ContrailPolicyRefSeq seq; - - public JsonNode toJsonNode() { - JsonNode node = null; - try { - ObjectMapper mapper = new ObjectMapper(); - node = mapper.convertValue(this, JsonNode.class); - } catch (Exception e) { - logger.error("{} {} Error creating JsonString for Contrail Policy Ref: ", MessageEnum.RA_MARSHING_ERROR, - ErrorCode.SchemaError.getValue(), e); - } - - return node; - } - - public String toJsonString() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - jsonString = mapper.writeValueAsString(this); - } catch (Exception e) { - logger.error("{} {} Error creating JsonString for Contrail Policy Ref: ", MessageEnum.RA_MARSHING_ERROR, - ErrorCode.SchemaError.getValue(), e); - } - - return jsonString; - } - - public void populate(String major, String minor) { - seq = new ContrailPolicyRefSeq(major, minor); - return; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRefSeq.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRefSeq.java deleted file mode 100644 index d5ea301dd3..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailPolicyRefSeq.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - -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() { - /* To be done */ - } - - public ContrailPolicyRefSeq(String major, String minor) { - super(); - this.major = major; - this.minor = minor; - } - - public String getMajor() { - return major; - } - - 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-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java deleted file mode 100644 index ba4e93fa93..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnet.java +++ /dev/null @@ -1,200 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (c) 2019 Samsung - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.ArrayList; -import java.util.List; -import org.onap.logging.filter.base.ErrorCode; -import org.onap.so.logger.MessageEnum; -import org.onap.so.openstack.beans.HostRoute; -import org.onap.so.openstack.beans.Pool; -import org.onap.so.openstack.beans.Subnet; -import org.onap.so.openstack.utils.MsoCommonUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; - -public class ContrailSubnet { - - private static final Logger logger = LoggerFactory.getLogger(ContrailSubnet.class); - @Autowired - private MsoCommonUtils msoCommonUtils; - - @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 final 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 setPools(List<ContrailSubnetPool> allocationPools) { - this.allocationPools = allocationPools; - } - - public Boolean isAddrFromStart() { - return addrFromStart; - } - - public void setAddrFromStart(Boolean addrFromStart) { - this.addrFromStart = addrFromStart; - } - - public JsonNode toJsonNode() { - JsonNode node = null; - try { - ObjectMapper mapper = new ObjectMapper(); - node = mapper.convertValue(this, JsonNode.class); - } catch (Exception e) { - logger.error("{} {} Error creating JsonNode for Contrail Subnet: {} ", MessageEnum.RA_MARSHING_ERROR, - ErrorCode.SchemaError.getValue(), subnetName, e); - } - - return node; - } - - public String toJsonString() { - String jsonString = null; - try { - ObjectMapper mapper = new ObjectMapper(); - jsonString = mapper.writeValueAsString(this); - } catch (Exception e) { - logger.error("{} {} Error creating JsonString for Contrail Subnet: {} ", MessageEnum.RA_MARSHING_ERROR, - ErrorCode.SchemaError.getValue(), subnetName, e); - } - - return jsonString; - } - - // poulate contrail subnet with input(from bopel) subnet - public void populateWith(Subnet inputSubnet) { - if (inputSubnet != null) { - if (!msoCommonUtils.isNullOrEmpty(inputSubnet.getSubnetName())) - subnetName = inputSubnet.getSubnetName(); - else - subnetName = inputSubnet.getSubnetId(); - enableDhcp = inputSubnet.getEnableDHCP(); - defaultGateway = inputSubnet.getGatewayIp(); - if (!msoCommonUtils.isNullOrEmpty(inputSubnet.getCidr())) { - int idx = inputSubnet.getCidr().indexOf("/"); - if (idx != -1) { - subnet.setIpPrefix(inputSubnet.getCidr().substring(0, idx)); - subnet.setIpPrefixLen(inputSubnet.getCidr().substring(idx + 1)); - } - } - if (inputSubnet.getAllocationPools() != null) { - for (Pool pool : inputSubnet.getAllocationPools()) { - if (!msoCommonUtils.isNullOrEmpty(pool.getStart()) - && !msoCommonUtils.isNullOrEmpty(pool.getEnd())) { - ContrailSubnetPool csp = new ContrailSubnetPool(); - csp.populateWith(pool); - allocationPools.add(csp); - } - } - } - if (inputSubnet.getHostRoutes() != null) { - List<ContrailSubnetHostRoute> hrList = hostRoutes.getHostRoutes(); - for (HostRoute hr : inputSubnet.getHostRoutes()) { - if (!msoCommonUtils.isNullOrEmpty(hr.getPrefix()) - || !msoCommonUtils.isNullOrEmpty(hr.getNextHop())) { - ContrailSubnetHostRoute cshr = new ContrailSubnetHostRoute(); - cshr.populateWith(hr); - hrList.add(cshr); - } - } - } - } - } - - @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-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoute.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoute.java deleted file mode 100644 index 32f85ddf60..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoute.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - -import org.onap.so.openstack.beans.HostRoute; -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 ContrailSubnetHostRoute() {} - - 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; - } - - public void populateWith(HostRoute hostRoute) { - if (hostRoute != null) { - prefix = hostRoute.getPrefix(); - nextHop = hostRoute.getNextHop(); - } - } - - @Override - public String toString() { - return "ContrailSubnetHostRoute [prefix=" + prefix + ", nextHop=" + nextHop + "]"; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java deleted file mode 100644 index 0802194b4a..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetHostRoutes.java +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - - -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 ContrailSubnetHostRoutes() {} - - 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-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetIp.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetIp.java deleted file mode 100644 index a00a1eb5ea..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetIp.java +++ /dev/null @@ -1,59 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - -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 ContrailSubnetIp() { - /* Empty constructor */ - } - - 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-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetPool.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetPool.java deleted file mode 100644 index edba780318..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/ContrailSubnetPool.java +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - -import org.onap.so.openstack.beans.Pool; -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 ContrailSubnetPool() { - /* Empty constructor */ - } - - 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; - } - - public void populateWith(Pool pool) { - if (pool != null) { - start = pool.getStart(); - end = pool.getEnd(); - } - } - - @Override - public String toString() { - return "ContrailSubnetPool [start=" + start + ", end=" + end + "]"; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java deleted file mode 100644 index 52340d684a..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapter.java +++ /dev/null @@ -1,209 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - - -import java.util.List; -import java.util.Map; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebParam.Mode; -import javax.jws.WebService; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.ws.Holder; -import org.onap.so.adapters.network.exceptions.NetworkException; -import org.onap.so.entity.MsoRequest; -import org.onap.so.openstack.beans.NetworkRollback; -import org.onap.so.openstack.beans.NetworkStatus; -import org.onap.so.openstack.beans.RouteTarget; -import org.onap.so.openstack.beans.Subnet; - -@Deprecated -@WebService(name = "NetworkAdapter", targetNamespace = "http://org.onap.so/network") -public interface MsoNetworkAdapter { - // TODO: Rename all of these to include Vlan in the service name? At least for the - // create and update calls, since they are specific to VLAN-based provider networks. - - /** - * This is the "Create Network" Web Service Endpoint definition. - */ - @WebMethod - public void createNetwork(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkType") @XmlElement(required = true) String networkType, - @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid, - @WebParam(name = "networkName") @XmlElement(required = true) String networkName, - @WebParam(name = "physicalNetworkName") String physicalNetworkName, - @WebParam(name = "vlans") List<Integer> vlans, @WebParam(name = "shared") String shared, - @WebParam(name = "external") String external, @WebParam(name = "failIfExists") Boolean failIfExists, - @WebParam(name = "backout") Boolean backout, @WebParam(name = "subnets") List<Subnet> subnets, - @WebParam(name = "networkParams") Map<String, String> networkParams, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "networkId", mode = Mode.OUT) Holder<String> networkId, - @WebParam(name = "neutronNetworkId", mode = Mode.OUT) Holder<String> neutronNetworkId, - @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap, - @WebParam(name = "rollback", mode = Mode.OUT) Holder<NetworkRollback> rollback) throws NetworkException; - - @WebMethod - public void createNetworkContrail(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkType") @XmlElement(required = true) String networkType, - @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid, - @WebParam(name = "networkName") @XmlElement(required = true) String networkName, - @WebParam(name = "routeTargets") List<RouteTarget> routeTargets, @WebParam(name = "shared") String shared, - @WebParam(name = "external") String external, @WebParam(name = "failIfExists") Boolean failIfExists, - @WebParam(name = "backout") Boolean backout, @WebParam(name = "subnets") List<Subnet> subnets, - @WebParam(name = "networkParams") Map<String, String> networkParams, - @WebParam(name = "policyFqdns") List<String> policyFqdns, - @WebParam(name = "routeTableFqdns") List<String> routeTableFqdns, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "networkId", mode = Mode.OUT) Holder<String> networkId, - @WebParam(name = "neutronNetworkId", mode = Mode.OUT) Holder<String> neutronNetworkId, - @WebParam(name = "networkFqdn", mode = Mode.OUT) Holder<String> networkFqdn, - @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap, - @WebParam(name = "rollback", mode = Mode.OUT) Holder<NetworkRollback> rollback) throws NetworkException; - - /** - * This is the "Update VLANs" Web Service Endpoint definition. This webservice replaces the set of VLANs on a - * network. - */ - @WebMethod - public void updateNetwork(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkType") @XmlElement(required = true) String networkType, - @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid, - @WebParam(name = "networkId") @XmlElement(required = true) String networkId, - @WebParam(name = "networkName") @XmlElement(required = true) String networkName, - @WebParam(name = "physicalNetworkName") @XmlElement(required = true) String physicalNetworkName, - @WebParam(name = "vlans") @XmlElement(required = true) List<Integer> vlans, - @WebParam(name = "shared") String shared, @WebParam(name = "external") String external, - @WebParam(name = "subnets") List<Subnet> subnets, - @WebParam(name = "networkParams") Map<String, String> networkParams, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap, - @WebParam(name = "rollback", mode = Mode.OUT) Holder<NetworkRollback> rollback) throws NetworkException; - - @WebMethod - public void updateNetworkContrail(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkType") @XmlElement(required = true) String networkType, - @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid, - @WebParam(name = "networkId") @XmlElement(required = true) String networkId, - @WebParam(name = "networkName") @XmlElement(required = true) String networkName, - @WebParam(name = "routeTargets") List<RouteTarget> routeTargets, @WebParam(name = "shared") String shared, - @WebParam(name = "external") String external, @WebParam(name = "subnets") List<Subnet> subnets, - @WebParam(name = "networkParams") Map<String, String> networkParams, - @WebParam(name = "policyFqdns") List<String> policyFqdns, - @WebParam(name = "routeTableFqdns") List<String> routeTableFqdns, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap, - @WebParam(name = "rollback", mode = Mode.OUT) Holder<NetworkRollback> rollback) throws NetworkException; - - /** - * TODO: This is the "Add VLAN" Web Service Endpoint definition. This webservice adds a VLAN to a network. This - * service assumes that PO supports querying the current vlans in real time. Otherwise, the caller must have the - * complete list and should use updateVlans instead. - * - * @WebMethod public void addVlan (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId, - * @WebParam(name="tenantId") @XmlElement(required=true) String tenantId, - * @WebParam(name="networkType") @XmlElement(required=true) String networkType, - * @WebParam(name="networkId") @XmlElement(required=true) String networkId, - * @WebParam(name="physicalNetworkName") @XmlElement(required=true) String physicalNetworkName, - * @WebParam(name="vlan") @XmlElement(required=true) Integer vlan, - * @WebParam(name="rollback", mode=Mode.OUT) Holder<NetworkRollback> rollback ) throws NetworkException; - */ - - /** - * TODO: This is the "Remove VLAN" Web Service Endpoint definition. This webservice removes a VLAN from a network. - * This service assumes that PO supports querying the current vlans in real time. Otherwise, the caller must have - * the complete list and should use updateVlans instead. - * - * This service returns an indicator (noMoreVLans) if the VLAN that was removed was the last one on the network. - * - * It is not clear that Rollback will work for delete. The network can be recreated from the NetworkRollback object, - * but the network ID (and stack ID for Heat-based orchestration) will be different. The caller will need to know to - * update these identifiers in the inventory DB (A&AI). - * - * @WebMethod public void removeVlan (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId, - * @WebParam(name="tenantId") @XmlElement(required=true) String tenantId, - * @WebParam(name="networkType") @XmlElement(required=true) String networkType, - * @WebParam(name="networkId") @XmlElement(required=true) String networkId, - * @WebParam(name="physicalNetworkName") @XmlElement(required=true) String physicalNetworkName, - * @WebParam(name="vlan") @XmlElement(required=true) Integer vlan, - * @WebParam(name="noMoreVlans", mode=Mode.OUT) Holder<Boolean> noMoreVlans, - * @WebParam(name="rollback", mode=Mode.OUT) Holder<NetworkRollback> rollback ) throws NetworkException; - */ - - /** - * This is the "Query Network" Web Service Endpoint definition. TODO: Should this just return the NetworkInfo - * complete structure? - */ - @WebMethod - public void queryNetwork(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkNameOrId") @XmlElement(required = true) String networkNameOrId, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "networkExists", mode = Mode.OUT) Holder<Boolean> networkExists, - @WebParam(name = "networkId", mode = Mode.OUT) Holder<String> networkId, - @WebParam(name = "neutronNetworkId", mode = Mode.OUT) Holder<String> neutronNetworkId, - @WebParam(name = "status", mode = Mode.OUT) Holder<NetworkStatus> status, - @WebParam(name = "vlans", mode = Mode.OUT) Holder<List<Integer>> vlans, - @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap) - throws NetworkException; - - @WebMethod - public void queryNetworkContrail(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkNameOrId") @XmlElement(required = true) String networkNameOrId, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "networkExists", mode = Mode.OUT) Holder<Boolean> networkExists, - @WebParam(name = "networkId", mode = Mode.OUT) Holder<String> networkId, - @WebParam(name = "neutronNetworkId", mode = Mode.OUT) Holder<String> neutronNetworkId, - @WebParam(name = "status", mode = Mode.OUT) Holder<NetworkStatus> status, - @WebParam(name = "routeTargets", mode = Mode.OUT) Holder<List<RouteTarget>> routeTargets, - @WebParam(name = "subnetIdMap", mode = Mode.OUT) Holder<Map<String, String>> subnetIdMap) - throws NetworkException; - - /** - * This is the "Delete Network" Web Service endpoint definition. - */ - @WebMethod - public void deleteNetwork(@WebParam(name = "cloudSiteId") @XmlElement(required = true) String cloudSiteId, - @WebParam(name = "tenantId") @XmlElement(required = true) String tenantId, - @WebParam(name = "networkType") @XmlElement(required = true) String networkType, - @WebParam(name = "modelCustomizationUuid") String modelCustomizationUuid, - @WebParam(name = "networkId") @XmlElement(required = true) String networkId, - @WebParam(name = "request") MsoRequest msoRequest, - @WebParam(name = "networkDeleted", mode = Mode.OUT) Holder<Boolean> networkDeleted, - @WebParam(name = "pollForCompletion") @XmlElement(required = false) Boolean pollForCompletion) - throws NetworkException; - - /** - * This is the "Rollback Network" Web Service endpoint definition. - */ - @WebMethod - public void rollbackNetwork(@WebParam(name = "rollback") @XmlElement(required = true) NetworkRollback rollback, - @WebParam(name = "pollForCompletion") @XmlElement(required = false) Boolean pollForCompletion) - throws NetworkException; - - @WebMethod - public void healthCheck(); -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java index b84d2a8600..cb6a2fac1f 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java @@ -54,7 +54,6 @@ import org.onap.so.logger.MessageEnum; import org.onap.so.openstack.beans.HeatStatus; import org.onap.so.openstack.beans.NetworkInfo; import org.onap.so.openstack.beans.NetworkRollback; -import org.onap.so.openstack.beans.NetworkStatus; import org.onap.so.openstack.beans.Pool; import org.onap.so.openstack.beans.RouteTarget; import org.onap.so.openstack.beans.StackInfo; @@ -80,15 +79,13 @@ import com.fasterxml.jackson.databind.ObjectMapper; @Transactional @WebService(serviceName = "NetworkAdapter", endpointInterface = "org.onap.so.adapters.network.MsoNetworkAdapter", targetNamespace = "http://org.onap.so/network") -public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { +public class MsoNetworkAdapterImpl { private static final String OS3_NW_PROPERTY = "org.onap.so.adapters.network.aic3nw"; private static final String OS3_NW = "OS::ContrailV2::VirtualNetwork"; private static final String VLANS = "vlans"; private static final String PHYSICAL_NETWORK = "physical_network"; private static final String UPDATE_NETWORK_CONTEXT = "UpdateNetwork"; - private static final String NETWORK_ID = "network_id"; - private static final String NETWORK_FQDN = "network_fqdn"; private static final String CREATE_NETWORK_CONTEXT = "CreateNetwork"; private static final String NEUTRON_MODE = "NEUTRON"; private static final String CLOUD_OWNER = "CloudOwner"; @@ -128,47 +125,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { public MsoNetworkAdapterImpl() {} /** - * Health Check web method. Does nothing but return to show the adapter is deployed. - */ - @Override - public void healthCheck() { - logger.debug("Health check call in Network Adapter"); - } - - /** - * Do not use this constructor or the msoPropertiesFactory will be NULL. - * - * @see MsoNetworkAdapterImpl#MsoNetworkAdapterImpl(MsoPropertiesFactory) - */ - - @Deprecated - @Override - public void createNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, - String networkName, String physicalNetworkName, List<Integer> vlans, String shared, String external, - Boolean failIfExists, Boolean backout, List<Subnet> subnets, Map<String, String> networkParams, - MsoRequest msoRequest, Holder<String> networkId, Holder<String> neutronNetworkId, - Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback) throws NetworkException { - Holder<String> networkFqdn = new Holder<>(); - createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName, physicalNetworkName, - vlans, null, shared, external, failIfExists, backout, subnets, null, null, msoRequest, networkId, - neutronNetworkId, networkFqdn, subnetIdMap, rollback, true, new MutableBoolean()); - } - - @Deprecated - @Override - public void createNetworkContrail(String cloudSiteId, String tenantId, String networkType, - String modelCustomizationUuid, String networkName, List<RouteTarget> routeTargets, String shared, - String external, Boolean failIfExists, Boolean backout, List<Subnet> subnets, - Map<String, String> networkParams, List<String> policyFqdns, List<String> routeTableFqdns, - MsoRequest msoRequest, Holder<String> networkId, Holder<String> neutronNetworkId, - Holder<String> networkFqdn, Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback) - throws NetworkException { - createNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkName, null, null, routeTargets, - shared, external, failIfExists, backout, subnets, policyFqdns, routeTableFqdns, msoRequest, networkId, - neutronNetworkId, networkFqdn, subnetIdMap, rollback, true, new MutableBoolean()); - } - - /** * This is the "Create Network" web service implementation. It will create a new Network of the requested type in * the specified cloud and tenant. The tenant must exist at the time this service is called. * @@ -194,26 +150,13 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { public void createNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, String networkName, String physicalNetworkName, List<Integer> vlans, List<RouteTarget> routeTargets, String shared, String external, Boolean failIfExists, Boolean backout, List<Subnet> subnets, - List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, Holder<String> networkId, - Holder<String> neutronNetworkId, Holder<String> networkFqdn, Holder<Map<String, String>> subnetIdMap, - Holder<NetworkRollback> rollback, Boolean pollForCompletion, MutableBoolean isOs3Nw) - throws NetworkException { + List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, Holder<String> stackId, + MutableBoolean isOs3Nw) throws NetworkException { logger.debug("*** CREATE Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId); // Will capture execution time for metrics long startTime = System.currentTimeMillis(); - // Build a default rollback object (no actions performed) //TODO remove - NetworkRollback networkRollback = new NetworkRollback(); - networkRollback.setCloudId(cloudSiteId); - networkRollback.setTenantId(tenantId); - networkRollback.setMsoRequest(msoRequest); - networkRollback.setModelCustomizationUuid(modelCustomizationUuid); - - // tenant query is not required here. - // If the tenant doesn't exist, the Heat calls will fail anyway (when the HeatUtils try to obtain a token). - // So this is just catching that error in a bit more obvious way up front. - Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite(cloudSiteId); if (!cloudSiteOpt.isPresent()) { String error = String.format( @@ -271,20 +214,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { error); throw new NetworkException(error, MsoExceptionCategory.USERDATA); } else { - // Populate the outputs from the existing stack. - networkId.value = heatStack.getCanonicalName(); - Map<String, String> sMap = new HashMap<>(); - if (heatStack.getOutputs() != null) { - neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID); - rollback.value = networkRollback; // Default rollback - no updates performed - if (os3template) { - networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN); - } - Map<String, Object> outputs = heatStack.getOutputs(); - - sMap = buildSubnetMap(outputs, subnets, os3template); - } - subnetIdMap.value = sMap; logger.warn("{} {} Found Existing network stack, status={} networkName={} for {}/{}", MessageEnum.RA_NETWORK_ALREADY_EXIST, ErrorCode.DataError.getValue(), heatStack.getStatus(), networkName, cloudSiteId, tenantId); @@ -356,8 +285,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { if (backout == null) backout = true; heatStack = heat.createStack(cloudSiteId, CLOUD_OWNER, tenantId, networkName, null, template, stackParams, - pollForCompletion, heatTemplate.getTimeoutMinutes(), null, null, null, backout.booleanValue(), - failIfExists); + false, heatTemplate.getTimeoutMinutes(), null, null, null, backout.booleanValue(), failIfExists); } catch (MsoException me) { me.addContext(CREATE_NETWORK_CONTEXT); logger.error("{} {} Exception creating network type {} in {}/{} ", MessageEnum.RA_CREATE_NETWORK_EXC, @@ -366,29 +294,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } // Reach this point if createStack is successful. - - // For Heat-based orchestration, the MSO-tracked network ID is the heat stack, - // and the neutronNetworkId is the network UUID returned in stack outputs. - networkId.value = heatStack.getCanonicalName(); - if (heatStack.getOutputs() != null) { - neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID); - if (os3template) { - networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN); - } - } - Map<String, Object> outputs = heatStack.getOutputs(); - Map<String, String> sMap = new HashMap<>(); - if (outputs != null) { - sMap = buildSubnetMap(outputs, subnets, os3template); - networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID)); - } - subnetIdMap.value = sMap; - - rollback.value = networkRollback; - // Populate remaining rollback info and response parameters. - networkRollback.setNetworkStackId(heatStack.getCanonicalName()); - networkRollback.setNetworkCreated(true); - networkRollback.setNetworkType(networkType); + stackId.value = heatStack.getCanonicalName(); try { heat.updateResourceStatus(msoRequest.getRequestId(), NETWORK_CREATED_STATUS_MESSAGE); @@ -398,34 +304,9 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { logger.debug("Network {} successfully created via HEAT", networkName); - return; } - @Deprecated - @Override - public void updateNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, - String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, String shared, - String external, List<Subnet> subnets, Map<String, String> networkParams, MsoRequest msoRequest, - Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback) throws NetworkException { - updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId, networkName, - physicalNetworkName, vlans, null, shared, external, subnets, null, null, msoRequest, subnetIdMap, - rollback); - - } - - @Deprecated - @Override - public void updateNetworkContrail(String cloudSiteId, String tenantId, String networkType, - String modelCustomizationUuid, String networkId, String networkName, List<RouteTarget> routeTargets, - String shared, String external, List<Subnet> subnets, Map<String, String> networkParams, - List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, - Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback) throws NetworkException { - updateNetwork(cloudSiteId, tenantId, networkType, modelCustomizationUuid, networkId, networkName, null, null, - routeTargets, shared, external, subnets, policyFqdns, routeTableFqdns, msoRequest, subnetIdMap, - rollback); - } - /** * This is the "Update Network" web service implementation. It will update an existing Network of the requested type * in the specified cloud and tenant. The typical use will be to replace the VLANs with the supplied list (to add or @@ -449,8 +330,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { public void updateNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, String networkId, String networkName, String physicalNetworkName, List<Integer> vlans, List<RouteTarget> routeTargets, String shared, String external, List<Subnet> subnets, - List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, - Holder<Map<String, String>> subnetIdMap, Holder<NetworkRollback> rollback) throws NetworkException { + List<String> policyFqdns, List<String> routeTableFqdns, MsoRequest msoRequest, Holder<String> stackId) + throws NetworkException { logger.debug("***UPDATE Network adapter with Network: {} of type {} in {}/{}", networkName, networkType, cloudSiteId, tenantId); @@ -458,12 +339,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Will capture execution time for metrics long startTime = System.currentTimeMillis(); - // Build a default rollback object (no actions performed) - NetworkRollback networkRollback = new NetworkRollback(); - networkRollback.setCloudId(cloudSiteId); - networkRollback.setTenantId(tenantId); - networkRollback.setMsoRequest(msoRequest); - Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite(cloudSiteId); if (!cloudSiteOpt.isPresent()) { String error = String.format( @@ -474,8 +349,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException(error, MsoExceptionCategory.USERDATA); } - - NetworkResource networkResource = networkCheck(startTime, networkType, modelCustomizationUuid, networkName, physicalNetworkName, vlans, routeTargets, cloudSiteId, cloudSiteOpt.get()); String mode = networkResource.getOrchestrationMode(); @@ -515,15 +388,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException(me); } - // Add the network ID and previously queried vlans to the rollback object - networkRollback.setNetworkId(netInfo.getId()); - networkRollback.setNeutronNetworkId(netInfo.getId()); - networkRollback.setNetworkType(networkType); - // Save previous parameters - networkRollback.setNetworkName(netInfo.getName()); - networkRollback.setPhysicalNetwork(netInfo.getProvider()); - networkRollback.setVlans(netInfo.getVlans()); - logger.debug("Network {} updated, id = {}", networkId, netInfo.getId()); } else if ("HEAT".equals(mode)) { @@ -551,9 +415,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Get the previous parameters for rollback Map<String, Object> heatParams = heatStack.getParameters(); - String previousNetworkName = (String) heatParams.get("network_name"); - String previousPhysicalNetwork = (String) heatParams.get(PHYSICAL_NETWORK); - List<Integer> previousVlans = new ArrayList<>(); String vlansParam = (String) heatParams.get(VLANS); if (vlansParam != null) { @@ -569,8 +430,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { logger.debug("Update Stack: Previous VLANS: {}", previousVlans); // Ready to deploy the updated Network via Heat - - HeatTemplate heatTemplate = networkResource.getHeatTemplate(); if (heatTemplate == null) { String error = "Network error - undefined Heat Template. Network Type=" + networkType; @@ -659,28 +518,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException(me); } - Map<String, Object> outputs = heatStack.getOutputs(); - Map<String, String> sMap = new HashMap<>(); - if (outputs != null) { - sMap = buildSubnetMap(outputs, subnets, os3template); - } - subnetIdMap.value = sMap; - - // Reach this point if createStack is successful. - // Populate remaining rollback info and response parameters. - networkRollback.setNetworkStackId(heatStack.getCanonicalName()); - if (null != outputs) { - networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID)); - } else { - logger.debug("outputs is NULL"); - } - networkRollback.setNetworkType(networkType); - // Save previous parameters - networkRollback.setNetworkName(previousNetworkName); - networkRollback.setPhysicalNetwork(previousPhysicalNetwork); - networkRollback.setVlans(previousVlans); - - rollback.value = networkRollback; + stackId.value = heatStack.getCanonicalName(); logger.debug("Network {} successfully updated via HEAT", networkId); } @@ -769,131 +607,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { return networkResource; } - @Override - public void queryNetwork(String cloudSiteId, String tenantId, String networkNameOrId, MsoRequest msoRequest, - Holder<Boolean> networkExists, Holder<String> networkId, Holder<String> neutronNetworkId, - Holder<NetworkStatus> status, Holder<List<Integer>> vlans, Holder<Map<String, String>> subnetIdMap) - throws NetworkException { - queryNetwork(cloudSiteId, tenantId, networkNameOrId, msoRequest, networkExists, networkId, neutronNetworkId, - status, vlans, null, subnetIdMap); - } - - @Override - public void queryNetworkContrail(String cloudSiteId, String tenantId, String networkNameOrId, MsoRequest msoRequest, - Holder<Boolean> networkExists, Holder<String> networkId, Holder<String> neutronNetworkId, - Holder<NetworkStatus> status, Holder<List<RouteTarget>> routeTargets, - Holder<Map<String, String>> subnetIdMap) throws NetworkException { - queryNetwork(cloudSiteId, tenantId, networkNameOrId, msoRequest, networkExists, networkId, neutronNetworkId, - status, null, routeTargets, subnetIdMap); - } - - /** - * This is the queryNetwork method. It returns the existence and status of the specified network, along with its - * Neutron UUID and list of VLANs. This method attempts to find the network using both Heat and Neutron. Heat stacks - * are first searched based on the provided network name/id. If none is found, the Neutron is directly queried. - */ - private void queryNetwork(String cloudSiteId, String tenantId, String networkNameOrId, MsoRequest msoRequest, - Holder<Boolean> networkExists, Holder<String> networkId, Holder<String> neutronNetworkId, - Holder<NetworkStatus> status, Holder<List<Integer>> vlans, Holder<List<RouteTarget>> routeTargets, - Holder<Map<String, String>> subnetIdMap) throws NetworkException { - - logger.debug("*** QUERY Network with Network: {} in {}/{}", networkNameOrId, cloudSiteId, tenantId); - - if (commonUtils.isNullOrEmpty(cloudSiteId) || commonUtils.isNullOrEmpty(tenantId) - || commonUtils.isNullOrEmpty(networkNameOrId)) { - - String error = "Missing mandatory parameter cloudSiteId, tenantId or networkId"; - logger.error(LoggingAnchor.THREE, MessageEnum.RA_MISSING_PARAM, ErrorCode.DataError.getValue(), error); - throw new NetworkException(error, MsoExceptionCategory.USERDATA); - } - - Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite(cloudSiteId); - if (!cloudSiteOpt.isPresent()) { - String error = String.format( - "Configuration Error. Stack %s in %s/%s: CloudSite does not exist in MSO Configuration", - networkNameOrId, cloudSiteId, tenantId); - logger.error(LoggingAnchor.THREE, MessageEnum.RA_CONFIG_EXC, ErrorCode.DataError.getValue(), error); - // Set the detailed error as the Exception 'message' - throw new NetworkException(error, MsoExceptionCategory.USERDATA); - } - - // Use MsoNeutronUtils for all NEUTRON commands - - String neutronId = null; - // Try Heat first, since networks may be named the same as the Heat stack - StackInfo heatStack = null; - try { - heatStack = heat.queryStack(cloudSiteId, CLOUD_OWNER, tenantId, networkNameOrId); - } catch (MsoException me) { - me.addContext("QueryNetwork"); - logger.error("{} {} Exception - Query Network (heat): {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC, - ErrorCode.DataError.getValue(), networkNameOrId, cloudSiteId, tenantId, me); - throw new NetworkException(me); - } - - // Populate the outputs based on the returned Stack information - if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND) { - // Found it. Get the neutronNetworkId for further query - Map<String, String> sMap = new HashMap<>(); - Map<String, Object> outputs = heatStack.getOutputs(); - if (outputs != null) { - neutronId = (String) outputs.get(NETWORK_ID); - - for (String key : outputs.keySet()) { - if (key != null && key.startsWith("subnet_id_")) // multiples subnet_%aaid% outputs - { - String subnetUUId = (String) outputs.get(key); - sMap.put(key.substring("subnet_id_".length()), subnetUUId); - } else if (key != null && key.startsWith("subnet")) // one subnet output expected - { - Map<String, String> map = getSubnetUUId(key, outputs, null); - sMap.putAll(map); - } - - } - } - subnetIdMap.value = sMap; - } - - // Query directly against the Neutron Network for the details - // no RouteTargets available for ContrailV2 in neutron net-show - // networkId is heatStackId - try { - NetworkInfo netInfo = neutron.queryNetwork(neutronId, tenantId, cloudSiteId); - if (netInfo != null) { - // Found. Populate the output elements - networkExists.value = Boolean.TRUE; - if (heatStack != null) { - networkId.value = heatStack.getCanonicalName(); - } else { - networkId.value = netInfo.getId(); - } - neutronNetworkId.value = netInfo.getId(); - status.value = netInfo.getStatus(); - if (vlans != null) - vlans.value = netInfo.getVlans(); - - logger.debug("Network {}, ID = {}{}", networkNameOrId, networkId.value, - (",NeutronId = " + neutronNetworkId.value)); - } else { - // Not found. Populate the status fields, leave the rest null - networkExists.value = Boolean.FALSE; - status.value = NetworkStatus.NOTFOUND; - neutronNetworkId.value = null; - if (vlans != null) - vlans.value = new ArrayList<>(); - - logger.debug("Network {} not found", networkNameOrId); - } - } catch (MsoException me) { - me.addContext("QueryNetwork"); - logger.error("{} {} Exception - Query Network (neutron): {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC, - ErrorCode.DataError.getValue(), networkNameOrId, cloudSiteId, tenantId, me); - throw new NetworkException(me); - } - return; - } - /** * This is the "Delete Network" web service implementation. It will delete a Network in the specified cloud and * tenant. @@ -909,10 +622,8 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { * The method returns nothing on success. Rollback is not possible for delete commands, so any failure on delete * will require manual fallout in the client. */ - @Override public void deleteNetwork(String cloudSiteId, String tenantId, String networkType, String modelCustomizationUuid, - String networkId, MsoRequest msoRequest, Holder<Boolean> networkDeleted, Boolean pollForCompletion) - throws NetworkException { + String networkId, MsoRequest msoRequest) throws NetworkException { logger.debug("*** DELETE Network adapter with Network: {} in {}/{}", networkId, cloudSiteId, tenantId); if (commonUtils.isNullOrEmpty(cloudSiteId) || commonUtils.isNullOrEmpty(tenantId) || commonUtils.isNullOrEmpty(networkId)) { @@ -921,16 +632,12 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { throw new NetworkException(error, MsoExceptionCategory.USERDATA); } - if (pollForCompletion == null) { - pollForCompletion = true; - } - int timeoutMinutes = heat.getNetworkHeatTimeoutValue(modelCustomizationUuid, networkType); + boolean networkDeleted = false; try { - StackInfo stack = - heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, pollForCompletion, timeoutMinutes); - networkDeleted.value = stack.isOperationPerformed(); + StackInfo stack = heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, false, timeoutMinutes); + networkDeleted = stack.isOperationPerformed(); } catch (MsoException me) { me.addContext("DeleteNetwork"); logger.error("{} {} Delete Network (heat): {} in {}/{} ", MessageEnum.RA_DELETE_NETWORK_EXC, @@ -940,7 +647,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { try { heat.updateResourceStatus(msoRequest.getRequestId(), - networkDeleted.value ? NETWORK_DELETED_STATUS_MESSAGE : NETWORK_NOT_EXIST_STATUS_MESSAGE); + networkDeleted ? NETWORK_DELETED_STATUS_MESSAGE : NETWORK_NOT_EXIST_STATUS_MESSAGE); } catch (Exception e) { logger.warn("Exception while updating infra active request", e); } @@ -954,17 +661,12 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { * The rollback includes removing the VNF and deleting the tenant if the tenant did not exist prior to the VNF * creation. */ - @Override - public void rollbackNetwork(NetworkRollback rollback, Boolean pollForCompletion) throws NetworkException { + public void rollbackNetwork(NetworkRollback rollback) throws NetworkException { if (rollback == null) { logger.error("{} {} rollback is null", MessageEnum.RA_ROLLBACK_NULL, ErrorCode.DataError.getValue()); return; } - if (pollForCompletion == null) { - pollForCompletion = true; - } - // Get the elements of the VnfRollback object for easier access String cloudSiteId = rollback.getCloudId(); String tenantId = rollback.getTenantId(); @@ -974,7 +676,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { if (rollback.getNetworkCreated()) { try { - heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, pollForCompletion, 120); + heat.deleteStack(tenantId, CLOUD_OWNER, cloudSiteId, networkId, false, 120); } catch (MsoException me) { me.addContext("RollbackNetwork"); logger.error("{} {} Exception - Rollback Network (heat): {} in {}/{} ", @@ -1324,7 +1026,6 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { return heatTemplate; } - // TODO remove public Map<String, String> getSubnetUUId(String key, Map<String, Object> outputs, List<Subnet> subnets) { Map<String, String> sMap = new HashMap<>(); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java index 942da2937b..28763f2228 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/CXFConfiguration.java @@ -24,21 +24,15 @@ package org.onap.so.adapters.openstack; import java.util.Arrays; import java.util.HashSet; -import javax.xml.ws.Endpoint; import org.apache.cxf.Bus; import org.apache.cxf.bus.spring.SpringBus; import org.apache.cxf.endpoint.Server; import org.apache.cxf.feature.LoggingFeature; import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; import org.apache.cxf.jaxrs.openapi.OpenApiFeature; -import org.apache.cxf.jaxws.EndpointImpl; import org.apache.cxf.transport.servlet.CXFServlet; import org.onap.so.adapters.cloudregion.CloudRegionRestV1; -import org.onap.so.adapters.network.MsoNetworkAdapterImpl; -import org.onap.so.adapters.vnf.MsoVnfAdapterImpl; import org.onap.so.client.policy.JettisonStyleMapperProvider; -import org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor; -import org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor; import org.onap.so.logging.jaxrs.filter.SOAuditLogContainerFilter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.web.servlet.ServletRegistrationBean; @@ -51,10 +45,6 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; @Configuration public class CXFConfiguration { @Autowired - private MsoNetworkAdapterImpl networkAdapterImpl; - @Autowired - private MsoVnfAdapterImpl vnfAdapterImpl; - @Autowired private CloudRegionRestV1 cloudRegionRestV1; @Autowired private JettisonStyleMapperProvider jettisonStyleObjectMapper; @@ -76,20 +66,6 @@ public class CXFConfiguration { return servletRegistrationBean; } - /* - * network adapter endpoint - */ - @Bean - public Endpoint networkAdapterEndpoint() { - EndpointImpl endpoint = new EndpointImpl(springBus(), networkAdapterImpl); - endpoint.publish("/NetworkAdapter"); - endpoint.setWsdlLocation("NetworkAdapter.wsdl"); - endpoint.getInInterceptors().add(new SOAPLoggingInInterceptor()); - endpoint.getOutInterceptors().add(new SOAPLoggingOutInterceptor()); - endpoint.getOutFaultInterceptors().add(new SOAPLoggingOutInterceptor()); - return endpoint; - } - // Uses normal Jackson marshalling semantics @Bean public Server rsServerApi() { diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java index f13b5bda7c..31da330c7f 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/PollService.java @@ -38,6 +38,7 @@ import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.nwrest.CreateNetworkResponse; import org.onap.so.adapters.nwrest.DeleteNetworkRequest; import org.onap.so.adapters.nwrest.DeleteNetworkResponse; +import org.onap.so.adapters.nwrest.RollbackNetworkRequest; import org.onap.so.adapters.nwrest.UpdateNetworkRequest; import org.onap.so.adapters.nwrest.UpdateNetworkResponse; import org.onap.so.adapters.vnf.MsoVnfAdapterImpl; @@ -157,6 +158,13 @@ public class PollService extends ExternalTaskUtils { UpdateNetworkResponse updateResponse = new UpdateNetworkResponse(req.getNetworkId(), null, null, req.getMessageId()); response = Optional.of(updateResponse.toXmlString()); + } else if ("rollbackNetworkRequest".equals(requestType.get())) { + logger.debug("Executing External Task Poll Service for Rollback Network"); + String stackId = externalTask.getVariable("stackId"); + RollbackNetworkRequest req = + JAXB.unmarshal(new StringReader(xmlRequest), RollbackNetworkRequest.class); + pollDeleteResource(118, req.getNetworkRollback().getCloudId(), + req.getNetworkRollback().getTenantId(), stackId, success); } } } catch (Exception e) { diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java index 52dfa6a534..4636a91d5c 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/RollbackService.java @@ -88,11 +88,9 @@ public class RollbackService extends ExternalTaskUtils { } } else if ("createNetworkRequest".equals(requestType.get())) { logger.debug("Executing External Task Rollback Service for Create Network"); - Holder<Boolean> networkDeleted = new Holder<>(); CreateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), CreateNetworkRequest.class); networkAdapterImpl.deleteNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), - req.getModelCustomizationUuid(), req.getNetworkName(), req.getMsoRequest(), networkDeleted, - false); + req.getModelCustomizationUuid(), req.getNetworkName(), req.getMsoRequest()); pollRollbackStatus = true; success = true; } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java index 9d217380d6..9b2badd1e7 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/orchestration/StackService.java @@ -43,7 +43,6 @@ import org.onap.so.adapters.nwrest.DeleteNetworkRequest; import org.onap.so.adapters.nwrest.ProviderVlanNetwork; import org.onap.so.adapters.nwrest.RollbackNetworkRequest; import org.onap.so.adapters.nwrest.UpdateNetworkRequest; -import org.onap.so.adapters.nwrest.UpdateNetworkResponse; import org.onap.so.adapters.vnf.MsoVnfAdapterImpl; import org.onap.so.adapters.vnf.MsoVnfPluginAdapterImpl; import org.onap.so.adapters.vnf.VnfAdapterUtils; @@ -97,8 +96,6 @@ public class StackService extends ExternalTaskUtils { try { if (xmlRequest != null) { Optional<String> requestType = findRequestType(xmlRequest); - Holder<Map<String, String>> subnetIdMap = new Holder<>(); - Holder<NetworkRollback> networkRollback = new Holder<>(); if ("createVolumeGroupRequest".equals(requestType.get())) { logger.debug("Executing External Task Stack Service For Create Volume Group"); createVolumeGroup(xmlRequest, canonicalStackId, backout, success); @@ -112,11 +109,11 @@ public class StackService extends ExternalTaskUtils { logger.debug("Executing External Task Stack Service For Delete Volume Group"); deleteVolumeGroup(xmlRequest, canonicalStackId, backout, success); } else if ("createNetworkRequest".equals(requestType.get())) { - createNetwork(xmlRequest, subnetIdMap, networkRollback, canonicalStackId, backout, success, os3Nw); + createNetwork(xmlRequest, canonicalStackId, backout, success, os3Nw); } else if ("deleteNetworkRequest".equals(requestType.get())) { deleteNetwork(xmlRequest, canonicalStackId, backout, success); } else if ("updateNetworkRequest".equals(requestType.get())) { - updateNetwork(xmlRequest, subnetIdMap, networkRollback, canonicalStackId, backout, success); + updateNetwork(xmlRequest, canonicalStackId, backout, success); } else if ("rollbackNetworkRequest".equals(requestType.get())) { rollbackNetwork(xmlRequest, canonicalStackId, backout, success); } @@ -217,14 +214,9 @@ public class StackService extends ExternalTaskUtils { canonicalStackId.value = req.getVolumeGroupStackId(); } - private void createNetwork(String xmlRequest, Holder<Map<String, String>> subnetIdMap, - Holder<NetworkRollback> networkRollback, Holder<String> canonicalStackId, MutableBoolean backout, + private void createNetwork(String xmlRequest, Holder<String> canonicalStackId, MutableBoolean backout, MutableBoolean success, MutableBoolean os3) throws NetworkException { - Holder<String> networkId = new Holder<>(); - Holder<String> neutronNetworkId = new Holder<>(); - Holder<String> networkFqdn = new Holder<>(); - CreateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), CreateNetworkRequest.class); HashMap<String, String> params = (HashMap<String, String>) req.getNetworkParams(); if (params == null) { @@ -268,20 +260,18 @@ public class StackService extends ExternalTaskUtils { networkAdapterImpl.createNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), req.getModelCustomizationUuid(), req.getNetworkName(), physicalNetworkName, vlans, routeTargets, shared, external, req.getFailIfExists(), false, req.getSubnets(), fqdns, routeTable, req.getMsoRequest(), - networkId, neutronNetworkId, networkFqdn, subnetIdMap, networkRollback, true, os3); + canonicalStackId, os3); success.setTrue(); backout.setValue(req.getBackout()); - canonicalStackId.value = networkRollback.value.getNetworkStackId(); } private void deleteNetwork(String xmlRequest, Holder<String> canonicalStackId, MutableBoolean backout, MutableBoolean success) throws NetworkException { backout.setFalse(); DeleteNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), DeleteNetworkRequest.class); - Holder<Boolean> networkDeleted = new Holder<>(); networkAdapterImpl.deleteNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), - req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getMsoRequest(), networkDeleted, false); + req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getMsoRequest()); canonicalStackId.value = req.getNetworkStackId(); success.setTrue(); @@ -293,14 +283,13 @@ public class StackService extends ExternalTaskUtils { RollbackNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), RollbackNetworkRequest.class); NetworkRollback rollback = req.getNetworkRollback(); - networkAdapterImpl.rollbackNetwork(rollback, false); + networkAdapterImpl.rollbackNetwork(rollback); canonicalStackId.value = rollback.getNetworkStackId(); success.setTrue(); } - private String updateNetwork(String xmlRequest, Holder<Map<String, String>> subnetIdMap, - Holder<NetworkRollback> networkRollback, Holder<String> canonicalStackId, MutableBoolean backout, + private void updateNetwork(String xmlRequest, Holder<String> canonicalStackId, MutableBoolean backout, MutableBoolean success) throws NetworkException { backout.setFalse(); UpdateNetworkRequest req = JAXB.unmarshal(new StringReader(xmlRequest), UpdateNetworkRequest.class); @@ -347,18 +336,12 @@ public class StackService extends ExternalTaskUtils { networkAdapterImpl.updateNetwork(req.getCloudSiteId(), req.getTenantId(), req.getNetworkType(), req.getModelCustomizationUuid(), req.getNetworkStackId(), req.getNetworkName(), physicalNetworkName, vlans, routeTargets, shared, external, req.getSubnets(), fqdns, routeTable, req.getMsoRequest(), - subnetIdMap, networkRollback); + canonicalStackId); success.setTrue(); - canonicalStackId.value = req.getNetworkStackId(); - UpdateNetworkResponse response = - new UpdateNetworkResponse(req.getNetworkId(), null, subnetIdMap.value, req.getMessageId()); - return response.toXmlString(); } - - protected Optional<String> findRequestType(String xmlString) { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/CreateVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/CreateVnfNotification.java deleted file mode 100644 index e3c59fd93d..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/CreateVnfNotification.java +++ /dev/null @@ -1,370 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for createVnfNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="createVnfNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="vnfId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="outputs" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * <element name="rollback" type="{http://org.onap.so/vnfNotify}vnfRollback" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "createVnfNotification", - propOrder = {"messageId", "completed", "exception", "errorMessage", "vnfId", "outputs", "rollback"}) -public class CreateVnfNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - protected String vnfId; - protected CreateVnfNotification.Outputs outputs; - protected VnfRollback rollback; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - - /** - * Gets the value of the vnfId property. - * - * @return possible object is {@link String } - * - */ - public String getVnfId() { - return vnfId; - } - - /** - * Sets the value of the vnfId property. - * - * @param value allowed object is {@link String } - * - */ - public void setVnfId(String value) { - this.vnfId = value; - } - - /** - * Gets the value of the outputs property. - * - * @return possible object is {@link CreateVnfNotification.Outputs } - * - */ - public CreateVnfNotification.Outputs getOutputs() { - return outputs; - } - - /** - * Sets the value of the outputs property. - * - * @param value allowed object is {@link CreateVnfNotification.Outputs } - * - */ - public void setOutputs(CreateVnfNotification.Outputs value) { - this.outputs = value; - } - - /** - * Gets the value of the rollback property. - * - * @return possible object is {@link VnfRollback } - * - */ - public VnfRollback getRollback() { - return rollback; - } - - /** - * Sets the value of the rollback property. - * - * @param value allowed object is {@link VnfRollback } - * - */ - public void setRollback(VnfRollback value) { - this.rollback = value; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"entry"}) - public static class Outputs { - - protected List<CreateVnfNotification.Outputs.Entry> entry; - - /** - * Gets the value of the entry property. - * - * <p> - * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you - * make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> - * method for the entry property. - * - * <p> - * For example, to add a new item, do as follows: - * - * <pre> - * getEntry().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list {@link CreateVnfNotification.Outputs.Entry } - * - * - */ - public List<CreateVnfNotification.Outputs.Entry> getEntry() { - if (entry == null) { - entry = new ArrayList<>(); - } - return this.entry; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"key", "value"}) - public static class Entry { - - protected String key; - protected String value; - - /** - * Gets the value of the key property. - * - * @return possible object is {@link String } - * - */ - public String getKey() { - return key; - } - - /** - * Sets the value of the key property. - * - * @param value allowed object is {@link String } - * - */ - public void setKey(String value) { - this.key = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - } - - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/DeleteVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/DeleteVnfNotification.java deleted file mode 100644 index 434cf7f772..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/DeleteVnfNotification.java +++ /dev/null @@ -1,139 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for deleteVnfNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="deleteVnfNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "deleteVnfNotification", propOrder = {"messageId", "completed", "exception", "errorMessage"}) -public class DeleteVnfNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/ObjectFactory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/ObjectFactory.java deleted file mode 100644 index bb2a9059b9..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/ObjectFactory.java +++ /dev/null @@ -1,207 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Modifications Copyright (C) 2018 IBM. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each Java content interface and Java element interface generated in the - * org.onap.so.adapters.vnf.async.client package. - * <p> - * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. - * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding - * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in - * this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private static final String URL = "http://org.onap.so/vnfNotify"; - private static final QName _QueryVnfNotification_QNAME = new QName(URL, "queryVnfNotification"); - private static final QName _RollbackVnfNotification_QNAME = new QName(URL, "rollbackVnfNotification"); - private static final QName _CreateVnfNotification_QNAME = new QName(URL, "createVnfNotification"); - private static final QName _DeleteVnfNotification_QNAME = new QName(URL, "deleteVnfNotification"); - private static final QName _UpdateVnfNotification_QNAME = new QName(URL, "updateVnfNotification"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: - * org.onap.so.adapters.vnf.async.client - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link UpdateVnfNotification } - * - */ - public UpdateVnfNotification createUpdateVnfNotification() { - return new UpdateVnfNotification(); - } - - /** - * Create an instance of {@link UpdateVnfNotification.Outputs } - * - */ - public UpdateVnfNotification.Outputs createUpdateVnfNotificationOutputs() { - return new UpdateVnfNotification.Outputs(); - } - - /** - * Create an instance of {@link CreateVnfNotification } - * - */ - public CreateVnfNotification createCreateVnfNotification() { - return new CreateVnfNotification(); - } - - /** - * Create an instance of {@link CreateVnfNotification.Outputs } - * - */ - public CreateVnfNotification.Outputs createCreateVnfNotificationOutputs() { - return new CreateVnfNotification.Outputs(); - } - - /** - * Create an instance of {@link QueryVnfNotification } - * - */ - public QueryVnfNotification createQueryVnfNotification() { - return new QueryVnfNotification(); - } - - /** - * Create an instance of {@link QueryVnfNotification.Outputs } - * - */ - public QueryVnfNotification.Outputs createQueryVnfNotificationOutputs() { - return new QueryVnfNotification.Outputs(); - } - - /** - * Create an instance of {@link RollbackVnfNotification } - * - */ - public RollbackVnfNotification createRollbackVnfNotification() { - return new RollbackVnfNotification(); - } - - /** - * Create an instance of {@link DeleteVnfNotification } - * - */ - public DeleteVnfNotification createDeleteVnfNotification() { - return new DeleteVnfNotification(); - } - - /** - * Create an instance of {@link MsoRequest } - * - */ - public MsoRequest createMsoRequest() { - return new MsoRequest(); - } - - /** - * Create an instance of {@link VnfRollback } - * - */ - public VnfRollback createVnfRollback() { - return new VnfRollback(); - } - - /** - * Create an instance of {@link UpdateVnfNotification.Outputs.Entry } - * - */ - public UpdateVnfNotification.Outputs.Entry createUpdateVnfNotificationOutputsEntry() { - return new UpdateVnfNotification.Outputs.Entry(); - } - - /** - * Create an instance of {@link CreateVnfNotification.Outputs.Entry } - * - */ - public CreateVnfNotification.Outputs.Entry createCreateVnfNotificationOutputsEntry() { - return new CreateVnfNotification.Outputs.Entry(); - } - - /** - * Create an instance of {@link QueryVnfNotification.Outputs.Entry } - * - */ - public QueryVnfNotification.Outputs.Entry createQueryVnfNotificationOutputsEntry() { - return new QueryVnfNotification.Outputs.Entry(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link QueryVnfNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "queryVnfNotification") - public JAXBElement<QueryVnfNotification> createQueryVnfNotification(QueryVnfNotification value) { - return new JAXBElement<>(_QueryVnfNotification_QNAME, QueryVnfNotification.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link RollbackVnfNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "rollbackVnfNotification") - public JAXBElement<RollbackVnfNotification> createRollbackVnfNotification(RollbackVnfNotification value) { - return new JAXBElement<>(_RollbackVnfNotification_QNAME, RollbackVnfNotification.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CreateVnfNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "createVnfNotification") - public JAXBElement<CreateVnfNotification> createCreateVnfNotification(CreateVnfNotification value) { - return new JAXBElement<>(_CreateVnfNotification_QNAME, CreateVnfNotification.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link DeleteVnfNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "deleteVnfNotification") - public JAXBElement<DeleteVnfNotification> createDeleteVnfNotification(DeleteVnfNotification value) { - return new JAXBElement<>(_DeleteVnfNotification_QNAME, DeleteVnfNotification.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link UpdateVnfNotification }{@code >}} - * - */ - @XmlElementDecl(namespace = URL, name = "updateVnfNotification") - public JAXBElement<UpdateVnfNotification> createUpdateVnfNotification(UpdateVnfNotification value) { - return new JAXBElement<>(_UpdateVnfNotification_QNAME, UpdateVnfNotification.class, null, value); - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/QueryVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/QueryVnfNotification.java deleted file mode 100644 index 8681070972..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/QueryVnfNotification.java +++ /dev/null @@ -1,392 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for queryVnfNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="queryVnfNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="vnfExists" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> - * <element name="vnfId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="status" type="{http://org.onap.so/vnfNotify}vnfStatus" minOccurs="0"/> - * <element name="outputs" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "queryVnfNotification", - propOrder = {"messageId", "completed", "exception", "errorMessage", "vnfExists", "vnfId", "status", "outputs"}) -public class QueryVnfNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - protected Boolean vnfExists; - protected String vnfId; - protected VnfStatus status; - protected QueryVnfNotification.Outputs outputs; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - - /** - * Gets the value of the vnfExists property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isVnfExists() { - return vnfExists; - } - - /** - * Sets the value of the vnfExists property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setVnfExists(Boolean value) { - this.vnfExists = value; - } - - /** - * Gets the value of the vnfId property. - * - * @return possible object is {@link String } - * - */ - public String getVnfId() { - return vnfId; - } - - /** - * Sets the value of the vnfId property. - * - * @param value allowed object is {@link String } - * - */ - public void setVnfId(String value) { - this.vnfId = value; - } - - /** - * Gets the value of the status property. - * - * @return possible object is {@link VnfStatus } - * - */ - public VnfStatus getStatus() { - return status; - } - - /** - * Sets the value of the status property. - * - * @param value allowed object is {@link VnfStatus } - * - */ - public void setStatus(VnfStatus value) { - this.status = value; - } - - /** - * Gets the value of the outputs property. - * - * @return possible object is {@link QueryVnfNotification.Outputs } - * - */ - public QueryVnfNotification.Outputs getOutputs() { - return outputs; - } - - /** - * Sets the value of the outputs property. - * - * @param value allowed object is {@link QueryVnfNotification.Outputs } - * - */ - public void setOutputs(QueryVnfNotification.Outputs value) { - this.outputs = value; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"entry"}) - public static class Outputs { - - protected List<QueryVnfNotification.Outputs.Entry> entry; - - /** - * Gets the value of the entry property. - * - * <p> - * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you - * make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> - * method for the entry property. - * - * <p> - * For example, to add a new item, do as follows: - * - * <pre> - * getEntry().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list {@link QueryVnfNotification.Outputs.Entry } - * - * - */ - public List<QueryVnfNotification.Outputs.Entry> getEntry() { - if (entry == null) { - entry = new ArrayList<>(); - } - return this.entry; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"key", "value"}) - public static class Entry { - - protected String key; - protected String value; - - /** - * Gets the value of the key property. - * - * @return possible object is {@link String } - * - */ - public String getKey() { - return key; - } - - /** - * Sets the value of the key property. - * - * @param value allowed object is {@link String } - * - */ - public void setKey(String value) { - this.key = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - } - - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/RollbackVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/RollbackVnfNotification.java deleted file mode 100644 index e5f8878e84..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/RollbackVnfNotification.java +++ /dev/null @@ -1,139 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for rollbackVnfNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="rollbackVnfNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "rollbackVnfNotification", propOrder = {"messageId", "completed", "exception", "errorMessage"}) -public class RollbackVnfNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/UpdateVnfNotification.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/UpdateVnfNotification.java deleted file mode 100644 index 968b3767c3..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/UpdateVnfNotification.java +++ /dev/null @@ -1,348 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for updateVnfNotification complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="updateVnfNotification"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="messageId" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="completed" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="exception" type="{http://org.onap.so/vnfNotify}msoExceptionCategory" minOccurs="0"/> - * <element name="errorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="outputs" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * <element name="rollback" type="{http://org.onap.so/vnfNotify}vnfRollback" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "updateVnfNotification", - propOrder = {"messageId", "completed", "exception", "errorMessage", "outputs", "rollback"}) -public class UpdateVnfNotification { - - @XmlElement(required = true) - protected String messageId; - protected boolean completed; - protected MsoExceptionCategory exception; - protected String errorMessage; - protected UpdateVnfNotification.Outputs outputs; - protected VnfRollback rollback; - - /** - * Gets the value of the messageId property. - * - * @return possible object is {@link String } - * - */ - public String getMessageId() { - return messageId; - } - - /** - * Sets the value of the messageId property. - * - * @param value allowed object is {@link String } - * - */ - public void setMessageId(String value) { - this.messageId = value; - } - - /** - * Gets the value of the completed property. - * - */ - public boolean isCompleted() { - return completed; - } - - /** - * Sets the value of the completed property. - * - */ - public void setCompleted(boolean value) { - this.completed = value; - } - - /** - * Gets the value of the exception property. - * - * @return possible object is {@link MsoExceptionCategory } - * - */ - public MsoExceptionCategory getException() { - return exception; - } - - /** - * Sets the value of the exception property. - * - * @param value allowed object is {@link MsoExceptionCategory } - * - */ - public void setException(MsoExceptionCategory value) { - this.exception = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return possible object is {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value allowed object is {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - - /** - * Gets the value of the outputs property. - * - * @return possible object is {@link UpdateVnfNotification.Outputs } - * - */ - public UpdateVnfNotification.Outputs getOutputs() { - return outputs; - } - - /** - * Sets the value of the outputs property. - * - * @param value allowed object is {@link UpdateVnfNotification.Outputs } - * - */ - public void setOutputs(UpdateVnfNotification.Outputs value) { - this.outputs = value; - } - - /** - * Gets the value of the rollback property. - * - * @return possible object is {@link VnfRollback } - * - */ - public VnfRollback getRollback() { - return rollback; - } - - /** - * Sets the value of the rollback property. - * - * @param value allowed object is {@link VnfRollback } - * - */ - public void setRollback(VnfRollback value) { - this.rollback = value; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="entry" maxOccurs="unbounded" minOccurs="0"> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </element> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"entry"}) - public static class Outputs { - - protected List<UpdateVnfNotification.Outputs.Entry> entry; - - /** - * Gets the value of the entry property. - * - * <p> - * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you - * make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> - * method for the entry property. - * - * <p> - * For example, to add a new item, do as follows: - * - * <pre> - * getEntry().add(newItem); - * </pre> - * - * - * <p> - * Objects of the following type(s) are allowed in the list {@link UpdateVnfNotification.Outputs.Entry } - * - * - */ - public List<UpdateVnfNotification.Outputs.Entry> getEntry() { - if (entry == null) { - entry = new ArrayList<>(); - } - return this.entry; - } - - - /** - * <p> - * Java class for anonymous complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"key", "value"}) - public static class Entry { - - protected String key; - protected String value; - - /** - * Gets the value of the key property. - * - * @return possible object is {@link String } - * - */ - public String getKey() { - return key; - } - - /** - * Sets the value of the key property. - * - * @param value allowed object is {@link String } - * - */ - public void setKey(String value) { - this.key = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - } - - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify.java deleted file mode 100644 index d4bdaa3d34..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify.java +++ /dev/null @@ -1,146 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import javax.jws.Oneway; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.ws.Action; -import javax.xml.ws.RequestWrapper; - - -/** - * This class was generated by the JAX-WS RI. JAX-WS RI 2.2.9-b14002 Generated source version: 2.2 - * - */ -@WebService(name = "vnfAdapterNotify", targetNamespace = "http://org.onap.so/vnfNotify") -@XmlSeeAlso({ObjectFactory.class}) -public interface VnfAdapterNotify { - - - /** - * - * @param exception - * @param errorMessage - * @param messageId - * @param completed - */ - @WebMethod - @Oneway - @RequestWrapper(localName = "rollbackVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify", - className = "org.onap.so.adapters.vnf.async.client.RollbackVnfNotification") - @Action(input = "http://org.onap.so/notify/adapterNotify/rollbackVnfNotificationRequest") - public void rollbackVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage); - - /** - * - * @param exception - * @param outputs - * @param errorMessage - * @param vnfExists - * @param messageId - * @param completed - * @param vnfId - * @param status - */ - @WebMethod - @Oneway - @RequestWrapper(localName = "queryVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify", - className = "org.onap.so.adapters.vnf.async.client.QueryVnfNotification") - @Action(input = "http://org.onap.so/notify/adapterNotify/queryVnfNotificationRequest") - public void queryVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage, - @WebParam(name = "vnfExists", targetNamespace = "") Boolean vnfExists, - @WebParam(name = "vnfId", targetNamespace = "") String vnfId, - @WebParam(name = "status", targetNamespace = "") VnfStatus status, @WebParam(name = "outputs", - targetNamespace = "") org.onap.so.adapters.vnf.async.client.QueryVnfNotification.Outputs outputs); - - /** - * - * @param exception - * @param outputs - * @param rollback - * @param errorMessage - * @param messageId - * @param completed - * @param vnfId - */ - @WebMethod - @Oneway - @RequestWrapper(localName = "createVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify", - className = "org.onap.so.adapters.vnf.async.client.CreateVnfNotification") - @Action(input = "http://org.onap.so/notify/adapterNotify/createVnfNotificationRequest") - public void createVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage, - @WebParam(name = "vnfId", targetNamespace = "") String vnfId, - @WebParam(name = "outputs", - targetNamespace = "") org.onap.so.adapters.vnf.async.client.CreateVnfNotification.Outputs outputs, - @WebParam(name = "rollback", targetNamespace = "") VnfRollback rollback); - - /** - * - * @param exception - * @param outputs - * @param rollback - * @param errorMessage - * @param messageId - * @param completed - */ - @WebMethod - @Oneway - @RequestWrapper(localName = "updateVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify", - className = "org.onap.so.adapters.vnf.async.client.UpdateVnfNotification") - @Action(input = "http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest") - public void updateVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage, - @WebParam(name = "outputs", - targetNamespace = "") org.onap.so.adapters.vnf.async.client.UpdateVnfNotification.Outputs outputs, - @WebParam(name = "rollback", targetNamespace = "") VnfRollback rollback); - - /** - * - * @param exception - * @param errorMessage - * @param messageId - * @param completed - */ - @WebMethod - @Oneway - @RequestWrapper(localName = "deleteVnfNotification", targetNamespace = "http://org.onap.so/vnfNotify", - className = "org.onap.so.adapters.vnf.async.client.DeleteVnfNotification") - @Action(input = "http://org.onap.so/notify/adapterNotify/deleteVnfNotificationRequest") - public void deleteVnfNotification(@WebParam(name = "messageId", targetNamespace = "") String messageId, - @WebParam(name = "completed", targetNamespace = "") boolean completed, - @WebParam(name = "exception", targetNamespace = "") MsoExceptionCategory exception, - @WebParam(name = "errorMessage", targetNamespace = "") String errorMessage); - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java deleted file mode 100644 index 402d0af8e4..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfAdapterNotify_Service.java +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import java.net.URL; -import javax.xml.namespace.QName; -import javax.xml.ws.Service; -import javax.xml.ws.WebEndpoint; -import javax.xml.ws.WebServiceClient; -import javax.xml.ws.WebServiceException; -import javax.xml.ws.WebServiceFeature; - - -/** - * This class was generated by the JAX-WS RI. JAX-WS RI 2.2.9-b14002 Generated source version: 2.2 - * - */ -@WebServiceClient(name = "vnfAdapterNotify", targetNamespace = "http://org.onap.so/vnfNotify", - wsdlLocation = "/VnfAdapterNotify.wsdl") -public class VnfAdapterNotify_Service extends Service { - - private static final URL VNFADAPTERNOTIFY_WSDL_LOCATION; - private static final WebServiceException VNFADAPTERNOTIFY_EXCEPTION; - private static final String VNF_NOTIFY_URL = "http://org.onap.so/vnfNotify"; - private static final QName VNFADAPTERNOTIFY_QNAME = new QName(VNF_NOTIFY_URL, "vnfAdapterNotify"); - - static { - VNFADAPTERNOTIFY_WSDL_LOCATION = org.onap.so.adapters.vnf.async.client.VnfAdapterNotify_Service.class - .getResource("/VnfAdapterNotify.wsdl"); - WebServiceException e = null; - if (VNFADAPTERNOTIFY_WSDL_LOCATION == null) { - e = new WebServiceException( - "Cannot find '/VnfAdapterNotify.wsdl' wsdl. Place the resource correctly in the classpath."); - } - VNFADAPTERNOTIFY_EXCEPTION = e; - } - - public VnfAdapterNotify_Service() { - super(getWsdlLocation(), VNFADAPTERNOTIFY_QNAME); - } - - public VnfAdapterNotify_Service(WebServiceFeature... features) { - super(getWsdlLocation(), VNFADAPTERNOTIFY_QNAME, features); - } - - public VnfAdapterNotify_Service(URL wsdlLocation) { - super(wsdlLocation, VNFADAPTERNOTIFY_QNAME); - } - - public VnfAdapterNotify_Service(URL wsdlLocation, WebServiceFeature... features) { - super(wsdlLocation, VNFADAPTERNOTIFY_QNAME, features); - } - - public VnfAdapterNotify_Service(URL wsdlLocation, QName serviceName) { - super(wsdlLocation, serviceName); - } - - public VnfAdapterNotify_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { - super(wsdlLocation, serviceName, features); - } - - /** - * - * @return returns VnfAdapterNotify - */ - @WebEndpoint(name = "MsoVnfAdapterAsyncImplPort") - public VnfAdapterNotify getMsoVnfAdapterAsyncImplPort() { - return super.getPort(new QName(VNF_NOTIFY_URL, "MsoVnfAdapterAsyncImplPort"), VnfAdapterNotify.class); - } - - /** - * - * @param features A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features - * not in the <code>features</code> parameter will have their default values. - * @return returns VnfAdapterNotify - */ - @WebEndpoint(name = "MsoVnfAdapterAsyncImplPort") - public VnfAdapterNotify getMsoVnfAdapterAsyncImplPort(WebServiceFeature... features) { - return super.getPort(new QName(VNF_NOTIFY_URL, "MsoVnfAdapterAsyncImplPort"), VnfAdapterNotify.class, features); - } - - private static URL getWsdlLocation() { - if (VNFADAPTERNOTIFY_EXCEPTION != null) { - throw VNFADAPTERNOTIFY_EXCEPTION; - } - return VNFADAPTERNOTIFY_WSDL_LOCATION; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfRollback.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfRollback.java deleted file mode 100644 index 7d8b4d1b41..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfRollback.java +++ /dev/null @@ -1,178 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for vnfRollback complex type. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * - * <pre> - * <complexType name="vnfRollback"> - * <complexContent> - * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <sequence> - * <element name="cloudSiteId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="msoRequest" type="{http://org.onap.so/vnfNotify}msoRequest" minOccurs="0"/> - * <element name="tenantCreated" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="tenantId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="vnfCreated" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="vnfId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * </sequence> - * </restriction> - * </complexContent> - * </complexType> - * </pre> - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "vnfRollback", - propOrder = {"cloudSiteId", "msoRequest", "tenantCreated", "tenantId", "vnfCreated", "vnfId"}) -public class VnfRollback { - - protected String cloudSiteId; - protected MsoRequest msoRequest; - protected boolean tenantCreated; - protected String tenantId; - protected boolean vnfCreated; - protected String vnfId; - - /** - * Gets the value of the cloudSiteId property. - * - * @return possible object is {@link String } - * - */ - public String getCloudSiteId() { - return cloudSiteId; - } - - /** - * Sets the value of the cloudSiteId property. - * - * @param value allowed object is {@link String } - * - */ - public void setCloudSiteId(String value) { - this.cloudSiteId = value; - } - - /** - * Gets the value of the msoRequest property. - * - * @return possible object is {@link MsoRequest } - * - */ - public MsoRequest getMsoRequest() { - return msoRequest; - } - - /** - * Sets the value of the msoRequest property. - * - * @param value allowed object is {@link MsoRequest } - * - */ - public void setMsoRequest(MsoRequest value) { - this.msoRequest = value; - } - - /** - * Gets the value of the tenantCreated property. - * - */ - public boolean isTenantCreated() { - return tenantCreated; - } - - /** - * Sets the value of the tenantCreated property. - * - */ - public void setTenantCreated(boolean value) { - this.tenantCreated = value; - } - - /** - * Gets the value of the tenantId property. - * - * @return possible object is {@link String } - * - */ - public String getTenantId() { - return tenantId; - } - - /** - * Sets the value of the tenantId property. - * - * @param value allowed object is {@link String } - * - */ - public void setTenantId(String value) { - this.tenantId = value; - } - - /** - * Gets the value of the vnfCreated property. - * - */ - public boolean isVnfCreated() { - return vnfCreated; - } - - /** - * Sets the value of the vnfCreated property. - * - */ - public void setVnfCreated(boolean value) { - this.vnfCreated = value; - } - - /** - * Gets the value of the vnfId property. - * - * @return possible object is {@link String } - * - */ - public String getVnfId() { - return vnfId; - } - - /** - * Sets the value of the vnfId property. - * - * @param value allowed object is {@link String } - * - */ - public void setVnfId(String value) { - this.vnfId = value; - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfStatus.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfStatus.java deleted file mode 100644 index 767777767c..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/VnfStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.vnf.async.client; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p> - * Java class for vnfStatus. - * - * <p> - * The following schema fragment specifies the expected content contained within this class. - * <p> - * - * <pre> - * <simpleType name="vnfStatus"> - * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> - * <enumeration value="ACTIVE"/> - * <enumeration value="FAILED"/> - * <enumeration value="NOTFOUND"/> - * <enumeration value="UNKNOWN"/> - * </restriction> - * </simpleType> - * </pre> - * - */ -@XmlType(name = "vnfStatus") -@XmlEnum -public enum VnfStatus { - - ACTIVE, FAILED, NOTFOUND, UNKNOWN; - - public String value() { - return name(); - } - - public static VnfStatus fromValue(String v) { - return valueOf(v); - } - -} diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/package-info.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/package-info.java deleted file mode 100644 index cc4a2a78ec..0000000000 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/async/client/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://org.onap.so/vnfNotify") -package org.onap.so.adapters.vnf.async.client; diff --git a/adapters/mso-openstack-adapters/src/main/resources/NetworkAdapterNotify.wsdl b/adapters/mso-openstack-adapters/src/main/resources/NetworkAdapterNotify.wsdl deleted file mode 100644 index 900389f205..0000000000 --- a/adapters/mso-openstack-adapters/src/main/resources/NetworkAdapterNotify.wsdl +++ /dev/null @@ -1,295 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#13316. --> -<definitions targetNamespace="http://org.onap.so/networkNotify" name="networkAdapterNotify" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://org.onap.so/networkNotify" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> - <types> - <xs:schema version="1.0" targetNamespace="http://org.onap.so/networkNotify" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - - <xs:element name="createNetworkNotification" type="tns:createNetworkNotification"/> - - <xs:element name="createNetworkNotificationResponse" type="tns:createNetworkNotificationResponse"/> - - <xs:element name="deleteNetworkNotification" type="tns:deleteNetworkNotification"/> - - <xs:element name="deleteNetworkNotificationResponse" type="tns:deleteNetworkNotificationResponse"/> - - <xs:element name="queryNetworkNotification" type="tns:queryNetworkNotification"/> - - <xs:element name="queryNetworkNotificationResponse" type="tns:queryNetworkNotificationResponse"/> - - <xs:element name="rollbackNetworkNotification" type="tns:rollbackNetworkNotification"/> - - <xs:element name="rollbackNetworkNotificationResponse" type="tns:rollbackNetworkNotificationResponse"/> - - <xs:element name="updateNetworkNotification" type="tns:updateNetworkNotification"/> - - <xs:element name="updateNetworkNotificationResponse" type="tns:updateNetworkNotificationResponse"/> - - <xs:complexType name="queryNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="networkExists" type="xs:boolean" minOccurs="0"/> - <xs:element name="networkId" type="xs:string" minOccurs="0"/> - <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/> - <xs:element name="status" type="tns:networkStatus" minOccurs="0"/> - <xs:element name="vlans" type="xs:int" minOccurs="0" maxOccurs="255"/> - <xs:element name="subnetIdMap" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="queryNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="deleteNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="networkDeleted" type="xs:boolean" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="deleteNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="rollbackNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="rollbackNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="createNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="networkId" type="xs:string" minOccurs="0"/> - <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/> - <xs:element name="subnetIdMap" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="rollback" type="tns:networkRollback" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="createNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="updateNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="subnetIdMap" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="rollback" type="tns:networkRollback" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="updateNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="networkRollback"> - <xs:sequence> - <xs:element name="cloudId" type="xs:string" minOccurs="0"/> - <xs:element name="msoRequest" type="tns:msoRequest" minOccurs="0"/> - <xs:element name="networkCreated" type="xs:boolean"/> - <xs:element name="networkId" type="xs:string" minOccurs="0"/> - <xs:element name="networkStackId" type="xs:string" minOccurs="0"/> - <xs:element name="networkName" type="xs:string" minOccurs="0"/> - <xs:element name="networkType" type="xs:string" minOccurs="0"/> - <xs:element name="networkUpdated" type="xs:boolean"/> - <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/> - <xs:element name="physicalNetwork" type="xs:string" minOccurs="0"/> - <xs:element name="tenantId" type="xs:string" minOccurs="0"/> - <xs:element name="vlans" type="xs:int" nillable="true" minOccurs="0" maxOccurs="255"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="msoRequest"> - <xs:sequence> - <xs:element name="requestId" type="xs:string" minOccurs="0"/> - <xs:element name="serviceInstanceId" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:simpleType name="msoExceptionCategory"> - <xs:restriction base="xs:string"> - <xs:enumeration value="OPENSTACK"/> - <xs:enumeration value="IO"/> - <xs:enumeration value="INTERNAL"/> - <xs:enumeration value="USERDATA"/> - </xs:restriction> - </xs:simpleType> - - <xs:simpleType name="networkStatus"> - <xs:restriction base="xs:string"> - <xs:enumeration value="NOTFOUND"/> - <xs:enumeration value="ACTIVE"/> - <xs:enumeration value="DOWN"/> - <xs:enumeration value="BUILD"/> - <xs:enumeration value="ERROR"/> - <xs:enumeration value="UNKNOWN"/> - </xs:restriction> - </xs:simpleType> -</xs:schema> - </types> - <message name="rollbackNetworkNotification"> - <part name="parameters" element="tns:rollbackNetworkNotification"/> - </message> - <message name="rollbackNetworkNotificationResponse"> - <part name="parameters" element="tns:rollbackNetworkNotificationResponse"/> - </message> - <message name="queryNetworkNotification"> - <part name="parameters" element="tns:queryNetworkNotification"/> - </message> - <message name="queryNetworkNotificationResponse"> - <part name="parameters" element="tns:queryNetworkNotificationResponse"/> - </message> - <message name="createNetworkNotification"> - <part name="parameters" element="tns:createNetworkNotification"/> - </message> - <message name="createNetworkNotificationResponse"> - <part name="parameters" element="tns:createNetworkNotificationResponse"/> - </message> - <message name="deleteNetworkNotification"> - <part name="parameters" element="tns:deleteNetworkNotification"/> - </message> - <message name="deleteNetworkNotificationResponse"> - <part name="parameters" element="tns:deleteNetworkNotificationResponse"/> - </message> - <message name="updateNetworkNotification"> - <part name="parameters" element="tns:updateNetworkNotification"/> - </message> - <message name="updateNetworkNotificationResponse"> - <part name="parameters" element="tns:updateNetworkNotificationResponse"/> - </message> - <portType name="networkAdapterNotify"> - <operation name="rollbackNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationRequest" message="tns:rollbackNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationResponse" message="tns:rollbackNetworkNotificationResponse"/> - </operation> - <operation name="queryNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/queryNetworkNotificationRequest" message="tns:queryNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/queryNetworkNotificationResponse" message="tns:queryNetworkNotificationResponse"/> - </operation> - <operation name="createNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/createNetworkNotificationRequest" message="tns:createNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/createNetworkNotificationResponse" message="tns:createNetworkNotificationResponse"/> - </operation> - <operation name="deleteNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationRequest" message="tns:deleteNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationResponse" message="tns:deleteNetworkNotificationResponse"/> - </operation> - <operation name="updateNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/updateNetworkNotificationRequest" message="tns:updateNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/updateNetworkNotificationResponse" message="tns:updateNetworkNotificationResponse"/> - </operation> - </portType> - <binding name="MsoNetworkAdapterAsyncImplPortBinding" type="tns:networkAdapterNotify"> - <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> - <operation name="rollbackNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - <operation name="queryNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - <operation name="createNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - <operation name="deleteNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - <operation name="updateNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - </binding> - <service name="networkAdapterNotify"> - <port name="MsoNetworkAdapterAsyncImplPort" binding="tns:MsoNetworkAdapterAsyncImplPortBinding"> - <soap:address location="REPLACE_WITH_ACTUAL_URL"/> - </port> - </service> -</definitions> - diff --git a/adapters/mso-openstack-adapters/src/main/resources/VnfAdapterNotify.wsdl b/adapters/mso-openstack-adapters/src/main/resources/VnfAdapterNotify.wsdl deleted file mode 100644 index eb3f1033cd..0000000000 --- a/adapters/mso-openstack-adapters/src/main/resources/VnfAdapterNotify.wsdl +++ /dev/null @@ -1,218 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#13316. --> -<definitions targetNamespace="http://org.onap.so/vnfNotify" name="vnfAdapterNotify" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://org.onap.so/vnfNotify" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> - <types> - <xs:schema version="1.0" targetNamespace="http://org.onap.so/vnfNotify" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - - <xs:element name="createVnfNotification" type="tns:createVnfNotification"/> - - <xs:element name="updateVnfNotification" type="tns:updateVnfNotification"/> - - <xs:element name="deleteVnfNotification" type="tns:deleteVnfNotification"/> - - <xs:element name="queryVnfNotification" type="tns:queryVnfNotification"/> - - <xs:element name="rollbackVnfNotification" type="tns:rollbackVnfNotification"/> - - <xs:complexType name="queryVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="vnfExists" type="xs:boolean" minOccurs="0"/> - <xs:element name="vnfId" type="xs:string" minOccurs="0"/> - <xs:element name="status" type="tns:vnfStatus" minOccurs="0"/> - <xs:element name="outputs" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="deleteVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="rollbackVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="createVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="vnfId" type="xs:string" minOccurs="0"/> - <xs:element name="outputs" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="rollback" type="tns:vnfRollback" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="updateVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="outputs" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="rollback" type="tns:vnfRollback" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="vnfRollback"> - <xs:sequence> - <xs:element name="cloudSiteId" type="xs:string" minOccurs="0"/> - <xs:element name="msoRequest" type="tns:msoRequest" minOccurs="0"/> - <xs:element name="tenantCreated" type="xs:boolean"/> - <xs:element name="tenantId" type="xs:string" minOccurs="0"/> - <xs:element name="vnfCreated" type="xs:boolean"/> - <xs:element name="vnfId" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="msoRequest"> - <xs:sequence> - <xs:element name="requestId" type="xs:string" minOccurs="0"/> - <xs:element name="serviceInstanceId" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:simpleType name="msoExceptionCategory"> - <xs:restriction base="xs:string"> - <xs:enumeration value="OPENSTACK"/> - <xs:enumeration value="IO"/> - <xs:enumeration value="INTERNAL"/> - <xs:enumeration value="USERDATA"/> - </xs:restriction> - </xs:simpleType> - - <xs:simpleType name="vnfStatus"> - <xs:restriction base="xs:string"> - <xs:enumeration value="ACTIVE"/> - <xs:enumeration value="FAILED"/> - <xs:enumeration value="NOTFOUND"/> - <xs:enumeration value="UNKNOWN"/> - </xs:restriction> - </xs:simpleType> -</xs:schema> - </types> - <message name="rollbackVnfNotification"> - <part name="parameters" element="tns:rollbackVnfNotification"/> - </message> - <message name="queryVnfNotification"> - <part name="parameters" element="tns:queryVnfNotification"/> - </message> - <message name="createVnfNotification"> - <part name="parameters" element="tns:createVnfNotification"/> - </message> - <message name="updateVnfNotification"> - <part name="parameters" element="tns:updateVnfNotification"/> - </message> - <message name="deleteVnfNotification"> - <part name="parameters" element="tns:deleteVnfNotification"/> - </message> - <portType name="vnfAdapterNotify"> - <operation name="rollbackVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackVnfNotificationRequest" message="tns:rollbackVnfNotification"/> - </operation> - <operation name="queryVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/queryVnfNotificationRequest" message="tns:queryVnfNotification"/> - </operation> - <operation name="createVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/createVnfNotificationRequest" message="tns:createVnfNotification"/> - </operation> - <operation name="updateVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest" message="tns:updateVnfNotification"/> - </operation> - <operation name="deleteVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/deleteVnfNotificationRequest" message="tns:deleteVnfNotification"/> - </operation> - </portType> - <binding name="MsoVnfAdapterAsyncImplPortBinding" type="tns:vnfAdapterNotify"> - <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> - <operation name="rollbackVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - <operation name="queryVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - <operation name="createVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - <operation name="updateVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - <operation name="deleteVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - </binding> - <service name="vnfAdapterNotify"> - <port name="MsoVnfAdapterAsyncImplPort" binding="tns:MsoVnfAdapterAsyncImplPortBinding"> - <soap:address location="REPLACE_WITH_ACTUAL_URL"/> - </port> - </service> -</definitions> - diff --git a/adapters/mso-openstack-adapters/src/main/resources/wsdl/NetworkAdapterNotify.wsdl b/adapters/mso-openstack-adapters/src/main/resources/wsdl/NetworkAdapterNotify.wsdl deleted file mode 100644 index 900389f205..0000000000 --- a/adapters/mso-openstack-adapters/src/main/resources/wsdl/NetworkAdapterNotify.wsdl +++ /dev/null @@ -1,295 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#13316. --> -<definitions targetNamespace="http://org.onap.so/networkNotify" name="networkAdapterNotify" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://org.onap.so/networkNotify" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> - <types> - <xs:schema version="1.0" targetNamespace="http://org.onap.so/networkNotify" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - - <xs:element name="createNetworkNotification" type="tns:createNetworkNotification"/> - - <xs:element name="createNetworkNotificationResponse" type="tns:createNetworkNotificationResponse"/> - - <xs:element name="deleteNetworkNotification" type="tns:deleteNetworkNotification"/> - - <xs:element name="deleteNetworkNotificationResponse" type="tns:deleteNetworkNotificationResponse"/> - - <xs:element name="queryNetworkNotification" type="tns:queryNetworkNotification"/> - - <xs:element name="queryNetworkNotificationResponse" type="tns:queryNetworkNotificationResponse"/> - - <xs:element name="rollbackNetworkNotification" type="tns:rollbackNetworkNotification"/> - - <xs:element name="rollbackNetworkNotificationResponse" type="tns:rollbackNetworkNotificationResponse"/> - - <xs:element name="updateNetworkNotification" type="tns:updateNetworkNotification"/> - - <xs:element name="updateNetworkNotificationResponse" type="tns:updateNetworkNotificationResponse"/> - - <xs:complexType name="queryNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="networkExists" type="xs:boolean" minOccurs="0"/> - <xs:element name="networkId" type="xs:string" minOccurs="0"/> - <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/> - <xs:element name="status" type="tns:networkStatus" minOccurs="0"/> - <xs:element name="vlans" type="xs:int" minOccurs="0" maxOccurs="255"/> - <xs:element name="subnetIdMap" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="queryNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="deleteNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="networkDeleted" type="xs:boolean" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="deleteNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="rollbackNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="rollbackNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="createNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="networkId" type="xs:string" minOccurs="0"/> - <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/> - <xs:element name="subnetIdMap" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="rollback" type="tns:networkRollback" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="createNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="updateNetworkNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="subnetIdMap" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="rollback" type="tns:networkRollback" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="updateNetworkNotificationResponse"> - <xs:sequence/> - </xs:complexType> - - <xs:complexType name="networkRollback"> - <xs:sequence> - <xs:element name="cloudId" type="xs:string" minOccurs="0"/> - <xs:element name="msoRequest" type="tns:msoRequest" minOccurs="0"/> - <xs:element name="networkCreated" type="xs:boolean"/> - <xs:element name="networkId" type="xs:string" minOccurs="0"/> - <xs:element name="networkStackId" type="xs:string" minOccurs="0"/> - <xs:element name="networkName" type="xs:string" minOccurs="0"/> - <xs:element name="networkType" type="xs:string" minOccurs="0"/> - <xs:element name="networkUpdated" type="xs:boolean"/> - <xs:element name="neutronNetworkId" type="xs:string" minOccurs="0"/> - <xs:element name="physicalNetwork" type="xs:string" minOccurs="0"/> - <xs:element name="tenantId" type="xs:string" minOccurs="0"/> - <xs:element name="vlans" type="xs:int" nillable="true" minOccurs="0" maxOccurs="255"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="msoRequest"> - <xs:sequence> - <xs:element name="requestId" type="xs:string" minOccurs="0"/> - <xs:element name="serviceInstanceId" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:simpleType name="msoExceptionCategory"> - <xs:restriction base="xs:string"> - <xs:enumeration value="OPENSTACK"/> - <xs:enumeration value="IO"/> - <xs:enumeration value="INTERNAL"/> - <xs:enumeration value="USERDATA"/> - </xs:restriction> - </xs:simpleType> - - <xs:simpleType name="networkStatus"> - <xs:restriction base="xs:string"> - <xs:enumeration value="NOTFOUND"/> - <xs:enumeration value="ACTIVE"/> - <xs:enumeration value="DOWN"/> - <xs:enumeration value="BUILD"/> - <xs:enumeration value="ERROR"/> - <xs:enumeration value="UNKNOWN"/> - </xs:restriction> - </xs:simpleType> -</xs:schema> - </types> - <message name="rollbackNetworkNotification"> - <part name="parameters" element="tns:rollbackNetworkNotification"/> - </message> - <message name="rollbackNetworkNotificationResponse"> - <part name="parameters" element="tns:rollbackNetworkNotificationResponse"/> - </message> - <message name="queryNetworkNotification"> - <part name="parameters" element="tns:queryNetworkNotification"/> - </message> - <message name="queryNetworkNotificationResponse"> - <part name="parameters" element="tns:queryNetworkNotificationResponse"/> - </message> - <message name="createNetworkNotification"> - <part name="parameters" element="tns:createNetworkNotification"/> - </message> - <message name="createNetworkNotificationResponse"> - <part name="parameters" element="tns:createNetworkNotificationResponse"/> - </message> - <message name="deleteNetworkNotification"> - <part name="parameters" element="tns:deleteNetworkNotification"/> - </message> - <message name="deleteNetworkNotificationResponse"> - <part name="parameters" element="tns:deleteNetworkNotificationResponse"/> - </message> - <message name="updateNetworkNotification"> - <part name="parameters" element="tns:updateNetworkNotification"/> - </message> - <message name="updateNetworkNotificationResponse"> - <part name="parameters" element="tns:updateNetworkNotificationResponse"/> - </message> - <portType name="networkAdapterNotify"> - <operation name="rollbackNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationRequest" message="tns:rollbackNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackNetworkNotificationResponse" message="tns:rollbackNetworkNotificationResponse"/> - </operation> - <operation name="queryNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/queryNetworkNotificationRequest" message="tns:queryNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/queryNetworkNotificationResponse" message="tns:queryNetworkNotificationResponse"/> - </operation> - <operation name="createNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/createNetworkNotificationRequest" message="tns:createNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/createNetworkNotificationResponse" message="tns:createNetworkNotificationResponse"/> - </operation> - <operation name="deleteNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationRequest" message="tns:deleteNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/deleteNetworkNotificationResponse" message="tns:deleteNetworkNotificationResponse"/> - </operation> - <operation name="updateNetworkNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/updateNetworkNotificationRequest" message="tns:updateNetworkNotification"/> - <output wsam:Action="http://org.onap.so/notify/adapterNotify/updateNetworkNotificationResponse" message="tns:updateNetworkNotificationResponse"/> - </operation> - </portType> - <binding name="MsoNetworkAdapterAsyncImplPortBinding" type="tns:networkAdapterNotify"> - <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> - <operation name="rollbackNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - <operation name="queryNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - <operation name="createNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - <operation name="deleteNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - <operation name="updateNetworkNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - <output> - <soap:body use="literal"/> - </output> - </operation> - </binding> - <service name="networkAdapterNotify"> - <port name="MsoNetworkAdapterAsyncImplPort" binding="tns:MsoNetworkAdapterAsyncImplPortBinding"> - <soap:address location="REPLACE_WITH_ACTUAL_URL"/> - </port> - </service> -</definitions> - diff --git a/adapters/mso-openstack-adapters/src/main/resources/wsdl/VnfAdapterNotify.wsdl b/adapters/mso-openstack-adapters/src/main/resources/wsdl/VnfAdapterNotify.wsdl deleted file mode 100644 index eb3f1033cd..0000000000 --- a/adapters/mso-openstack-adapters/src/main/resources/wsdl/VnfAdapterNotify.wsdl +++ /dev/null @@ -1,218 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.7-b01 svn-revision#13316. --> -<definitions targetNamespace="http://org.onap.so/vnfNotify" name="vnfAdapterNotify" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://org.onap.so/vnfNotify" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> - <types> - <xs:schema version="1.0" targetNamespace="http://org.onap.so/vnfNotify" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - - <xs:element name="createVnfNotification" type="tns:createVnfNotification"/> - - <xs:element name="updateVnfNotification" type="tns:updateVnfNotification"/> - - <xs:element name="deleteVnfNotification" type="tns:deleteVnfNotification"/> - - <xs:element name="queryVnfNotification" type="tns:queryVnfNotification"/> - - <xs:element name="rollbackVnfNotification" type="tns:rollbackVnfNotification"/> - - <xs:complexType name="queryVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="vnfExists" type="xs:boolean" minOccurs="0"/> - <xs:element name="vnfId" type="xs:string" minOccurs="0"/> - <xs:element name="status" type="tns:vnfStatus" minOccurs="0"/> - <xs:element name="outputs" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="deleteVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="rollbackVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="createVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="vnfId" type="xs:string" minOccurs="0"/> - <xs:element name="outputs" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="rollback" type="tns:vnfRollback" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="updateVnfNotification"> - <xs:sequence> - <xs:element name="messageId" type="xs:string"/> - <xs:element name="completed" type="xs:boolean"/> - <xs:element name="exception" type="tns:msoExceptionCategory" minOccurs="0"/> - <xs:element name="errorMessage" type="xs:string" minOccurs="0"/> - <xs:element name="outputs" minOccurs="0"> - <xs:complexType> - <xs:sequence> - <xs:element name="entry" minOccurs="0" maxOccurs="255"> - <xs:complexType> - <xs:sequence> - <xs:element name="key" minOccurs="0" type="xs:string"/> - <xs:element name="value" minOccurs="0" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="rollback" type="tns:vnfRollback" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="vnfRollback"> - <xs:sequence> - <xs:element name="cloudSiteId" type="xs:string" minOccurs="0"/> - <xs:element name="msoRequest" type="tns:msoRequest" minOccurs="0"/> - <xs:element name="tenantCreated" type="xs:boolean"/> - <xs:element name="tenantId" type="xs:string" minOccurs="0"/> - <xs:element name="vnfCreated" type="xs:boolean"/> - <xs:element name="vnfId" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:complexType name="msoRequest"> - <xs:sequence> - <xs:element name="requestId" type="xs:string" minOccurs="0"/> - <xs:element name="serviceInstanceId" type="xs:string" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - - <xs:simpleType name="msoExceptionCategory"> - <xs:restriction base="xs:string"> - <xs:enumeration value="OPENSTACK"/> - <xs:enumeration value="IO"/> - <xs:enumeration value="INTERNAL"/> - <xs:enumeration value="USERDATA"/> - </xs:restriction> - </xs:simpleType> - - <xs:simpleType name="vnfStatus"> - <xs:restriction base="xs:string"> - <xs:enumeration value="ACTIVE"/> - <xs:enumeration value="FAILED"/> - <xs:enumeration value="NOTFOUND"/> - <xs:enumeration value="UNKNOWN"/> - </xs:restriction> - </xs:simpleType> -</xs:schema> - </types> - <message name="rollbackVnfNotification"> - <part name="parameters" element="tns:rollbackVnfNotification"/> - </message> - <message name="queryVnfNotification"> - <part name="parameters" element="tns:queryVnfNotification"/> - </message> - <message name="createVnfNotification"> - <part name="parameters" element="tns:createVnfNotification"/> - </message> - <message name="updateVnfNotification"> - <part name="parameters" element="tns:updateVnfNotification"/> - </message> - <message name="deleteVnfNotification"> - <part name="parameters" element="tns:deleteVnfNotification"/> - </message> - <portType name="vnfAdapterNotify"> - <operation name="rollbackVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/rollbackVnfNotificationRequest" message="tns:rollbackVnfNotification"/> - </operation> - <operation name="queryVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/queryVnfNotificationRequest" message="tns:queryVnfNotification"/> - </operation> - <operation name="createVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/createVnfNotificationRequest" message="tns:createVnfNotification"/> - </operation> - <operation name="updateVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest" message="tns:updateVnfNotification"/> - </operation> - <operation name="deleteVnfNotification"> - <input wsam:Action="http://org.onap.so/notify/adapterNotify/deleteVnfNotificationRequest" message="tns:deleteVnfNotification"/> - </operation> - </portType> - <binding name="MsoVnfAdapterAsyncImplPortBinding" type="tns:vnfAdapterNotify"> - <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> - <operation name="rollbackVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - <operation name="queryVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - <operation name="createVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - <operation name="updateVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - <operation name="deleteVnfNotification"> - <soap:operation soapAction=""/> - <input> - <soap:body use="literal"/> - </input> - </operation> - </binding> - <service name="vnfAdapterNotify"> - <port name="MsoVnfAdapterAsyncImplPort" binding="tns:MsoVnfAdapterAsyncImplPortBinding"> - <soap:address location="REPLACE_WITH_ACTUAL_URL"/> - </port> - </service> -</definitions> - diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefSeqTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefSeqTest.java deleted file mode 100644 index dd59121a39..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefSeqTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - -import static org.junit.Assert.assertTrue; -import org.junit.Test; - -public class ContrailPolicyRefSeqTest { - @Test - public void ContrailPolicyRefSeqJson_Test() { - ContrailPolicyRefSeq cprs = new ContrailPolicyRefSeq("majorVersion 1", "minorVersion 0.02"); - assertTrue(cprs.toString().contains("majorVersion 1")); - assertTrue(cprs.toString().contains("minorVersion 0.02")); - } - -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefTest.java deleted file mode 100644 index e8e14417c0..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailPolicyRefTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - -import static org.junit.Assert.assertTrue; -import org.junit.Test; - -public class ContrailPolicyRefTest { - - @Test - public void ContrailPolicyRef_Test() { - ContrailPolicyRef ref = new ContrailPolicyRef(); - ref.populate("majorVersion 1", "minorVersion 0.02"); - String strJson = ref.toJsonString(); - assertTrue(strJson.contains("majorVersion 1")); - assertTrue(strJson.contains("minorVersion 0.02")); - } - -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRouteTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRouteTest.java deleted file mode 100644 index eb8395cd9b..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRouteTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * ============LICENSE_START======================================================= ONAP : SO - * ================================================================================ Copyright (C) 2018 TechMahindra - * ================================================================================ Licensed under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy - * of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.so.adapters.network; - -import static org.junit.Assert.assertEquals; -import org.junit.Test; -import org.onap.so.openstack.beans.HostRoute; - -public class ContrailSubnetHostRouteTest { - - private ContrailSubnetHostRoute cshr = new ContrailSubnetHostRoute(); - HostRoute hr = new HostRoute(); - - @Test - public void testContrailSubnetHostRoute() { - - cshr.setPrefix("prefix"); - cshr.setNextHop("nextHop"); - assertEquals("prefix", cshr.getPrefix()); - assertEquals("nextHop", cshr.getNextHop()); - assert (cshr.toString() != null); - cshr.populateWith(hr); - } -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRoutesTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRoutesTest.java deleted file mode 100644 index 830d94cf85..0000000000 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/ContrailSubnetHostRoutesTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * ============LICENSE_START======================================================= ONAP : SO - * ================================================================================ Copyright (C) 2018 TechMahindra - * ================================================================================ Licensed under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy - * of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.so.adapters.network; - -import static org.junit.Assert.*; -import java.util.List; -import org.junit.Test; - -public class ContrailSubnetHostRoutesTest { - - ContrailSubnetHostRoutes cshr = new ContrailSubnetHostRoutes(); - List<ContrailSubnetHostRoute> host_routes; - StringBuilder buf = new StringBuilder(); - - @Test - public void testContrailSubnetHostRoutes() { - cshr.setHostRoutes(host_routes); - assertEquals(cshr.getHostRoutes(), host_routes); - assert (cshr.toString() != null); - } -} diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java index 88c6992a0a..a7abdcab7f 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/MSONetworkAdapterImplTest.java @@ -23,22 +23,16 @@ package org.onap.so.adapters.network; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.patch; import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; -import static org.junit.Assert.assertEquals; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteNeutronNetwork; +import static org.junit.Assert.assertNotNull; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteStack_200; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackDeleteStack_500; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetAllNeutronNetworks_200; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetAllNeutronNetworks_404; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetNeutronNetwork; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetNeutronNetwork_404; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackCreated_200; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackDeleteOrUpdateComplete_200; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStack_404; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStack_500; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPostNeutronNetwork_200; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPostStack_200; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutNeutronNetwork; -import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutNeutronNetwork_200; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackPutStack; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess; import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenstackGet; @@ -47,24 +41,36 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import javax.xml.ws.Holder; +import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.http.HttpStatus; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.onap.so.adapters.network.exceptions.NetworkException; import org.onap.so.adapters.vnf.BaseRestTestUtils; +import org.onap.so.entity.MsoRequest; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.web.util.UriComponentsBuilder; import com.github.tomakehurst.wiremock.WireMockServer; +import com.woorea.openstack.base.client.OpenStackResponseException; public class MSONetworkAdapterImplTest extends BaseRestTestUtils { public static final String NETWORK_ID = "43173f6a-d699-414b-888f-ab243dda6dfe"; public static final String NETWORK_NAME = "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0"; + @Autowired + MsoNetworkAdapterImpl impl; + + @Rule + public final ExpectedException exception = ExpectedException.none(); @Test - public void createNetworkByModelNameHeatMode() throws IOException { + public void createNetworkByModelNameHeatMode() throws IOException, NetworkException { mockUpdateRequestDb(wireMockServer, "9733c8d1-2668-4e5f-8b51-2cacc9b662c0"); @@ -77,62 +83,63 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId"); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = sendXMLRequest(inputStream("/CreateNetwork.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void createNetworkByModelNameAlreadyExistHeatMode() throws IOException { - - mockUpdateRequestDb(wireMockServer, "9733c8d1-2668-4e5f-8b51-2cacc9b662c0"); - - mockOpenStackResponseAccess(wireMockServer, wireMockPort); + MsoRequest request = new MsoRequest(); + request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0"); + request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET"); - mockOpenStackPostStack_200(wireMockServer, "OpenstackResponse_Stack.json"); + Holder<String> stackId = new Holder<String>(); - mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", - "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId"); + impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null, + "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001", "dvs-mtjnj-01", null, null, null, null, false, + false, null, null, null, request, stackId, new MutableBoolean()); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = sendXMLRequest(inputStream("/CreateNetwork.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + assertNotNull(stackId.value); } @Test - public void createNetworkByModelNameAlreadyExistHeatModeFailIfExistTrue() throws IOException { + public void createNetworkByModelNameAlreadyExistHeatModeFailIfExistTrue() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", "dvspg-VCE_VPE-mtjnj40avbc"); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_Fail_If_Exist_True.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0"); + request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET"); + + Holder<String> stackId = new Holder<String>(); + + impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null, + "dvspg-VCE_VPE-mtjnj40avbc", "dvs-mtjnj-01", null, null, null, null, true, false, null, null, null, + request, stackId, new MutableBoolean()); } @Test - public void createNetworkByModelNameHeatModeQueryNetworkException() throws IOException { + public void createNetworkByModelNameHeatModeQueryNetworkException() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); mockOpenstackGet(wireMockServer, "/mockPublicUrl/stacks/dvspg-VCE_VPE-mtjnj40avbc", HttpStatus.SC_INTERNAL_SERVER_ERROR); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = sendXMLRequest(inputStream("/CreateNetwork.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0"); + request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET"); + + Holder<String> stackId = new Holder<String>(); + + impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null, + "dvspg-VCE_VPE-mtjnj40avbc", "dvs-mtjnj-01", null, null, null, null, true, false, null, null, null, + request, stackId, new MutableBoolean()); } @Test - public void createNetworkByModelNameHeatModeCreateNetworkException() throws IOException { + public void createNetworkByModelNameHeatModeCreateNetworkException() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); @@ -140,14 +147,20 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { mockOpenstackPost(wireMockServer, "/mockPublicUrl/stacks", HttpStatus.SC_INTERNAL_SERVER_ERROR); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = sendXMLRequest(inputStream("/CreateNetwork.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0"); + request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET"); + + Holder<String> stackId = new Holder<String>(); + + impl.createNetwork("mtn13", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null, + "dvspg-VCE_VPE-mtjnj40avbc", "dvs-mtjnj-01", null, null, null, null, false, false, null, null, null, + request, stackId, new MutableBoolean()); } @Test - public void createNetworkByModelNameCloudSiteNotPresentError() throws IOException { + public void createNetworkByModelNameCloudSiteNotPresentError() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); @@ -156,15 +169,20 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", "dvspg-VCE_VPE-mtjnj40avbc"); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/CreateNetwork_InvalidCloudSiteId.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("9733c8d1-2668-4e5f-8b51-2cacc9b662c0"); + request.setServiceInstanceId("MIS/1806/25009/SW_INTERNET"); + + Holder<String> stackId = new Holder<String>(); + + impl.createNetwork("mtn14", "bef254252c5d44e6bcec65c180180ab5", "CONTRAIL30_GNDIRECT", null, + "dvspg-VCE_VPE-mtjnj40avbc", "dvs-mtjnj-01", null, null, null, null, false, false, null, null, null, + request, stackId, new MutableBoolean()); + } @Test - public void deleteNetworkHeatModeSuccess() throws IOException { + public void deleteNetworkHeatModeSuccess() throws IOException, NetworkException { mockUpdateRequestDb(wireMockServer, "5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); @@ -177,14 +195,17 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", "43173f6a-d699-414b-888f-ab243dda6dfe"); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = sendXMLRequest(inputStream("/DeleteNetwork.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); + request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0"); + + impl.deleteNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null, + "43173f6a-d699-414b-888f-ab243dda6dfe", request); } @Test - public void deleteNetworkDeleteStackException() throws IOException { + public void deleteNetworkDeleteStackException() throws IOException, NetworkException { + exception.expect(OpenStackResponseException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); @@ -195,14 +216,17 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", "43173f6a-d699-414b-888f-ab243dda6dfe"); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = sendXMLRequest(inputStream("/DeleteNetwork.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); + request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0"); + + impl.deleteNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null, + "43173f6a-d699-414b-888f-ab243dda6dfe", request); } @Test - public void deleteNetworkError() throws IOException { + public void deleteNetworkError() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); @@ -213,31 +237,38 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", "43173f6a-d699-414b-888f-ab243dda6dfe"); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/DeleteNetwork.xml").replace("mtn13", ""), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); + request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0"); + + impl.deleteNetwork("", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null, + "43173f6a-d699-414b-888f-ab243dda6dfe", request); + } @Test - public void updateNetworkNeutronUpdateException() throws IOException { + public void updateNetworkNeutronUpdateException() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK); mockOpenStackPutNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/UpdateNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), - uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); + request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0"); + + Holder<String> stackId = new Holder<String>(); + + impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL31_GNDIRECT", null, + "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", + "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId); } @Test - public void updateNetworkHeatUpdateException() throws IOException { + public void updateNetworkHeatUpdateException() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); @@ -245,113 +276,95 @@ public class MSONetworkAdapterImplTest extends BaseRestTestUtils { mockOpenStackPutStack(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = sendXMLRequest(inputStream("/UpdateNetwork.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); + request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0"); + + Holder<String> stackId = new Holder<String>(); + + impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null, + "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", + "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId); + } @Test - public void updateNetworkHeatQueryException() throws IOException { + public void updateNetworkHeatQueryException() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); mockOpenStackGetStack_500(wireMockServer, NETWORK_NAME); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = sendXMLRequest(inputStream("/UpdateNetwork.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + MsoRequest request = new MsoRequest(); + request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); + request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0"); + + Holder<String> stackId = new Holder<String>(); + + impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null, + "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", + "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId); } @Test - public void updateNetworkHeatStackNotFound() throws IOException { + public void updateNetworkHeatStackNotFound() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); mockOpenStackGetStack_404(wireMockServer, NETWORK_NAME); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = sendXMLRequest(inputStream("/UpdateNetwork.xml"), uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void updateNetworkNeutronQueryException() throws IOException { + MsoRequest request = new MsoRequest(); + request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); + request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0"); - mockOpenStackResponseAccess(wireMockServer, wireMockPort); + Holder<String> stackId = new Holder<String>(); - mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/UpdateNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), - uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); + impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL30_BASIC", null, + "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", + "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId); } @Test - public void updateNetworkNeutronStackNotFound() throws IOException { + public void updateNetworkNeutronQueryException() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_NOT_FOUND); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/UpdateNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), - uri, HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } - - @Test - public void queryNetworkHeatModesuccess() throws IOException { + mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_INTERNAL_SERVER_ERROR); - mockOpenStackResponseAccess(wireMockServer, wireMockPort); + MsoRequest request = new MsoRequest(); + request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); + request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0"); - mockOpenStackGetStackCreated_200(wireMockServer, "OpenstackResponse_Stack_Created.json", NETWORK_ID); + Holder<String> stackId = new Holder<String>(); - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/QueryNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), uri, - HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL31_GNDIRECT", null, + "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", + "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId); } @Test - public void queryNetworkHeatModeQueryException() throws IOException { + public void updateNetworkNeutronStackNotFound() throws IOException, NetworkException { + exception.expect(NetworkException.class); mockOpenStackResponseAccess(wireMockServer, wireMockPort); - mockOpenStackGetStack_500(wireMockServer, NETWORK_ID); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/QueryNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), uri, - HttpMethod.POST); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatusCode().value()); - } + mockOpenStackGetNeutronNetwork(wireMockServer, NETWORK_ID, HttpStatus.SC_NOT_FOUND); - @Test - public void queryNetworkNeutronModeSuccess() throws IOException { + MsoRequest request = new MsoRequest(); + request.setRequestId("5a29d907-b8c7-47bf-85f3-3940c0cce0f7"); + request.setServiceInstanceId("ab652f96-1fc3-4fdd-8e1b-4af629bc22c0"); - mockOpenStackResponseAccess(wireMockServer, wireMockPort); + Holder<String> stackId = new Holder<String>(); - mockOpenStackGetNeutronNetwork(wireMockServer, "GetNeutronNetwork.json", NETWORK_ID, HttpStatus.SC_OK); - - String uri = "/services/NetworkAdapter"; - headers.set("X-ECOMP-RequestID", "123456789456127"); - ResponseEntity<String> response = - sendXMLRequest(inputStream("/QueryNetwork.xml").replace("CONTRAIL30_BASIC", "CONTRAIL31_GNDIRECT"), uri, - HttpMethod.POST); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + impl.updateNetwork("mtn13", "2871503957144f72b3cf481b379828ec", "CONTRAIL31_GNDIRECT", null, + "43173f6a-d699-414b-888f-ab243dda6dfe", "vUSP-23804-T-01-dpa2b_EVUSP-CORE-VIF-TSIG0_net_0", + "TestPhysicalNetwork", null, null, null, null, null, null, null, request, stackId); } + public ResponseEntity<String> sendXMLRequest(String requestJson, String uriPath, HttpMethod reqMethod) { headers.set("Accept", MediaType.APPLICATION_XML); headers.set("Content-Type", MediaType.APPLICATION_XML); diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java index 09fea0644e..33805f9faa 100644 --- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java +++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java @@ -26,6 +26,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import java.sql.Timestamp; import java.time.Instant; import java.time.temporal.ChronoUnit; @@ -331,4 +332,14 @@ public class RequestsDbClientTest extends RequestsAdapterBase { List<InfraActiveRequests> infraActiveRequests = requestsDbClient.getInProgressVolumeGroupsAndVfModules(); assertThat(request, sameBeanAs(infraActiveRequests.get(0)).ignoring("modifyTime")); } + + @Test + public void getRequestProcessingDataBySoRequestIdAndNameAndTag() { + List<RequestProcessingData> requestProcessingData = + requestsDbClient.getRequestProcessingDataBySoRequestIdAndNameAndTagOrderByCreateTimeDesc( + "00032ab7-na18-42e5-965d-8ea592502018", "requestAction", "pincFabricConfigRequest"); + assertNotNull(requestProcessingData); + assertTrue(requestProcessingData.size() == 1); + assertEquals("assign", requestProcessingData.get(0).getValue()); + } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java index 1290f2aeef..df726fed22 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java @@ -79,266 +79,266 @@ public class BBInputSetupParameter { } - protected CloudConfiguration getCloudConfiguration() { + public CloudConfiguration getCloudConfiguration() { return cloudConfiguration; } - protected void setCloudConfiguration(CloudConfiguration cloudConfiguration) { + public void setCloudConfiguration(CloudConfiguration cloudConfiguration) { this.cloudConfiguration = cloudConfiguration; } - protected ConfigurationResourceKeys getConfigurationResourceKeys() { + public ConfigurationResourceKeys getConfigurationResourceKeys() { return configurationResourceKeys; } - protected void setConfigurationResourceKeys(ConfigurationResourceKeys configurationResourceKeys) { + public void setConfigurationResourceKeys(ConfigurationResourceKeys configurationResourceKeys) { this.configurationResourceKeys = configurationResourceKeys; } - protected List<Map<String, String>> getInstanceParams() { + public List<Map<String, String>> getInstanceParams() { return instanceParams; } - protected void setInstanceParams(List<Map<String, String>> instanceParams) { + public void setInstanceParams(List<Map<String, String>> instanceParams) { this.instanceParams = instanceParams; } - protected Map<ResourceKey, String> getLookupKeyMap() { + public Map<ResourceKey, String> getLookupKeyMap() { return lookupKeyMap; } - protected void setLookupKeyMap(Map<ResourceKey, String> lookupKeyMap) { + public void setLookupKeyMap(Map<ResourceKey, String> lookupKeyMap) { this.lookupKeyMap = lookupKeyMap; } - protected ModelInfo getModelInfo() { + public ModelInfo getModelInfo() { return modelInfo; } - protected void setModelInfo(ModelInfo modelInfo) { + public void setModelInfo(ModelInfo modelInfo) { this.modelInfo = modelInfo; } - protected LineOfBusiness getLineOfBusiness() { + public LineOfBusiness getLineOfBusiness() { return lineOfBusiness; } - protected void setLineOfBusiness(LineOfBusiness lineOfBusiness) { + public void setLineOfBusiness(LineOfBusiness lineOfBusiness) { this.lineOfBusiness = lineOfBusiness; } - protected Platform getPlatform() { + public Platform getPlatform() { return platform; } - protected void setPlatform(Platform platform) { + public void setPlatform(Platform platform) { this.platform = platform; } - protected RelatedInstanceList[] getRelatedInstanceList() { + public RelatedInstanceList[] getRelatedInstanceList() { return relatedInstanceList; } - protected void setRelatedInstanceList(RelatedInstanceList[] relatedInstanceList) { + public void setRelatedInstanceList(RelatedInstanceList[] relatedInstanceList) { this.relatedInstanceList = relatedInstanceList; } - protected RequestDetails getRequestDetails() { + public RequestDetails getRequestDetails() { return requestDetails; } - protected void setRequestDetails(RequestDetails requestDetails) { + public void setRequestDetails(RequestDetails requestDetails) { this.requestDetails = requestDetails; } - protected Service getService() { + public Service getService() { return service; } - protected void setService(Service service) { + public void setService(Service service) { this.service = service; } - protected ServiceInstance getServiceInstance() { + public ServiceInstance getServiceInstance() { return serviceInstance; } - protected void setServiceInstance(ServiceInstance serviceInstance) { + public void setServiceInstance(ServiceInstance serviceInstance) { this.serviceInstance = serviceInstance; } - protected String getBbName() { + public String getBbName() { return bbName; } - protected void setBbName(String bbName) { + public void setBbName(String bbName) { this.bbName = bbName; } - protected String getInstanceGroupId() { + public String getInstanceGroupId() { return instanceGroupId; } - protected void setInstanceGroupId(String instanceGroupId) { + public void setInstanceGroupId(String instanceGroupId) { this.instanceGroupId = instanceGroupId; } - protected String getInstanceName() { + public String getInstanceName() { return instanceName; } - protected void setInstanceName(String instanceName) { + public void setInstanceName(String instanceName) { this.instanceName = instanceName; } - protected String getProductFamilyId() { + public String getProductFamilyId() { return productFamilyId; } - protected void setProductFamilyId(String productFamilyId) { + public void setProductFamilyId(String productFamilyId) { this.productFamilyId = productFamilyId; } - protected String getResourceId() { + public String getResourceId() { return resourceId; } - protected void setResourceId(String resourceId) { + public void setResourceId(String resourceId) { this.resourceId = resourceId; } - protected String getVnfType() { + public String getVnfType() { return vnfType; } - protected void setVnfType(String vnfType) { + public void setVnfType(String vnfType) { this.vnfType = vnfType; } - protected ExecuteBuildingBlock getExecuteBB() { + public ExecuteBuildingBlock getExecuteBB() { return executeBB; } - protected void setExecuteBB(ExecuteBuildingBlock executeBB) { + public void setExecuteBB(ExecuteBuildingBlock executeBB) { this.executeBB = executeBB; } - protected String getRequestAction() { + public String getRequestAction() { return requestAction; } - protected void setRequestAction(String requestAction) { + public void setRequestAction(String requestAction) { this.requestAction = requestAction; } - protected boolean getaLaCarte() { + public boolean getaLaCarte() { return aLaCarte; } - protected void setaLaCarte(boolean aLaCarte) { + public void setaLaCarte(boolean aLaCarte) { this.aLaCarte = aLaCarte; } - protected Customer getCustomer() { + public Customer getCustomer() { return customer; } - protected void setCustomer(Customer customer) { + public void setCustomer(Customer customer) { this.customer = customer; } - protected void setRequestId(String requestId) { + public void setRequestId(String requestId) { this.requestId = requestId; } - protected String getRequestId() { + public String getRequestId() { return requestId; } - protected void setConfigurationKey(String configurationKey) { + public void setConfigurationKey(String configurationKey) { this.configurationKey = configurationKey; } - protected String getConfigurationKey() { + public String getConfigurationKey() { return configurationKey; } - protected String getKey() { + public String getKey() { return key; } - protected void setKey(String key) { + public void setKey(String key) { this.key = key; } - protected String getApplicationId() { + public String getApplicationId() { return applicationId; } - protected void setApplicationId(String applicationId) { + public void setApplicationId(String applicationId) { this.applicationId = applicationId; } - protected boolean getIsReplace() { + public boolean getIsReplace() { return isReplace; } - protected void setIsReplace(boolean isReplace) { + public void setIsReplace(boolean isReplace) { this.isReplace = isReplace; } - protected ServiceModel getServiceModel() { + public ServiceModel getServiceModel() { return this.serviceModel; } - protected void setServiceModel(ServiceModel serviceModel) { + public void setServiceModel(ServiceModel serviceModel) { this.serviceModel = serviceModel; } - protected boolean getIsHelm() { + public boolean getIsHelm() { return isHelm; } - protected void setIsHelm(boolean isHelm) { + public void setIsHelm(boolean isHelm) { this.isHelm = isHelm; } @@ -492,27 +492,27 @@ public class BBInputSetupParameter { return this; } - protected Builder setApplicationId(String applicationId) { + public Builder setApplicationId(String applicationId) { this.applicationId = applicationId; return this; } - protected Builder setIsReplace(boolean isReplace) { + public Builder setIsReplace(boolean isReplace) { this.isReplace = isReplace; return this; } - protected Builder setServiceModel(ServiceModel serviceModel) { + public Builder setServiceModel(ServiceModel serviceModel) { this.serviceModel = serviceModel; return this; } - protected boolean getIsHelm() { + public boolean getIsHelm() { return isHelm; } - protected void setIsHelm(boolean isHelm) { + public void setIsHelm(boolean isHelm) { this.isHelm = isHelm; } diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java index 477dce1072..8d6e133a1c 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java @@ -79,6 +79,7 @@ public class MSOInfrastructureApplication { private static final String LOGS_DIR = "logs_dir"; private static final String BPMN_SUFFIX = ".bpmn"; private static final String SDC_SOURCE = "sdc"; + private static final int CANNOT_INVOKE_COMMAND = 126; private static void setLogsDir() { @@ -88,9 +89,14 @@ public class MSOInfrastructureApplication { } public static void main(String... args) { - SpringApplication.run(MSOInfrastructureApplication.class, args); - System.getProperties().setProperty("mso.config.path", "."); - setLogsDir(); + try { + SpringApplication.run(MSOInfrastructureApplication.class, args); + System.getProperties().setProperty("mso.config.path", "."); + setLogsDir(); + } catch (Exception e) { + logger.error("Exception has occurred during application startup. App will exit. ", e); + System.exit(CANNOT_INVOKE_COMMAND); + } } @PostConstruct diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy index 59decb56a4..a3e245ffea 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy @@ -120,17 +120,17 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter //set new nsiId to sliceParams suggestNsiId - sliceParams.setSuggestNsiId(sliceInstanceId) - ServiceInstance nsi = new ServiceInstance() - String sliceInstanceName = "nsi_"+execution.getVariable("sliceServiceInstanceName") String serviceType = sliceParams.serviceProfile.get("sST") String serviceStatus = "deactivated" String modelInvariantUuid = sliceParams.getNSTInfo().invariantUUID String modelUuid = sliceParams.getNSTInfo().UUID + sliceParams.setSuggestNsiId(sliceInstanceId) + sliceParams.setSuggestNsiName(sliceInstanceName) + String uuiRequest = execution.getVariable("uuiRequest") String serviceInstanceLocationid = jsonUtil.getJsonValue(uuiRequest, "service.parameters.requestInputs.plmnIdList") String serviceRole = "nsi" diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index ee4e56bc18..29206a6aa9 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -26,18 +26,30 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.ASSIGNINSTANCE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CONTROLLER; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.FABRIC_CONFIGURATION; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.REPLACEINSTANCE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.REPLACEINSTANCERETAINASSIGNMENTS; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.SERVICE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.WORKFLOW_ACTION_ERROR_MESSAGE; import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; import org.apache.commons.lang3.SerializationUtils; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.javatuples.Pair; -import org.onap.aai.domain.yang.Relationship; -import org.onap.aai.domain.yang.ServiceInstance; import org.onap.aai.domain.yang.Vnfc; import org.onap.aai.domain.yang.VolumeGroup; -import org.onap.aai.domain.yang.VpnBinding; -import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider; import org.onap.aaiclient.client.aai.AAIObjectName; import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; import org.onap.aaiclient.client.aai.entities.Relationships; @@ -46,22 +58,16 @@ import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types; import org.onap.so.bpmn.common.BBConstants; +import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.ServiceEBBLoader; import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.VnfEBBLoader; import org.onap.so.bpmn.infrastructure.workflow.tasks.excpetion.VnfcMultipleRelationshipException; import org.onap.so.bpmn.infrastructure.workflow.tasks.utils.WorkflowResourceIdsUtils; -import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration; -import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule; import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.so.client.orchestration.AAIConfigurationResources; import org.onap.so.client.orchestration.AAIEntityNotFoundException; -import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization; -import org.onap.so.db.catalog.beans.CollectionResourceCustomization; -import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization; -import org.onap.so.db.catalog.beans.InstanceGroup; import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.macro.NorthBoundRequest; import org.onap.so.db.catalog.beans.macro.OrchestrationFlow; @@ -79,26 +85,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.UUID; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.ASSIGNINSTANCE; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CONTROLLER; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.FABRIC_CONFIGURATION; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.NETWORKCOLLECTION; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.REPLACEINSTANCE; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.REPLACEINSTANCERETAINASSIGNMENTS; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.SERVICE; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.USER_PARAM_SERVICE; -import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.WORKFLOW_ACTION_ERROR_MESSAGE; +import com.fasterxml.jackson.databind.ObjectMapper; @Component public class WorkflowAction { @@ -131,21 +118,15 @@ public class WorkflowAction { @Autowired private CatalogDbClient catalogDbClient; @Autowired - private AAIConfigurationResources aaiConfigurationResources; - @Autowired - private WorkflowActionExtractResourcesAAI workflowActionUtils; - @Autowired - private VrfValidation vrfValidation; - @Autowired private Environment environment; @Autowired - private UserParamsServiceTraversal userParamsServiceTraversal; - @Autowired private AaiResourceIdValidator aaiResourceIdValidator; @Autowired private ExecuteBuildingBlockBuilder executeBuildingBlockBuilder; @Autowired private VnfEBBLoader vnfEBBLoader; + @Autowired + private ServiceEBBLoader serviceEBBLoader; public void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils) { this.bbInputSetupUtils = bbInputSetupUtils; @@ -295,52 +276,12 @@ public class WorkflowAction { String cloudOwner, String serviceType, String requestId, String apiVersion, String vnfType, RequestDetails requestDetails) throws IOException, VrfBondingServiceException { List<ExecuteBuildingBlock> flowsToExecute; - boolean containsService = false; List<Resource> resourceList = new ArrayList<>(); List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>(); - List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams(); - if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(ASSIGNINSTANCE)) { - // SERVICE-MACRO-ASSIGN will always get user params with a - // service. - - if (userParams != null) { - containsService = isContainsService(sIRequest); - if (containsService) { - resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams, - serviceInstanceId, requestAction); - } - } else { - buildAndThrowException(execution, - "Service-Macro-Assign request details must contain user params with a service"); - } - } else if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(CREATE_INSTANCE)) { - // SERVICE-MACRO-CREATE will get user params with a service, - // a service with a network, a service with a - // network collection, OR an empty service. - // If user params is just a service or null and macro - // queries the SI and finds a VNF, macro fails. - - if (userParams != null) { - containsService = isContainsService(sIRequest); - } - if (containsService) { - resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams, - serviceInstanceId, requestAction); - } - if (!foundRelated(resourceList)) { - traverseCatalogDbService(execution, sIRequest, resourceList, aaiResourceIds); - } - } else if (resourceType == WorkflowType.SERVICE && ("activateInstance".equalsIgnoreCase(requestAction) - || "unassignInstance".equalsIgnoreCase(requestAction) - || "deleteInstance".equalsIgnoreCase(requestAction) - || requestAction.equalsIgnoreCase("activate" + FABRIC_CONFIGURATION))) { - // SERVICE-MACRO-ACTIVATE, SERVICE-MACRO-UNASSIGN, and - // SERVICE-MACRO-DELETE - // Will never get user params with service, macro will have - // to query the SI in AAI to find related instances. - traverseAAIService(execution, resourceList, resourceId, aaiResourceIds); - } else if (resourceType == WorkflowType.SERVICE && "deactivateInstance".equalsIgnoreCase(requestAction)) { - resourceList.add(new Resource(WorkflowType.SERVICE, "", false)); + + if (resourceType == WorkflowType.SERVICE) { + resourceList = serviceEBBLoader.getResourceListForService(sIRequest, requestAction, execution, + serviceInstanceId, resourceId, aaiResourceIds); } else if (resourceType == WorkflowType.VNF && (REPLACEINSTANCE.equalsIgnoreCase(requestAction) || ("recreateInstance".equalsIgnoreCase(requestAction)))) { vnfEBBLoader.traverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(), @@ -370,7 +311,7 @@ public class WorkflowAction { } flowsToExecute = executeBuildingBlockBuilder.buildExecuteBuildingBlockList(orchFlows, resourceList, requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, vnfReplace); - if (isNetworkCollectionInTheResourceList(resourceList)) { + if (serviceEBBLoader.isNetworkCollectionInTheResourceList(resourceList)) { logger.info("Sorting for Vlan Tagging"); flowsToExecute = sortExecutionPathByObjectForVlanTagging(flowsToExecute, requestAction); } @@ -400,13 +341,6 @@ public class WorkflowAction { execution.setVariable("isRollbackComplete", false); } - private boolean isContainsService(ServiceInstancesRequest sIRequest) { - boolean containsService; - List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams(); - containsService = userParams.stream().anyMatch(param -> param.containsKey(USER_PARAM_SERVICE)); - return containsService; - } - private List<ExecuteBuildingBlock> loadExecuteBuildingBlocks(DelegateExecution execution, String requestId, String errorMessage) { List<ExecuteBuildingBlock> flowsToExecute; @@ -699,8 +633,6 @@ public class WorkflowAction { return orchFlows; } - - private void updateResourceIdsFromAAITraversal(List<ExecuteBuildingBlock> flowsToExecute, List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds, String serviceInstanceId) { for (Pair<WorkflowType, String> pair : aaiResourceIds) { @@ -759,342 +691,6 @@ public class WorkflowAction { } } - protected CollectionResourceCustomization findCatalogNetworkCollection(DelegateExecution execution, - org.onap.so.db.catalog.beans.Service service) { - CollectionResourceCustomization networkCollection = null; - int count = 0; - for (CollectionResourceCustomization collectionCust : service.getCollectionResourceCustomizations()) { - if (catalogDbClient.getNetworkCollectionResourceCustomizationByID( - collectionCust.getModelCustomizationUUID()) != null) { - networkCollection = collectionCust; - count++; - } - } - if (count == 0) { - return null; - } else if (count > 1) { - buildAndThrowException(execution, - "Found multiple Network Collections in the Service model, only one per Service is supported."); - } - return networkCollection; - } - - protected void traverseCatalogDbService(DelegateExecution execution, ServiceInstancesRequest sIRequest, - List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds) - throws JsonProcessingException, VrfBondingServiceException { - String modelUUID = sIRequest.getRequestDetails().getModelInfo().getModelVersionId(); - org.onap.so.db.catalog.beans.Service service = catalogDbClient.getServiceByID(modelUUID); - - if (service == null) { - buildAndThrowException(execution, "Could not find the service model in catalog db."); - } else { - resourceList.add(new Resource(WorkflowType.SERVICE, service.getModelUUID(), false)); - RelatedInstance relatedVpnBinding = - bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.vpnBinding); - RelatedInstance relatedLocalNetwork = - bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.network); - - if (relatedVpnBinding != null && relatedLocalNetwork != null) { - traverseVrfConfiguration(aaiResourceIds, resourceList, service, relatedVpnBinding, relatedLocalNetwork); - } else { - traverseNetworkCollection(execution, resourceList, service); - } - } - } - - protected void traverseVrfConfiguration(List<Pair<WorkflowType, String>> aaiResourceIds, - List<Resource> resourceList, org.onap.so.db.catalog.beans.Service service, - RelatedInstance relatedVpnBinding, RelatedInstance relatedLocalNetwork) - throws VrfBondingServiceException, JsonProcessingException { - org.onap.aai.domain.yang.L3Network aaiLocalNetwork = - bbInputSetupUtils.getAAIL3Network(relatedLocalNetwork.getInstanceId()); - vrfValidation.vrfServiceValidation(service); - vrfValidation.vrfCatalogDbChecks(service); - vrfValidation.aaiVpnBindingValidation(relatedVpnBinding.getInstanceId(), - bbInputSetupUtils.getAAIVpnBinding(relatedVpnBinding.getInstanceId())); - vrfValidation.aaiNetworkValidation(relatedLocalNetwork.getInstanceId(), aaiLocalNetwork); - vrfValidation.aaiSubnetValidation(aaiLocalNetwork); - vrfValidation.aaiAggregateRouteValidation(aaiLocalNetwork); - vrfValidation.aaiRouteTargetValidation(aaiLocalNetwork); - String existingAAIVrfConfiguration = getExistingAAIVrfConfiguration(relatedVpnBinding, aaiLocalNetwork); - if (existingAAIVrfConfiguration != null) { - aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, existingAAIVrfConfiguration)); - } - resourceList.add(new Resource(WorkflowType.CONFIGURATION, - service.getConfigurationCustomizations().get(0).getModelCustomizationUUID(), false)); - - } - - protected String getExistingAAIVrfConfiguration(RelatedInstance relatedVpnBinding, - org.onap.aai.domain.yang.L3Network aaiLocalNetwork) - throws JsonProcessingException, VrfBondingServiceException { - Optional<Relationships> relationshipsOp = new AAIResultWrapper( - new AAICommonObjectMapperProvider().getMapper().writeValueAsString(aaiLocalNetwork)).getRelationships(); - if (relationshipsOp.isPresent()) { - List<AAIResultWrapper> configurationsRelatedToLocalNetwork = - relationshipsOp.get().getByType(Types.CONFIGURATION); - if (configurationsRelatedToLocalNetwork.size() > 1) { - throw new VrfBondingServiceException( - "Network: " + aaiLocalNetwork.getNetworkId() + " has more than 1 configuration related to it"); - } - if (configurationsRelatedToLocalNetwork.size() == 1) { - AAIResultWrapper configWrapper = configurationsRelatedToLocalNetwork.get(0); - Optional<Configuration> relatedConfiguration = configWrapper.asBean(Configuration.class); - if (relatedConfiguration.isPresent() && vrfConfigurationAlreadyExists(relatedVpnBinding, - relatedConfiguration.get(), configWrapper)) { - return relatedConfiguration.get().getConfigurationId(); - } - } - } - return null; - } - - protected boolean vrfConfigurationAlreadyExists(RelatedInstance relatedVpnBinding, Configuration vrfConfiguration, - AAIResultWrapper configWrapper) throws VrfBondingServiceException { - if ("VRF-ENTRY".equalsIgnoreCase(vrfConfiguration.getConfigurationType())) { - Optional<Relationships> relationshipsConfigOp = configWrapper.getRelationships(); - if (relationshipsConfigOp.isPresent()) { - Optional<VpnBinding> relatedInfraVpnBindingOp = - workflowActionUtils.extractRelationshipsVpnBinding(relationshipsConfigOp.get()); - if (relatedInfraVpnBindingOp.isPresent()) { - VpnBinding relatedInfraVpnBinding = relatedInfraVpnBindingOp.get(); - if (!relatedInfraVpnBinding.getVpnId().equalsIgnoreCase(relatedVpnBinding.getInstanceId())) { - throw new VrfBondingServiceException("Configuration: " + vrfConfiguration.getConfigurationId() - + " is not connected to the same vpn binding id provided in request: " - + relatedVpnBinding.getInstanceId()); - } else { - return true; - } - } - } - } - return false; - } - - protected void traverseNetworkCollection(DelegateExecution execution, List<Resource> resourceList, - org.onap.so.db.catalog.beans.Service service) { - if (isVnfCustomizationsInTheService(service)) { - buildAndThrowException(execution, - "Cannot orchestrate Service-Macro-Create without user params with a vnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows"); - } - if (isPnfCustomizationsInTheService(service)) { - buildAndThrowException(execution, - "Cannot orchestrate Service-Macro-Create without user params with a pnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows"); - } - List<CollectionResourceCustomization> customizations = service.getCollectionResourceCustomizations(); - if (customizations.isEmpty()) { - logger.debug("No Collections found. CollectionResourceCustomization list is empty."); - } else { - CollectionResourceCustomization collectionResourceCustomization = - findCatalogNetworkCollection(execution, service); - traverseNetworkCollectionResourceCustomization(resourceList, collectionResourceCustomization); - } - traverseNetworkCollectionCustomization(resourceList, service); - } - - private void traverseNetworkCollectionResourceCustomization(List<Resource> resourceList, - CollectionResourceCustomization collectionResourceCustomization) { - if (collectionResourceCustomizationShouldNotBeProcessed(resourceList, collectionResourceCustomization)) - return; - int minNetworks = 0; - org.onap.so.db.catalog.beans.InstanceGroup instanceGroup = - collectionResourceCustomization.getCollectionResource().getInstanceGroup(); - CollectionResourceInstanceGroupCustomization collectionInstCust = null; - if (!instanceGroup.getCollectionInstanceGroupCustomizations().isEmpty()) { - for (CollectionResourceInstanceGroupCustomization collectionInstanceGroupTemp : instanceGroup - .getCollectionInstanceGroupCustomizations()) { - if (collectionInstanceGroupTemp.getModelCustomizationUUID() - .equalsIgnoreCase(collectionResourceCustomization.getModelCustomizationUUID())) { - collectionInstCust = collectionInstanceGroupTemp; - break; - } - } - if (interfaceNetworkQuantityIsAvailableInCollection(collectionInstCust)) { - minNetworks = collectionInstCust.getSubInterfaceNetworkQuantity(); - } - } - logger.debug("minNetworks: {}", minNetworks); - CollectionNetworkResourceCustomization collectionNetworkResourceCust = - getCollectionNetworkResourceCustomization(collectionResourceCustomization, instanceGroup); - for (int i = 0; i < minNetworks; i++) { - if (collectionNetworkResourceCust != null) { - Resource resource = new Resource(WorkflowType.VIRTUAL_LINK, - collectionNetworkResourceCust.getModelCustomizationUUID(), false); - resource.setVirtualLinkKey(Integer.toString(i)); - resourceList.add(resource); - } - } - } - - private CollectionNetworkResourceCustomization getCollectionNetworkResourceCustomization( - CollectionResourceCustomization collectionResourceCustomization, InstanceGroup instanceGroup) { - CollectionNetworkResourceCustomization collectionNetworkResourceCust = null; - for (CollectionNetworkResourceCustomization collectionNetworkTemp : instanceGroup - .getCollectionNetworkResourceCustomizations()) { - if (collectionNetworkTemp.getNetworkResourceCustomization().getModelCustomizationUUID() - .equalsIgnoreCase(collectionResourceCustomization.getModelCustomizationUUID())) { - collectionNetworkResourceCust = collectionNetworkTemp; - break; - } - } - return collectionNetworkResourceCust; - } - - private boolean collectionResourceCustomizationShouldNotBeProcessed(List<Resource> resourceList, - CollectionResourceCustomization collectionResourceCustomization) { - if (collectionResourceCustomization == null) { - logger.debug("No Network Collection Customization found"); - return true; - } - resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, - collectionResourceCustomization.getModelCustomizationUUID(), false)); - logger.debug("Found a network collection"); - if (collectionResourceCustomization.getCollectionResource() == null) { - logger.debug("No Network Collection found. collectionResource is null"); - return true; - } - if (collectionResourceCustomization.getCollectionResource().getInstanceGroup() == null) { - logger.debug("No Instance Group found for network collection."); - return true; - } - String toscaNodeType = - collectionResourceCustomization.getCollectionResource().getInstanceGroup().getToscaNodeType(); - if (!toscaNodeTypeHasNetworkCollection(toscaNodeType)) { - logger.debug("Instance Group tosca node type does not contain NetworkCollection: {}", toscaNodeType); - return true; - } - return false; - } - - private boolean interfaceNetworkQuantityIsAvailableInCollection( - CollectionResourceInstanceGroupCustomization collectionInstCust) { - return collectionInstCust != null && collectionInstCust.getSubInterfaceNetworkQuantity() != null; - } - - private boolean toscaNodeTypeHasNetworkCollection(String toscaNodeType) { - return toscaNodeType != null && toscaNodeType.contains(NETWORKCOLLECTION); - } - - private void traverseNetworkCollectionCustomization(List<Resource> resourceList, - org.onap.so.db.catalog.beans.Service service) { - if (isNetworkCollectionInTheResourceList(resourceList)) { - return; - } - if (service.getNetworkCustomizations() == null) { - logger.debug("No networks were found on this service model"); - return; - } - for (int i = 0; i < service.getNetworkCustomizations().size(); i++) { - resourceList.add(new Resource(WorkflowType.NETWORK, - service.getNetworkCustomizations().get(i).getModelCustomizationUUID(), false)); - } - } - - private boolean isNetworkCollectionInTheResourceList(List<Resource> resourceList) { - return resourceList.stream().anyMatch(x -> WorkflowType.NETWORKCOLLECTION == x.getResourceType()); - } - - private boolean isVnfCustomizationsInTheService(org.onap.so.db.catalog.beans.Service service) { - return !(service.getVnfCustomizations() == null || service.getVnfCustomizations().isEmpty()); - } - - private boolean isPnfCustomizationsInTheService(org.onap.so.db.catalog.beans.Service service) { - return !(service.getPnfCustomizations() == null || service.getPnfCustomizations().isEmpty()); - } - - protected void traverseAAIService(DelegateExecution execution, List<Resource> resourceList, String resourceId, - List<Pair<WorkflowType, String>> aaiResourceIds) { - try { - ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(resourceId); - org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO = - bbInputSetup.getExistingServiceInstance(serviceInstanceAAI); - resourceList.add(new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false)); - traverseServiceInstanceMSOVnfs(resourceList, aaiResourceIds, serviceInstanceMSO); - traverseServiceInstanceMSOPnfs(resourceList, aaiResourceIds, serviceInstanceMSO); - if (serviceInstanceMSO.getNetworks() != null) { - for (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network network : serviceInstanceMSO - .getNetworks()) { - aaiResourceIds.add(new Pair<>(WorkflowType.NETWORK, network.getNetworkId())); - resourceList.add(new Resource(WorkflowType.NETWORK, network.getNetworkId(), false)); - } - } - if (serviceInstanceMSO.getCollection() != null) { - logger.debug("found networkcollection"); - aaiResourceIds - .add(new Pair<>(WorkflowType.NETWORKCOLLECTION, serviceInstanceMSO.getCollection().getId())); - resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, - serviceInstanceMSO.getCollection().getId(), false)); - } - if (serviceInstanceMSO.getConfigurations() != null) { - for (Configuration config : serviceInstanceMSO.getConfigurations()) { - Optional<org.onap.aai.domain.yang.Configuration> aaiConfig = - aaiConfigurationResources.getConfiguration(config.getConfigurationId()); - if (aaiConfig.isPresent() && aaiConfig.get().getRelationshipList() != null) { - for (Relationship relationship : aaiConfig.get().getRelationshipList().getRelationship()) { - if (relationship.getRelatedTo().contains("vnfc") - || relationship.getRelatedTo().contains("vpn-binding")) { - aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, config.getConfigurationId())); - resourceList.add( - new Resource(WorkflowType.CONFIGURATION, config.getConfigurationId(), false)); - break; - } - } - } - } - } - } catch (Exception ex) { - logger.error("Exception in traverseAAIService", ex); - buildAndThrowException(execution, - "Could not find existing Service Instance or related Instances to execute the request on."); - } - } - - private void traverseServiceInstanceMSOVnfs(List<Resource> resourceList, - List<Pair<WorkflowType, String>> aaiResourceIds, - org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) { - if (serviceInstanceMSO.getVnfs() == null) { - return; - } - for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) { - aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId())); - resourceList.add(new Resource(WorkflowType.VNF, vnf.getVnfId(), false)); - traverseVnfModules(resourceList, aaiResourceIds, vnf); - if (vnf.getVolumeGroups() != null) { - for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf.getVolumeGroups()) { - aaiResourceIds.add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId())); - resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false)); - } - } - } - } - - private void traverseServiceInstanceMSOPnfs(List<Resource> resourceList, - List<Pair<WorkflowType, String>> aaiResourceIds, - org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) { - if (serviceInstanceMSO.getPnfs() == null) { - return; - } - for (org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf pnf : serviceInstanceMSO.getPnfs()) { - aaiResourceIds.add(new Pair<>(WorkflowType.PNF, pnf.getPnfId())); - resourceList.add(new Resource(WorkflowType.PNF, pnf.getPnfId(), false)); - } - } - - private void traverseVnfModules(List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds, - org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf) { - if (vnf.getVfModules() == null) { - return; - } - for (VfModule vfModule : vnf.getVfModules()) { - aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId())); - Resource resource = new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false); - resource.setBaseVfModule(vfModule.getModelInfoVfModule().getIsBaseBoolean()); - resourceList.add(resource); - } - } - - - protected WorkflowResourceIds populateResourceIdsFromApiHandler(DelegateExecution execution) { return WorkflowResourceIdsUtils.getWorkflowResourceIdsFromExecution(execution); } @@ -1296,17 +892,6 @@ public class WorkflowAction { && (bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId) != null)); } - protected boolean foundRelated(List<Resource> resourceList) { - return (containsWorkflowType(resourceList, WorkflowType.VNF) - || containsWorkflowType(resourceList, WorkflowType.PNF) - || containsWorkflowType(resourceList, WorkflowType.NETWORK) - || containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION)); - } - - protected boolean containsWorkflowType(List<Resource> resourceList, WorkflowType workflowType) { - return resourceList.stream().anyMatch(resource -> resource.getResourceType().equals(workflowType)); - } - private void fillExecutionDefault(DelegateExecution execution) { execution.setVariable("sentSyncResponse", false); execution.setVariable(HOMING, false); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index ec2ca74fa7..cd151bafea 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -37,6 +37,7 @@ import org.onap.aai.domain.yang.Vnfc; import org.onap.aai.domain.yang.VolumeGroup; import org.onap.aaiclient.client.aai.entities.Configuration; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types; +import org.onap.so.bpmn.common.BBConstants; import org.onap.so.bpmn.common.DelegateExecutionImpl; import org.onap.so.bpmn.common.listener.db.RequestsDbListenerRunner; import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner; @@ -68,10 +69,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; @Component public class WorkflowActionBBTasks { - private static final String G_CURRENT_SEQUENCE = "gCurrentSequence"; - private static final String G_REQUEST_ID = "mso-request-id"; - private static final String G_ALACARTE = "aLaCarte"; - private static final String G_ACTION = "requestAction"; private static final String RETRY_COUNT = "retryCount"; private static final String FABRIC_CONFIGURATION = "FabricConfiguration"; private static final String ADD_FABRIC_CONFIGURATION_BB = "AddFabricConfigurationBB"; @@ -112,14 +109,15 @@ public class WorkflowActionBBTasks { } catch (NullPointerException ex) { workflowAction.buildAndThrowException(execution, "Error in FlowManipulator Modify Flows", ex); } - int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); + int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence); execution.setVariable("buildingBlock", ebb); currentSequence++; execution.setVariable(COMPLETED, currentSequence >= flowsToExecute.size()); - execution.setVariable(G_CURRENT_SEQUENCE, currentSequence); + execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currentSequence); + } catch (Exception e) { workflowAction.buildAndThrowException(execution, "Internal Error occured during selectBB", e); } @@ -127,7 +125,7 @@ public class WorkflowActionBBTasks { public void updateFlowStatistics(DelegateExecution execution) { try { - int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); + int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); if (currentSequence > 1) { InfraActiveRequests request = this.getUpdatedRequest(execution, currentSequence); requestDbclient.updateInfraActiveRequests(request); @@ -142,7 +140,7 @@ public class WorkflowActionBBTasks { protected InfraActiveRequests getUpdatedRequest(DelegateExecution execution, int currentSequence) { List<ExecuteBuildingBlock> flowsToExecute = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); - String requestId = (String) execution.getVariable(G_REQUEST_ID); + String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID); InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); ExecuteBuildingBlock completedBB = flowsToExecute.get(currentSequence - 2); ExecuteBuildingBlock nextBB = flowsToExecute.get(currentSequence - 1); @@ -171,7 +169,7 @@ public class WorkflowActionBBTasks { } public void sendSyncAck(DelegateExecution execution) { - final String requestId = (String) execution.getVariable(G_REQUEST_ID); + final String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID); final String resourceId = (String) execution.getVariable("resourceId"); ServiceInstancesResponse serviceInstancesResponse = new ServiceInstancesResponse(); RequestReferences requestRef = new RequestReferences(); @@ -199,7 +197,7 @@ public class WorkflowActionBBTasks { } public void sendErrorSyncAck(DelegateExecution execution) { - final String requestId = (String) execution.getVariable(G_REQUEST_ID); + final String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID); try { ExceptionBuilder exceptionBuilder = new ExceptionBuilder(); String errorMsg = (String) execution.getVariable("WorkflowActionErrorMessage"); @@ -225,10 +223,10 @@ public class WorkflowActionBBTasks { public void updateRequestStatusToComplete(DelegateExecution execution) { try { - final String requestId = (String) execution.getVariable(G_REQUEST_ID); + final String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID); InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); - final String action = (String) execution.getVariable(G_ACTION); - final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE); + final String action = (String) execution.getVariable(BBConstants.G_ACTION); + final boolean aLaCarte = (boolean) execution.getVariable(BBConstants.G_ALACARTE); final String resourceName = (String) execution.getVariable("resourceName"); String statusMessage = (String) execution.getVariable("StatusMessage"); String macroAction; @@ -258,7 +256,7 @@ public class WorkflowActionBBTasks { public void checkRetryStatus(DelegateExecution execution) { String handlingCode = (String) execution.getVariable(HANDLINGCODE); - String requestId = (String) execution.getVariable(G_REQUEST_ID); + String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID); String retryDuration = (String) execution.getVariable("RetryDuration"); int retryCount = (int) execution.getVariable(RETRY_COUNT); int envMaxRetries; @@ -280,8 +278,8 @@ public class WorkflowActionBBTasks { logger.warn("Failed to update Request Db Infra Active Requests with Retry Status", ex); } if (retryCount < envMaxRetries) { - int currSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); - execution.setVariable(G_CURRENT_SEQUENCE, currSequence - 1); + int currSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); + execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currSequence - 1); execution.setVariable(RETRY_COUNT, nextCount); } else { workflowAction.buildAndThrowException(execution, @@ -297,7 +295,7 @@ public class WorkflowActionBBTasks { * working on. */ public void rollbackExecutionPath(DelegateExecution execution) { - final String action = (String) execution.getVariable(G_ACTION); + final String action = (String) execution.getVariable(BBConstants.G_ACTION); final String resourceName = (String) execution.getVariable("resourceName"); if (!(boolean) execution.getVariable("isRollback")) { List<ExecuteBuildingBlock> flowsToExecute = @@ -308,7 +306,7 @@ public class WorkflowActionBBTasks { .collect(Collectors.toList()); List<ExecuteBuildingBlock> rollbackFlows = new ArrayList<>(); - int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); + int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); int listSize = flowsToExecute.size(); for (int i = listSize - 1; i >= 0; i--) { @@ -381,7 +379,7 @@ public class WorkflowActionBBTasks { execution.setVariable("flowsToExecute", rollbackFlowsFiltered); execution.setVariable(HANDLINGCODE, "PreformingRollback"); execution.setVariable("isRollback", true); - execution.setVariable(G_CURRENT_SEQUENCE, 0); + execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, 0); execution.setVariable(RETRY_COUNT, 0); } else { workflowAction.buildAndThrowException(execution, @@ -391,7 +389,7 @@ public class WorkflowActionBBTasks { protected void updateInstanceId(DelegateExecution execution) { try { - String requestId = (String) execution.getVariable(G_REQUEST_ID); + String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID); String resourceId = (String) execution.getVariable("resourceId"); WorkflowType resourceType = (WorkflowType) execution.getVariable("resourceType"); InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); @@ -424,8 +422,8 @@ public class WorkflowActionBBTasks { List<ExecuteBuildingBlock> flowsToExecute = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); String handlingCode = (String) execution.getVariable(HANDLINGCODE); - final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE); - int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); + final boolean aLaCarte = (boolean) execution.getVariable(BBConstants.G_ALACARTE); + int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); logger.debug("Current Sequence: {}", currentSequence); ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1); String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName(); @@ -444,7 +442,7 @@ public class WorkflowActionBBTasks { protected void postProcessingExecuteBBActivateVfModule(DelegateExecution execution, ExecuteBuildingBlock ebb, List<ExecuteBuildingBlock> flowsToExecute) { try { - String requestAction = (String) execution.getVariable(G_ACTION); + String requestAction = (String) execution.getVariable(BBConstants.G_ACTION); String serviceInstanceId = ebb.getWorkflowResourceIds().getServiceInstanceId(); String vnfId = ebb.getWorkflowResourceIds().getVnfId(); String vfModuleId = ebb.getResourceId(); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java index 9128e9e3e1..b2cc89545b 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java @@ -32,15 +32,15 @@ public final class WorkflowActionConstants { throw new IllegalStateException("Utility class"); } - static final String USER_PARAM_SERVICE = "service"; - static final String CREATE_INSTANCE = "createInstance"; - static final String FABRIC_CONFIGURATION = "FabricConfiguration"; + public static final String USER_PARAM_SERVICE = "service"; + public static final String CREATE_INSTANCE = "createInstance"; + public static final String FABRIC_CONFIGURATION = "FabricConfiguration"; public static final String WORKFLOW_ACTION_ERROR_MESSAGE = "WorkflowActionErrorMessage"; static final String SERVICE = "Service"; static final String CONTROLLER = "Controller"; - static final String NETWORKCOLLECTION = "NetworkCollection"; + public static final String NETWORKCOLLECTION = "NetworkCollection"; static final String CONFIGURATION = "Configuration"; - static final String ASSIGNINSTANCE = "assignInstance"; + public static final String ASSIGNINSTANCE = "assignInstance"; static final String REPLACEINSTANCE = "replaceInstance"; static final String VOLUMEGROUP = "VolumeGroup"; static final String REPLACEINSTANCERETAINASSIGNMENTS = "replaceInstanceRetainAssignments"; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java new file mode 100644 index 0000000000..55a92b0b81 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java @@ -0,0 +1,485 @@ +package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader; + +import com.fasterxml.jackson.core.JsonProcessingException; +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.javatuples.Pair; +import org.onap.aai.domain.yang.Relationship; +import org.onap.aai.domain.yang.ServiceInstance; +import org.onap.aai.domain.yang.VpnBinding; +import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider; +import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; +import org.onap.aaiclient.client.aai.entities.Relationships; +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; +import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource; +import org.onap.so.bpmn.infrastructure.workflow.tasks.VrfBondingServiceException; +import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionExtractResourcesAAI; +import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType; +import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration; +import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule; +import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup; +import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.client.orchestration.AAIConfigurationResources; +import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization; +import org.onap.so.db.catalog.beans.CollectionResourceCustomization; +import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization; +import org.onap.so.db.catalog.beans.InstanceGroup; +import org.onap.so.db.catalog.client.CatalogDbClient; +import org.onap.so.serviceinstancebeans.ModelType; +import org.onap.so.serviceinstancebeans.RelatedInstance; +import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.WORKFLOW_ACTION_ERROR_MESSAGE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.FABRIC_CONFIGURATION; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.NETWORKCOLLECTION; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.USER_PARAM_SERVICE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.ASSIGNINSTANCE; + + +@Component +public class ServiceEBBLoader { + + private static final Logger logger = LoggerFactory.getLogger(ServiceEBBLoader.class); + + private final UserParamsServiceTraversal userParamsServiceTraversal; + private final CatalogDbClient catalogDbClient; + private final VrfValidation vrfValidation; + private final AAIConfigurationResources aaiConfigurationResources; + private final WorkflowActionExtractResourcesAAI workflowActionUtils; + private final BBInputSetupUtils bbInputSetupUtils; + private final BBInputSetup bbInputSetup; + private final ExceptionBuilder exceptionBuilder; + + public ServiceEBBLoader(UserParamsServiceTraversal userParamsServiceTraversal, CatalogDbClient catalogDbClient, + VrfValidation vrfValidation, AAIConfigurationResources aaiConfigurationResources, + WorkflowActionExtractResourcesAAI workflowActionUtils, BBInputSetupUtils bbInputSetupUtils, + BBInputSetup bbInputSetup, ExceptionBuilder exceptionBuilder) { + this.userParamsServiceTraversal = userParamsServiceTraversal; + this.catalogDbClient = catalogDbClient; + this.vrfValidation = vrfValidation; + this.aaiConfigurationResources = aaiConfigurationResources; + this.workflowActionUtils = workflowActionUtils; + this.bbInputSetupUtils = bbInputSetupUtils; + this.bbInputSetup = bbInputSetup; + this.exceptionBuilder = exceptionBuilder; + } + + public List<Resource> getResourceListForService(ServiceInstancesRequest sIRequest, String requestAction, + DelegateExecution execution, String serviceInstanceId, String resourceId, + List<Pair<WorkflowType, String>> aaiResourceIds) throws IOException, VrfBondingServiceException { + boolean containsService = false; + List<Resource> resourceList = new ArrayList<>(); + List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams(); + if (requestAction.equalsIgnoreCase(ASSIGNINSTANCE)) { + // SERVICE-MACRO-ASSIGN will always get user params with a + // service. + + if (userParams != null) { + containsService = isContainsService(sIRequest); + if (containsService) { + resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams, + serviceInstanceId, requestAction); + } + } else { + buildAndThrowException(execution, + "Service-Macro-Assign request details must contain user params with a service"); + } + } else if (requestAction.equalsIgnoreCase(CREATE_INSTANCE)) { + // SERVICE-MACRO-CREATE will get user params with a service, + // a service with a network, a service with a + // network collection, OR an empty service. + // If user params is just a service or null and macro + // queries the SI and finds a VNF, macro fails. + + if (userParams != null) { + containsService = isContainsService(sIRequest); + } + if (containsService) { + resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams, + serviceInstanceId, requestAction); + } + if (!foundRelated(resourceList)) { + traverseCatalogDbService(execution, sIRequest, resourceList, aaiResourceIds); + } + } else if (("activateInstance".equalsIgnoreCase(requestAction) + || "unassignInstance".equalsIgnoreCase(requestAction) + || "deleteInstance".equalsIgnoreCase(requestAction) + || requestAction.equalsIgnoreCase("activate" + FABRIC_CONFIGURATION))) { + // SERVICE-MACRO-ACTIVATE, SERVICE-MACRO-UNASSIGN, and + // SERVICE-MACRO-DELETE + // Will never get user params with service, macro will have + // to query the SI in AAI to find related instances. + traverseAAIService(execution, resourceList, resourceId, aaiResourceIds); + } else if ("deactivateInstance".equalsIgnoreCase(requestAction)) { + resourceList.add(new Resource(WorkflowType.SERVICE, "", false)); + } + return resourceList; + } + + private boolean isContainsService(ServiceInstancesRequest sIRequest) { + boolean containsService; + List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams(); + containsService = userParams.stream().anyMatch(param -> param.containsKey(USER_PARAM_SERVICE)); + return containsService; + } + + public void traverseCatalogDbService(DelegateExecution execution, ServiceInstancesRequest sIRequest, + List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds) + throws JsonProcessingException, VrfBondingServiceException { + String modelUUID = sIRequest.getRequestDetails().getModelInfo().getModelVersionId(); + org.onap.so.db.catalog.beans.Service service = catalogDbClient.getServiceByID(modelUUID); + + if (service == null) { + buildAndThrowException(execution, "Could not find the service model in catalog db."); + } else { + resourceList.add(new Resource(WorkflowType.SERVICE, service.getModelUUID(), false)); + RelatedInstance relatedVpnBinding = + bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.vpnBinding); + RelatedInstance relatedLocalNetwork = + bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.network); + + if (relatedVpnBinding != null && relatedLocalNetwork != null) { + traverseVrfConfiguration(aaiResourceIds, resourceList, service, relatedVpnBinding, relatedLocalNetwork); + } else { + traverseNetworkCollection(execution, resourceList, service); + } + } + } + + public boolean foundRelated(List<Resource> resourceList) { + return (containsWorkflowType(resourceList, WorkflowType.VNF) + || containsWorkflowType(resourceList, WorkflowType.PNF) + || containsWorkflowType(resourceList, WorkflowType.NETWORK) + || containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION)); + } + + public void traverseAAIService(DelegateExecution execution, List<Resource> resourceList, String resourceId, + List<Pair<WorkflowType, String>> aaiResourceIds) { + try { + ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(resourceId); + org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO = + bbInputSetup.getExistingServiceInstance(serviceInstanceAAI); + resourceList.add(new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false)); + traverseServiceInstanceMSOVnfs(resourceList, aaiResourceIds, serviceInstanceMSO); + traverseServiceInstanceMSOPnfs(resourceList, aaiResourceIds, serviceInstanceMSO); + if (serviceInstanceMSO.getNetworks() != null) { + for (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network network : serviceInstanceMSO + .getNetworks()) { + aaiResourceIds.add(new Pair<>(WorkflowType.NETWORK, network.getNetworkId())); + resourceList.add(new Resource(WorkflowType.NETWORK, network.getNetworkId(), false)); + } + } + if (serviceInstanceMSO.getCollection() != null) { + logger.debug("found networkcollection"); + aaiResourceIds + .add(new Pair<>(WorkflowType.NETWORKCOLLECTION, serviceInstanceMSO.getCollection().getId())); + resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, + serviceInstanceMSO.getCollection().getId(), false)); + } + if (serviceInstanceMSO.getConfigurations() != null) { + for (Configuration config : serviceInstanceMSO.getConfigurations()) { + Optional<org.onap.aai.domain.yang.Configuration> aaiConfig = + aaiConfigurationResources.getConfiguration(config.getConfigurationId()); + if (aaiConfig.isPresent() && aaiConfig.get().getRelationshipList() != null) { + for (Relationship relationship : aaiConfig.get().getRelationshipList().getRelationship()) { + if (relationship.getRelatedTo().contains("vnfc") + || relationship.getRelatedTo().contains("vpn-binding")) { + aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, config.getConfigurationId())); + resourceList.add( + new Resource(WorkflowType.CONFIGURATION, config.getConfigurationId(), false)); + break; + } + } + } + } + } + } catch (Exception ex) { + logger.error("Exception in traverseAAIService", ex); + buildAndThrowException(execution, + "Could not find existing Service Instance or related Instances to execute the request on."); + } + } + + private void traverseServiceInstanceMSOVnfs(List<Resource> resourceList, + List<Pair<WorkflowType, String>> aaiResourceIds, + org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) { + if (serviceInstanceMSO.getVnfs() == null) { + return; + } + for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) { + aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId())); + resourceList.add(new Resource(WorkflowType.VNF, vnf.getVnfId(), false)); + traverseVnfModules(resourceList, aaiResourceIds, vnf); + if (vnf.getVolumeGroups() != null) { + for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf.getVolumeGroups()) { + aaiResourceIds.add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId())); + resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false)); + } + } + } + } + + private void traverseServiceInstanceMSOPnfs(List<Resource> resourceList, + List<Pair<WorkflowType, String>> aaiResourceIds, + org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) { + if (serviceInstanceMSO.getPnfs() == null) { + return; + } + for (org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf pnf : serviceInstanceMSO.getPnfs()) { + aaiResourceIds.add(new Pair<>(WorkflowType.PNF, pnf.getPnfId())); + resourceList.add(new Resource(WorkflowType.PNF, pnf.getPnfId(), false)); + } + } + + protected void traverseVrfConfiguration(List<Pair<WorkflowType, String>> aaiResourceIds, + List<Resource> resourceList, org.onap.so.db.catalog.beans.Service service, + RelatedInstance relatedVpnBinding, RelatedInstance relatedLocalNetwork) + throws VrfBondingServiceException, JsonProcessingException { + org.onap.aai.domain.yang.L3Network aaiLocalNetwork = + bbInputSetupUtils.getAAIL3Network(relatedLocalNetwork.getInstanceId()); + vrfValidation.vrfServiceValidation(service); + vrfValidation.vrfCatalogDbChecks(service); + vrfValidation.aaiVpnBindingValidation(relatedVpnBinding.getInstanceId(), + bbInputSetupUtils.getAAIVpnBinding(relatedVpnBinding.getInstanceId())); + vrfValidation.aaiNetworkValidation(relatedLocalNetwork.getInstanceId(), aaiLocalNetwork); + vrfValidation.aaiSubnetValidation(aaiLocalNetwork); + vrfValidation.aaiAggregateRouteValidation(aaiLocalNetwork); + vrfValidation.aaiRouteTargetValidation(aaiLocalNetwork); + String existingAAIVrfConfiguration = getExistingAAIVrfConfiguration(relatedVpnBinding, aaiLocalNetwork); + if (existingAAIVrfConfiguration != null) { + aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, existingAAIVrfConfiguration)); + } + resourceList.add(new Resource(WorkflowType.CONFIGURATION, + service.getConfigurationCustomizations().get(0).getModelCustomizationUUID(), false)); + + } + + protected void traverseNetworkCollection(DelegateExecution execution, List<Resource> resourceList, + org.onap.so.db.catalog.beans.Service service) { + if (isVnfCustomizationsInTheService(service)) { + buildAndThrowException(execution, + "Cannot orchestrate Service-Macro-Create without user params with a vnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows"); + } + if (isPnfCustomizationsInTheService(service)) { + buildAndThrowException(execution, + "Cannot orchestrate Service-Macro-Create without user params with a pnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows"); + } + List<CollectionResourceCustomization> customizations = service.getCollectionResourceCustomizations(); + if (customizations.isEmpty()) { + logger.debug("No Collections found. CollectionResourceCustomization list is empty."); + } else { + CollectionResourceCustomization collectionResourceCustomization = + findCatalogNetworkCollection(execution, service); + traverseNetworkCollectionResourceCustomization(resourceList, collectionResourceCustomization); + } + traverseNetworkCollectionCustomization(resourceList, service); + } + + private void traverseNetworkCollectionResourceCustomization(List<Resource> resourceList, + CollectionResourceCustomization collectionResourceCustomization) { + if (collectionResourceCustomizationShouldNotBeProcessed(resourceList, collectionResourceCustomization)) + return; + int minNetworks = 0; + org.onap.so.db.catalog.beans.InstanceGroup instanceGroup = + collectionResourceCustomization.getCollectionResource().getInstanceGroup(); + CollectionResourceInstanceGroupCustomization collectionInstCust = null; + if (!instanceGroup.getCollectionInstanceGroupCustomizations().isEmpty()) { + for (CollectionResourceInstanceGroupCustomization collectionInstanceGroupTemp : instanceGroup + .getCollectionInstanceGroupCustomizations()) { + if (collectionInstanceGroupTemp.getModelCustomizationUUID() + .equalsIgnoreCase(collectionResourceCustomization.getModelCustomizationUUID())) { + collectionInstCust = collectionInstanceGroupTemp; + break; + } + } + if (interfaceNetworkQuantityIsAvailableInCollection(collectionInstCust)) { + minNetworks = collectionInstCust.getSubInterfaceNetworkQuantity(); + } + } + logger.debug("minNetworks: {}", minNetworks); + CollectionNetworkResourceCustomization collectionNetworkResourceCust = + getCollectionNetworkResourceCustomization(collectionResourceCustomization, instanceGroup); + for (int i = 0; i < minNetworks; i++) { + if (collectionNetworkResourceCust != null) { + Resource resource = new Resource(WorkflowType.VIRTUAL_LINK, + collectionNetworkResourceCust.getModelCustomizationUUID(), false); + resource.setVirtualLinkKey(Integer.toString(i)); + resourceList.add(resource); + } + } + } + + private CollectionNetworkResourceCustomization getCollectionNetworkResourceCustomization( + CollectionResourceCustomization collectionResourceCustomization, InstanceGroup instanceGroup) { + CollectionNetworkResourceCustomization collectionNetworkResourceCust = null; + for (CollectionNetworkResourceCustomization collectionNetworkTemp : instanceGroup + .getCollectionNetworkResourceCustomizations()) { + if (collectionNetworkTemp.getNetworkResourceCustomization().getModelCustomizationUUID() + .equalsIgnoreCase(collectionResourceCustomization.getModelCustomizationUUID())) { + collectionNetworkResourceCust = collectionNetworkTemp; + break; + } + } + return collectionNetworkResourceCust; + } + + private boolean collectionResourceCustomizationShouldNotBeProcessed(List<Resource> resourceList, + CollectionResourceCustomization collectionResourceCustomization) { + if (collectionResourceCustomization == null) { + logger.debug("No Network Collection Customization found"); + return true; + } + resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, + collectionResourceCustomization.getModelCustomizationUUID(), false)); + logger.debug("Found a network collection"); + if (collectionResourceCustomization.getCollectionResource() == null) { + logger.debug("No Network Collection found. collectionResource is null"); + return true; + } + if (collectionResourceCustomization.getCollectionResource().getInstanceGroup() == null) { + logger.debug("No Instance Group found for network collection."); + return true; + } + String toscaNodeType = + collectionResourceCustomization.getCollectionResource().getInstanceGroup().getToscaNodeType(); + if (!toscaNodeTypeHasNetworkCollection(toscaNodeType)) { + logger.debug("Instance Group tosca node type does not contain NetworkCollection: {}", toscaNodeType); + return true; + } + return false; + } + + private boolean interfaceNetworkQuantityIsAvailableInCollection( + CollectionResourceInstanceGroupCustomization collectionInstCust) { + return collectionInstCust != null && collectionInstCust.getSubInterfaceNetworkQuantity() != null; + } + + private boolean toscaNodeTypeHasNetworkCollection(String toscaNodeType) { + return toscaNodeType != null && toscaNodeType.contains(NETWORKCOLLECTION); + } + + private void traverseNetworkCollectionCustomization(List<Resource> resourceList, + org.onap.so.db.catalog.beans.Service service) { + if (isNetworkCollectionInTheResourceList(resourceList)) { + return; + } + if (service.getNetworkCustomizations() == null) { + logger.debug("No networks were found on this service model"); + return; + } + for (int i = 0; i < service.getNetworkCustomizations().size(); i++) { + resourceList.add(new Resource(WorkflowType.NETWORK, + service.getNetworkCustomizations().get(i).getModelCustomizationUUID(), false)); + } + } + + private boolean isVnfCustomizationsInTheService(org.onap.so.db.catalog.beans.Service service) { + return !(service.getVnfCustomizations() == null || service.getVnfCustomizations().isEmpty()); + } + + private boolean isPnfCustomizationsInTheService(org.onap.so.db.catalog.beans.Service service) { + return !(service.getPnfCustomizations() == null || service.getPnfCustomizations().isEmpty()); + } + + private void traverseVnfModules(List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds, + org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf) { + if (vnf.getVfModules() == null) { + return; + } + for (VfModule vfModule : vnf.getVfModules()) { + aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId())); + Resource resource = new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false); + resource.setBaseVfModule(vfModule.getModelInfoVfModule().getIsBaseBoolean()); + resourceList.add(resource); + } + } + + + protected String getExistingAAIVrfConfiguration(RelatedInstance relatedVpnBinding, + org.onap.aai.domain.yang.L3Network aaiLocalNetwork) + throws JsonProcessingException, VrfBondingServiceException { + Optional<Relationships> relationshipsOp = new AAIResultWrapper( + new AAICommonObjectMapperProvider().getMapper().writeValueAsString(aaiLocalNetwork)).getRelationships(); + if (relationshipsOp.isPresent()) { + List<AAIResultWrapper> configurationsRelatedToLocalNetwork = + relationshipsOp.get().getByType(AAIFluentTypeBuilder.Types.CONFIGURATION); + if (configurationsRelatedToLocalNetwork.size() > 1) { + throw new VrfBondingServiceException( + "Network: " + aaiLocalNetwork.getNetworkId() + " has more than 1 configuration related to it"); + } + if (configurationsRelatedToLocalNetwork.size() == 1) { + AAIResultWrapper configWrapper = configurationsRelatedToLocalNetwork.get(0); + Optional<Configuration> relatedConfiguration = configWrapper.asBean(Configuration.class); + if (relatedConfiguration.isPresent() && vrfConfigurationAlreadyExists(relatedVpnBinding, + relatedConfiguration.get(), configWrapper)) { + return relatedConfiguration.get().getConfigurationId(); + } + } + } + return null; + } + + protected boolean vrfConfigurationAlreadyExists(RelatedInstance relatedVpnBinding, Configuration vrfConfiguration, + AAIResultWrapper configWrapper) throws VrfBondingServiceException { + if ("VRF-ENTRY".equalsIgnoreCase(vrfConfiguration.getConfigurationType())) { + Optional<Relationships> relationshipsConfigOp = configWrapper.getRelationships(); + if (relationshipsConfigOp.isPresent()) { + Optional<VpnBinding> relatedInfraVpnBindingOp = + workflowActionUtils.extractRelationshipsVpnBinding(relationshipsConfigOp.get()); + if (relatedInfraVpnBindingOp.isPresent()) { + VpnBinding relatedInfraVpnBinding = relatedInfraVpnBindingOp.get(); + if (!relatedInfraVpnBinding.getVpnId().equalsIgnoreCase(relatedVpnBinding.getInstanceId())) { + throw new VrfBondingServiceException("Configuration: " + vrfConfiguration.getConfigurationId() + + " is not connected to the same vpn binding id provided in request: " + + relatedVpnBinding.getInstanceId()); + } else { + return true; + } + } + } + } + return false; + } + + public boolean containsWorkflowType(List<Resource> resourceList, WorkflowType workflowType) { + return resourceList.stream().anyMatch(resource -> resource.getResourceType().equals(workflowType)); + } + + public boolean isNetworkCollectionInTheResourceList(List<Resource> resourceList) { + return resourceList.stream().anyMatch(x -> WorkflowType.NETWORKCOLLECTION == x.getResourceType()); + } + + public CollectionResourceCustomization findCatalogNetworkCollection(DelegateExecution execution, + org.onap.so.db.catalog.beans.Service service) { + CollectionResourceCustomization networkCollection = null; + int count = 0; + for (CollectionResourceCustomization collectionCust : service.getCollectionResourceCustomizations()) { + if (catalogDbClient.getNetworkCollectionResourceCustomizationByID( + collectionCust.getModelCustomizationUUID()) != null) { + networkCollection = collectionCust; + count++; + } + } + if (count == 0) { + return null; + } else if (count > 1) { + buildAndThrowException(execution, + "Found multiple Network Collections in the Service model, only one per Service is supported."); + } + return networkCollection; + } + + protected void buildAndThrowException(DelegateExecution execution, String msg) { + logger.error(msg); + execution.setVariable(WORKFLOW_ACTION_ERROR_MESSAGE, msg); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg); + } +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java index 3a7dd5772f..4b1fdd8da1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java @@ -24,10 +24,12 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.bpmn.infrastructure.workflow.tasks; +package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader; import com.fasterxml.jackson.databind.ObjectMapper; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource; +import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.db.catalog.beans.CollectionResourceCustomization; import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization; @@ -68,7 +70,7 @@ public class UserParamsServiceTraversal { this.exceptionBuilder = exceptionBuilder; } - protected List<Resource> getResourceListFromUserParams(DelegateExecution execution, + public List<Resource> getResourceListFromUserParams(DelegateExecution execution, List<Map<String, Object>> userParams, String serviceModelVersionId, String requestAction) throws IOException { if (userParams != null) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidation.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidation.java index 304cb9f4b4..3b54645b35 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidation.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidation.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.bpmn.infrastructure.workflow.tasks; +package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader; import java.util.List; import java.util.Optional; @@ -26,6 +26,7 @@ import org.onap.aai.domain.yang.L3Network; import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types; +import org.onap.so.bpmn.infrastructure.workflow.tasks.VrfBondingServiceException; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils; import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization; import org.springframework.beans.factory.annotation.Autowired; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java index 26e0d2f8c9..31f37f4ac3 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java @@ -78,6 +78,8 @@ import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types; import org.onap.so.bpmn.BaseTaskTest; +import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.ServiceEBBLoader; +import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.UserParamsServiceTraversal; import org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader.VnfEBBLoader; import org.onap.so.bpmn.servicedecomposition.bbobjects.Collection; import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration; @@ -141,6 +143,10 @@ public class WorkflowActionTest extends BaseTaskTest { @Spy protected VnfEBBLoader vnfEBBLoaderSpy; + @InjectMocks + @Spy + protected ServiceEBBLoader serviceEBBLoader; + @Rule public ExpectedException thrown = ExpectedException.none(); @@ -232,7 +238,6 @@ public class WorkflowActionTest extends BaseTaskTest { when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource, true, "my-custom-cloud-owner")).thenReturn(northBoundRequest); - workflowAction.selectExecutionList(execution); List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); assertEqualsBulkFlowName(ebbs, "AssignServiceInstanceBB", "ActivateServiceInstanceBB"); @@ -1044,7 +1049,7 @@ public class WorkflowActionTest extends BaseTaskTest { NorthBoundRequest northBoundRequest = new NorthBoundRequest(); List<OrchestrationFlow> orchFlows = createFlowList("AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB", - "AssignFabricConfigurationBB", "ActivateFabricConfigurationBB"); + "AddFabricConfigurationBB"); northBoundRequest.setOrchestrationFlowList(orchFlows); List<CvnfcCustomization> cvnfcCustomizations = new ArrayList<CvnfcCustomization>(); @@ -1078,15 +1083,14 @@ public class WorkflowActionTest extends BaseTaskTest { when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource, true, "my-custom-cloud-owner")).thenReturn(northBoundRequest); - // when(catalogDbClient.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID("fc25201d-36d6-43a3-8d39-fdae88e526ae", - // "9a6d01fd-19a7-490a-9800-460830a12e0b")).thenReturn(cvnfcCustomizations); + workflowAction.selectExecutionList(execution); List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); - assertEqualsBulkFlowName(ebbs, "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB", - "AssignFabricConfigurationBB", "ActivateFabricConfigurationBB", "AssignFabricConfigurationBB", - "ActivateFabricConfigurationBB"); + assertEqualsBulkFlowName(ebbs, "AssignVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB"); } + + @Test public void selectExecutionListALaCarteVfModuleNoVolumeGroupReplaceTest() throws Exception { String gAction = "replaceInstance"; @@ -1450,7 +1454,6 @@ public class WorkflowActionTest extends BaseTaskTest { "ChangeModelVnfBB", "ChangeModelServiceInstanceBB"); } - @Test public void selectExecutionListALaCarteVfModuleFabricDeleteTest() throws Exception { String gAction = "deleteInstance"; @@ -2097,7 +2100,7 @@ public class WorkflowActionTest extends BaseTaskTest { List<Resource> resourceCounter = new ArrayList<>(); thrown.expect(BpmnError.class); List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>(); - workflowAction.traverseCatalogDbService(execution, sIRequest, resourceCounter, aaiResourceIds); + serviceEBBLoader.traverseCatalogDbService(execution, sIRequest, resourceCounter, aaiResourceIds); } @@ -2109,7 +2112,8 @@ public class WorkflowActionTest extends BaseTaskTest { networkCustomization.setModelCustomizationUUID("123"); service.getCollectionResourceCustomizations().add(networkCustomization); doReturn(networkCustomization).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("123"); - CollectionResourceCustomization customization = workflowAction.findCatalogNetworkCollection(execution, service); + CollectionResourceCustomization customization = + serviceEBBLoader.findCatalogNetworkCollection(execution, service); assertNotNull(customization); } @@ -2119,7 +2123,8 @@ public class WorkflowActionTest extends BaseTaskTest { NetworkCollectionResourceCustomization networkCustomization = new NetworkCollectionResourceCustomization(); networkCustomization.setModelCustomizationUUID("123"); service.getCollectionResourceCustomizations().add(networkCustomization); - CollectionResourceCustomization customization = workflowAction.findCatalogNetworkCollection(execution, service); + CollectionResourceCustomization customization = + serviceEBBLoader.findCatalogNetworkCollection(execution, service); assertNull(customization); } @@ -2134,7 +2139,7 @@ public class WorkflowActionTest extends BaseTaskTest { service.getCollectionResourceCustomizations().add(networkCustomization2); doReturn(networkCustomization1).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("123"); doReturn(networkCustomization2).when(catalogDbClient).getNetworkCollectionResourceCustomizationByID("321"); - workflowAction.findCatalogNetworkCollection(execution, service); + serviceEBBLoader.findCatalogNetworkCollection(execution, service); assertEquals("Found multiple Network Collections in the Service model, only one per Service is supported.", execution.getVariable("WorkflowActionErrorMessage")); } @@ -2186,7 +2191,7 @@ public class WorkflowActionTest extends BaseTaskTest { .getConfiguration("testConfigurationId"); doReturn(Optional.of(aaiConfiguration2)).when(aaiConfigurationResources) .getConfiguration("testConfigurationId2"); - workflowAction.traverseAAIService(execution, resourceCounter, resourceId, aaiResourceIds); + serviceEBBLoader.traverseAAIService(execution, resourceCounter, resourceId, aaiResourceIds); assertEquals(8, resourceCounter.size()); assertTrue(resourceCounter.get(2).isBaseVfModule()); assertThat(aaiResourceIds, sameBeanAs(getExpectedResourceIds())); @@ -2203,7 +2208,7 @@ public class WorkflowActionTest extends BaseTaskTest { resourceList.add(new Resource(WorkflowType.NETWORK, "model customization id", false)); resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, "model customization id", false)); - assertEquals(workflowAction.foundRelated(resourceList), true); + assertEquals(serviceEBBLoader.foundRelated(resourceList), true); } @Test @@ -2214,11 +2219,11 @@ public class WorkflowActionTest extends BaseTaskTest { resourceList.add(new Resource(WorkflowType.NETWORK, "model customization id", false)); resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, "model customization id", false)); - assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.PNF), true); - assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.VNF), true); - assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.NETWORK), true); - assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION), true); - assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.CONFIGURATION), false); + assertEquals(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.PNF), true); + assertEquals(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.VNF), true); + assertEquals(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.NETWORK), true); + assertEquals(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION), true); + assertEquals(serviceEBBLoader.containsWorkflowType(resourceList, WorkflowType.CONFIGURATION), false); } private List<Pair<WorkflowType, String>> getExpectedResourceIds() { @@ -2249,6 +2254,7 @@ public class WorkflowActionTest extends BaseTaskTest { for (int i = 0; i < ebbs.size(); i++) { assertEquals(ebbs.get(i).getBuildingBlock().getBpmnFlowName(), flowNames[i]); } + assertEquals(ebbs.size(), flowNames.length); } private void initExecution(String gAction, String bpmnRequest, boolean isAlaCarte) { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversalTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversalTest.java index 99f17a3628..75514b15d7 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversalTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversalTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.bpmn.infrastructure.workflow.tasks; +package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader; import com.fasterxml.jackson.databind.ObjectMapper; import org.camunda.bpm.engine.delegate.DelegateExecution; @@ -28,6 +28,8 @@ import org.junit.Test; import org.mockito.Mockito; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.common.BBConstants; +import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource; +import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.db.catalog.beans.ConfigurationResource; import org.onap.so.db.catalog.beans.CvnfcCustomization; diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidationTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidationTest.java index 7f9f0417ea..dcccb74f58 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/VrfValidationTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VrfValidationTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.bpmn.infrastructure.workflow.tasks; +package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.doReturn; @@ -45,6 +45,7 @@ import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types; import org.onap.so.bpmn.BaseTaskTest; +import org.onap.so.bpmn.infrastructure.workflow.tasks.VrfBondingServiceException; import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization; diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java index 21bc2a697a..9ec214fc6d 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java @@ -23,6 +23,7 @@ package org.onap.so.db.request.data.repository; import java.util.List; import org.onap.so.db.request.beans.RequestProcessingData; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @@ -44,4 +45,7 @@ public interface RequestProcessingDataRepository extends JpaRepository<RequestPr RequestProcessingData[] findByGroupingIdAndNameAndTag(@Param("GROUPING_ID") String groupingId, @Param("NAME") String name, @Param("TAG") String tag); + + RequestProcessingData[] findBySoRequestIdAndNameAndTagOrderByCreatedDesc(@Param("SO_REQUEST_ID") String soRequestId, + @Param("NAME") String name, @Param("TAG") String tag); } diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java index 9b42eacfc2..806d347582 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java @@ -127,6 +127,9 @@ public class RequestsDbClient { private static final String findByGroupingIdAndNameAndTag = "/requestProcessingData/search/findByGroupingIdAndNameAndTag"; + private static final String findBySoRequestIdAndNameAndTagOrderByCreateTimeDesc = + "/requestProcessingData/search/findBySoRequestIdAndNameAndTagOrderByCreatedDesc"; + @Autowired protected RestTemplate restTemplate; @@ -403,6 +406,15 @@ public class RequestsDbClient { RequestProcessingData.class); } + public List<RequestProcessingData> getRequestProcessingDataBySoRequestIdAndNameAndTagOrderByCreateTimeDesc( + String soRequestId, String name, String tag) { + + return getMultipleResponse(getUri(UriBuilder + .fromUri(endpoint + findBySoRequestIdAndNameAndTagOrderByCreateTimeDesc) + .queryParam(SO_REQUEST_ID, soRequestId).queryParam(NAME, name).queryParam(TAG, tag).build().toString()), + new ParameterizedTypeReference<List<RequestProcessingData>>() {}); + } + public void persistProcessingData(String flowExecutionPath, String requestId) { diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java index c3617b62c7..36d3c98413 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java @@ -27,6 +27,7 @@ import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.Id; import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @@ -74,7 +75,7 @@ public class CloudIdentity { @Column(name = "PROJECT_DOMAIN_NAME") private String projectDomainName; - @JsonProperty("admin_project_domain_name ") + @JsonProperty("admin_project_domain_name") @BusinessKey @Column(name = "ADMIN_PROJECT_DOMAIN_NAME", nullable = false) private String adminProjectDomainName = "Default"; @@ -94,7 +95,7 @@ public class CloudIdentity { @Column(name = "MEMBER_ROLE") private String memberRole; - @JsonProperty("tenant_metadata") + @JsonProperty("tenant_meta_data") @BusinessKey @Column(name = "TENANT_METADATA") private Boolean tenantMetadata; @@ -136,6 +137,11 @@ public class CloudIdentity { this.updated = new Date(); } + @PreUpdate + protected void onUpdate() { + this.updated = new Date(); + } + public String getId() { return id; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java index 64c4b62b11..f7cb9fe3c4 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java @@ -31,6 +31,7 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.PrePersist; +import javax.persistence.PreUpdate; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @@ -143,6 +144,11 @@ public class CloudSite { this.updated = new Date(); } + @PreUpdate + protected void onUpdate() { + this.updated = new Date(); + } + public CloudSite(CloudSite site) { this.cloudVersion = site.getCloudVersion(); this.clli = site.getClli(); |