aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/aai/graphgraph/App.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/aai/graphgraph/App.java')
-rw-r--r--src/main/java/org/onap/aai/graphgraph/App.java62
1 files changed, 33 insertions, 29 deletions
diff --git a/src/main/java/org/onap/aai/graphgraph/App.java b/src/main/java/org/onap/aai/graphgraph/App.java
index ed1bb9a..1c6bc61 100644
--- a/src/main/java/org/onap/aai/graphgraph/App.java
+++ b/src/main/java/org/onap/aai/graphgraph/App.java
@@ -1,21 +1,21 @@
-/**
- * ============LICENSE_START=======================================================
- * org.onap.aai
- * ================================================================================
- * Copyright © 2019 Orange 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=========================================================
+/*
+ ============LICENSE_START=======================================================
+ org.onap.aai
+ ================================================================================
+ Copyright © 2019-2020 Orange 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.aai.graphgraph;
@@ -40,32 +40,35 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
@SpringBootApplication
-public class App{
+public class App {
+
public static EdgeIngestor edgeIngestor;
public static Map<String, MoxyLoader> moxyLoaders = new HashMap<>();
// TODO
// this should be used properly within Spring as this is a 'static' workaround due
// to some initialization issues. By all means feel free to improve and move it to Spring
- public static void loadSchemes(ConfigurableApplicationContext context){
+ public static void loadSchemes(ConfigurableApplicationContext context) {
String version;
for (int i = 10; i < 19; i++) {
version = "v" + i;
- moxyLoaders.put(version, new MoxyLoader(new SchemaVersion(version), (NodeIngestor) context.getBean("nodeIngestor")) );
+ moxyLoaders.put(version, new MoxyLoader(
+ new SchemaVersion(version), (NodeIngestor) context.getBean("nodeIngestor"))
+ );
}
}
- public static void main( String[] args ) throws IOException {
+ public static void main(String[] args) throws IOException {
ArgumentParser parser = new ArgumentParser().parseArguments(args);
- if (parser.isPrintHelp()){
+ if (parser.isPrintHelp()) {
parser.printHelp();
return;
}
- SpringApplication app = new SpringApplication(App.class);
+ SpringApplication app = new SpringApplication(App.class);
- if (parser.isRunLocally()){
+ if (parser.isRunLocally()) {
copyKeystore(app);
}
@@ -74,7 +77,7 @@ public class App{
loadSchemes(context);
edgeIngestor = (EdgeIngestor) context.getBean("edgeIngestor");
- if (parser.shoudGenerateUml()){
+ if (parser.shouldGenerateUrl()) {
writeExportedModel(exportModel(parser.getSchemaVersion()));
System.exit(0);
}
@@ -83,9 +86,10 @@ public class App{
private static void copyKeystore(SpringApplication app) throws IOException {
Path path = Paths.get("etc/auth/aai_keystore");
if (Files.notExists(path)) {
- FileUtils.copyInputStreamToFile(Objects
- .requireNonNull(app.getClassLoader().getResourceAsStream("etc/auth/aai_keystore")),
- path.toFile());
+ FileUtils.copyInputStreamToFile(
+ Objects.requireNonNull(app.getClassLoader().getResourceAsStream("etc/auth/aai_keystore")),
+ path.toFile()
+ );
}
}
}