diff options
author | 2022-11-10 11:03:00 +0000 | |
---|---|---|
committer | 2022-11-10 11:03:00 +0000 | |
commit | f8c058b2be718ab825f88e10e43ed59d5ca75de2 (patch) | |
tree | 7078532cf899cc9d618345aac2c865e233663e01 /aai-schema-service/src/main | |
parent | a8e838713d168e7cd81c9765d5e5a56b88e48def (diff) |
Reduce the number of problems in schema-service
Issue-ID: AAI-3590
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: I7a5d3e5a4db75efb8a8fcc6c8598d6cab80dca4a
Diffstat (limited to 'aai-schema-service/src/main')
5 files changed, 9 insertions, 15 deletions
diff --git a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/SchemaServiceApp.java b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/SchemaServiceApp.java index 291e0a6..1cc7a36 100644 --- a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/SchemaServiceApp.java +++ b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/SchemaServiceApp.java @@ -20,9 +20,6 @@ package org.onap.aai.schemaservice; -import java.util.Map; -import java.util.UUID; - import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; @@ -31,7 +28,6 @@ import org.onap.aai.exceptions.AAIException; import org.onap.aai.schemaservice.config.PropertyPasswordConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -41,7 +37,6 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerA import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.core.env.Environment; -import org.springframework.web.context.request.RequestContextListener; @SpringBootApplication // Component Scan provides a way to look for spring beans diff --git a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/config/PropertyPasswordConfiguration.java b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/config/PropertyPasswordConfiguration.java index 2292577..bd8ce6e 100644 --- a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/config/PropertyPasswordConfiguration.java +++ b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/config/PropertyPasswordConfiguration.java @@ -24,6 +24,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.charset.Charset; import java.util.LinkedHashMap; import java.util.Map; import java.util.Properties; @@ -61,7 +62,7 @@ public class PropertyPasswordConfiguration try (InputStream passwordStream = new FileInputStream(passwordFile)) { String keystorePassword = null; - keystorePassword = IOUtils.toString(passwordStream); + keystorePassword = IOUtils.toString(passwordStream, Charset.defaultCharset()); if (keystorePassword != null) { keystorePassword = keystorePassword.trim(); sslProps.put("server.ssl.key-store-password", keystorePassword); diff --git a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/interceptors/post/InvalidResponseStatus.java b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/interceptors/post/InvalidResponseStatus.java index 5f80b2b..5a09615 100644 --- a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/interceptors/post/InvalidResponseStatus.java +++ b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/interceptors/post/InvalidResponseStatus.java @@ -25,12 +25,10 @@ import java.util.ArrayList; import java.util.List; import javax.annotation.Priority; -import javax.print.attribute.standard.Media; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.container.ContainerResponseContext; import javax.ws.rs.container.ContainerResponseFilter; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.UriInfo; import org.onap.aai.exceptions.AAIException; import org.onap.aai.logging.ErrorLogHelper; diff --git a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/NodeIngestor.java b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/NodeIngestor.java index e7b9167..ad39e49 100644 --- a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/NodeIngestor.java +++ b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/nodeschema/NodeIngestor.java @@ -20,6 +20,12 @@ package org.onap.aai.schemaservice.nodeschema; +import com.google.common.base.CaseFormat; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Multimap; + +import jakarta.xml.bind.JAXBException; + import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; @@ -58,12 +64,6 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import com.google.common.base.CaseFormat; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Multimap; - -import jakarta.xml.bind.JAXBException; - /** * NodeIngestor - ingests A&AI OXM files per given config, serves DynamicJAXBContext per version */ diff --git a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/web/JerseyConfiguration.java b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/web/JerseyConfiguration.java index 8b3a936..ad7e546 100644 --- a/aai-schema-service/src/main/java/org/onap/aai/schemaservice/web/JerseyConfiguration.java +++ b/aai-schema-service/src/main/java/org/onap/aai/schemaservice/web/JerseyConfiguration.java @@ -77,7 +77,7 @@ public class JerseyConfiguration extends ResourceConfig { // Check to ensure that each of the filter has the @Priority annotation and if not throw // exception - for (Class filterClass : filters) { + for (Class<?> filterClass : filters) { if (filterClass.getAnnotation(Priority.class) == null) { throw new RuntimeException("Container filter " + filterClass.getName() + " does not have @Priority annotation"); |