Fix Checkstyle issues 12/85412/2
authorVidyashree Rama <vidyashree.rama@huawei.com>
Tue, 16 Apr 2019 05:22:51 +0000 (10:52 +0530)
committerVidyashree Rama <vidyashree.rama@huawei.com>
Tue, 16 Apr 2019 06:02:46 +0000 (11:32 +0530)
Fix Checkstyle issues

Issue-ID: CLAMP-328

Change-Id: Idecd87abbf3765a7e77e2219df1063e732bb04b0
Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
21 files changed:
src/main/java/org/onap/clamp/authorization/AuthorizationController.java
src/main/java/org/onap/clamp/clds/config/AAFConfiguration.java
src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java
src/main/java/org/onap/clamp/clds/config/ClampProperties.java
src/main/java/org/onap/clamp/clds/config/CldsUserJsonDecoder.java
src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java
src/main/java/org/onap/clamp/clds/config/PolicyConfiguration.java
src/main/java/org/onap/clamp/clds/config/SystemPropertiesLoader.java
src/main/java/org/onap/clamp/clds/config/sdc/BlueprintParserMappingConfiguration.java
src/main/java/org/onap/clamp/clds/config/sdc/SdcControllersConfiguration.java
src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java
src/main/java/org/onap/clamp/clds/dao/CldsServiceDataMapper.java
src/main/java/org/onap/clamp/clds/dao/ValueItemMapper.java
src/main/java/org/onap/clamp/clds/service/CldsHealthcheckService.java
src/main/java/org/onap/clamp/configuration/ClampGsonDataFormat.java
src/main/java/org/onap/clamp/dao/model/jsontype/JsonStringSqlTypeDescriptor.java
src/main/java/org/onap/clamp/dao/model/jsontype/JsonTypeDescriptor.java
src/main/java/org/onap/clamp/dao/model/jsontype/StringJsonUserType.java
src/main/java/org/onap/clamp/exception/OperationException.java
src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java

