Fix Checkstyle issues
Fix Checkstyle issues
Change-Id: I67fa832cc1ac3e4992837a8022bb7673ab81913d
Issue-ID: CLAMP-328
Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
diff --git a/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
index 283d8c5..052ea73 100644
--- a/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfiguration.java
@@ -203,8 +203,8 @@
@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;
diff --git a/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java b/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java
index e0a804e..1fdc898 100644
--- a/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java
@@ -49,7 +49,7 @@
/**
* Clds Identity database DataSource configuration.
*
- * @return
+ * @return encoded password data source
*/
@Bean(name = "cldsDataSource")
@ConfigurationProperties(prefix = "spring.datasource.cldsdb")
diff --git a/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java
index 3f1403f..92b0272 100644
--- a/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/spring/CldsSdcControllerConfiguration.java
@@ -57,6 +57,9 @@
@Autowired
protected CsarInstaller csarInstaller;
+ /**
+ * Loads SDC controllers configuration.
+ */
@PostConstruct
public void loadSdcControllers() {
SdcControllersConfiguration sdcControllersConfig = getSdcControllersConfiguration();
@@ -67,6 +70,9 @@
});
}
+ /**
+ * Checks whether all SDC controllers defined are up and running.
+ */
@Scheduled(fixedRate = 120000)
public void checkAllSdcControllers() {
logger.info("Checking that all SDC Controllers defined are up and running");
@@ -82,6 +88,9 @@
logger.info("SDC Controllers check completed");
}
+ /**
+ * Closes all SDC Controller and the SDC Client.
+ */
@PreDestroy
public void killSdcControllers() {
sdcControllersList.forEach(e -> {
diff --git a/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java b/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
index 2977d1a..55b90cc 100644
--- a/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/spring/SdcControllerConfiguration.java
@@ -56,6 +56,9 @@
@Autowired
protected CsarInstaller csarInstaller;
+ /**
+ * Loads SDC controller configuration.
+ */
@PostConstruct
public void loadSdcControllers() {
SdcControllersConfiguration sdcControllersConfig = getSdcControllersConfiguration();
@@ -66,6 +69,9 @@
});
}
+ /**
+ * Checks whether all SDC controllers defined are up and running.
+ */
@Scheduled(fixedRate = 120000)
public void checkAllSdcControllers() {
logger.info("Checking that all SDC Controllers defined are up and running");
@@ -81,6 +87,9 @@
logger.info("SDC Controllers check completed");
}
+ /**
+ * Closes all SDC Controller and the SDC Client.
+ */
@PreDestroy
public void killSdcControllers() {
sdcControllersList.forEach(e -> {
diff --git a/src/main/java/org/onap/clamp/clds/exception/BadRequestException.java b/src/main/java/org/onap/clamp/clds/exception/BadRequestException.java
index c6b0d55..caf525e 100644
--- a/src/main/java/org/onap/clamp/clds/exception/BadRequestException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/BadRequestException.java
@@ -30,20 +30,20 @@
public class BadRequestException extends RuntimeException {
/**
- *
- */
- private static final long serialVersionUID = -5738167530541646123L;
+ * The serial version ID.
+ */
+ private static final long serialVersionUID = -5738167530541646123L;
- /**
+ /**
* This constructor can be used to create a new CldsConfigException.
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public BadRequestException(String message, Throwable e) {
- super(message, e);
+ public BadRequestException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/CldsConfigException.java b/src/main/java/org/onap/clamp/clds/exception/CldsConfigException.java
index c06d101..93d9815 100644
--- a/src/main/java/org/onap/clamp/clds/exception/CldsConfigException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/CldsConfigException.java
@@ -30,7 +30,7 @@
public class CldsConfigException extends RuntimeException {
/**
- *
+ * The serial version ID.
*/
private static final long serialVersionUID = 5958873136187918505L;
@@ -39,11 +39,11 @@
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public CldsConfigException(String message, Throwable e) {
- super(message, e);
+ public CldsConfigException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/CldsUsersException.java b/src/main/java/org/onap/clamp/clds/exception/CldsUsersException.java
index 0f54f3b..270bfa1 100644
--- a/src/main/java/org/onap/clamp/clds/exception/CldsUsersException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/CldsUsersException.java
@@ -30,7 +30,7 @@
public class CldsUsersException extends RuntimeException {
/**
- *
+ * The serial version ID.
*/
private static final long serialVersionUID = 933535057227505342L;
@@ -39,11 +39,11 @@
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public CldsUsersException(String message, Throwable e) {
- super(message, e);
+ public CldsUsersException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/ModelBpmnException.java b/src/main/java/org/onap/clamp/clds/exception/ModelBpmnException.java
index 02d5703..5892dfc 100644
--- a/src/main/java/org/onap/clamp/clds/exception/ModelBpmnException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/ModelBpmnException.java
@@ -41,11 +41,11 @@
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public ModelBpmnException(String message, Throwable e) {
- super(message, e);
+ public ModelBpmnException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/ModelPropertiesException.java b/src/main/java/org/onap/clamp/clds/exception/ModelPropertiesException.java
index b17616b..8d474fc 100644
--- a/src/main/java/org/onap/clamp/clds/exception/ModelPropertiesException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/ModelPropertiesException.java
@@ -40,11 +40,11 @@
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public ModelPropertiesException(String message, Throwable e) {
- super(message, e);
+ public ModelPropertiesException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/NotAuthorizedException.java b/src/main/java/org/onap/clamp/clds/exception/NotAuthorizedException.java
index 4ea0503..1bdf18e 100644
--- a/src/main/java/org/onap/clamp/clds/exception/NotAuthorizedException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/NotAuthorizedException.java
@@ -30,7 +30,7 @@
public class NotAuthorizedException extends RuntimeException {
/**
- *
+ * The serial version ID.
*/
private static final long serialVersionUID = -5738167530541646123L;
@@ -39,11 +39,11 @@
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public NotAuthorizedException(String message, Throwable e) {
- super(message, e);
+ public NotAuthorizedException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/TcaRequestFormatterException.java b/src/main/java/org/onap/clamp/clds/exception/TcaRequestFormatterException.java
index 92d3663..3bfb5ea 100644
--- a/src/main/java/org/onap/clamp/clds/exception/TcaRequestFormatterException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/TcaRequestFormatterException.java
@@ -30,7 +30,7 @@
public class TcaRequestFormatterException extends RuntimeException {
/**
- *
+ * The serial version ID.
*/
private static final long serialVersionUID = 169875373143236667L;
@@ -40,11 +40,11 @@
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public TcaRequestFormatterException(String message, Throwable e) {
- super(message, e);
+ public TcaRequestFormatterException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/dcae/DcaeDeploymentException.java b/src/main/java/org/onap/clamp/clds/exception/dcae/DcaeDeploymentException.java
index 9e11321..e733da5 100644
--- a/src/main/java/org/onap/clamp/clds/exception/dcae/DcaeDeploymentException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/dcae/DcaeDeploymentException.java
@@ -30,7 +30,7 @@
public class DcaeDeploymentException extends RuntimeException {
/**
- * Generated ID
+ * Generated ID.
*/
private static final long serialVersionUID = 8452294782552680243L;
@@ -39,11 +39,11 @@
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public DcaeDeploymentException(String message, Throwable e) {
- super(message, e);
+ public DcaeDeploymentException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/policy/PolicyClientException.java b/src/main/java/org/onap/clamp/clds/exception/policy/PolicyClientException.java
index 85695a2..06dcdbf 100644
--- a/src/main/java/org/onap/clamp/clds/exception/policy/PolicyClientException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/policy/PolicyClientException.java
@@ -39,11 +39,11 @@
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public PolicyClientException(String message, Throwable e) {
- super(message, e);
+ public PolicyClientException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/SdcCommunicationException.java b/src/main/java/org/onap/clamp/clds/exception/sdc/SdcCommunicationException.java
index 862b213..b70b114 100644
--- a/src/main/java/org/onap/clamp/clds/exception/sdc/SdcCommunicationException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/sdc/SdcCommunicationException.java
@@ -30,7 +30,7 @@
public class SdcCommunicationException extends RuntimeException {
/**
- * Generated ID
+ * Generated ID.
*/
private static final long serialVersionUID = 8452294782552680243L;
@@ -39,11 +39,11 @@
*
* @param message
* A string message detailing the problem
- * @param e
+ * @param ex
* The exception sent by the code
*/
- public SdcCommunicationException(String message, Throwable e) {
- super(message, e);
+ public SdcCommunicationException(String message, Throwable ex) {
+ super(message, ex);
}
/**
diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/CsarHandlerException.java b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/CsarHandlerException.java
index 4e1b8ea..c3ebde1 100644
--- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/CsarHandlerException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/CsarHandlerException.java
@@ -29,25 +29,24 @@
public class CsarHandlerException extends Exception {
/**
- *
+ * The serial version ID.
*/
private static final long serialVersionUID = -7628640776124409155L;
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new CsarHandlerException.
+ *
+ * @param message The message to dump
*/
public CsarHandlerException(final String message) {
super(message);
}
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new CsarHandlerException.
+ *
+ * @param message The message to dump
+ * @param cause The Throwable cause object
*/
public CsarHandlerException(final String message, final Throwable cause) {
super(message, cause);
diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java
index eba3263..523766a 100644
--- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcArtifactInstallerException.java
@@ -34,20 +34,19 @@
private static final long serialVersionUID = 4095937499475915021L;
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new SdcArtifactInstallerException.
+ *
+ * @param message The message to dump
*/
public SdcArtifactInstallerException(final String message) {
super(message);
}
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new SdcArtifactInstallerException.
+ *
+ * @param message The message to dump
+ * @param cause The Throwable cause object
*/
public SdcArtifactInstallerException(final String message, final Throwable cause) {
super(message, cause);
diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcControllerException.java b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcControllerException.java
index 1a7afd2..d73001d 100644
--- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcControllerException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcControllerException.java
@@ -34,20 +34,19 @@
private static final long serialVersionUID = -4236006447255525130L;
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new SdcControllerException.
+ *
+ * @param message The message to dump
*/
public SdcControllerException(final String message) {
super(message);
}
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new SdcControllerException.
+ *
+ * @param message The message to dump
+ * @param cause The Throwable cause object
*/
public SdcControllerException(final String message, final Throwable cause) {
super(message, cause);
diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcDownloadException.java b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcDownloadException.java
index fa92499..6cd3fb8 100644
--- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcDownloadException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcDownloadException.java
@@ -34,20 +34,19 @@
private static final long serialVersionUID = -5276848693231134901L;
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new SdcDownloadException.
+ *
+ * @param message The message to dump
*/
public SdcDownloadException(final String message) {
super(message);
}
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new SdcDownloadException.
+ *
+ * @param message The message to dump
+ * @param cause The Throwable cause object
*/
public SdcDownloadException(final String message, final Throwable cause) {
super(message, cause);
diff --git a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcParametersException.java b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcParametersException.java
index 8a11a6e..bfe63cb 100644
--- a/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcParametersException.java
+++ b/src/main/java/org/onap/clamp/clds/exception/sdc/controller/SdcParametersException.java
@@ -34,20 +34,19 @@
private static final long serialVersionUID = 8425657297510362736L;
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new SdcParametersException.
+ *
+ * @param message The message to dump
*/
public SdcParametersException(final String message) {
super(message);
}
/**
- * @param message
- * The message to dump
- * @param cause
- * The Throwable cause object
+ * This constructor can be used to create a new SdcParametersException.
+ *
+ * @param message The message to dump
+ * @param cause The Throwable cause object
*/
public SdcParametersException(final String message, final Throwable cause) {
super(message, cause);
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsDictionaryService.java b/src/main/java/org/onap/clamp/clds/service/CldsDictionaryService.java
index 0fb1e0f..7641713 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsDictionaryService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsDictionaryService.java
@@ -39,7 +39,7 @@
import org.springframework.stereotype.Component;
/**
- * REST services to manage dictionary and dictionary items for Tosca Model
+ * REST services to manage dictionary and dictionary items for Tosca Model.
*/
@Component
public class CldsDictionaryService extends SecureServiceBase {
@@ -65,10 +65,10 @@
}
/**
- * REST Service that creates or Updates a Dictionary
+ * REST Service that creates or Updates a Dictionary.
*
- * @param dictionaryName
- * @param cldsDictionary
+ * @param dictionaryName dictionary name
+ * @param cldsDictionary clds dictionary
* @return CldsDictionary that was created in DB.
*/
public ResponseEntity<CldsDictionary> createOrUpdateDictionary(String dictionaryName,
@@ -90,10 +90,10 @@
/**
* REST Service that creates or Updates a Dictionary Elements for dictionary
- * in DB
+ * in DB.
*
- * @param dictionaryName
- * @param dictionaryItem
+ * @param dictionaryName dictionary name
+ * @param dictionaryItem dictionary item
* @return CldsDictionaryItem A dictionary items that was created or updated
* in DB
*/
@@ -111,7 +111,7 @@
}
/**
- * Rest Service that retrieves all CLDS dictionary in DB
+ * Rest Service that retrieves all CLDS dictionary in DB.
*
* @return CldsDictionary List List of CldsDictionary available in DB
*/
@@ -129,9 +129,9 @@
/**
* Rest Service that retrieves all CLDS dictionary items in DB for a give
- * dictionary name
+ * dictionary name.
*
- * @param dictionaryName
+ * @param dictionaryName dictionary name
* @return CldsDictionaryItem list List of CLDS Dictionary items for a given
* dictionary name
*/
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java
index b9cce08..2a89b19 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java
@@ -85,7 +85,7 @@
* The constant LIST_OF_SDC_SERVICE_INFO_TYPE.
*/
public static final Type LIST_OF_SDC_SERVICE_INFO_TYPE = new TypeToken<List<SdcServiceInfo>>() {
- }.getType();
+ }.getType();
@Produce(uri = "direct:processSubmit")
private CamelProxy camelProxy;
/**
@@ -551,7 +551,7 @@
* UUID. If not authorized, then NotAuthorizedException is thrown.
*
* @param model The clds model
- * @return
+ * @return boolean or throws NotAuthorizedException
*/
private boolean isAuthorizedForVf(CldsModel model) {
String vf = ModelProperties.getVf(model);
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java b/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java
index d82e7c6..f60c638 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsTemplateService.java
@@ -52,7 +52,7 @@
private SecureServicePermission permissionReadTemplate;
private SecureServicePermission permissionUpdateTemplate;
@Autowired
- private HttpServletRequest request;
+ private HttpServletRequest request;
@PostConstruct
private final void afterConstruction() {
@@ -71,11 +71,11 @@
* database. This is subset of the json getModel. This is only expected to
* be used for testing purposes, not by the UI.
*
- * @param templateName
+ * @param templateName template name
* @return bpmn xml text - content of bpmn given name
*/
public String getBpmnTemplate(String templateName) {
- util.entering(request, "CldsTemplateService: GET template bpmn");
+ util.entering(request, "CldsTemplateService: GET template bpmn");
Date startTime = new Date();
isAuthorized(permissionReadTemplate);
logger.info("GET bpmnText for templateName=" + templateName);
@@ -92,11 +92,11 @@
* database. This is subset of the json getModel. This is only expected to
* be used for testing purposes, not by the UI.
*
- * @param templateName
+ * @param templateName template name
* @return image xml text - content of image given name
*/
public String getImageXml(String templateName) {
- util.entering(request, "CldsTemplateService: GET template image");
+ util.entering(request, "CldsTemplateService: GET template image");
Date startTime = new Date();
isAuthorized(permissionReadTemplate);
logger.info("GET imageText for templateName=" + templateName);
@@ -111,11 +111,11 @@
/**
* REST service that retrieves a CLDS template by name from the database.
*
- * @param templateName
+ * @param templateName template name
* @return clds template - clds template for the given template name
*/
public CldsTemplate getTemplate(String templateName) {
- util.entering(request, "CldsTemplateService: GET template");
+ util.entering(request, "CldsTemplateService: GET template");
Date startTime = new Date();
isAuthorized(permissionReadTemplate);
logger.info("GET model for templateName=" + templateName);
@@ -131,12 +131,12 @@
/**
* REST service that saves a CLDS template by name in the database.
*
- * @param templateName
- * @param cldsTemplate
+ * @param templateName template name
+ * @param cldsTemplate clds template
* @return The CldsTemplate modified and saved in DB
*/
public CldsTemplate putTemplate(String templateName, CldsTemplate cldsTemplate) {
- util.entering(request, "CldsTemplateService: PUT template");
+ util.entering(request, "CldsTemplateService: PUT template");
Date startTime = new Date();
isAuthorized(permissionUpdateTemplate);
logger.info("PUT Template for templateName=" + templateName);
@@ -158,7 +158,7 @@
* @return template names in JSON
*/
public List<ValueItem> getTemplateNames() {
- util.entering(request, "CldsTemplateService: GET template names");
+ util.entering(request, "CldsTemplateService: GET template names");
Date startTime = new Date();
isAuthorized(permissionReadTemplate);
logger.info("GET list of template names");
@@ -171,7 +171,7 @@
}
// Created for the integration test
- public void setLoggingUtil (LoggingUtils utilP) {
+ public void setLoggingUtil(LoggingUtils utilP) {
util = utilP;
}
}
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java b/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java
index adebd78..f2c75ea 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsToscaService.java
@@ -41,7 +41,7 @@
import org.springframework.stereotype.Component;
/**
- * REST services to manage Tosca Model
+ * REST services to manage Tosca Model.
*/
@Component
public class CldsToscaService extends SecureServiceBase {
diff --git a/src/main/java/org/onap/clamp/clds/service/SecureServiceBase.java b/src/main/java/org/onap/clamp/clds/service/SecureServiceBase.java
index 522f682..f653089 100644
--- a/src/main/java/org/onap/clamp/clds/service/SecureServiceBase.java
+++ b/src/main/java/org/onap/clamp/clds/service/SecureServiceBase.java
@@ -53,7 +53,7 @@
/**
* Get the userId from AAF/CSP.
*
- * @return
+ * @return user ID
*/
public String getUserId() {
return getUserName();
@@ -62,7 +62,7 @@
/**
* Get the Full name.
*
- * @return
+ * @return user name
*/
public String getUserName() {
String name = userNameHandler.retrieveUserName(securityContext);
@@ -76,7 +76,7 @@
/**
* Get the principal name.
*
- * @return
+ * @return the principal name
*/
public String getPrincipalName() {
String principal = ((UserDetails)securityContext.getAuthentication().getPrincipal()).getUsername();
@@ -175,13 +175,16 @@
// the rest of these don't seem to be required - isUserInRole method
// appears to take * as a wildcard
} else if (hasRole(inPermission.getKeyAllInstance())) {
- securityLogger.info("{} authorized because user has permission with * for instance: {}", getPrincipalName(), inPermission.getKey());
+ securityLogger.info("{} authorized because user has permission with * for instance: {}",
+ getPrincipalName(), inPermission.getKey());
authorized = true;
} else if (hasRole(inPermission.getKeyAllInstanceAction())) {
- securityLogger.info("{} authorized because user has permission with * for instance and * for action: {}", getPrincipalName(), inPermission.getKey());
+ securityLogger.info("{} authorized because user has permission with * for instance and * for action: {}",
+ getPrincipalName(), inPermission.getKey());
authorized = true;
} else if (hasRole(inPermission.getKeyAllAction())) {
- securityLogger.info("{} authorized because user has permission with * for action: {}", getPrincipalName(), inPermission.getKey());
+ securityLogger.info("{} authorized because user has permission with * for action: {}",
+ getPrincipalName(), inPermission.getKey());
authorized = true;
} else {
throw new NotAuthorizedException("");
@@ -196,8 +199,9 @@
}
for (GrantedAuthority auth : authentication.getAuthorities()) {
- if (role.equals(auth.getAuthority()))
+ if (role.equals(auth.getAuthority())) {
return true;
+ }
}
return false;
diff --git a/src/main/java/org/onap/clamp/clds/service/SecureServicePermission.java b/src/main/java/org/onap/clamp/clds/service/SecureServicePermission.java
index ae30d2a..a93732c 100644
--- a/src/main/java/org/onap/clamp/clds/service/SecureServicePermission.java
+++ b/src/main/java/org/onap/clamp/clds/service/SecureServicePermission.java
@@ -37,10 +37,10 @@
/**
* Factory method to create permission given type, instance, and action.
*
- * @param type
- * @param instance
- * @param action
- * @return
+ * @param type type of the permission
+ * @param instance instance of the permission
+ * @param action action of the permission
+ * @return instance of SecureServicePermission with type, instance and action
*/
public static SecureServicePermission create(String type, String instance, String action) {
return new SecureServicePermission(type, instance, action);
@@ -50,9 +50,9 @@
* Factory method to create permission given type and instance. Default
* action to ALL/*.
*
- * @param type
- * @param instance
- * @return
+ * @param type type of the permission
+ * @param instance instance of the permission
+ * @return instance of SecureServicePermission with type, instance and default action
*/
public static SecureServicePermission create(String type, String instance) {
return new SecureServicePermission(type, instance, ALL);
@@ -62,8 +62,8 @@
* Factory method to create permission given type. Default instance and
* action to ALL/*.
*
- * @param type
- * @return
+ * @param type type of the permission
+ * @return instance of SecureServicePermission with type and default instance and action
*/
public static SecureServicePermission create(String type) {
return new SecureServicePermission(type, ALL, ALL);
@@ -72,9 +72,9 @@
/**
* Instantiate permission given type, instance, and action.
*
- * @param type
- * @param instance
- * @param action
+ * @param type type of the permission
+ * @param instance instance of the permission
+ * @param action action of the permission
*/
public SecureServicePermission(String type, String instance, String action) {
this.type = type;
@@ -99,7 +99,7 @@
}
/**
- * Override toString - return permission in key format
+ * Override toString - return permission in key format.
*/
@Override
public String toString() {
@@ -110,7 +110,7 @@
* Return Permission in Key format = type, instance, and action separate by
* pipe character.
*
- * @return
+ * @return permission in key format
*/
public String getKey() {
return type + "|" + instance + "|" + action;
@@ -120,7 +120,7 @@
* Return Permission in Key format = type, all instance, and action separate
* by pipe character.
*
- * @return
+ * @return permission in key format
*/
public String getKeyAllInstance() {
return type + "|" + ALL + "|" + action;
@@ -130,7 +130,7 @@
* Return Permission in Key format = type, all instance, and all action
* separate by pipe character.
*
- * @return
+ * @return permission in key format
*/
public String getKeyAllInstanceAction() {
return type + "|" + ALL + "|" + ALL;
@@ -140,13 +140,15 @@
* Return Permission in Key format = type, instance, and all action separate
* by pipe character.
*
- * @return
+ * @return permission in key format
*/
public String getKeyAllAction() {
return type + "|" + instance + "|" + ALL;
}
/**
+ * Returns the permission type.
+ *
* @return the type
*/
public String getType() {
@@ -154,14 +156,17 @@
}
/**
- * @param type
- * the type to set
+ * Sets the type of permission.
+ *
+ * @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
+ * Returns the instance of permission.
+ *
* @return the instance
*/
public String getInstance() {
@@ -169,14 +174,17 @@
}
/**
- * @param instance
- * the instance to set
+ * Sets the instance of permission.
+ *
+ * @param instance the instance to set
*/
public void setInstance(String instance) {
this.instance = instance;
}
/**
+ * Returns the action of permission.
+ *
* @return the action
*/
public String getAction() {
@@ -184,8 +192,9 @@
}
/**
- * @param action
- * the action to set
+ * Sets the action of permission.
+ *
+ * @param action the action to set
*/
public void setAction(String action) {
this.action = action;
diff --git a/src/main/java/org/onap/clamp/clds/service/UserService.java b/src/main/java/org/onap/clamp/clds/service/UserService.java
index cfe50c9..cf8f663 100644
--- a/src/main/java/org/onap/clamp/clds/service/UserService.java
+++ b/src/main/java/org/onap/clamp/clds/service/UserService.java
@@ -35,12 +35,11 @@
@Controller
public class UserService {
- private SecurityContext securityContext= SecurityContextHolder.getContext();
+ private SecurityContext securityContext = SecurityContextHolder.getContext();
/**
* REST service that returns the username.
*
- * @param userName
* @return the user name
*/
public String getUser() {