diff options
Diffstat (limited to 'aai-service/provider')
11 files changed, 205 insertions, 199 deletions
diff --git a/aai-service/provider/pom.xml b/aai-service/provider/pom.xml index 441143263..cbf161d6f 100755 --- a/aai-service/provider/pom.xml +++ b/aai-service/provider/pom.xml @@ -1,157 +1,168 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.onap.ccsdk.parent</groupId> - <artifactId>binding-parent</artifactId> - <version>1.2.0-SNAPSHOT</version> - <relativePath /> - </parent> + <parent> + <groupId>org.onap.ccsdk.parent</groupId> + <artifactId>binding-parent</artifactId> + <version>1.2.1-SNAPSHOT</version> + <relativePath/> + </parent> - <groupId>org.onap.ccsdk.sli.adaptors</groupId> - <artifactId>aai-service-provider</artifactId> - <version>0.4.0-SNAPSHOT</version> - <packaging>bundle</packaging> + <groupId>org.onap.ccsdk.sli.adaptors</groupId> + <artifactId>aai-service-provider</artifactId> + <version>0.4.1-SNAPSHOT</version> + <packaging>bundle</packaging> - <name>ccsdk-sli-adaptors :: aai-service :: ${project.artifactId}</name> - <url>http://maven.apache.org</url> + <name>ccsdk-sli-adaptors :: aai-service :: ${project.artifactId}</name> + <url>http://maven.apache.org</url> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <ccsdk.sli.adaptors.version>${project.version}</ccsdk.sli.adaptors.version> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-core-artifacts</artifactId> + <version>${ccsdk.sli.core.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.onap.ccsdk.sli.core</groupId> - <artifactId>sli-common</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.onap.ccsdk.sli.core</groupId> - <artifactId>sli-provider</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.onap.ccsdk.sli.core</groupId> - <artifactId>utils-provider</artifactId> - <version>${sdnctl.sli.version}</version> - </dependency> - <dependency> - <groupId>org.osgi</groupId> - <artifactId>org.osgi.core</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - </dependency> - <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-client</artifactId> - </dependency> - <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpcore</artifactId> - <version>${apache.httpcomponents.core.version}</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>${apache.httpcomponents.client.version}</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.module</groupId> - <artifactId>jackson-module-jaxb-annotations</artifactId> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-core</artifactId> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-common</artifactId> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-provider</artifactId> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>utils-provider</artifactId> + <version>${sdnctl.sli.version}</version> + </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.core</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + </dependency> + <dependency> + <groupId>com.sun.jersey</groupId> + <artifactId>jersey-client</artifactId> + </dependency> + <dependency> + <groupId>com.sun.jersey</groupId> + <artifactId>jersey-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore</artifactId> + <version>${apache.httpcomponents.core.version}</version> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>${apache.httpcomponents.client.version}</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.module</groupId> + <artifactId>jackson-module-jaxb-annotations</artifactId> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annotations</artifactId> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </dependency> - <dependency> - <groupId>org.jsoup</groupId> - <artifactId>jsoup</artifactId> - <version>1.8.3</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>4.3.5.RELEASE</version> - <scope>test</scope> - </dependency> - </dependencies> + <dependency> + <groupId>org.jsoup</groupId> + <artifactId>jsoup</artifactId> + <version>1.8.3</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>4.3.5.RELEASE</version> + <scope>test</scope> + </dependency> + </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.jvnet.jaxb2.maven2</groupId> - <artifactId>maven-jaxb2-plugin</artifactId> - <version>0.13.1</version> - <executions> - <execution> - <id>gen-xjc</id> - <goals> - <goal>generate</goal> - </goals> - </execution> - </executions> - <configuration> - <schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory> - <schemaIncludes> - <value>aai_schema_v14.xsd</value> - </schemaIncludes> - <bindingIncludes> - <include>aai-schema-bindings.xjb</include> - </bindingIncludes> - <generateDirectory>${project.build.directory}/generated-sources/main/java</generateDirectory> - <generatePackage>org.onap.aai.inventory.v14</generatePackage> - <extension>true</extension> - <args> - <arg>-Xannotate</arg> - </args> - <plugins> - <plugin> - <groupId>org.jvnet.jaxb2_commons</groupId> - <artifactId>jaxb2-basics-annotate</artifactId> - <version>0.6.4</version> - </plugin> - </plugins> - </configuration> - </plugin> - </plugins> - </build> + <build> + <plugins> + <plugin> + <groupId>org.jvnet.jaxb2.maven2</groupId> + <artifactId>maven-jaxb2-plugin</artifactId> + <version>0.13.1</version> + <executions> + <execution> + <id>gen-xjc</id> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + <configuration> + <schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory> + <schemaIncludes> + <value>aai_schema_v14.xsd</value> + </schemaIncludes> + <bindingIncludes> + <include>aai-schema-bindings.xjb</include> + </bindingIncludes> + <generateDirectory>${project.build.directory}/generated-sources/main/java</generateDirectory> + <generatePackage>org.onap.aai.inventory.v14</generatePackage> + <extension>true</extension> + <args> + <arg>-Xannotate</arg> + </args> + <plugins> + <plugin> + <groupId>org.jvnet.jaxb2_commons</groupId> + <artifactId>jaxb2-basics-annotate</artifactId> + <version>0.6.4</version> + </plugin> + </plugins> + </configuration> + </plugin> + </plugins> + </build> </project> diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java index cf1392f67..a3aecda14 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIClientRESTExecutor.java @@ -44,7 +44,6 @@ import java.security.NoSuchAlgorithmException; import java.text.SimpleDateFormat; import java.util.Properties; -import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; @@ -82,6 +81,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface { private String userPassword; private final String applicationId; private static final String HTTP_URL_CONNECTION_RESULT="HttpURLConnection result: {} : {}"; + private static final String ENTRY_DOESNT_EXIST="Entry does not exist."; /** * class Constructor @@ -281,7 +281,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface { LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, responseMessage, mapper.writeValueAsString(response)); } } else if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) { - LOGwriteEndingTrace(responseCode, responseMessage, "Entry does not exist."); + LOGwriteEndingTrace(responseCode, responseMessage, ENTRY_DOESNT_EXIST); ErrorResponse errorresponse = null; try { errorresponse = mapper.readValue(reader, ErrorResponse.class); @@ -289,7 +289,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface { errorresponse = new ErrorResponse(); RequestError requestError = new RequestError(); ServiceException serviceException = new ServiceException(); - serviceException.setText("Entry does not exist."); + serviceException.setText(ENTRY_DOESNT_EXIST); requestError.setServiceException(serviceException); errorresponse.setRequestError(requestError ); } @@ -501,7 +501,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface { LOGwriteEndingTrace(responseCode, responseMessage, stringBuilder.toString()); response = true; } else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND ) { - LOGwriteEndingTrace(responseCode, responseMessage, "Entry does not exist."); + LOGwriteEndingTrace(responseCode, responseMessage, ENTRY_DOESNT_EXIST); response = false; } else { ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); @@ -574,7 +574,7 @@ public class AAIClientRESTExecutor implements AAIExecutorInterface { response = mapper.readValue(reader, clas); LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, "SUCCESS", mapper.writeValueAsString(response)); } else if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) { - LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist."); + LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", ENTRY_DOESNT_EXIST); return response; } else { BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java index 4a3f92360..20f926569 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIDeclarations.java @@ -147,6 +147,8 @@ public abstract class AAIDeclarations implements AAIClient { protected abstract Logger getLogger(); public abstract AAIExecutorInterface getExecutor(); + + private static final String RELATIONSHIP_DATA= "Retrofitting relationship data: "; @Override @@ -891,7 +893,7 @@ public abstract class AAIDeclarations implements AAIClient { AAIServiceUtils.populateRelationshipDataFromPath(list); } } catch(Exception exc) { - getLogger().debug("Retrofiting relationship data: " + exc.getMessage()); + getLogger().debug(RELATIONSHIP_DATA + exc.getMessage()); } String preFix; @@ -1226,7 +1228,7 @@ public abstract class AAIDeclarations implements AAIClient { try { getRelationshipListMethod = resourceClass.getMethod("getRelationshipList"); } catch(Exception exc) { - getLogger().debug("Retrofiting relationship data: " + exc.getMessage()); + getLogger().debug(RELATIONSHIP_DATA + exc.getMessage()); } if(getRelationshipListMethod != null){ @@ -1509,7 +1511,7 @@ public abstract class AAIDeclarations implements AAIClient { try { getRelationshipListMethod = resourceClass.getMethod("getRelationshipList"); } catch(Exception exc) { - getLogger().debug("Retrofiting relationship data: " + exc.getMessage()); + getLogger().debug(RELATIONSHIP_DATA + exc.getMessage()); } if(getRelationshipListMethod != null){ try { @@ -1798,7 +1800,7 @@ public abstract class AAIDeclarations implements AAIClient { try { getRelationshipListMethod = resourceClass.getMethod("getRelationshipList"); } catch(Exception exc) { - getLogger().debug("Retrofiting relationship data: " + exc.getMessage()); + getLogger().debug(RELATIONSHIP_DATA + exc.getMessage()); } if(getRelationshipListMethod != null){ try { 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 baceffab3..c66ae06f4 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 @@ -5,6 +5,8 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -292,7 +294,7 @@ public abstract class AAIRequest { // for group search add itself, but remove singular version of itself if(!uniqueResources.contains(resource)) { boolean replaced = false; - Set<String> tmpUniqueResources = new HashSet<String>(); + Set<String> tmpUniqueResources = new HashSet<>(); tmpUniqueResources.addAll(uniqueResources); for(String item : tmpUniqueResources){ String plural = item +"s"; @@ -431,8 +433,7 @@ public abstract class AAIRequest { if(clazz == null) { return null; } - GenericRequest request = new GenericRequest(clazz); - return request; + return new GenericRequest(clazz); } public static Map<String, String> splitQuery(String query) throws UnsupportedEncodingException { diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceUtils.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceUtils.java index 6af9f9cd6..6c48c63dd 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceUtils.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIServiceUtils.java @@ -5,6 +5,8 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -153,7 +155,7 @@ public class AAIServiceUtils { String term1 = null; String op = null; String term2 = null; - HashMap<String, String> results = new HashMap<String, String>(); + HashMap<String, String> results = new HashMap<>(); for (int i = 0; i < keyTerms.length; i++) { if (term1 == null) { @@ -267,7 +269,7 @@ public class AAIServiceUtils { } protected static HashMap<String,String> pathToHashMap(String path) { - HashMap<String, String> nameValues = new HashMap<String, String>(); + HashMap<String, String> nameValues = new HashMap<>(); String[] split = path.split("/"); 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 fb2345056..6011858d0 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright (C) 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,14 +68,14 @@ public class EchoRequest extends AAIRequest { public String toJSONString() { ObjectMapper mapper = getObjectMapper(); EchoResponse tenant = (EchoResponse)requestDatum; - String json_text = null; + String jsonText = null; try { - json_text = mapper.writeValueAsString(tenant); + jsonText = mapper.writeValueAsString(tenant); } catch (JsonProcessingException exc) { handleException(this, exc); return null; } - return json_text; + return jsonText; } 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 515359602..35f190e52 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 @@ -5,6 +5,8 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -104,19 +106,19 @@ public class GenericQueryRequest extends AAIRequest { String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); request_url = request_url.replace("{identifier}", encoded_vnf) ; - aaiService.LOGwriteDateTrace("identifier", requestProperties.getProperty(key)); + aaiService.LOGwriteDateTrace(IDENTIFIER, requestProperties.getProperty(key)); key = VALUE; encoded_vnf = encodeQuery(requestProperties.getProperty(key)); request_url = request_url.replace("{value}", encoded_vnf) ; - aaiService.LOGwriteDateTrace("value", requestProperties.getProperty(key)); + aaiService.LOGwriteDateTrace(VALUE, requestProperties.getProperty(key)); key = START_NODE_TYPE; encoded_vnf = encodeQuery(requestProperties.getProperty(key)); request_url = request_url.replace("{start-node-type}", encoded_vnf) ; - aaiService.LOGwriteDateTrace("start-node-type", requestProperties.getProperty(key)); + aaiService.LOGwriteDateTrace(START_NODE_TYPE, requestProperties.getProperty(key)); return request_url; } diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java index 7987aefc2..458248462 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/GenericRequest.java @@ -5,6 +5,8 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,7 +20,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - + package org.onap.ccsdk.sli.adaptors.aai; import java.io.UnsupportedEncodingException; @@ -70,7 +72,7 @@ public class GenericRequest extends AAIRequest { String request_url = getRequestPath(resourceName); - Map<String, String> queryParams = new HashMap<String, String> (); + Map<String, String> queryParams = new HashMap<> (); if(resourceVersion != null) { queryParams.put("resource-version", resourceVersion.toString()); } 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 691ae27a3..d1995f04f 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 @@ -5,6 +5,8 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -107,7 +109,7 @@ public class NamedQueryRequest extends AAIRequest { if(innerChild != null) { if(innerChild instanceof ObjectNode) { ObjectNode on = ObjectNode.class.cast(innerChild); - List<String> namesToDelete = new ArrayList<String>(); + List<String> namesToDelete = new ArrayList<>(); Iterator<String> names = on.fieldNames(); while(names.hasNext()) { String name = names.next(); @@ -125,7 +127,7 @@ public class NamedQueryRequest extends AAIRequest { if(innerChild != null) { if(innerChild instanceof ObjectNode) { ObjectNode on = ObjectNode.class.cast(innerChild); - List<String> namesToDelete = new ArrayList<String>(); + List<String> namesToDelete = new ArrayList<>(); Iterator<String> names = on.fieldNames(); while(names.hasNext()) { String name = names.next(); @@ -143,7 +145,7 @@ public class NamedQueryRequest extends AAIRequest { if(innerChild != null) { if(innerChild instanceof ObjectNode) { ObjectNode on = ObjectNode.class.cast(innerChild); - List<String> namesToDelete = new ArrayList<String>(); + List<String> namesToDelete = new ArrayList<>(); Iterator<String> names = on.fieldNames(); while(names.hasNext()) { String name = names.next(); @@ -194,7 +196,7 @@ public class NamedQueryRequest extends AAIRequest { if(requestProperties.containsKey(key)) { encoded_vnf = encodeQuery(requestProperties.getProperty(key)); request_url = request_url.replace("{named-query-uuid}", encoded_vnf) ; - aaiService.LOGwriteDateTrace("named-query-uuid", requestProperties.getProperty(key)); + aaiService.LOGwriteDateTrace(NAMED_QUERY_UUID, requestProperties.getProperty(key)); } key = PREFIX; @@ -202,7 +204,7 @@ public class NamedQueryRequest extends AAIRequest { if(requestProperties.containsKey(key)) { encoded_vnf = encodeQuery(requestProperties.getProperty(key)); request_url = request_url.replace("{prefix}", encoded_vnf) ; - aaiService.LOGwriteDateTrace("prefix", requestProperties.getProperty(key)); + aaiService.LOGwriteDateTrace(PREFIX, requestProperties.getProperty(key)); } return request_url; 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 0099e933d..dafc4a70c 100755 --- 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 @@ -5,6 +5,8 @@ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -48,26 +50,6 @@ public class NodesQueryRequest extends AAIRequest { } -// @Override -// public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { -// -// String request_url = targetUri+generic_search_path; -// String key = START_NODE_TYPE; -// -// String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); -// request_url = request_url.replace("{vnf-id}", 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()); -// -// -// return http_req_url; -// } - @Override public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { @@ -125,7 +107,7 @@ public class NodesQueryRequest extends AAIRequest { String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); request_url = request_url.replace("{entity-identifier}", encoded_vnf) ; - aaiService.LOGwriteDateTrace("entity-identifier", requestProperties.getProperty(key)); + aaiService.LOGwriteDateTrace(ENTITY_IDENTIFIER, requestProperties.getProperty(key)); key = ENTITY_VALUE; @@ -137,7 +119,7 @@ public class NodesQueryRequest extends AAIRequest { encoded_vnf = encodeQuery(requestProperties.getProperty(key)); request_url = request_url.replace("{node-type}", encoded_vnf) ; - aaiService.LOGwriteDateTrace("node-type", requestProperties.getProperty(key)); + aaiService.LOGwriteDateTrace(NODE_TYPE, requestProperties.getProperty(key)); return request_url; } diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/UpdateRequest.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/UpdateRequest.java index 789c13164..8ecc0b3ea 100755 --- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/UpdateRequest.java +++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/UpdateRequest.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights * reserved. + * Modifications Copyright (C) 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,7 +84,7 @@ public class UpdateRequest extends AAIRequest { request.requestProperties.put(key, value); } - public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + public static String processPathData(String requestUrl, Properties requestProperties) { // if(request != null) { // Class<?> clazz = request.getClass(); @@ -97,7 +98,7 @@ public class UpdateRequest extends AAIRequest { // } // request.processPathData(request_url, requestProperties); - return request_url; + return requestUrl; } public void processRequestPathValues(Map<String, String> nameValues) { |