index 568af48..511b950 100644 (file)
@@ -76,7 +76,7 @@ public class AuthorizationController {
      * @param action
      *        The action of the permissions. e.g. read
      */
-    public void authorize (Exchange camelExchange, String typeVar, String instanceVar, String action) {
+    public void authorize(Exchange camelExchange, String typeVar, String instanceVar, String action) {
         String type = refProp.getStringValue(permPrefix + typeVar);
         String instance = refProp.getStringValue(permInstance);
 
@@ -123,7 +123,7 @@ public class AuthorizationController {
                   principalName, inPermission.getKey());
             authorized = true;
         } else if (hasRole(inPermission.getKeyAllAction())) {
-            auditLogger.info("{} authorized because user has permission with * for action: {}", 
+            auditLogger.info("{} authorized because user has permission with * for action: {}",
                   principalName, inPermission.getKey());
             authorized = true;
         } else {
@@ -133,7 +133,7 @@ public class AuthorizationController {
     }
 
     /**
-     * Verify whether the user has the permission
+     * Verify whether the user has the permission.
      *
      * @param inPermission
      *        The permissions to verify
index c91494d..99d64fd 100644 (file)
@@ -20,6 +20,7 @@
  * ===================================================================
  *
  */
+
 package org.onap.clamp.clds.config;
 
 import javax.servlet.Filter;
index f178ce0..3a98788 100644 (file)
@@ -19,6 +19,7 @@
  * ============LICENSE_END============================================
  * ===================================================================
  */
+
 package org.onap.clamp.clds.config;
 
 import org.apache.camel.CamelContext;
index 4f1e8a2..9905585 100644 (file)
@@ -155,8 +155,8 @@ public class ClampProperties {
     }
 
     /**
-     * 
-     * 
+     * Returns the list of strings split with separator.
+     *
      * @param key
      *        property key
      * @param separator
index 8af1286..602ee62 100644 (file)
@@ -53,6 +53,12 @@ public class CldsUserJsonDecoder {
         }
     }
 
+    /**
+     * This method decodes the JSON string to a CldsUser Array.
+     *
+     * @param cldsUsersString JSON string
+     * @return CldsUser[] Array containing a list of the user defined in the JSON
+     */
     public static CldsUser[] decodeJson(String cldsUsersString) {
         try {
             // the ObjectMapper readValue method closes the stream no need to do
index a99dde2..6ec2221 100644 (file)
@@ -86,7 +86,7 @@ public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter {
      * defined in cldsUsersFile variable (this file path can be configured in the
      * application.properties).
      *
-     * @param auth
+     * @param auth authentication manager builder
      */
     @Autowired
     public void configureGlobal(AuthenticationManagerBuilder auth) {
index cd89acb..a4f37e8 100644 (file)
@@ -113,6 +113,11 @@ public class PolicyConfiguration {
         this.policyEnvironment = environment;
     }
 
+    /**
+     * Returns policy configuration properties.
+     *
+     * @return policy configuration properties
+     */
     public Properties getProperties() {
         Properties prop = new Properties();
         prop.put(PDP_URL1, pdpUrl1);
index 093ad48..7480beb 100644 (file)
@@ -43,7 +43,7 @@ public class SystemPropertiesLoader implements ApplicationListener<ContextRefres
 
     @Override
     public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
-        logger.info("Loading additional JVM properties:"+myTranslator.toString());
+        logger.info("Loading additional JVM properties:" + myTranslator.toString());
         System.getProperties().putAll(myTranslator);
     }
 }
index 2f0e698..529753f 100644 (file)
@@ -43,7 +43,7 @@ import org.onap.clamp.clds.util.JsonUtils;
 public class BlueprintParserMappingConfiguration {
 
     private static final Type BLUEPRINT_MAP_CONF_TYPE = new TypeToken<List<BlueprintParserMappingConfiguration>>() {
-    }.getType();
+        }.getType();
     private String blueprintKey;
     private boolean dcaeDeployable;
     private BlueprintParserFilesConfiguration files;
index b21c75f..b7a7f0e 100644 (file)
@@ -63,11 +63,18 @@ public class SdcControllersConfiguration {
      */
     private JsonObject jsonRootNode;
 
+    /**
+     * Loads configuration from SDC controller config file.
+     *
+     * @throws IOException IO Exception
+     */
     @PostConstruct
     public void loadConfiguration() throws IOException {
         Resource resource = appContext.getResource(sdcControllerFile);
         // Try to load json tree
-        jsonRootNode = JsonUtils.GSON.fromJson(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8), JsonObject.class);
+        jsonRootNode = JsonUtils.GSON.fromJson(new InputStreamReader(
+                resource.getInputStream(), StandardCharsets.UTF_8),
+                                               JsonObject.class);
     }
 
     public SdcSingleControllerConfiguration getSdcSingleControllerConfiguration(String controllerName) {
index 564e01f..283d8c5 100644 (file)
@@ -81,7 +81,7 @@ public class SdcSingleControllerConfiguration implements IConfiguration {
     public static final String TOSCA_CSAR = "TOSCA_CSAR";
     public static final String VF_MODULES_METADATA = "VF_MODULES_METADATA";
     private static final String[] SUPPORTED_ARTIFACT_TYPES = {
-            TOSCA_CSAR, VF_MODULES_METADATA
+        TOSCA_CSAR, VF_MODULES_METADATA
     };
     public static final List<String> SUPPORTED_ARTIFACT_TYPES_LIST = Collections
             .unmodifiableList(Arrays.asList(SUPPORTED_ARTIFACT_TYPES));
@@ -105,6 +105,11 @@ public class SdcSingleControllerConfiguration implements IConfiguration {
         return sdcControllerName;
     }
 
+    /**
+     * Sets SDC controller name.
+     *
+     * @param controllerName SDC controller name
+     */
     public void setSdcControllerName(String controllerName) {
         this.sdcControllerName = controllerName;
         errorMessageKeyNotFound = " parameter cannot be found in config file for controller name" + sdcControllerName;
@@ -198,7 +203,8 @@ public class SdcSingleControllerConfiguration implements IConfiguration {
 
     @Override
     public boolean activateServerTLSAuth() {
-        if (jsonRootNode != null && jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH) != null && jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH).isJsonPrimitive()) {
+        if (jsonRootNode != null && jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH) != null &&
+                jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH).isJsonPrimitive()) {
             return jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH).getAsBoolean();
         } else {
             return false;
index 8e1c75b..e0a804e 100644 (file)
@@ -47,7 +47,7 @@ public class CldsConfiguration {
     private ClampProperties refProp;
 
     /**
-     * Clds Identity database DataSource configuration
+     * Clds Identity database DataSource configuration.
      *
      * @return
      */
index 4e0a50c..2fc0478 100644 (file)
@@ -39,7 +39,7 @@ import org.onap.clamp.clds.model.CldsVfcData;
 import org.springframework.jdbc.core.RowMapper;
 
 /**
- * Generic mapper for CldsDBServiceCache
+ * Generic mapper for CldsDBServiceCache.
  */
 public final class CldsServiceDataMapper implements RowMapper<CldsServiceData> {
 
index 4c3ff9d..599bef7 100644 (file)
@@ -30,7 +30,7 @@ import org.onap.clamp.clds.model.ValueItem;
 import org.springframework.jdbc.core.RowMapper;
 
 /**
- * Generic mapper for list of values
+ * Generic mapper for list of values.
  */
 public final class ValueItemMapper implements RowMapper<ValueItem> {
     @Override
index c25e6e7..1b0cca6 100644 (file)
@@ -19,6 +19,7 @@
  * ============LICENSE_END============================================
  * ===================================================================
  */
+
 package org.onap.clamp.clds.service;
 
 import com.att.eelf.configuration.EELFLogger;
@@ -46,7 +47,7 @@ public class CldsHealthcheckService {
     @Autowired
     private CldsDao cldsDao;
 
-    protected static final EELFLogger logger          = EELFManager.getInstance().getLogger(CldsHealthcheckService.class);
+    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(CldsHealthcheckService.class);
 
     /**
      * REST service that retrieves clds healthcheck information.
@@ -76,11 +77,13 @@ public class CldsHealthcheckService {
         }
         // audit log
         LoggingUtils.setTimeContext(startTime, new Date());
-        if(healthcheckFailed) {
-            util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "Healthcheck failed", Level.INFO, ONAPLogConstants.ResponseStatus.ERROR);
+        if (healthcheckFailed) {
+            util.exiting(HttpStatus.INTERNAL_SERVER_ERROR.toString(), "Healthcheck failed", Level.INFO,
+                         ONAPLogConstants.ResponseStatus.ERROR);
             return new ResponseEntity<>(cldsHealthCheck, HttpStatus.INTERNAL_SERVER_ERROR);
         } else {
-            util.exiting("200", "Healthcheck failed", Level.INFO, ONAPLogConstants.ResponseStatus.COMPLETED);
+            util.exiting("200", "Healthcheck failed", Level.INFO,
+                         ONAPLogConstants.ResponseStatus.COMPLETED);
             return new ResponseEntity<>(cldsHealthCheck, HttpStatus.OK);
         }
     }
index aad1ab4..c4d28be 100644 (file)
@@ -19,6 +19,7 @@
  * ============LICENSE_END============================================
  * ===================================================================
  */
+
 package org.onap.clamp.configuration;
 
 import com.google.gson.Gson;
@@ -50,7 +51,7 @@ public class ClampGsonDataFormat extends ServiceSupport implements DataFormat, D
     }
 
     /**
-     * Use the default Gson {@link Gson} and with a custom unmarshal type
+     * Use the default Gson {@link Gson} and with a custom unmarshal type.
      *
      * @param unmarshalType
      *        the custom unmarshal type
@@ -60,7 +61,7 @@ public class ClampGsonDataFormat extends ServiceSupport implements DataFormat, D
     }
 
     /**
-     * Use a custom Gson mapper and and unmarshal type
+     * Use a custom Gson mapper and and unmarshal type.
      *
      * @param gson
      *        the custom mapper
@@ -73,7 +74,7 @@ public class ClampGsonDataFormat extends ServiceSupport implements DataFormat, D
     }
 
     /**
-     * Use the default Gson {@link Gson} and with a custom unmarshal generic type
+     * Use the default Gson {@link Gson} and with a custom unmarshal generic type.
      *
      * @param unmarshalGenericType
      *        the custom unmarshal generic type
@@ -83,7 +84,7 @@ public class ClampGsonDataFormat extends ServiceSupport implements DataFormat, D
     }
 
     /**
-     * Use a custom Gson mapper and and unmarshal token type
+     * Use a custom Gson mapper and and unmarshal token type.
      *
      * @param gson
      *        the custom mapper
index 611f5ec..f5aba4e 100644 (file)
@@ -40,7 +40,7 @@ import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
 public class JsonStringSqlTypeDescriptor implements SqlTypeDescriptor {
 
     /**
-     *
+     * The serial version ID.
      */
     private static final long serialVersionUID = 1103168570216921981L;
 
index 155758e..518ec2d 100644 (file)
@@ -35,17 +35,20 @@ import org.onap.clamp.clds.util.JsonUtils;
 public class JsonTypeDescriptor extends AbstractTypeDescriptor<JsonObject> {
 
     /**
-     *
+     * The serial version ID.
      */
     private static final long serialVersionUID = -3439698221196089003L;
 
     public static final JsonTypeDescriptor INSTANCE = new JsonTypeDescriptor();
 
+    /**
+     * Creates an instance of JsonTypeDescriptor.
+     */
     public JsonTypeDescriptor() {
         super(JsonObject.class, new ImmutableMutabilityPlan<JsonObject>() {
 
             /**
-             *
+             * The serial version ID.
              */
             private static final long serialVersionUID = 1169396106518110214L;
 
@@ -74,8 +77,9 @@ public class JsonTypeDescriptor extends AbstractTypeDescriptor<JsonObject> {
 
     @Override
     public <X> X unwrap(JsonObject value, Class<X> type, WrapperOptions options) {
-        if (value == null)
+        if (value == null) {
             return null;
+        }
 
         if (String.class.isAssignableFrom(type)) {
             return (X) toString(value);
@@ -89,11 +93,13 @@ public class JsonTypeDescriptor extends AbstractTypeDescriptor<JsonObject> {
 
     @Override
     public <X> JsonObject wrap(X value, WrapperOptions options) {
-        if (value == null)
+        if (value == null) {
             return null;
+        }
 
-        if (String.class.isInstance(value))
+        if (String.class.isInstance(value)) {
             return JsonUtils.GSON_JPA_MODEL.fromJson((String) value, JsonObject.class);
+        }
 
         throw unknownWrap(value.getClass());
     }
index 1831c17..621fa8d 100644 (file)
@@ -32,7 +32,7 @@ import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
 public class StringJsonUserType extends AbstractSingleColumnStandardBasicType<JsonObject> {
 
     /**
-     *
+     * The serial version ID.
      */
     private static final long serialVersionUID = -7929809808079327767L;
 
index 0233b09..6e26d29 100644 (file)
@@ -30,20 +30,20 @@ package org.onap.clamp.exception;
 public class OperationException extends RuntimeException {
 
     /**
-        * The serial version ID.
-        */
-       private static final long serialVersionUID = 2788967876393519620L;
+     * The serial version ID.
+     */
+    private static final long serialVersionUID = 2788967876393519620L;
 
-       /**
+    /**
      * This constructor can be used to create a new CldsUsersException.
-     * 
+     *
      * @param message
      *            A string message detailing the problem
-     * @param e
+     * @param cause
      *            The exception sent by the code
      */
-    public OperationException(String message, Throwable e) {
-        super(message, e);
+    public OperationException(String message, Throwable cause) {
+        super(message, cause);
     }
 
     /**
index 332b20a..2bbb911 100644 (file)
@@ -100,7 +100,7 @@ public class MicroServicePolicy implements Serializable, Policy {
      *
      * @param name
      *        The name of the MicroService
-     * @param type
+     * @param modelType
      *        The model type of the MicroService
      * @param policyTosca
      *        The policy Tosca of the MicroService
@@ -132,7 +132,7 @@ public class MicroServicePolicy implements Serializable, Policy {
      *
      * @param name
      *        The name of the MicroService
-     * @param type
+     * @param modelType
      *        The model type of the MicroService
      * @param policyTosca
      *        The policy Tosca of the MicroService