aboutsummaryrefslogtreecommitdiffstats
path: root/aai-core
diff options
context:
space:
mode:
Diffstat (limited to 'aai-core')
-rw-r--r--aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java35
-rw-r--r--aai-core/src/main/java/org/onap/aai/config/RestBeanConfig.java31
-rw-r--r--aai-core/src/main/java/org/onap/aai/config/SchemaConfiguration.java26
-rw-r--r--aai-core/src/main/java/org/onap/aai/config/SwaggerGenerationConfiguration.java43
4 files changed, 67 insertions, 68 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java b/aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java
index e0ce203d..aa4ec1a1 100644
--- a/aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java
+++ b/aai-core/src/main/java/org/onap/aai/config/IntrospectionConfig.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright © 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
@@ -35,23 +37,22 @@ import org.onap.aai.nodes.NodeIngestor;
@Configuration
public class IntrospectionConfig {
- private Map<SchemaVersion, MoxyLoader> MOXYINSTANCEMAP = new ConcurrentHashMap<>();
- @Autowired
- NodeIngestor nodeIngestor;
+ private Map<SchemaVersion, MoxyLoader> moxyInstanceMap = new ConcurrentHashMap<>();
+ @Autowired
+ NodeIngestor nodeIngestor;
- @Bean
- public LoaderFactory loaderFactory(SchemaVersions schemaVersions) {
- LoaderFactory loaderFactory = new LoaderFactory(moxyLoaderInstance(schemaVersions));
- return loaderFactory;
- }
+ @Bean
+ public LoaderFactory loaderFactory(SchemaVersions schemaVersions) {
+ return new LoaderFactory(moxyLoaderInstance(schemaVersions));
+ }
- @Bean
- public Map<SchemaVersion, MoxyLoader> moxyLoaderInstance(SchemaVersions schemaVersions) {
- for(SchemaVersion version : schemaVersions.getVersions()){
- if (!MOXYINSTANCEMAP.containsKey(version)) {
- MOXYINSTANCEMAP.put(version, new MoxyLoader(version, nodeIngestor));
- }
- }
- return MOXYINSTANCEMAP;
- }
+ @Bean
+ public Map<SchemaVersion, MoxyLoader> moxyLoaderInstance(SchemaVersions schemaVersions) {
+ for(SchemaVersion version : schemaVersions.getVersions()){
+ if (!moxyInstanceMap.containsKey(version)) {
+ moxyInstanceMap.put(version, new MoxyLoader(version, nodeIngestor));
+ }
+ }
+ return moxyInstanceMap;
+ }
}
diff --git a/aai-core/src/main/java/org/onap/aai/config/RestBeanConfig.java b/aai-core/src/main/java/org/onap/aai/config/RestBeanConfig.java
index 29763291..6c56ff69 100644
--- a/aai-core/src/main/java/org/onap/aai/config/RestBeanConfig.java
+++ b/aai-core/src/main/java/org/onap/aai/config/RestBeanConfig.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright © 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
@@ -31,21 +33,18 @@ import org.springframework.context.annotation.Scope;
@Configuration
public class RestBeanConfig {
- @Bean(name = "traversalUriHttpEntry")
- @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
- public HttpEntry traversalUriHttpEntry() {
- HttpEntry httpEntry = new HttpEntry(ModelType.MOXY, QueryStyle.TRAVERSAL_URI);
- return httpEntry;
- }
-
- @Bean(name = "traversalHttpEntry")
- @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
- public HttpEntry traversalHttpEntry() {
- HttpEntry httpEntry = new HttpEntry(ModelType.MOXY, QueryStyle.TRAVERSAL);
-
- return httpEntry;
- }
-
-
+ @Bean(name = "traversalUriHttpEntry")
+ @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+ public HttpEntry traversalUriHttpEntry() {
+ return new HttpEntry(ModelType.MOXY, QueryStyle.TRAVERSAL_URI);
+ }
+
+ @Bean(name = "traversalHttpEntry")
+ @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+ public HttpEntry traversalHttpEntry() {
+ return new HttpEntry(ModelType.MOXY, QueryStyle.TRAVERSAL);
+ }
+
+
}
diff --git a/aai-core/src/main/java/org/onap/aai/config/SchemaConfiguration.java b/aai-core/src/main/java/org/onap/aai/config/SchemaConfiguration.java
index 20112bde..b00ecfb7 100644
--- a/aai-core/src/main/java/org/onap/aai/config/SchemaConfiguration.java
+++ b/aai-core/src/main/java/org/onap/aai/config/SchemaConfiguration.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright © 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
@@ -43,20 +45,18 @@ public class SchemaConfiguration {
return new EdgeSerializer(edgeIngestor);
}
- @Bean(name = "nodeIngestor")
- public NodeIngestor nodeIngestor(ConfigTranslator configTranslator) {
- NodeIngestor nodeIngestor = new NodeIngestor(configTranslator);
- return nodeIngestor;
- }
+ @Bean(name = "nodeIngestor")
+ public NodeIngestor nodeIngestor(ConfigTranslator configTranslator) {
+ return new NodeIngestor(configTranslator);
+ }
- @Bean(name = "configTranslator")
- public ConfigTranslator configTranslator(SchemaLocationsBean schemaLocationsBean, SchemaVersions schemaVersions) {
- ConfigTranslator aaiConfigTranslator = new AAIConfigTranslator(schemaLocationsBean, schemaVersions);
- return aaiConfigTranslator;
- }
+ @Bean(name = "configTranslator")
+ public ConfigTranslator configTranslator(SchemaLocationsBean schemaLocationsBean, SchemaVersions schemaVersions) {
+ return new AAIConfigTranslator(schemaLocationsBean, schemaVersions);
+ }
- @Bean
- public SchemaErrorStrategy schemaErrorStrategy(){
+ @Bean
+ public SchemaErrorStrategy schemaErrorStrategy(){
return new CheckEverythingStrategy();
- }
+ }
}
diff --git a/aai-core/src/main/java/org/onap/aai/config/SwaggerGenerationConfiguration.java b/aai-core/src/main/java/org/onap/aai/config/SwaggerGenerationConfiguration.java
index a09018ad..fbbb703a 100644
--- a/aai-core/src/main/java/org/onap/aai/config/SwaggerGenerationConfiguration.java
+++ b/aai-core/src/main/java/org/onap/aai/config/SwaggerGenerationConfiguration.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright © 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
@@ -35,28 +37,25 @@ import org.springframework.context.annotation.Scope;
@Configuration
public class SwaggerGenerationConfiguration {
- @Value("${schema.uri.base.path}")
- private String basePath;
+ @Value("${schema.uri.base.path}")
+ private String basePath;
- @Bean
- @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
- public NodesYAMLfromOXM nodesYamlFromOXM(SchemaVersions schemaVersions, NodeIngestor nodeIngestor, EdgeIngestor edgeIngestor) {
- NodesYAMLfromOXM nodesYamlFromOXM = new NodesYAMLfromOXM(basePath, schemaVersions, nodeIngestor, edgeIngestor);
- return nodesYamlFromOXM;
- }
-
- @Bean
- @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
- public HTMLfromOXM htmlFromOXM(SchemaVersions schemaVersions, NodeIngestor nodeIngestor, EdgeIngestor edgeIngestor) {
- HTMLfromOXM htmlFromOXM = new HTMLfromOXM(schemaVersions, nodeIngestor, edgeIngestor);
- return htmlFromOXM;
- }
-
- @Bean
- @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
- public YAMLfromOXM yamlFromOXM(SchemaVersions schemaVersions, NodeIngestor nodeIngestor, EdgeIngestor edgeIngestor) {
- YAMLfromOXM yamlFromOXM = new YAMLfromOXM(basePath, schemaVersions, nodeIngestor, edgeIngestor);
- return yamlFromOXM;
- }
+ @Bean
+ @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+ public NodesYAMLfromOXM nodesYamlFromOXM(SchemaVersions schemaVersions, NodeIngestor nodeIngestor, EdgeIngestor edgeIngestor) {
+ return new NodesYAMLfromOXM(basePath, schemaVersions, nodeIngestor, edgeIngestor);
+ }
+
+ @Bean
+ @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+ public HTMLfromOXM htmlFromOXM(SchemaVersions schemaVersions, NodeIngestor nodeIngestor, EdgeIngestor edgeIngestor) {
+ return new HTMLfromOXM(schemaVersions, nodeIngestor, edgeIngestor);
+ }
+
+ @Bean
+ @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+ public YAMLfromOXM yamlFromOXM(SchemaVersions schemaVersions, NodeIngestor nodeIngestor, EdgeIngestor edgeIngestor) {
+ return new YAMLfromOXM(basePath, schemaVersions, nodeIngestor, edgeIngestor);
+ }
}