Fix Checkstyle issues
Issue-ID: CLAMP-328
Change-Id: Idecd87abbf3765a7e77e2219df1063e732bb04b0
Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
21 files changed:
* @param action
* The action of the permissions. e.g. read
*/
* @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);
String type = refProp.getStringValue(permPrefix + typeVar);
String instance = refProp.getStringValue(permInstance);
principalName, inPermission.getKey());
authorized = true;
} else if (hasRole(inPermission.getKeyAllAction())) {
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 {
principalName, inPermission.getKey());
authorized = true;
} else {
- * Verify whether the user has the permission
+ * Verify whether the user has the permission.
*
* @param inPermission
* The permissions to verify
*
* @param inPermission
* The permissions to verify
* ===================================================================
*
*/
* ===================================================================
*
*/
package org.onap.clamp.clds.config;
import javax.servlet.Filter;
package org.onap.clamp.clds.config;
import javax.servlet.Filter;
* ============LICENSE_END============================================
* ===================================================================
*/
* ============LICENSE_END============================================
* ===================================================================
*/
package org.onap.clamp.clds.config;
import org.apache.camel.CamelContext;
package org.onap.clamp.clds.config;
import org.apache.camel.CamelContext;
+ * Returns the list of strings split with separator.
+ *
* @param key
* property key
* @param separator
* @param key
* property key
* @param separator
+ /**
+ * 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
public static CldsUser[] decodeJson(String cldsUsersString) {
try {
// the ObjectMapper readValue method closes the stream no need to do
* defined in cldsUsersFile variable (this file path can be configured in the
* application.properties).
*
* defined in cldsUsersFile variable (this file path can be configured in the
* application.properties).
*
+ * @param auth authentication manager builder
*/
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) {
*/
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) {
this.policyEnvironment = environment;
}
this.policyEnvironment = environment;
}
+ /**
+ * Returns policy configuration properties.
+ *
+ * @return policy configuration properties
+ */
public Properties getProperties() {
Properties prop = new Properties();
prop.put(PDP_URL1, pdpUrl1);
public Properties getProperties() {
Properties prop = new Properties();
prop.put(PDP_URL1, pdpUrl1);
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
@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);
}
}
System.getProperties().putAll(myTranslator);
}
}
public class BlueprintParserMappingConfiguration {
private static final Type BLUEPRINT_MAP_CONF_TYPE = new TypeToken<List<BlueprintParserMappingConfiguration>>() {
public class BlueprintParserMappingConfiguration {
private static final Type BLUEPRINT_MAP_CONF_TYPE = new TypeToken<List<BlueprintParserMappingConfiguration>>() {
private String blueprintKey;
private boolean dcaeDeployable;
private BlueprintParserFilesConfiguration files;
private String blueprintKey;
private boolean dcaeDeployable;
private BlueprintParserFilesConfiguration files;
*/
private JsonObject jsonRootNode;
*/
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
@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) {
}
public SdcSingleControllerConfiguration getSdcSingleControllerConfiguration(String controllerName) {
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 = {
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));
};
public static final List<String> SUPPORTED_ARTIFACT_TYPES_LIST = Collections
.unmodifiableList(Arrays.asList(SUPPORTED_ARTIFACT_TYPES));
return sdcControllerName;
}
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;
public void setSdcControllerName(String controllerName) {
this.sdcControllerName = controllerName;
errorMessageKeyNotFound = " parameter cannot be found in config file for controller name" + sdcControllerName;
@Override
public boolean activateServerTLSAuth() {
@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;
return jsonRootNode.get(ACTIVATE_SERVER_TLS_AUTH).getAsBoolean();
} else {
return false;
private ClampProperties refProp;
/**
private ClampProperties refProp;
/**
- * Clds Identity database DataSource configuration
+ * Clds Identity database DataSource configuration.
import org.springframework.jdbc.core.RowMapper;
/**
import org.springframework.jdbc.core.RowMapper;
/**
- * Generic mapper for CldsDBServiceCache
+ * Generic mapper for CldsDBServiceCache.
*/
public final class CldsServiceDataMapper implements RowMapper<CldsServiceData> {
*/
public final class CldsServiceDataMapper implements RowMapper<CldsServiceData> {
import org.springframework.jdbc.core.RowMapper;
/**
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
*/
public final class ValueItemMapper implements RowMapper<ValueItem> {
@Override
* ============LICENSE_END============================================
* ===================================================================
*/
* ============LICENSE_END============================================
* ===================================================================
*/
package org.onap.clamp.clds.service;
import com.att.eelf.configuration.EELFLogger;
package org.onap.clamp.clds.service;
import com.att.eelf.configuration.EELFLogger;
@Autowired
private CldsDao cldsDao;
@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.
/**
* REST service that retrieves clds healthcheck information.
}
// audit log
LoggingUtils.setTimeContext(startTime, new Date());
}
// 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 {
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);
}
}
return new ResponseEntity<>(cldsHealthCheck, HttpStatus.OK);
}
}
* ============LICENSE_END============================================
* ===================================================================
*/
* ============LICENSE_END============================================
* ===================================================================
*/
package org.onap.clamp.configuration;
import com.google.gson.Gson;
package org.onap.clamp.configuration;
import com.google.gson.Gson;
- * 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
*
* @param unmarshalType
* the custom unmarshal type
- * Use a custom Gson mapper and and unmarshal type
+ * Use a custom Gson mapper and and unmarshal type.
*
* @param gson
* the custom mapper
*
* @param gson
* the custom mapper
- * 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
*
* @param unmarshalGenericType
* the custom unmarshal generic type
- * 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
*
* @param gson
* the custom mapper
public class JsonStringSqlTypeDescriptor implements SqlTypeDescriptor {
/**
public class JsonStringSqlTypeDescriptor implements SqlTypeDescriptor {
/**
+ * The serial version ID.
*/
private static final long serialVersionUID = 1103168570216921981L;
*/
private static final long serialVersionUID = 1103168570216921981L;
public class JsonTypeDescriptor extends AbstractTypeDescriptor<JsonObject> {
/**
public class JsonTypeDescriptor extends AbstractTypeDescriptor<JsonObject> {
/**
+ * The serial version ID.
*/
private static final long serialVersionUID = -3439698221196089003L;
public static final JsonTypeDescriptor INSTANCE = new JsonTypeDescriptor();
*/
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>() {
/**
public JsonTypeDescriptor() {
super(JsonObject.class, new ImmutableMutabilityPlan<JsonObject>() {
/**
+ * The serial version ID.
*/
private static final long serialVersionUID = 1169396106518110214L;
*/
private static final long serialVersionUID = 1169396106518110214L;
@Override
public <X> X unwrap(JsonObject value, Class<X> type, WrapperOptions options) {
@Override
public <X> X unwrap(JsonObject value, Class<X> type, WrapperOptions options) {
if (String.class.isAssignableFrom(type)) {
return (X) toString(value);
if (String.class.isAssignableFrom(type)) {
return (X) toString(value);
@Override
public <X> JsonObject wrap(X value, WrapperOptions options) {
@Override
public <X> JsonObject wrap(X value, WrapperOptions options) {
- if (String.class.isInstance(value))
+ if (String.class.isInstance(value)) {
return JsonUtils.GSON_JPA_MODEL.fromJson((String) value, JsonObject.class);
return JsonUtils.GSON_JPA_MODEL.fromJson((String) value, JsonObject.class);
throw unknownWrap(value.getClass());
}
throw unknownWrap(value.getClass());
}
public class StringJsonUserType extends AbstractSingleColumnStandardBasicType<JsonObject> {
/**
public class StringJsonUserType extends AbstractSingleColumnStandardBasicType<JsonObject> {
/**
+ * The serial version ID.
*/
private static final long serialVersionUID = -7929809808079327767L;
*/
private static final long serialVersionUID = -7929809808079327767L;
public class OperationException extends RuntimeException {
/**
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.
* This constructor can be used to create a new CldsUsersException.
* @param message
* A string message detailing the problem
* @param message
* A string message detailing the problem
* The exception sent by the code
*/
* The exception sent by the code
*/
- public OperationException(String message, Throwable e) {
- super(message, e);
+ public OperationException(String message, Throwable cause) {
+ super(message, cause);
*
* @param name
* The name of the MicroService
*
* @param name
* The name of the MicroService
* The model type of the MicroService
* @param policyTosca
* The policy Tosca of the MicroService
* The model type of the MicroService
* @param policyTosca
* The policy Tosca of the MicroService
*
* @param name
* The name of the MicroService
*
* @param name
* The name of the MicroService
* The model type of the MicroService
* @param policyTosca
* The policy Tosca of the MicroService
* The model type of the MicroService
* @param policyTosca
* The policy Tosca of the MicroService