From c7c8048c03a06d3e0cccf4e8a4473fe81f92f1da Mon Sep 17 00:00:00 2001 From: Rich Tabedzki Date: Tue, 3 Oct 2017 22:30:48 +0000 Subject: Improve CCSDK adaptors Sonar coverage Changes made: 1. Removed unused classes 2. Added new test cases Change-Id: I26be2445488a6ae32ff478e9d06cf992266e273a Issue-ID: CCSDK-108 Signed-off-by: Rich Tabedzki --- .../org/onap/ccsdk/sli/adaptors/aai/AAIClient.java | 4 +- .../onap/ccsdk/sli/adaptors/aai/AAIRequest.java | 26 +- .../onap/ccsdk/sli/adaptors/aai/AAIService.java | 17 +- .../ccsdk/sli/adaptors/aai/CloudRegionRequest.java | 135 ----------- .../ccsdk/sli/adaptors/aai/CustomQueryRequest.java | 2 +- .../onap/ccsdk/sli/adaptors/aai/EchoRequest.java | 28 +-- .../sli/adaptors/aai/GenericQueryRequest.java | 2 +- .../ccsdk/sli/adaptors/aai/GenericVnfRequest.java | 4 +- .../aai/L3InterfaceIpv4AddressListRequest.java | 212 ----------------- .../aai/L3InterfaceIpv6AddressListRequest.java | 179 -------------- .../ccsdk/sli/adaptors/aai/LInterfaceRequest.java | 244 ------------------- .../sli/adaptors/aai/LagInterfacePnfRequest.java | 142 ----------- .../ccsdk/sli/adaptors/aai/NamedQueryRequest.java | 2 +- .../ccsdk/sli/adaptors/aai/NodesQueryRequest.java | 2 +- .../sli/adaptors/aai/PInterfacePnfRequest.java | 142 ----------- .../ccsdk/sli/adaptors/aai/PInterfaceRequest.java | 132 ----------- .../onap/ccsdk/sli/adaptors/aai/PathRequest.java | 2 +- .../sli/adaptors/aai/PhysicalLinkRequest.java | 112 --------- .../sli/adaptors/aai/RelationshipRequest.java | 2 +- .../ccsdk/sli/adaptors/aai/SelfLinkRequest.java | 2 +- .../sli/adaptors/aai/SubInterfaceRequest.java | 184 --------------- .../ccsdk/sli/adaptors/aai/data/v1507/Flavor.java | 122 ---------- .../ccsdk/sli/adaptors/aai/data/v1507/Host.java | 122 ---------- .../ccsdk/sli/adaptors/aai/data/v1507/Image.java | 237 ------------------- .../sli/adaptors/aai/data/v1507/IpAddress.java | 168 ------------- .../sli/adaptors/aai/data/v1507/Relationship.java | 147 ------------ .../adaptors/aai/data/v1507/RelationshipDatum.java | 124 ---------- .../adaptors/aai/data/v1507/RelationshipList.java | 101 -------- .../ccsdk/sli/adaptors/aai/data/v1507/VServer.java | 262 --------------------- .../ccsdk/sli/adaptors/aai/EchoRequestTest.java | 110 +++++++++ .../src/test/resources/aaiclient.properties | 3 +- 31 files changed, 158 insertions(+), 2813 deletions(-) delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CloudRegionRequest.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/L3InterfaceIpv4AddressListRequest.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/L3InterfaceIpv6AddressListRequest.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/LInterfaceRequest.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/LagInterfacePnfRequest.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PInterfacePnfRequest.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PInterfaceRequest.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PhysicalLinkRequest.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SubInterfaceRequest.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Flavor.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Host.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Image.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/IpAddress.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Relationship.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipDatum.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipList.java delete mode 100644 aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/VServer.java create mode 100755 aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequestTest.java diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java index 37daa0732..cfeda4ccb 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClient.java @@ -32,9 +32,7 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; import org.onap.ccsdk.sli.core.sli.SvcLogicResource; -import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent; -import org.onap.ccsdk.sli.adaptors.aai.data.v1507.VServer; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; @@ -79,7 +77,7 @@ public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin { // --------------------------------- 1507 --------------------------- // Data Change - public VServer dataChangeRequestVServerData(URL url) throws AAIServiceException; + public Vserver dataChangeRequestVServerData(URL url) throws AAIServiceException; public CtagPool dataChangeRequestCtagPoolData(URL url) throws AAIServiceException; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java index 5388dbc85..215f9ae82 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIRequest.java @@ -69,7 +69,7 @@ public abstract class AAIRequest { public static final String DEPTH = "depth"; protected static Properties configProperties; - protected final String target_uri; + protected final String targetUri; protected static AAIService aaiService; protected AAIDatum requestDatum; @@ -116,16 +116,22 @@ public abstract class AAIRequest { case "custom-query": case "formatted-query": return new CustomQueryRequest(); - case "linterface": - return new LInterfaceRequest(LInterfaceRequest.TYPE.L2_BRIDGE_SBG); - case "l2-bridge-sbg": - return new SubInterfaceRequest(SubInterfaceRequest.TYPE.L2_BRIDGE_SBG); - case "l2-bridge-bgf": - return new SubInterfaceRequest(SubInterfaceRequest.TYPE.L2_BRIDGE_BGF); case "echo": case "test": return new EchoRequest(); + case "linterface": + case "l2-bridge-sbg": + case "l2-bridge-bgf": + { + resoource = "l-interface"; + AAIRequest request = getRequestFromResource("l-interface"); + if(request == null) { + return null; + } + return request; + } + default: { AAIRequest request = getRequestFromResource(resoource); @@ -210,7 +216,7 @@ public abstract class AAIRequest { } public AAIRequest() { - target_uri = configProperties.getProperty(TARGET_URI); + targetUri = configProperties.getProperty(TARGET_URI); } public void addRequestProperty(String key, String value) { @@ -241,7 +247,7 @@ public abstract class AAIRequest { String request_url = null; - request_url = target_uri + updatePathDataValues(resourceVersion); + request_url = targetUri + updatePathDataValues(resourceVersion); URL http_req_url = new URL(request_url); @@ -469,6 +475,6 @@ public abstract class AAIRequest { public String getTargetUri() { - return target_uri; + return targetUri; } } diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java index d3d57eaa9..1ec222c91 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java @@ -67,7 +67,6 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocketFactory; import javax.ws.rs.HttpMethod; -import javax.ws.rs.core.UriBuilder; import javax.xml.bind.annotation.XmlElement; import org.apache.commons.codec.binary.Base64; @@ -96,7 +95,6 @@ import org.openecomp.aai.inventory.v11.Tenant; import org.openecomp.aai.inventory.v11.Vce; import org.openecomp.aai.inventory.v11.VnfImage; import org.openecomp.aai.inventory.v11.VnfImages; -import org.openecomp.aai.inventory.v11.Vpe; import org.openecomp.aai.inventory.v11.VplsPe; import org.openecomp.aai.inventory.v11.VpnBinding; import org.openecomp.aai.inventory.v11.Vserver; @@ -106,7 +104,6 @@ import org.onap.ccsdk.sli.adaptors.aai.data.RequestError; import org.onap.ccsdk.sli.adaptors.aai.data.ResourceVersion; import org.onap.ccsdk.sli.adaptors.aai.data.ServiceException; import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent; -import org.onap.ccsdk.sli.adaptors.aai.data.v1507.VServer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; @@ -1106,9 +1103,9 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe PInterface response = null; try { - AAIRequest request = new PInterfaceRequest(); - request.addRequestProperty(PInterfaceRequest.PINTERFACE_INTERFACE_NAME, interfaceName); - request.addRequestProperty(PInterfaceRequest.PSERVER_HOSTNAME, hostname); + AAIRequest request = AAIRequest.getRequestFromResource("p-interface"); + request.addRequestProperty("p-interface.interface-name", interfaceName); + request.addRequestProperty("pserver.hostname", hostname); String rv = executor.get(request); if(rv != null) { ObjectMapper mapper = getObjectMapper(); @@ -1438,16 +1435,14 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe //================== End of Service ================= - - // 1507 - Request @Override - public VServer dataChangeRequestVServerData(URL url) throws AAIServiceException { + public Vserver dataChangeRequestVServerData(URL url) throws AAIServiceException { if(url == null) { throw new NullPointerException(); } - return this.getResource(url.toString(), VServer.class); + return this.getResource(url.toString(), Vserver.class); } @Override @@ -2267,7 +2262,7 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe String data_type = datum.getResourceType(); String resourceLink = datum.getResourceLink(); if(!resourceLink.isEmpty() && !resourceLink.toLowerCase().startsWith("http")) { - resourceLink = (new EchoRequest()).target_uri + resourceLink; + resourceLink = (new EchoRequest()).targetUri + resourceLink; } entity = new URL(resourceLink); } diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CloudRegionRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CloudRegionRequest.java deleted file mode 100644 index 1f5bd7f2e..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CloudRegionRequest.java +++ /dev/null @@ -1,135 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.CloudRegion; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Joiner; - -public class CloudRegionRequest extends AAIRequest { - - public static final String CLOUD_REGION_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.cloud.region"; - - private final String cloud_region_path; - - public static final String CLOUD_REGION_CLOUD_OWNER = "cloud-region.cloud-owner"; - public static final String CLOUD_REGION_CLOUD_REGION_ID = "cloud-region.cloud-region-id"; - - - public CloudRegionRequest() { - cloud_region_path = configProperties.getProperty(CLOUD_REGION_PATH); - } - - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - return this.getRequestUrl(method, null); - } - - @Override - public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - - String request_url = target_uri+cloud_region_path; - - request_url = processPathData(request_url, requestProperties); - - Map query = new HashMap(); - if(requestProperties.containsKey(DEPTH)) { - query.put(DEPTH, requestProperties.getProperty(DEPTH)); - } - - if(resourceVersion != null) { -// request_url = request_url +"?resource-version="+resourceVersion; - query.put(RESOURCE_VERSION, resourceVersion); - } - - if(!query.isEmpty()) { - Joiner.MapJoiner mapJoiner = Joiner.on("&").withKeyValueSeparator("="); - String queryString = mapJoiner.join(query); - request_url = String.format("%s?%s", request_url, queryString); - } - URL http_req_url = new URL(request_url); - - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - - return http_req_url; - } - - - @Override - public String toJSONString() { - ObjectMapper mapper = getObjectMapper(); - CloudRegion vnfc = (CloudRegion)requestDatum; - String json_text = null; - try { - json_text = mapper.writeValueAsString(vnfc); - } catch (JsonProcessingException exc) { - handleException(this, exc); - return null; - } - return json_text; - } - - @Override - public String[] getArgsList() { - String[] args = - { - CLOUD_REGION_CLOUD_OWNER, - CLOUD_REGION_CLOUD_REGION_ID, - DEPTH - }; - - return args; - } - - @Override - public Class getModelClass() { - return CloudRegion.class; - } - - public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { - - if(!requestProperties.containsKey(CLOUD_REGION_CLOUD_OWNER) || !requestProperties.containsKey(CLOUD_REGION_CLOUD_REGION_ID)) { - aaiService.logKeyError(String.format("%s,%s", CLOUD_REGION_CLOUD_OWNER, CLOUD_REGION_CLOUD_REGION_ID)); - } - - String encoded_vnf = encodeQuery(requestProperties.getProperty(CLOUD_REGION_CLOUD_OWNER)); - request_url = request_url.replace("{cloud-owner}", encoded_vnf) ; - - encoded_vnf = encodeQuery(requestProperties.getProperty(CLOUD_REGION_CLOUD_REGION_ID)); - request_url = request_url.replace("{cloud-region-id}", encoded_vnf) ; - - aaiService.LOGwriteDateTrace("cloud-owner", requestProperties.getProperty(CLOUD_REGION_CLOUD_OWNER)); - aaiService.LOGwriteDateTrace("cloud-region-id", requestProperties.getProperty(CLOUD_REGION_CLOUD_REGION_ID)); - - return request_url; - } -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CustomQueryRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CustomQueryRequest.java index 89ca875ba..aa402ecff 100644 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CustomQueryRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/CustomQueryRequest.java @@ -56,7 +56,7 @@ public class CustomQueryRequest extends AAIRequest { @Override public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - String request_url = target_uri+generic_search_path; + String request_url = targetUri+generic_search_path; request_url = processPathData(request_url, requestProperties); diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequest.java index 99036aa7e..fb2345056 100644 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequest.java @@ -8,9 +8,9 @@ * 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. @@ -34,29 +34,29 @@ import com.fasterxml.jackson.databind.ObjectMapper; public class EchoRequest extends AAIRequest { - - private final String echo_path; - + + private final String echoPath; + public EchoRequest() { - echo_path = "/aai/util/echo"; + echoPath = "/aai/util/echo"; } - + @Override public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - String request_url = target_uri+echo_path; + String requestUrl = targetUri+echoPath; if(resourceVersion != null) { - request_url = request_url +"?resource-version="+resourceVersion; + requestUrl = requestUrl +"?resource-version="+resourceVersion; } - URL http_req_url = new URL(request_url); + URL httpReqUrl = new URL(requestUrl); - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - - return http_req_url; + aaiService.LOGwriteFirstTrace(method, httpReqUrl.toString()); + + return httpReqUrl; } - + @Override public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { return getRequestUrl(method, null); diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java index 0717dd34d..98de85a58 100644 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericQueryRequest.java @@ -71,7 +71,7 @@ public class GenericQueryRequest extends AAIRequest { @Override public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - String request_url = target_uri+generic_search_path; + String request_url = targetUri+generic_search_path; request_url = processPathData(request_url, requestProperties); diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfRequest.java index d7bf1d0d4..7aabb8dc7 100644 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericVnfRequest.java @@ -54,7 +54,7 @@ public class GenericVnfRequest extends AAIRequest { @Override public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - String request_url = target_uri+generic_vnf_path; + String request_url = targetUri+generic_vnf_path; String key = VNF_ID; if(requestProperties.containsKey(GENERIC_VNF_ID)) { key = GENERIC_VNF_ID; @@ -80,7 +80,7 @@ public class GenericVnfRequest extends AAIRequest { @Override public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - String request_url = target_uri+generic_vnf_path; + String request_url = targetUri+generic_vnf_path; String key = VNF_ID; if(requestProperties.containsKey(GENERIC_VNF_ID)) { diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/L3InterfaceIpv4AddressListRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/L3InterfaceIpv4AddressListRequest.java deleted file mode 100644 index e2fd570a3..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/L3InterfaceIpv4AddressListRequest.java +++ /dev/null @@ -1,212 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Properties; - -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.L3InterfaceIpv4AddressList; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class L3InterfaceIpv4AddressListRequest extends AAIRequest { - - /* - * Note: there are 3 possible paths: - * /network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - * /inventory/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} - */ - - public static final String L3_INTERFACE_IPV4_ADDRESS_LIST_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.l3.interface.ipv4.address.list"; - public static final String VLAN_L3_INTERFACE_IPV4_ADDRESS_LIST_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.vlan.l3.interface.ipv4.address.list"; - - private final String l3_interface_ipv4_address_list_path; - private final String vlan_l3_interface_ipv4_address_list_path; - - public static final String L3_INTERFACE_IPV4_ADDRESS = "l3-interface-ipv4-address"; - public static final String LIST_L3_INTERFACE_IPV4_ADDRESS = "l3-interface-ipv4-address-list.l3-interface-ipv4-address"; - public static final String VLAN_INTERFACE = "vlan-interface"; - public static final String VLAN_VLAN_INTERFACE = "vlan.vlan-interface"; - - public L3InterfaceIpv4AddressListRequest() { - l3_interface_ipv4_address_list_path = configProperties.getProperty(L3_INTERFACE_IPV4_ADDRESS_LIST_PATH); - vlan_l3_interface_ipv4_address_list_path = configProperties.getProperty(VLAN_L3_INTERFACE_IPV4_ADDRESS_LIST_PATH); - } - - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - return this.getRequestUrl(method, null); - } - - @Override - public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - - String request_url = target_uri+l3_interface_ipv4_address_list_path; - - if(requestProperties.containsKey(VLAN_INTERFACE) || requestProperties.containsKey(VLAN_VLAN_INTERFACE)){ - request_url = target_uri+vlan_l3_interface_ipv4_address_list_path; - request_url = processVLanRequestPathData(request_url, requestProperties); - } - - request_url = processPathData(request_url, requestProperties); - request_url = LInterfaceRequest.processPathData(request_url, requestProperties); -// request_url = GenericVnfRequest.processPathData(request_url, requestProperties); - - if(resourceVersion != null) { - request_url = request_url +"?resource-version="+resourceVersion; - } - URL http_req_url = new URL(request_url); - - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - - return http_req_url; - } - - public static String processVLanRequestPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { - String key = null; - - if(requestProperties.containsKey(VLAN_VLAN_INTERFACE)) { - key = VLAN_VLAN_INTERFACE; - } else if(requestProperties.containsKey(VLAN_INTERFACE)) { - key = VLAN_INTERFACE; - } else { - aaiService.logKeyError(String.format("%s,%s", VLAN_INTERFACE, VLAN_VLAN_INTERFACE)); - } - - String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); - - request_url = request_url.replace("{vlan-interface}", encoded_vnf) ; - aaiService.LOGwriteDateTrace("vlan-interface", requestProperties.getProperty(key)); - return request_url; - } - - @Override - public String toJSONString() { - ObjectMapper mapper = getObjectMapper(); - L3InterfaceIpv4AddressList vnfc = (L3InterfaceIpv4AddressList)requestDatum; - String json_text = null; - try { - json_text = mapper.writeValueAsString(vnfc); - } catch (JsonProcessingException exc) { - handleException(this, exc); - return null; - } - return json_text; - } - - @Override - public String[] getArgsList() { - String[] args = - { - L3_INTERFACE_IPV4_ADDRESS, - LIST_L3_INTERFACE_IPV4_ADDRESS, - VLAN_INTERFACE, - VLAN_VLAN_INTERFACE, - LInterfaceRequest.INTERFACE_NAME, - LInterfaceRequest.LINTERFACE_INTERFACE_NAME, - "generic-vnf.vnf-id" - }; - - return args; - } - - @Override - public Class getModelClass() { - return L3InterfaceIpv4AddressList.class; - } - - public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { - String key = L3_INTERFACE_IPV4_ADDRESS; - if(requestProperties.containsKey(LIST_L3_INTERFACE_IPV4_ADDRESS)) { - key = LIST_L3_INTERFACE_IPV4_ADDRESS; - } - - if(!requestProperties.containsKey(key)) { - aaiService.logKeyError(String.format("%s,%s", L3_INTERFACE_IPV4_ADDRESS, LIST_L3_INTERFACE_IPV4_ADDRESS)); - } - - String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); - - request_url = request_url.replace("{l3-interface-ipv4-address}", encoded_vnf) ; - - aaiService.LOGwriteDateTrace("l3-interface-ipv4-address", requestProperties.getProperty(key)); - return request_url; - } - - /* - * (non-Javadoc) - * @see org.onap.ccsdk.sli.adaptors.aai.PathConfigurator#configurePath(java.lang.String) - */ -// @Override -// public void processRequestPathValues(Map nameValues) { -// String[] paths = -// { -// "/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address}", -// "/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address}", -// "/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address}", -// "/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address}" -// }; -// -// Listkeys = new LinkedList(); -// keys.addAll(nameValues.keySet()); -// for(String key : keys) { -// if(key.contains(".")) { -// key = key.replaceAll("_", "-"); -// if(!LIST_L3_INTERFACE_IPV4_ADDRESS.equals(key)) { -// int index = key.indexOf("."); -// String resource = key.substring(0, index); -// AAIRequest rx = createRequest(resource, nameValues); -// if(rx != null) { -// pathElements.add(rx); -// } -// } -// } -// } -// super.processRequestPathValues(nameValues); -// } -// List pathElements = new LinkedList(); - -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/L3InterfaceIpv6AddressListRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/L3InterfaceIpv6AddressListRequest.java deleted file mode 100644 index 793155088..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/L3InterfaceIpv6AddressListRequest.java +++ /dev/null @@ -1,179 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Properties; - -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.L3InterfaceIpv6AddressList; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class L3InterfaceIpv6AddressListRequest extends AAIRequest { - - /* - * Note: there are 3 possible paths: - * /network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - * /inventory/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} - */ - - public static final String L3_INTERFACE_IPV6_ADDRESS_LIST_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.l3.interface.ipv6.address.list"; - public static final String VLAN_L3_INTERFACE_IPV6_ADDRESS_LIST_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.vlan.l3.interface.ipv6.address.list"; - - private final String l3_interface_ipv6_address_list_path; - private final String vlan_l3_interface_ipv6_address_list_path; - - public static final String L3_INTERFACE_IPV6_ADDRESS = "l3-interface-ipv6-address"; - public static final String LIST_L3_INTERFACE_IPV6_ADDRESS = "l3-interface-ipv6-address-list.l3-interface-ipv6-address"; - public static final String VLAN_INTERFACE = "vlan-interface"; - public static final String VLAN_VLAN_INTERFACE = "vlan.vlan-interface"; - - public L3InterfaceIpv6AddressListRequest() { - l3_interface_ipv6_address_list_path = configProperties.getProperty(L3_INTERFACE_IPV6_ADDRESS_LIST_PATH); - vlan_l3_interface_ipv6_address_list_path = configProperties.getProperty(VLAN_L3_INTERFACE_IPV6_ADDRESS_LIST_PATH); - } - - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - return this.getRequestUrl(method, null); - } - - @Override - public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - - String request_url = target_uri+l3_interface_ipv6_address_list_path; - - if(requestProperties.containsKey(VLAN_INTERFACE) || requestProperties.containsKey(VLAN_VLAN_INTERFACE)){ - request_url = target_uri+vlan_l3_interface_ipv6_address_list_path; - request_url = processVLanRequestPathData(request_url, requestProperties); - } - - request_url = processPathData(request_url, requestProperties); - request_url = LInterfaceRequest.processPathData(request_url, requestProperties); -// request_url = GenericVnfRequest.processPathData(request_url, requestProperties); - - if(resourceVersion != null) { - request_url = request_url +"?resource-version="+resourceVersion; - } - URL http_req_url = new URL(request_url); - - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - - return http_req_url; - } - - public static String processVLanRequestPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { - String key = null; - - if(requestProperties.containsKey(VLAN_VLAN_INTERFACE)) { - key = VLAN_VLAN_INTERFACE; - } else if(requestProperties.containsKey(VLAN_INTERFACE)) { - key = VLAN_INTERFACE; - } else { - aaiService.logKeyError(String.format("%s,%s", VLAN_INTERFACE, VLAN_VLAN_INTERFACE)); - } - - String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); - - request_url = request_url.replace("{vlan-interface}", encoded_vnf) ; - aaiService.LOGwriteDateTrace("vlan-interface", requestProperties.getProperty(key)); - return request_url; - } - - @Override - public String toJSONString() { - ObjectMapper mapper = getObjectMapper(); - L3InterfaceIpv6AddressList vnfc = (L3InterfaceIpv6AddressList)requestDatum; - String json_text = null; - try { - json_text = mapper.writeValueAsString(vnfc); - } catch (JsonProcessingException exc) { - handleException(this, exc); - return null; - } - return json_text; - } - - @Override - public String[] getArgsList() { - String[] args = - { - L3_INTERFACE_IPV6_ADDRESS, - LIST_L3_INTERFACE_IPV6_ADDRESS, - VLAN_INTERFACE, - VLAN_VLAN_INTERFACE, - LInterfaceRequest.INTERFACE_NAME, - LInterfaceRequest.LINTERFACE_INTERFACE_NAME, - "generic-vnf.vnf-id" - - }; - - return args; - } - - @Override - public Class getModelClass() { - return L3InterfaceIpv6AddressList.class; - } - - public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { - String key = L3_INTERFACE_IPV6_ADDRESS; - if(requestProperties.containsKey(LIST_L3_INTERFACE_IPV6_ADDRESS)) { - key = LIST_L3_INTERFACE_IPV6_ADDRESS; - } - - if(!requestProperties.containsKey(key)) { - aaiService.logKeyError(String.format("%s,%s", L3_INTERFACE_IPV6_ADDRESS, LIST_L3_INTERFACE_IPV6_ADDRESS)); - } - - String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); - - request_url = request_url.replace("{l3-interface-ipv6-address}", encoded_vnf) ; - - aaiService.LOGwriteDateTrace("l3-interface-ipv6-address", requestProperties.getProperty(key)); - return request_url; - } -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/LInterfaceRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/LInterfaceRequest.java deleted file mode 100644 index ae1eb287f..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/LInterfaceRequest.java +++ /dev/null @@ -1,244 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Properties; - -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.LInterface; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class LInterfaceRequest extends AAIRequest { - - // tenant (1602) - public static final String LAGINTERFACE_LINTERFACE_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.lag.interface.l.interface"; - public static final String LAGINTERFACE_LINTERFACE_QUERY_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.lag.interface.l.interface.query"; - - public static final String P_INTERFACE_LINTERFACE_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.p.interface.l.interface"; - public static final String P_INTERFACE_LINTERFACE_QUERY_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.p.interface.l.interface.query"; - - public static final String LAGINTERFACE_LINTERFACE_PNF_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.lag.interface.l.interface.pnf"; - public static final String P_INTERFACE_LINTERFACE_PNF_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.p.interface.l.interface.pnf"; - - private final String laginterface_linterface_path; - private final String laginterface_linterface_query_path; - private final String p_interface_linterface_path; - private final String p_interface_linterface_query_path; - - private final String laginterface_linterface_pnf_path; - private final String p_interface_linterface_pnf_path; - - public static final String INTERFACE_NAME = "interface-name"; - public static final String LINTERFACE_INTERFACE_NAME = "l-interface.interface-name"; - public static final String LAG_INTERFACE_INTERFACE_NAME = "lag-interface.interface-name"; - public static final String P_INTERFACE_INTERFACE_NAME = "p-interface.interface-name"; - public static final String PNF_PNF_NAME = "pnf.pnf-name"; - - public static final String ROUTER_NAME = "router-name"; - public static final String HOSTNAME = "hostname"; - - - public static enum TYPE { L2_BRIDGE_BGF, L2_BRIDGE_SBG}; - - private final TYPE type; - - public LInterfaceRequest(TYPE type) { - this.type = type; - - laginterface_linterface_path = configProperties.getProperty(LAGINTERFACE_LINTERFACE_PATH); - laginterface_linterface_query_path = configProperties.getProperty(LAGINTERFACE_LINTERFACE_QUERY_PATH); - - p_interface_linterface_path = configProperties.getProperty(P_INTERFACE_LINTERFACE_PATH); - p_interface_linterface_query_path = configProperties.getProperty(P_INTERFACE_LINTERFACE_QUERY_PATH); - - laginterface_linterface_pnf_path = configProperties.getProperty(LAGINTERFACE_LINTERFACE_PNF_PATH); - p_interface_linterface_pnf_path = configProperties.getProperty(P_INTERFACE_LINTERFACE_PNF_PATH); - } - - - @Override - public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - - String request_url = null; - String encoded_vnf = null; - String hostname = null; - String pnfname = null; - String interfaceName = null; - - if(type == TYPE.L2_BRIDGE_SBG) { - if(requestProperties.containsKey(PNF_PNF_NAME)) { - request_url = target_uri + laginterface_linterface_pnf_path; - } else { - request_url = target_uri + laginterface_linterface_path; - } - - if(requestProperties.containsKey(ROUTER_NAME)) { - hostname = requestProperties.getProperty(ROUTER_NAME); - encoded_vnf = encodeQuery(hostname); - request_url = request_url.replace("{hostname}", encoded_vnf); - } - - if(requestProperties.containsKey(HOSTNAME)) { - hostname = requestProperties.getProperty(HOSTNAME); - encoded_vnf = encodeQuery(hostname); - request_url = request_url.replace("{hostname}", encoded_vnf); - } - - if(requestProperties.containsKey(PNF_PNF_NAME)) { - pnfname = requestProperties.getProperty(PNF_PNF_NAME); - encoded_vnf = encodeQuery(pnfname); - request_url = request_url.replace("{pnf-name}", encoded_vnf); - } - - encoded_vnf = encodeQuery(requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME)); - request_url = request_url.replace("{lag-interface.interface-name}", encoded_vnf) ; - - - interfaceName = requestProperties.getProperty(INTERFACE_NAME); - if(interfaceName == null || interfaceName.isEmpty()) { - interfaceName = requestProperties.getProperty(LINTERFACE_INTERFACE_NAME); - } - encoded_vnf = encodeQuery(interfaceName); - request_url = request_url.replace("{interface-name}", encoded_vnf) ; - - } - if(type == TYPE.L2_BRIDGE_BGF) { - if(requestProperties.containsKey(PNF_PNF_NAME)) { - request_url = target_uri + p_interface_linterface_pnf_path; - } else { - request_url = target_uri + p_interface_linterface_path; - } - - - if(requestProperties.containsKey(ROUTER_NAME)) { - hostname = requestProperties.getProperty(ROUTER_NAME); - encoded_vnf = encodeQuery(hostname); - request_url = request_url.replace("{hostname}", encoded_vnf); - } - - if(requestProperties.containsKey(HOSTNAME)) { - hostname = requestProperties.getProperty(HOSTNAME); - encoded_vnf = encodeQuery(hostname); - request_url = request_url.replace("{hostname}", encoded_vnf); - } - - if(requestProperties.containsKey(PNF_PNF_NAME)) { - pnfname = requestProperties.getProperty(PNF_PNF_NAME); - encoded_vnf = encodeQuery(pnfname); - request_url = request_url.replace("{pnf-name}", encoded_vnf); - } - - encoded_vnf = encodeQuery(requestProperties.getProperty(P_INTERFACE_INTERFACE_NAME)); - request_url = request_url.replace("{p-interface.interface-name}", encoded_vnf) ; - - - interfaceName = requestProperties.getProperty(INTERFACE_NAME); - if(interfaceName == null || interfaceName.isEmpty()) { - interfaceName = requestProperties.getProperty(LINTERFACE_INTERFACE_NAME); - } - encoded_vnf = encodeQuery(interfaceName); - request_url = request_url.replace("{interface-name}", encoded_vnf) ; - } - - - if(resourceVersion != null) { - request_url = request_url +"?resource-version="+resourceVersion; - } - URL http_req_url = new URL(request_url); - - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - if(hostname != null) - aaiService.LOGwriteDateTrace("hostname", hostname); - if(pnfname != null) - aaiService.LOGwriteDateTrace("pnf-name", pnfname); - if(requestProperties.containsKey(LAG_INTERFACE_INTERFACE_NAME)) { - aaiService.LOGwriteDateTrace("lag-interface.interface-name", requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME)); - } - if(requestProperties.containsKey(P_INTERFACE_INTERFACE_NAME)) { - aaiService.LOGwriteDateTrace("p-interface.interface-name", requestProperties.getProperty(P_INTERFACE_INTERFACE_NAME)); - } - aaiService.LOGwriteDateTrace("interface-name", interfaceName); - - return http_req_url; - } - - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - return this.getRequestUrl(method, null); - } - - - @Override - public String toJSONString() { - ObjectMapper mapper = getObjectMapper(); - LInterface vnfc = (LInterface)requestDatum; - String json_text = null; - try { - json_text = mapper.writeValueAsString(vnfc); - } catch (JsonProcessingException exc) { - handleException(this, exc); - return null; - } - return json_text; - } - - - @Override - public String[] getArgsList() { - String[] args = {}; - if(type == TYPE.L2_BRIDGE_SBG) { - String[] tmpArray = {INTERFACE_NAME, LINTERFACE_INTERFACE_NAME, LAG_INTERFACE_INTERFACE_NAME, HOSTNAME, ROUTER_NAME, PNF_PNF_NAME}; - args = tmpArray; - } - if(type == TYPE.L2_BRIDGE_BGF) { - String[] tmpArray = {INTERFACE_NAME, LINTERFACE_INTERFACE_NAME, P_INTERFACE_INTERFACE_NAME, HOSTNAME, ROUTER_NAME, PNF_PNF_NAME}; - args = tmpArray; - } - - return args; - } - - @Override - public Class getModelClass() { - return LInterface.class; - } - - @Override - public String getPrimaryResourceName(String resource) { - return "l-interface"; - } - - public static final String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { - String interfaceName = requestProperties.getProperty(INTERFACE_NAME); - if(interfaceName == null || interfaceName.isEmpty()) { - interfaceName = requestProperties.getProperty(LINTERFACE_INTERFACE_NAME); - } - - request_url = request_url.replace("{interface-name}", encodeQuery(interfaceName)) ; - return request_url; - } -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/LagInterfacePnfRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/LagInterfacePnfRequest.java deleted file mode 100644 index 169f0d1d0..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/LagInterfacePnfRequest.java +++ /dev/null @@ -1,142 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Properties; - -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.LagInterface; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class LagInterfacePnfRequest extends AAIRequest { - - // tenant (1602) - public static final String LAG_INTERFACE_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface"; - public static final String LAG_INTERFACE_QUERY_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface.query"; - public static final String PNF_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pnf"; - - private final String lag_interface_path; - private final String lag_interface_query_path; - - public static final String INTERFACE_NAME = "interface-name"; - public static final String LAG_INTERFACE_INTERFACE_NAME = "lag-interface.interface-name"; - public static final String PNF_NAME = "pnf-name"; - public static final String PNF_PNF_NAME = "pnf.pnf-name"; - - - public LagInterfacePnfRequest() { - lag_interface_path = configProperties.getProperty(PNF_PATH) + "/lag-interfaces/lag-interface/{interface-name}"; - lag_interface_query_path = configProperties.getProperty(LAG_INTERFACE_QUERY_PATH); - LoggerFactory.getLogger(LagInterfacePnfRequest.class).debug("org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface=\t" + lag_interface_path); - LoggerFactory.getLogger(LagInterfacePnfRequest.class).debug("org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface.query=\t" + lag_interface_query_path); - if(lag_interface_path == null) { - LoggerFactory.getLogger(LagInterfacePnfRequest.class).warn("org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface PATH not found in aaiclient.properties"); - } - } - - - @Override - public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - - String request_url = target_uri + lag_interface_path; - String encoded_vnf = null; - - String interfaceName = null; - - if(requestProperties.containsKey(INTERFACE_NAME)) { - interfaceName = requestProperties.getProperty(INTERFACE_NAME); - } else - if(requestProperties.containsKey(LAG_INTERFACE_INTERFACE_NAME)) { - interfaceName = requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME); - } - - encoded_vnf = encodeQuery(interfaceName); - request_url = request_url.replace("{interface-name}", encoded_vnf) ; - - request_url = processPnfRequestPathData(request_url,requestProperties); - - if(resourceVersion != null) { - request_url = request_url +"?resource-version="+resourceVersion; - } - URL http_req_url = new URL(request_url); - - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - aaiService.LOGwriteDateTrace("interface-name", interfaceName); - - return http_req_url; - } - - public static String processPnfRequestPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { - - String key = PNF_NAME; - if(requestProperties.containsKey(PNF_PNF_NAME)) { - key = PNF_PNF_NAME; - } - - if(!requestProperties.containsKey(key)) { - aaiService.logKeyError(String.format("%s,%s", PNF_NAME, PNF_PNF_NAME)); - } - - String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); - request_url = request_url.replace("{pnf-name}", encoded_vnf) ; - - return request_url; - } - - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - return this.getRequestUrl(method, null); - } - - - @Override - public String toJSONString() { - ObjectMapper mapper = getObjectMapper(); - LagInterface vnfc = (LagInterface)requestDatum; - String json_text = null; - try { - json_text = mapper.writeValueAsString(vnfc); - } catch (JsonProcessingException exc) { - handleException(this, exc); - return null; - } - return json_text; - } - - @Override - public String[] getArgsList() { - String[] args = {INTERFACE_NAME, LAG_INTERFACE_INTERFACE_NAME, PNF_PNF_NAME}; - - return args; - } - - @Override - public Class getModelClass() { - return LagInterface.class; - } -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequest.java index 1236971fc..af475d1fb 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequest.java @@ -60,7 +60,7 @@ public class NamedQueryRequest extends AAIRequest { @Override public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - String request_url = target_uri+named_search_path; + String request_url = targetUri+named_search_path; request_url = processPathData(request_url, requestProperties); diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequest.java index 17d5a0dce..f1d55fa99 100644 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/NodesQueryRequest.java @@ -71,7 +71,7 @@ public class NodesQueryRequest extends AAIRequest { @Override public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - String request_url = target_uri+nodes_search_path; + String request_url = targetUri+nodes_search_path; request_url = processPathData(request_url, requestProperties); diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PInterfacePnfRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PInterfacePnfRequest.java deleted file mode 100644 index 0d3c6f7ac..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PInterfacePnfRequest.java +++ /dev/null @@ -1,142 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Properties; - -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.PInterface; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class PInterfacePnfRequest extends AAIRequest { - - // tenant (1602) - public static final String PINTERFACE_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface"; - public static final String PINTERFACE_QUERY_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface.query"; - public static final String PNF_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pnf"; - - private final String pinterface_path; - private final String pinterface_query_path; - - public static final String INTERFACE_NAME = "interface-name"; - public static final String PINTERFACE_INTERFACE_NAME = "p-interface.interface-name"; - public static final String PNF_NAME = "pnf-name"; - public static final String PNF_PNF_NAME = "pnf.pnf-name"; - - - public PInterfacePnfRequest() { - pinterface_path = configProperties.getProperty(PNF_PATH) + "/p-interfaces/p-interface/{interface-name}"; - pinterface_query_path = configProperties.getProperty(PINTERFACE_QUERY_PATH); - LoggerFactory.getLogger(PInterfacePnfRequest.class).debug("org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface=\t" + pinterface_path); - LoggerFactory.getLogger(PInterfacePnfRequest.class).debug("org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface.query=\t" + pinterface_query_path); - if(pinterface_path == null) { - LoggerFactory.getLogger(PInterfacePnfRequest.class).warn("org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface PATH not found in aaiclient.properties"); - } - } - - - @Override - public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - - String request_url = target_uri + pinterface_path; - String encoded_vnf = null; - - String interfaceName = null; - - if(requestProperties.containsKey(INTERFACE_NAME)) { - interfaceName = requestProperties.getProperty(INTERFACE_NAME); - } else - if(requestProperties.containsKey(PINTERFACE_INTERFACE_NAME)) { - interfaceName = requestProperties.getProperty(PINTERFACE_INTERFACE_NAME); - } - - encoded_vnf = encodeQuery(interfaceName); - request_url = request_url.replace("{interface-name}", encoded_vnf) ; - - request_url = processPnfRequestPathData(request_url,requestProperties); - - if(resourceVersion != null) { - request_url = request_url +"?resource-version="+resourceVersion; - } - URL http_req_url = new URL(request_url); - - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - aaiService.LOGwriteDateTrace("interface-name", interfaceName); - - return http_req_url; - } - - public static String processPnfRequestPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { - - String key = PNF_NAME; - if(requestProperties.containsKey(PNF_PNF_NAME)) { - key = PNF_PNF_NAME; - } - - if(!requestProperties.containsKey(key)) { - aaiService.logKeyError(String.format("%s,%s", PNF_NAME, PNF_PNF_NAME)); - } - - String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); - request_url = request_url.replace("{pnf-name}", encoded_vnf) ; - - return request_url; - } - - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - return this.getRequestUrl(method, null); - } - - - @Override - public String toJSONString() { - ObjectMapper mapper = getObjectMapper(); - PInterface vnfc = (PInterface)requestDatum; - String json_text = null; - try { - json_text = mapper.writeValueAsString(vnfc); - } catch (JsonProcessingException exc) { - handleException(this, exc); - return null; - } - return json_text; - } - - @Override - public String[] getArgsList() { - String[] args = {INTERFACE_NAME, PINTERFACE_INTERFACE_NAME, PNF_NAME, PNF_PNF_NAME}; - - return args; - } - - @Override - public Class getModelClass() { - return PInterface.class; - } -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PInterfaceRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PInterfaceRequest.java deleted file mode 100644 index f5436d8fe..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PInterfaceRequest.java +++ /dev/null @@ -1,132 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; - -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.PInterface; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class PInterfaceRequest extends AAIRequest { - - // tenant (1602) - public static final String PINTERFACE_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface"; - public static final String PINTERFACE_QUERY_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface.query"; - - private final String pinterface_path; - private final String pinterface_query_path; - - public static final String HOSTNAME = "hostname"; - public static final String PSERVER_HOSTNAME = "pserver.hostname"; - public static final String INTERFACE_NAME = "interface-name"; - public static final String PINTERFACE_INTERFACE_NAME = "p-interface.interface-name"; - - - public PInterfaceRequest() { - pinterface_path = configProperties.getProperty(PINTERFACE_PATH); - pinterface_query_path = configProperties.getProperty(PINTERFACE_QUERY_PATH); - LoggerFactory.getLogger(PInterfaceRequest.class).debug("org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface=\t" + pinterface_path); - LoggerFactory.getLogger(PInterfaceRequest.class).debug("org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface.query=\t" + pinterface_query_path); - if(pinterface_path == null) { - LoggerFactory.getLogger(PInterfaceRequest.class).warn("org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface PATH not found in aaiclient.properties"); - } - } - - - @Override - public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - - String request_url = target_uri + pinterface_path; - String encoded_vnf = null; - - String hostname = null; - String interfaceName = null; - - if(requestProperties.containsKey(HOSTNAME)) { - hostname = requestProperties.getProperty(HOSTNAME); - } - if(requestProperties.containsKey(PSERVER_HOSTNAME)) { - hostname = requestProperties.getProperty(PSERVER_HOSTNAME); - } - - if(requestProperties.containsKey(INTERFACE_NAME)) { - interfaceName = requestProperties.getProperty(INTERFACE_NAME); - } - if(requestProperties.containsKey(PINTERFACE_INTERFACE_NAME)) { - interfaceName = requestProperties.getProperty(PINTERFACE_INTERFACE_NAME); - } - - encoded_vnf = encodeQuery(hostname); - request_url = request_url.replace("{hostname}", encoded_vnf) ; - - encoded_vnf = encodeQuery(interfaceName); - request_url = request_url.replace("{interface-name}", encoded_vnf) ; - - if(resourceVersion != null) { - request_url = request_url +"?resource-version="+resourceVersion; - } - URL http_req_url = new URL(request_url); - - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - aaiService.LOGwriteDateTrace("hostname", hostname); - aaiService.LOGwriteDateTrace("interface-name", hostname); - - return http_req_url; - } - - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - return this.getRequestUrl(method, null); - } - - - @Override - public String toJSONString() { - ObjectMapper mapper = getObjectMapper(); - PInterface vnfc = (PInterface)requestDatum; - String json_text = null; - try { - json_text = mapper.writeValueAsString(vnfc); - } catch (JsonProcessingException exc) { - handleException(this, exc); - return null; - } - return json_text; - } - - @Override - public String[] getArgsList() { - String[] args = {HOSTNAME, PSERVER_HOSTNAME, INTERFACE_NAME, PINTERFACE_INTERFACE_NAME}; - return args; - } - - @Override - public Class getModelClass() { - return PInterface.class; - } -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PathRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PathRequest.java index 608f2f491..cab601ac8 100644 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PathRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PathRequest.java @@ -44,7 +44,7 @@ public class PathRequest extends AAIRequest { @Override public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - String request_url = target_uri + "{resource-path}"; + String request_url = targetUri + "{resource-path}"; String encoded_vnf = requestProperties.getProperty(RESOURCE_PATH); request_url = request_url.replace("{resource-path}", encoded_vnf) ; diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PhysicalLinkRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PhysicalLinkRequest.java deleted file mode 100644 index 11e0a7824..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/PhysicalLinkRequest.java +++ /dev/null @@ -1,112 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; - -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.PhysicalLink; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class PhysicalLinkRequest extends AAIRequest { - - // physical link - public static final String PHYSICAL_LINK_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.physical.link"; - public static final String PHYSICAL_LINK_QUERY_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.physical.link.query"; - - private final String physical_link_path; - private final String physical_link_query_path; - - public static final String LINK_NAME = "link-name"; - public static final String PHYSICAL_LINK_NAME = "physical-link.link-name"; - - - public PhysicalLinkRequest() { - physical_link_path = configProperties.getProperty(PHYSICAL_LINK_PATH); - physical_link_query_path = configProperties.getProperty(PHYSICAL_LINK_QUERY_PATH); - } - - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - return this.getRequestUrl(method, null); - } - - @Override - public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - - String request_url = target_uri+physical_link_path; - - String linkName = null; - if(requestProperties.containsKey(LINK_NAME)) { - linkName = requestProperties.getProperty(LINK_NAME); - } - - if(requestProperties.containsKey(PHYSICAL_LINK_NAME)) { - linkName = requestProperties.getProperty(PHYSICAL_LINK_NAME); - } - - - String encoded_vnf = encodeQuery(linkName); - request_url = request_url.replace("{link-name}", encoded_vnf) ; - - if(resourceVersion != null) { - request_url = request_url +"?resource-version="+resourceVersion; - } - URL http_req_url = new URL(request_url); - - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - aaiService.LOGwriteDateTrace("link-name", linkName); - - return http_req_url; - } - - - @Override - public String toJSONString() { - ObjectMapper mapper = getObjectMapper(); - PhysicalLink vpe = (PhysicalLink)requestDatum; - String json_text = null; - try { - json_text = mapper.writeValueAsString(vpe); - } catch (JsonProcessingException exc) { - handleException(this, exc); - return null; - } - return json_text; - } - - @Override - public String[] getArgsList() { - String[] args = {LINK_NAME, PHYSICAL_LINK_NAME}; - - return args; - } - - @Override - public Class getModelClass() { - return PhysicalLink.class; - } -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipRequest.java index 61efc7a5e..2b1ce3f08 100644 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/RelationshipRequest.java @@ -81,7 +81,7 @@ public class RelationshipRequest extends AAIRequest { @Override public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - String request_url = target_uri+relationship_query_path; + String request_url = targetUri+relationship_query_path; String encoded_vnf = encodeQuery(requestProperties.getProperty(RELATIONSHIP_KEY)); request_url = request_url.replace("{tenant-name}", encoded_vnf) ; URL http_req_url = new URL(request_url); diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SelfLinkRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SelfLinkRequest.java index fb1f1aec4..1e9915a0d 100644 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SelfLinkRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SelfLinkRequest.java @@ -52,7 +52,7 @@ public class SelfLinkRequest extends AAIRequest { try { URI uri = new URI(request_url); if(uri.getHost() == null) { - request_url = target_uri + request_url; + request_url = targetUri + request_url; } } catch(Exception exc) { LOG.error("SelfLinkRequest.getRequestUrl", exc); diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SubInterfaceRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SubInterfaceRequest.java deleted file mode 100644 index af7bb184e..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/SubInterfaceRequest.java +++ /dev/null @@ -1,184 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Properties; - -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.openecomp.aai.inventory.v11.LInterface; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class SubInterfaceRequest extends AAIRequest { - - // tenant (1602) - public static final String PNF_LAGINTERFACE_SUBINTERFACE_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pnf.lag.interface.subinterface"; - public static final String PNF_LAGINTERFACE_SUBINTERFACE_QUERY_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pnf.lag.interface.subinterface.query"; - - public static final String PNF_P_INTERFACE_SUBINTERFACE_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pnf.p.interface.l.interface"; - public static final String PNF_P_INTERFACE_SUBINTERFACE_QUERY_PATH = "org.onap.ccsdk.sli.adaptors.aai.path.pnf.p.interface.l.interface.query"; - - private final String pnf_laginterface_subinterface_path; - private final String pnf_laginterface_subinterface_query_path; - private final String pnf_p_interface_subinterface_path; - private final String pnf_p_interface_subinterface_query_path; - - public static final String SUBINTERFACE_INTERFACE_NAME = "l-interface.interface-name"; - public static final String LAG_INTERFACE_INTERFACE_NAME = "lag-interface.interface-name"; - public static final String PNF_PNF_NAME = "pnf.pnf-name"; - public static enum TYPE { L2_BRIDGE_BGF, L2_BRIDGE_SBG}; - - private final TYPE type; - - public SubInterfaceRequest(TYPE type) { - this.type = type; - - pnf_laginterface_subinterface_path = configProperties.getProperty(PNF_LAGINTERFACE_SUBINTERFACE_PATH); - pnf_laginterface_subinterface_query_path = configProperties.getProperty(PNF_LAGINTERFACE_SUBINTERFACE_QUERY_PATH); - - pnf_p_interface_subinterface_path = configProperties.getProperty(PNF_P_INTERFACE_SUBINTERFACE_PATH); - pnf_p_interface_subinterface_query_path = configProperties.getProperty(PNF_P_INTERFACE_SUBINTERFACE_QUERY_PATH); - } - - - @Override - public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { - - String request_url = null; - String encoded_vnf = null; - - String pnfname = null; - String interfaceName = null; - - if(type == TYPE.L2_BRIDGE_SBG) { - request_url = target_uri + pnf_laginterface_subinterface_path; - - if(requestProperties.containsKey(PNF_PNF_NAME)) { - pnfname = requestProperties.getProperty(PNF_PNF_NAME); - encoded_vnf = encodeQuery(pnfname); - request_url = request_url.replace("{pnf-name}", encoded_vnf); - } - - encoded_vnf = encodeQuery(requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME)); - request_url = request_url.replace("{lag-interface.interface-name}", encoded_vnf) ; - - - interfaceName = requestProperties.getProperty(SUBINTERFACE_INTERFACE_NAME); - encoded_vnf = encodeQuery(interfaceName); - request_url = request_url.replace("{interface-name}", encoded_vnf) ; - - } - if(type == TYPE.L2_BRIDGE_BGF) { - request_url = target_uri + pnf_p_interface_subinterface_path; - - if(requestProperties.containsKey(PNF_PNF_NAME)) { - pnfname = requestProperties.getProperty(PNF_PNF_NAME); - encoded_vnf = encodeQuery(pnfname); - request_url = request_url.replace("{pnf-name}", encoded_vnf); - } - - encoded_vnf = encodeQuery(requestProperties.getProperty(PInterfaceRequest.PINTERFACE_INTERFACE_NAME)); - request_url = request_url.replace("{p-interface.interface-name}", encoded_vnf) ; - - - interfaceName = requestProperties.getProperty(SUBINTERFACE_INTERFACE_NAME); - encoded_vnf = encodeQuery(interfaceName); - request_url = request_url.replace("{interface-name}", encoded_vnf) ; - } - - - if(resourceVersion != null) { - request_url = request_url +"?resource-version="+resourceVersion; - } - URL http_req_url = new URL(request_url); - - aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); - - if(pnfname != null) - aaiService.LOGwriteDateTrace("pnf-name", pnfname); - if(requestProperties.containsKey(LAG_INTERFACE_INTERFACE_NAME)) { - aaiService.LOGwriteDateTrace("lag-interface.interface-name", requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME)); - } - if(requestProperties.containsKey(PInterfaceRequest.PINTERFACE_INTERFACE_NAME)) { - aaiService.LOGwriteDateTrace("p-interface.interface-name", requestProperties.getProperty(PInterfaceRequest.PINTERFACE_INTERFACE_NAME)); - } - aaiService.LOGwriteDateTrace("interface-name", interfaceName); - - return http_req_url; - } - - @Override - public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { - return this.getRequestUrl(method, null); - } - - - @Override - public String toJSONString() { - ObjectMapper mapper = getObjectMapper(); - LInterface vnfc = (LInterface)requestDatum; - String json_text = null; - try { - json_text = mapper.writeValueAsString(vnfc); - } catch (JsonProcessingException exc) { - handleException(this, exc); - return null; - } - return json_text; - } - - - @Override - public String[] getArgsList() { - String[] args = {}; - if(type == TYPE.L2_BRIDGE_SBG) { - String[] tmpArray = {SUBINTERFACE_INTERFACE_NAME, LAG_INTERFACE_INTERFACE_NAME, PNF_PNF_NAME}; - args = tmpArray; - } - if(type == TYPE.L2_BRIDGE_BGF) { - String[] tmpArray = {SUBINTERFACE_INTERFACE_NAME, PInterfaceRequest.PINTERFACE_INTERFACE_NAME, PNF_PNF_NAME}; - args = tmpArray; - } - - return args; - } - - @Override - public Class getModelClass() { - return LInterface.class; - } - - @Override - public String getPrimaryResourceName(String resource) { - return "sub-interface"; - } - - public static final String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { - String interfaceName = requestProperties.getProperty(SUBINTERFACE_INTERFACE_NAME); - request_url = request_url.replace("{interface-name}", encodeQuery(interfaceName)) ; - return request_url; - } -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Flavor.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Flavor.java deleted file mode 100644 index ad2291608..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Flavor.java +++ /dev/null @@ -1,122 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai.data.v1507; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@Generated("org.jsonschema2pojo") -@JsonPropertyOrder({ - "flavorId", - "flavorName", - "flavorLink" -}) -public class Flavor { - - @JsonProperty("flavorId") - private String flavorId; - @JsonProperty("flavorName") - private String flavorName; - @JsonProperty("flavorLink") - private String flavorLink; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - /** - * - * @return - * The flavorId - */ - @JsonProperty("flavorId") - public String getFlavorId() { - return flavorId; - } - - /** - * - * @param flavorId - * The flavorId - */ - @JsonProperty("flavorId") - public void setFlavorId(String flavorId) { - this.flavorId = flavorId; - } - - /** - * - * @return - * The flavorName - */ - @JsonProperty("flavorName") - public String getFlavorName() { - return flavorName; - } - - /** - * - * @param flavorName - * The flavorName - */ - @JsonProperty("flavorName") - public void setFlavorName(String flavorName) { - this.flavorName = flavorName; - } - - /** - * - * @return - * The flavorLink - */ - @JsonProperty("flavorLink") - public String getFlavorLink() { - return flavorLink; - } - - /** - * - * @param flavorLink - * The flavorLink - */ - @JsonProperty("flavorLink") - public void setFlavorLink(String flavorLink) { - this.flavorLink = flavorLink; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Host.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Host.java deleted file mode 100644 index 7a2d2027e..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Host.java +++ /dev/null @@ -1,122 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai.data.v1507; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@Generated("org.jsonschema2pojo") -@JsonPropertyOrder({ - "hostId", - "hostname", - "hostLoc" -}) -public class Host { - - @JsonProperty("hostId") - private String hostId; - @JsonProperty("hostname") - private String hostname; - @JsonProperty("hostLoc") - private String hostLoc; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - /** - * - * @return - * The hostId - */ - @JsonProperty("hostId") - public String getHostId() { - return hostId; - } - - /** - * - * @param hostId - * The hostId - */ - @JsonProperty("hostId") - public void setHostId(String hostId) { - this.hostId = hostId; - } - - /** - * - * @return - * The hostname - */ - @JsonProperty("hostname") - public String getHostname() { - return hostname; - } - - /** - * - * @param hostname - * The hostname - */ - @JsonProperty("hostname") - public void setHostname(String hostname) { - this.hostname = hostname; - } - - /** - * - * @return - * The hostLoc - */ - @JsonProperty("hostLoc") - public String getHostLoc() { - return hostLoc; - } - - /** - * - * @param hostLoc - * The hostLoc - */ - @JsonProperty("hostLoc") - public void setHostLoc(String hostLoc) { - this.hostLoc = hostLoc; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Image.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Image.java deleted file mode 100644 index 7451b41e1..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Image.java +++ /dev/null @@ -1,237 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai.data.v1507; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@Generated("org.jsonschema2pojo") -@JsonPropertyOrder({ - "imageId", - "imageName", - "osType", - "osVersion", - "application", - "applicationVersion", - "applicationVendor", - "imageLink" -}) -public class Image { - - @JsonProperty("imageId") - private String imageId; - @JsonProperty("imageName") - private String imageName; - @JsonProperty("osType") - private String osType; - @JsonProperty("osVersion") - private String osVersion; - @JsonProperty("application") - private String application; - @JsonProperty("applicationVersion") - private String applicationVersion; - @JsonProperty("applicationVendor") - private String applicationVendor; - @JsonProperty("imageLink") - private String imageLink; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - /** - * - * @return - * The imageId - */ - @JsonProperty("imageId") - public String getImageId() { - return imageId; - } - - /** - * - * @param imageId - * The imageId - */ - @JsonProperty("imageId") - public void setImageId(String imageId) { - this.imageId = imageId; - } - - /** - * - * @return - * The imageName - */ - @JsonProperty("imageName") - public String getImageName() { - return imageName; - } - - /** - * - * @param imageName - * The imageName - */ - @JsonProperty("imageName") - public void setImageName(String imageName) { - this.imageName = imageName; - } - - /** - * - * @return - * The osType - */ - @JsonProperty("osType") - public String getOsType() { - return osType; - } - - /** - * - * @param osType - * The osType - */ - @JsonProperty("osType") - public void setOsType(String osType) { - this.osType = osType; - } - - /** - * - * @return - * The osVersion - */ - @JsonProperty("osVersion") - public String getOsVersion() { - return osVersion; - } - - /** - * - * @param osVersion - * The osVersion - */ - @JsonProperty("osVersion") - public void setOsVersion(String osVersion) { - this.osVersion = osVersion; - } - - /** - * - * @return - * The application - */ - @JsonProperty("application") - public String getApplication() { - return application; - } - - /** - * - * @param application - * The application - */ - @JsonProperty("application") - public void setApplication(String application) { - this.application = application; - } - - /** - * - * @return - * The applicationVersion - */ - @JsonProperty("applicationVersion") - public String getApplicationVersion() { - return applicationVersion; - } - - /** - * - * @param applicationVersion - * The applicationVersion - */ - @JsonProperty("applicationVersion") - public void setApplicationVersion(String applicationVersion) { - this.applicationVersion = applicationVersion; - } - - /** - * - * @return - * The applicationVendor - */ - @JsonProperty("applicationVendor") - public String getApplicationVendor() { - return applicationVendor; - } - - /** - * - * @param applicationVendor - * The applicationVendor - */ - @JsonProperty("applicationVendor") - public void setApplicationVendor(String applicationVendor) { - this.applicationVendor = applicationVendor; - } - - /** - * - * @return - * The imageLink - */ - @JsonProperty("imageLink") - public String getImageLink() { - return imageLink; - } - - /** - * - * @param imageLink - * The imageLink - */ - @JsonProperty("imageLink") - public void setImageLink(String imageLink) { - this.imageLink = imageLink; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/IpAddress.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/IpAddress.java deleted file mode 100644 index 65800e4fb..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/IpAddress.java +++ /dev/null @@ -1,168 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai.data.v1507; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@Generated("org.jsonschema2pojo") -@JsonPropertyOrder({ - "addrId", - "addr", - "version", - "type", - "networkName" -}) -public class IpAddress { - - @JsonProperty("addrId") - private String addrId; - @JsonProperty("addr") - private String addr; - @JsonProperty("version") - private String version; - @JsonProperty("type") - private String type; - @JsonProperty("networkName") - private String networkName; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - /** - * - * @return - * The addrId - */ - @JsonProperty("addrId") - public String getAddrId() { - return addrId; - } - - /** - * - * @param addrId - * The addrId - */ - @JsonProperty("addrId") - public void setAddrId(String addrId) { - this.addrId = addrId; - } - - /** - * - * @return - * The addr - */ - @JsonProperty("addr") - public String getAddr() { - return addr; - } - - /** - * - * @param addr - * The addr - */ - @JsonProperty("addr") - public void setAddr(String addr) { - this.addr = addr; - } - - /** - * - * @return - * The version - */ - @JsonProperty("version") - public String getVersion() { - return version; - } - - /** - * - * @param version - * The version - */ - @JsonProperty("version") - public void setVersion(String version) { - this.version = version; - } - - /** - * - * @return - * The type - */ - @JsonProperty("type") - public String getType() { - return type; - } - - /** - * - * @param type - * The type - */ - @JsonProperty("type") - public void setType(String type) { - this.type = type; - } - - /** - * - * @return - * The networkName - */ - @JsonProperty("networkName") - public String getNetworkName() { - return networkName; - } - - /** - * - * @param networkName - * The networkName - */ - @JsonProperty("networkName") - public void setNetworkName(String networkName) { - this.networkName = networkName; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Relationship.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Relationship.java deleted file mode 100644 index 329571acf..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/Relationship.java +++ /dev/null @@ -1,147 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai.data.v1507; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@Generated("org.jsonschema2pojo") -@JsonPropertyOrder({ - "relatedTo", - "relatedLink", - "relationshipData", - "any" -}) -public class Relationship { - - @JsonProperty("relatedTo") - private String relatedTo; - @JsonProperty("relatedLink") - private String relatedLink; - @JsonProperty("relationshipData") - private List relationshipData = new ArrayList(); - @JsonProperty("any") - private List any = new ArrayList(); - @JsonIgnore - private Map additionalProperties = new HashMap(); - - /** - * - * @return - * The relatedTo - */ - @JsonProperty("relatedTo") - public String getRelatedTo() { - return relatedTo; - } - - /** - * - * @param relatedTo - * The relatedTo - */ - @JsonProperty("relatedTo") - public void setRelatedTo(String relatedTo) { - this.relatedTo = relatedTo; - } - - /** - * - * @return - * The relatedLink - */ - @JsonProperty("relatedLink") - public String getRelatedLink() { - return relatedLink; - } - - /** - * - * @param relatedLink - * The relatedLink - */ - @JsonProperty("relatedLink") - public void setRelatedLink(String relatedLink) { - this.relatedLink = relatedLink; - } - - /** - * - * @return - * The relationshipData - */ - @JsonProperty("relationshipData") - public List getRelationshipData() { - return relationshipData; - } - - /** - * - * @param relationshipData - * The relationshipData - */ - @JsonProperty("relationshipData") - public void setRelationshipData(List relationshipData) { - this.relationshipData = relationshipData; - } - - /** - * - * @return - * The any - */ - @JsonProperty("any") - public List getAny() { - return any; - } - - /** - * - * @param any - * The any - */ - @JsonProperty("any") - public void setAny(List any) { - this.any = any; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipDatum.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipDatum.java deleted file mode 100644 index 8e9675289..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipDatum.java +++ /dev/null @@ -1,124 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai.data.v1507; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@Generated("org.jsonschema2pojo") -@JsonPropertyOrder({ - "relationshipKey", - "relationshipValue", - "any" -}) -public class RelationshipDatum { - - @JsonProperty("relationshipKey") - private String relationshipKey; - @JsonProperty("relationshipValue") - private String relationshipValue; - @JsonProperty("any") - private List any = new ArrayList(); - @JsonIgnore - private Map additionalProperties = new HashMap(); - - /** - * - * @return - * The relationshipKey - */ - @JsonProperty("relationshipKey") - public String getRelationshipKey() { - return relationshipKey; - } - - /** - * - * @param relationshipKey - * The relationshipKey - */ - @JsonProperty("relationshipKey") - public void setRelationshipKey(String relationshipKey) { - this.relationshipKey = relationshipKey; - } - - /** - * - * @return - * The relationshipValue - */ - @JsonProperty("relationshipValue") - public String getRelationshipValue() { - return relationshipValue; - } - - /** - * - * @param relationshipValue - * The relationshipValue - */ - @JsonProperty("relationshipValue") - public void setRelationshipValue(String relationshipValue) { - this.relationshipValue = relationshipValue; - } - - /** - * - * @return - * The any - */ - @JsonProperty("any") - public List getAny() { - return any; - } - - /** - * - * @param any - * The any - */ - @JsonProperty("any") - public void setAny(List any) { - this.any = any; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipList.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipList.java deleted file mode 100644 index 81126baf0..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/RelationshipList.java +++ /dev/null @@ -1,101 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai.data.v1507; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@Generated("org.jsonschema2pojo") -@JsonPropertyOrder({ - "relationship", - "any" -}) -public class RelationshipList { - - @JsonProperty("relationship") - private List relationship = new ArrayList(); - @JsonProperty("any") - private List any = new ArrayList(); - @JsonIgnore - private Map additionalProperties = new HashMap(); - - /** - * - * @return - * The relationship - */ - @JsonProperty("relationship") - public List getRelationship() { - return relationship; - } - - /** - * - * @param relationship - * The relationship - */ - @JsonProperty("relationship") - public void setRelationship(List relationship) { - this.relationship = relationship; - } - - /** - * - * @return - * The any - */ - @JsonProperty("any") - public List getAny() { - return any; - } - - /** - * - * @param any - * The any - */ - @JsonProperty("any") - public void setAny(List any) { - this.any = any; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/VServer.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/VServer.java deleted file mode 100644 index 623c19ab7..000000000 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/data/v1507/VServer.java +++ /dev/null @@ -1,262 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * 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.ccsdk.sli.adaptors.aai.data.v1507; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@Generated("org.jsonschema2pojo") -@JsonPropertyOrder({ - "vmId", - "vmName", - "vmName2", - "host", - "image", - "flavor", - "ipAddresses", - "vserverLink", - "relationshipList" -}) -public class VServer { - - @JsonProperty("vmId") - private String vmId; - @JsonProperty("vmName") - private String vmName; - @JsonProperty("vmName2") - private String vmName2; - @JsonProperty("host") - private Host host; - @JsonProperty("image") - private Image image; - @JsonProperty("flavor") - private Flavor flavor; - @JsonProperty("ipAddresses") - private List ipAddresses = new ArrayList(); - @JsonProperty("vserverLink") - private String vserverLink; - @JsonProperty("relationshipList") - private RelationshipList relationshipList; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - /** - * - * @return - * The vmId - */ - @JsonProperty("vmId") - public String getVmId() { - return vmId; - } - - /** - * - * @param vmId - * The vmId - */ - @JsonProperty("vmId") - public void setVmId(String vmId) { - this.vmId = vmId; - } - - /** - * - * @return - * The vmName - */ - @JsonProperty("vmName") - public String getVmName() { - return vmName; - } - - /** - * - * @param vmName - * The vmName - */ - @JsonProperty("vmName") - public void setVmName(String vmName) { - this.vmName = vmName; - } - - /** - * - * @return - * The vmName2 - */ - @JsonProperty("vmName2") - public String getVmName2() { - return vmName2; - } - - /** - * - * @param vmName2 - * The vmName2 - */ - @JsonProperty("vmName2") - public void setVmName2(String vmName2) { - this.vmName2 = vmName2; - } - - /** - * - * @return - * The host - */ - @JsonProperty("host") - public Host getHost() { - return host; - } - - /** - * - * @param host - * The host - */ - @JsonProperty("host") - public void setHost(Host host) { - this.host = host; - } - - /** - * - * @return - * The image - */ - @JsonProperty("image") - public Image getImage() { - return image; - } - - /** - * - * @param image - * The image - */ - @JsonProperty("image") - public void setImage(Image image) { - this.image = image; - } - - /** - * - * @return - * The flavor - */ - @JsonProperty("flavor") - public Flavor getFlavor() { - return flavor; - } - - /** - * - * @param flavor - * The flavor - */ - @JsonProperty("flavor") - public void setFlavor(Flavor flavor) { - this.flavor = flavor; - } - - /** - * - * @return - * The ipAddresses - */ - @JsonProperty("ipAddresses") - public List getIpAddresses() { - return ipAddresses; - } - - /** - * - * @param ipAddresses - * The ipAddresses - */ - @JsonProperty("ipAddresses") - public void setIpAddresses(List ipAddresses) { - this.ipAddresses = ipAddresses; - } - - /** - * - * @return - * The vserverLink - */ - @JsonProperty("vserverLink") - public String getVserverLink() { - return vserverLink; - } - - /** - * - * @param vserverLink - * The vserverLink - */ - @JsonProperty("vserverLink") - public void setVserverLink(String vserverLink) { - this.vserverLink = vserverLink; - } - - /** - * - * @return - * The relationshipList - */ - @JsonProperty("relationshipList") - public RelationshipList getRelationshipList() { - return relationshipList; - } - - /** - * - * @param relationshipList - * The relationshipList - */ - @JsonProperty("relationshipList") - public void setRelationshipList(RelationshipList relationshipList) { - this.relationshipList = relationshipList; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequestTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequestTest.java new file mode 100755 index 000000000..4195d8485 --- /dev/null +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/EchoRequestTest.java @@ -0,0 +1,110 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * 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.ccsdk.sli.adaptors.aai; + +import static org.junit.Assert.assertNotNull; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; +import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class EchoRequestTest { + + private static final Logger LOG = LoggerFactory.getLogger(EchoRequestTest.class); + + protected static AAIRequest request; + + @BeforeClass + public static void setUp() throws Exception { + request = new EchoRequest(); + LOG.info("\nEchoRequestTest.setUp\n"); + } + + @AfterClass + public static void tearDown() throws Exception { + request = null; + LOG.info("----------------------- EchoRequestTest.tearDown -----------------------"); + } + + @Test + public void runGetRequestUrlTest() { + LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); + + URL url; + try { + url = request.getRequestUrl("GET", null); + assertNotNull(url); + } catch (UnsupportedEncodingException | MalformedURLException exc) { + LOG.error("Failed test", exc); + } + + } + + @Test + public void runToJSONStringTest() { + LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); + + try { + String json = request.toJSONString(); + + } catch (Exception exc) { + LOG.error("Failed test", exc); + } + + } + + @Test + public void runGetArgsListTest() { + LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); + + try { + String[] args = request.getArgsList(); + assertNotNull(args); + } catch (Exception exc) { + LOG.error("Failed test", exc); + } + + } + + @Test + public void runGetModelTest() { + LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); + + try { + Class clazz = request.getModelClass(); + assertNotNull(clazz); + } catch (Exception exc) { + LOG.error("Failed test", exc); + } + + } +} diff --git a/aai-service/provider/src/test/resources/aaiclient.properties b/aai-service/provider/src/test/resources/aaiclient.properties index 35dec548a..fb9a52feb 100755 --- a/aai-service/provider/src/test/resources/aaiclient.properties +++ b/aai-service/provider/src/test/resources/aaiclient.properties @@ -40,7 +40,8 @@ org.onap.ccsdk.sli.adaptors.aai.application=CCSDK # # Configuration file for A&AI Client # -org.onap.ccsdk.sli.adaptors.aai.uri=https://aai.api.simpledemo.openecomp.org:8443 +#org.onap.ccsdk.sli.adaptors.aai.uri=https://aai.api.simpledemo.openecomp.org:8443 +org.onap.ccsdk.sli.adaptors.aai.uri=https://aai-int2.test.att.com:8443 # connection.timeout=60000 -- cgit 1.2.3-korg