aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authormark.j.leonard <mark.j.leonard@gmail.com>2019-03-05 16:07:33 +0000
committermark.j.leonard <mark.j.leonard@gmail.com>2019-03-05 16:07:33 +0000
commit4e828f7f2037735de2253a0dcc2b557c88c15cd3 (patch)
tree6edfed8873ff91f1225ffe38796892ea8695d95c /src/main
parentf5dae47e293ae63a7a2f18230b772a699a52566f (diff)
Fix checkstyle warnings and formatting
Add Javadoc and make cosmetic changes to prevent Checkstyle messages Change-Id: Ibab7be42d6a01b181cdb625b6b34d580658c7046 Issue-ID: AAI-2212 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/aai/auth/AAIAuthException.java7
-rw-r--r--src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java11
-rw-r--r--src/main/java/org/onap/aai/auth/FileWatcher.java5
-rw-r--r--src/main/java/org/onap/aai/babel/BabelApplication.java8
-rw-r--r--src/main/java/org/onap/aai/babel/csar/CsarToXmlConverter.java7
-rw-r--r--src/main/java/org/onap/aai/babel/parser/ArtifactGeneratorToscaParser.java13
-rw-r--r--src/main/java/org/onap/aai/babel/service/GenerateArtifactsServiceImpl.java9
-rw-r--r--src/main/java/org/onap/aai/babel/xml/generator/api/AaiArtifactGenerator.java2
-rw-r--r--src/main/java/org/onap/aai/babel/xml/generator/model/Model.java17
-rw-r--r--src/main/java/org/onap/aai/babel/xml/generator/model/Service.java5
-rw-r--r--src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java5
-rw-r--r--src/main/resources/babel-logging-resources.properties37
12 files changed, 69 insertions, 57 deletions
diff --git a/src/main/java/org/onap/aai/auth/AAIAuthException.java b/src/main/java/org/onap/aai/auth/AAIAuthException.java
index a29ee98..35adb5a 100644
--- a/src/main/java/org/onap/aai/auth/AAIAuthException.java
+++ b/src/main/java/org/onap/aai/auth/AAIAuthException.java
@@ -2,8 +2,8 @@
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,10 +18,11 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.auth;
public class AAIAuthException extends Exception {
- /** */
+
private static final long serialVersionUID = 1L;
public AAIAuthException(String string) {
diff --git a/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java b/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java
index ee5fb26..ddbc002 100644
--- a/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java
+++ b/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java
@@ -2,8 +2,8 @@
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.auth;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -60,11 +61,7 @@ public class AAIMicroServiceAuthCore {
private static String policyAuthFileName;
public enum HTTP_METHODS {
- GET,
- PUT,
- DELETE,
- HEAD,
- POST
+ GET, PUT, DELETE, HEAD, POST
}
// Don't instantiate
diff --git a/src/main/java/org/onap/aai/auth/FileWatcher.java b/src/main/java/org/onap/aai/auth/FileWatcher.java
index d974e66..9c4e04e 100644
--- a/src/main/java/org/onap/aai/auth/FileWatcher.java
+++ b/src/main/java/org/onap/aai/auth/FileWatcher.java
@@ -2,8 +2,8 @@
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.auth;
import java.io.File;
diff --git a/src/main/java/org/onap/aai/babel/BabelApplication.java b/src/main/java/org/onap/aai/babel/BabelApplication.java
index 0b0285b..267642e 100644
--- a/src/main/java/org/onap/aai/babel/BabelApplication.java
+++ b/src/main/java/org/onap/aai/babel/BabelApplication.java
@@ -2,8 +2,8 @@
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.babel;
import java.util.HashMap;
@@ -44,7 +45,8 @@ public class BabelApplication extends SpringBootServletInitializer {
throw new IllegalArgumentException("Env property KEY_STORE_PASSWORD not set");
}
HashMap<String, Object> props = new HashMap<>();
- String decryptedValue = keyStorePassword.startsWith(OBFS_PATTERN)? Password.deobfuscate(keyStorePassword) : keyStorePassword;
+ String decryptedValue =
+ keyStorePassword.startsWith(OBFS_PATTERN) ? Password.deobfuscate(keyStorePassword) : keyStorePassword;
props.put("server.ssl.key-store-password", decryptedValue);
String requireClientAuth = System.getenv("REQUIRE_CLIENT_AUTH");
diff --git a/src/main/java/org/onap/aai/babel/csar/CsarToXmlConverter.java b/src/main/java/org/onap/aai/babel/csar/CsarToXmlConverter.java
index 98db8ae..9e1ff6e 100644
--- a/src/main/java/org/onap/aai/babel/csar/CsarToXmlConverter.java
+++ b/src/main/java/org/onap/aai/babel/csar/CsarToXmlConverter.java
@@ -2,8 +2,8 @@
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.babel.csar;
import java.util.List;
@@ -53,7 +54,7 @@ public class CsarToXmlConverter {
* the name of the archive file
* @param version
* the version of the archive file
- * @return List<org.onap.sdc.generator.data.Artifact> a list of generated XML artifacts
+ * @return a list of generated XML artifacts
* @throws CsarConverterException
* if there is an error either extracting the YAML files or generating XML artifacts
*/
diff --git a/src/main/java/org/onap/aai/babel/parser/ArtifactGeneratorToscaParser.java b/src/main/java/org/onap/aai/babel/parser/ArtifactGeneratorToscaParser.java
index c79c2ef..ce1c352 100644
--- a/src/main/java/org/onap/aai/babel/parser/ArtifactGeneratorToscaParser.java
+++ b/src/main/java/org/onap/aai/babel/parser/ArtifactGeneratorToscaParser.java
@@ -112,8 +112,9 @@ public class ArtifactGeneratorToscaParser {
/**
* Initializes the Widget to UUID mapping configuration.
- *
+ *
* @throws IOException
+ * if an error occurs reading the configuration properties
*/
public static void initWidgetConfiguration() throws IOException {
log.debug("Getting Widget Configuration");
@@ -172,6 +173,7 @@ public class ArtifactGeneratorToscaParser {
* @param serviceNodeTemplate
* @return resources for which XML Models should be generated
* @throws XmlArtifactGenerationException
+ * if there is no configuration defined for a member Widget of an instance group
*/
public List<Resource> processInstanceGroups(Model resourceModel, NodeTemplate serviceNodeTemplate)
throws XmlArtifactGenerationException {
@@ -212,9 +214,13 @@ public class ArtifactGeneratorToscaParser {
}
/**
+ * Add the resource/widget to the specified model.
+ *
* @param model
* @param relation
+ * resource or widget model to add
* @throws XmlArtifactGenerationException
+ * if the relation is a widget and there is no configuration defined for the relation's widget type
*/
public void addRelatedModel(final Model model, final Resource relation) throws XmlArtifactGenerationException {
if (relation.isResource()) {
@@ -299,6 +305,7 @@ public class ArtifactGeneratorToscaParser {
* the properties of the Group
* @return the Instance Group and Member resource models
* @throws XmlArtifactGenerationException
+ * if there is no configuration defined for one of the member Widgets
*/
private List<Resource> processInstanceGroup(Model resourceModel, ArrayList<NodeTemplate> memberNodes,
Map<String, String> metaProperties, Map<String, Property> properties)
@@ -317,8 +324,10 @@ public class ArtifactGeneratorToscaParser {
/**
* @param memberNodes
* @param groupModel
- * @return
+ * @return a list of Resources
* @throws XmlArtifactGenerationException
+ * if a member node template is a widget and there is no configuration defined for that relation's
+ * widget type
*/
private List<Resource> generateResourcesAndWidgets(final ArrayList<NodeTemplate> memberNodes,
final Resource groupModel) throws XmlArtifactGenerationException {
diff --git a/src/main/java/org/onap/aai/babel/service/GenerateArtifactsServiceImpl.java b/src/main/java/org/onap/aai/babel/service/GenerateArtifactsServiceImpl.java
index 72d8ae2..8d89db9 100644
--- a/src/main/java/org/onap/aai/babel/service/GenerateArtifactsServiceImpl.java
+++ b/src/main/java/org/onap/aai/babel/service/GenerateArtifactsServiceImpl.java
@@ -2,8 +2,8 @@
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.babel.service;
import com.google.gson.Gson;
@@ -59,7 +60,9 @@ public class GenerateArtifactsServiceImpl implements GenerateArtifactsService {
private AAIMicroServiceAuth aaiMicroServiceAuth;
- /** @param authorization */
+ /**
+ * @param authorization
+ */
@Inject
public GenerateArtifactsServiceImpl(final AAIMicroServiceAuth authorization) {
this.aaiMicroServiceAuth = authorization;
diff --git a/src/main/java/org/onap/aai/babel/xml/generator/api/AaiArtifactGenerator.java b/src/main/java/org/onap/aai/babel/xml/generator/api/AaiArtifactGenerator.java
index 4415c47..75c5073 100644
--- a/src/main/java/org/onap/aai/babel/xml/generator/api/AaiArtifactGenerator.java
+++ b/src/main/java/org/onap/aai/babel/xml/generator/api/AaiArtifactGenerator.java
@@ -84,7 +84,7 @@ public class AaiArtifactGenerator implements ArtifactGenerator {
ArtifactGeneratorToscaParser.initWidgetConfiguration();
ArtifactGeneratorToscaParser.initToscaMappingsConfiguration(configLocation);
} catch (IOException e) {
- log.error(ApplicationMsgs.LOAD_PROPERTIES, e);
+ log.error(ApplicationMsgs.LOAD_PROPERTIES, e, configLocation);
return createErrorData(e);
}
diff --git a/src/main/java/org/onap/aai/babel/xml/generator/model/Model.java b/src/main/java/org/onap/aai/babel/xml/generator/model/Model.java
index 3c407bd..3f081df 100644
--- a/src/main/java/org/onap/aai/babel/xml/generator/model/Model.java
+++ b/src/main/java/org/onap/aai/babel/xml/generator/model/Model.java
@@ -18,6 +18,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.babel.xml.generator.model;
import java.util.Collections;
@@ -110,10 +111,10 @@ public abstract class Model {
protected Set<Widget> widgets = new HashSet<>();
/**
- * Gets the object (model) corresponding to the supplied TOSCA type.
+ * Gets the Resource Model corresponding to the supplied TOSCA type.
*
* @param toscaType
- * the tosca type
+ * the tosca type
* @return the model for the type, or null
*/
public static Resource getModelFor(String toscaType) {
@@ -142,9 +143,9 @@ public abstract class Model {
* information.
*
* @param toscaType
- * the TOSCA type
+ * the TOSCA type
* @param metaDataType
- * the type from the TOSCA metadata
+ * the type from the TOSCA metadata
* @return the model for the type, or null
*/
public static Resource getModelFor(String toscaType, String metaDataType) {
@@ -219,7 +220,7 @@ public abstract class Model {
* Gets widget version id.
*
* @return the widget version id
- * @throws XmlArtifactGenerationException
+ * @throws XmlArtifactGenerationException
*/
public String getWidgetId() throws XmlArtifactGenerationException {
return Widget.getWidget(getWidgetType()).getId();
@@ -229,17 +230,17 @@ public abstract class Model {
* Gets invariant id.
*
* @return the invariant id
- * @throws XmlArtifactGenerationException
+ * @throws XmlArtifactGenerationException
*/
public String getWidgetInvariantId() throws XmlArtifactGenerationException {
return Widget.getWidget(getWidgetType()).getWidgetId();
}
-
+
/**
* Populate model identification information.
*
* @param modelIdentInfo
- * the model ident info
+ * the model ident info
*/
public void populateModelIdentificationInformation(Map<String, String> modelIdentInfo) {
Iterator<String> iter = modelIdentInfo.keySet().iterator();
diff --git a/src/main/java/org/onap/aai/babel/xml/generator/model/Service.java b/src/main/java/org/onap/aai/babel/xml/generator/model/Service.java
index fe8ba04..8a9e428 100644
--- a/src/main/java/org/onap/aai/babel/xml/generator/model/Service.java
+++ b/src/main/java/org/onap/aai/babel/xml/generator/model/Service.java
@@ -2,8 +2,8 @@
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017-2018 European Software Marketing Ltd.
+ * Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2019 European Software Marketing Ltd.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.babel.xml.generator.model;
import java.util.Collections;
diff --git a/src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java b/src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java
index e66b06c..67fac05 100644
--- a/src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java
+++ b/src/main/java/org/onap/aai/babel/xml/generator/model/Widget.java
@@ -57,7 +57,7 @@ public class Widget extends Model {
* Copy Constructor
*
* @param baseWidget
- * @throws XmlArtifactGenerationException
+ * @throws XmlArtifactGenerationException
*/
public Widget(Widget baseWidget) throws XmlArtifactGenerationException {
this(baseWidget.getWidgetType(), baseWidget.getName(), baseWidget.getDeleteFlag());
@@ -75,7 +75,8 @@ public class Widget extends Model {
* @param type
* the type
* @return a new widget of the specified type
- * @throws XmlArtifactGenerationException
+ * @throws XmlArtifactGenerationException
+ * if there is no configuration defined for the specified type
*/
public static Widget getWidget(Type type) throws XmlArtifactGenerationException {
Widget widget = WidgetConfigurationUtil.createWidgetFromType(type);
diff --git a/src/main/resources/babel-logging-resources.properties b/src/main/resources/babel-logging-resources.properties
index 841bdaf..d749cd0 100644
--- a/src/main/resources/babel-logging-resources.properties
+++ b/src/main/resources/babel-logging-resources.properties
@@ -1,8 +1,8 @@
# ============LICENSE_START=======================================================
# org.onap.aai
# ================================================================================
-# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
-# Copyright © 2017-2018 European Software Marketing Ltd.
+# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2017-2019 European Software Marketing Ltd.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,27 +17,23 @@
# limitations under the License.
# ============LICENSE_END=========================================================
-#Resource key=Error Code|Message text|Resolution text |Description text
-#######
-#Newlines can be utilized to add some clarity ensuring continuing line
-#has at least one leading space
-#ResourceKey=\
+# Resource key=Error Code|Message text|Resolution text |Description text
+#
+# For example:
+# ResourceKey=\
# ERR0000E\
# Sample error msg txt\
# Sample resolution msg\
# Sample description txt
#
-######
-#Error code classification category
-#000 Info/Debug
-#100 Permission errors
-#200 Availability errors/Timeouts
-#300 Data errors
-#400 Schema Interface type/validation errors
-#500 Business process errors
-#900 Unknown errors
-#
-########################################################################
+# Error code classification category
+# 000 Info/Debug
+# 100 Permission errors
+# 200 Availability errors/Timeouts
+# 300 Data errors
+# 400 Schema Interface type/validation errors
+# 500 Business process errors
+# 900 Unknown errors
DISTRIBUTION_EVENT=\
BABEL0001I|\
@@ -92,6 +88,5 @@ TEMP_FILE_ERROR=\
LOAD_PROPERTIES=\
BABEL0013E|\
- Error loading properties: {0}|Correct the file contents|\
-
- \ No newline at end of file
+ Error loading properties: {0}|\
+ Correct the file contents|\