aboutsummaryrefslogtreecommitdiffstats
path: root/context/context-management/src/main/java
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-10 17:05:36 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-10 17:07:47 +0100
commitd100854291559df1426ea1e64351872ae2d3867b (patch)
tree78baab90111307cd3d2460b2cca37e93a20ac9a3 /context/context-management/src/main/java
parent8f82d7adcb53b349e14d3b356bda03588a554f95 (diff)
Checkstyle changes for apex model
Fix checkstyle warnings in the apex mode and knock on changes. Issue-ID: POLICY-1034 Change-Id: I10537e4288e9cad5ef18165ed2cdc1d3ab3139c1 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'context/context-management/src/main/java')
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java2
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java2
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java (renamed from context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java)6
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java4
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JvmLocalLockManager.java (renamed from context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JVMLocalLockManager.java)2
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java6
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java35
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java23
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java4
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java4
10 files changed, 45 insertions, 43 deletions
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
index 305f14c8d..0f991ba36 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
@@ -424,7 +424,7 @@ public final class ContextAlbumImpl implements ContextAlbum {
}
// Sanity check on incoming context
- Assertions.argumentNotNull(incomingContextAlbum, ContextRuntimeException.class,
+ Assertions.argumentOfClassNotNull(incomingContextAlbum, ContextRuntimeException.class,
"cannot update context, context album is null");
// Iterate over the incoming context
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
index dba81d321..55df01b40 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
@@ -49,7 +49,7 @@ public class DistributorFactory {
public Distributor getDistributor(final AxArtifactKey key) throws ContextException {
LOGGER.entry("Distributor factory, key=" + key);
- Assertions.argumentNotNull(key, ContextException.class, "Parameter \"key\" may not be null");
+ Assertions.argumentOfClassNotNull(key, ContextException.class, "Parameter \"key\" may not be null");
// Get the class for the distributor using reflection
final DistributorParameters distributorParameters = ParameterService
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java
index cb9a77883..701c59342 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java
@@ -34,14 +34,14 @@ import org.slf4j.ext.XLoggerFactory;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public class JVMLocalDistributor extends AbstractDistributor {
+public class JvmLocalDistributor extends AbstractDistributor {
// Logger for this class
- private static final XLogger LOGGER = XLoggerFactory.getXLogger(JVMLocalDistributor.class);
+ private static final XLogger LOGGER = XLoggerFactory.getXLogger(JvmLocalDistributor.class);
/**
* Create an instance of a JVM Local Context Distributor.
*/
- public JVMLocalDistributor() {
+ public JvmLocalDistributor() {
super();
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java
index c45e3bd27..3e9120672 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java
@@ -66,8 +66,8 @@ public class LockManagerFactory {
// Check the class is a lock manager
if (!(lockManagerObject instanceof LockManager)) {
- LOGGER.error("Specified Apex context lock manager plugin class \"{}\" does not implement the LockManager interface",
- pluginClass);
+ LOGGER.error("Specified Apex context lock manager plugin class \"{}\" "
+ + "does not implement the LockManager interface", pluginClass);
throw new ContextException("Specified Apex context lock manager plugin class \"" + pluginClass
+ "\" does not implement the LockManager interface");
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JVMLocalLockManager.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JvmLocalLockManager.java
index 5e71557b8..721aa7f3c 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JVMLocalLockManager.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JvmLocalLockManager.java
@@ -32,7 +32,7 @@ import org.onap.policy.apex.context.impl.locking.AbstractLockManager;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public class JVMLocalLockManager extends AbstractLockManager {
+public class JvmLocalLockManager extends AbstractLockManager {
/*
* (non-Javadoc)
*
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java
index 34fa15dcb..60de80a7f 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java
@@ -48,7 +48,7 @@ public class PersistorFactory {
*/
public Persistor createPersistor(final AxArtifactKey key) throws ContextException {
LOGGER.entry("persistor factory, key=" + key);
- Assertions.argumentNotNull(key, ContextException.class, "Parameter \"key\" may not be null");
+ Assertions.argumentOfClassNotNull(key, ContextException.class, "Parameter \"key\" may not be null");
final PersistorParameters persistorParameters = ParameterService
.get(ContextParameterConstants.PERSISTENCE_GROUP_NAME);
@@ -67,8 +67,8 @@ public class PersistorFactory {
// Check the class is a persistor
if (!(persistorObject instanceof Persistor)) {
- LOGGER.error("Specified Apex context persistor plugin class \"{}\" does not implement the ContextDistributor interface",
- pluginClass);
+ LOGGER.error("Specified Apex context persistor plugin class \"{}\" "
+ + "does not implement the ContextDistributor interface", pluginClass);
throw new ContextException("Specified Apex context persistor plugin class \"" + pluginClass
+ "\" does not implement the ContextDistributor interface");
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
index 5513cc7e6..bb22827cd 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
@@ -32,8 +32,8 @@ import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
/**
- * This class implements the {@link SchemaHelper} functionality that is common across all
- * implementations. Schema helpers for specific schema mechanisms specialize this class.
+ * This class implements the {@link SchemaHelper} functionality that is common across all implementations. Schema
+ * helpers for specific schema mechanisms specialize this class.
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
@@ -62,14 +62,15 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.context.SchemaHelper#init(org.onap.policy.apex.model.basicmodel.concepts
- * .AxKey, org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema)
+ * @see org.onap.policy.apex.context.SchemaHelper#init(org.onap.policy.apex.model.basicmodel.concepts .AxKey,
+ * org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema)
*/
@Override
public void init(final AxKey incomingUserKey, final AxContextSchema incomingSchema) throws ContextRuntimeException {
- Assertions.argumentNotNull(incomingUserKey, ContextRuntimeException.class, "incomingUserKey may not be null");
- Assertions.argumentNotNull(incomingSchema, ContextRuntimeException.class, "incomingSchema may not be null");
+ Assertions.argumentOfClassNotNull(incomingUserKey, ContextRuntimeException.class,
+ "incomingUserKey may not be null");
+ Assertions.argumentOfClassNotNull(incomingSchema, ContextRuntimeException.class,
+ "incomingSchema may not be null");
this.userKey = incomingUserKey;
this.schema = incomingSchema;
@@ -123,8 +124,8 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
@Override
public Object createNewInstance() {
if (schemaClass == null) {
- final String returnString =
- userKey.getId() + ": could not create an instance, schema class for the schema is null";
+ final String returnString = userKey.getId()
+ + ": could not create an instance, schema class for the schema is null";
LOGGER.warn(returnString);
throw new ContextRuntimeException(returnString);
}
@@ -132,9 +133,9 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
try {
return schemaClass.newInstance();
} catch (final Exception e) {
- final String returnString =
- userKey.getId() + ": could not create an instance of class \"" + schemaClass.getCanonicalName()
- + "\" using the default constructor \"" + schemaClass.getSimpleName() + "()\"";
+ final String returnString = userKey.getId() + ": could not create an instance of class \""
+ + schemaClass.getCanonicalName() + "\" using the default constructor \""
+ + schemaClass.getSimpleName() + "()\"";
LOGGER.warn(returnString, e);
throw new ContextRuntimeException(returnString, e);
}
@@ -148,8 +149,8 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
@Override
public Object createNewInstance(final String stringValue) {
if (schemaClass == null) {
- final String returnString =
- userKey.getId() + ": could not create an instance, schema class for the schema is null";
+ final String returnString = userKey.getId()
+ + ": could not create an instance, schema class for the schema is null";
LOGGER.warn(returnString);
throw new ContextRuntimeException(returnString);
}
@@ -161,9 +162,9 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
// Invoke the constructor
return stringConstructor.newInstance(stringValue);
} catch (final Exception e) {
- final String returnString =
- userKey.getId() + ": could not create an instance of class \"" + schemaClass.getCanonicalName()
- + "\" using the string constructor \"" + schemaClass.getSimpleName() + "(String)\"";
+ final String returnString = userKey.getId() + ": could not create an instance of class \""
+ + schemaClass.getCanonicalName() + "\" using the string constructor \""
+ + schemaClass.getSimpleName() + "(String)\"";
LOGGER.warn(returnString, e);
throw new ContextRuntimeException(returnString);
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
index c6120c783..efc89b50d 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
@@ -54,15 +54,16 @@ public class SchemaHelperFactory {
*/
public SchemaHelper createSchemaHelper(final AxKey owningEntityKey, final AxArtifactKey schemaKey) {
LOGGER.entry("schema helper factory, owningEntityKey=" + owningEntityKey);
- Assertions.argumentNotNull(owningEntityKey, ContextRuntimeException.class,
- "Parameter \"owningEntityKey\" may not be null");
- Assertions.argumentNotNull(schemaKey, ContextRuntimeException.class, "Parameter \"schemaKey\" may not be null");
+ Assertions.argumentOfClassNotNull(owningEntityKey, ContextRuntimeException.class,
+ "Parameter \"owningEntityKey\" may not be null");
+ Assertions.argumentOfClassNotNull(schemaKey, ContextRuntimeException.class,
+ "Parameter \"schemaKey\" may not be null");
// Get the schema for items in the album
final AxContextSchema schema = ModelService.getModel(AxContextSchemas.class).get(schemaKey);
if (schema == null) {
- final String resultString =
- "schema \"" + schemaKey.getId() + "\" for entity " + owningEntityKey.getId() + " does not exist";
+ final String resultString = "schema \"" + schemaKey.getId() + "\" for entity " + owningEntityKey.getId()
+ + " does not exist";
LOGGER.warn(resultString);
throw new ContextRuntimeException(resultString);
}
@@ -71,11 +72,11 @@ public class SchemaHelperFactory {
final SchemaParameters schemaParameters = ParameterService.get(ContextParameterConstants.SCHEMA_GROUP_NAME);
// Get the class for the schema helper from the schema parameters
- final SchemaHelperParameters schemaHelperParameters =
- schemaParameters.getSchemaHelperParameters(schema.getSchemaFlavour());
+ final SchemaHelperParameters schemaHelperParameters = schemaParameters
+ .getSchemaHelperParameters(schema.getSchemaFlavour());
if (schemaHelperParameters == null) {
final String resultString = "context schema helper parameters not found for context schema \""
- + schema.getSchemaFlavour() + "\"";
+ + schema.getSchemaFlavour() + "\"";
LOGGER.warn(resultString);
throw new ContextRuntimeException(resultString);
}
@@ -87,7 +88,7 @@ public class SchemaHelperFactory {
schemaHelperObject = Class.forName(pluginClass).newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
final String resultString = "Apex context schema helper class not found for context schema helper plugin \""
- + pluginClass + "\"";
+ + pluginClass + "\"";
LOGGER.warn(resultString, e);
throw new ContextRuntimeException(resultString, e);
}
@@ -95,7 +96,7 @@ public class SchemaHelperFactory {
// Check the class is a schema helper
if (!(schemaHelperObject instanceof SchemaHelper)) {
final String resultString = "Specified Apex context schema helper plugin class \"" + pluginClass
- + "\" does not implement the SchemaHelper interface";
+ + "\" does not implement the SchemaHelper interface";
LOGGER.warn(resultString);
throw new ContextRuntimeException(resultString);
}
@@ -107,7 +108,7 @@ public class SchemaHelperFactory {
schemaHelper.init(owningEntityKey.getKey(), schema);
LOGGER.exit("Schema Helper factory, owningEntityKey=" + owningEntityKey + ", selected schema helper of class "
- + schemaHelper.getClass());
+ + schemaHelper.getClass());
return schemaHelper;
}
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java
index e3f58cae4..79310a0e2 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java
@@ -20,7 +20,7 @@
package org.onap.policy.apex.context.parameters;
-import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor;
+import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.common.parameters.ParameterGroup;
@@ -33,7 +33,7 @@ import org.onap.policy.common.parameters.ParameterGroup;
*/
public class DistributorParameters implements ParameterGroup {
/** The default distributor makes context albums available to all threads in a single JVM. */
- public static final String DEFAULT_DISTRIBUTOR_PLUGIN_CLASS = JVMLocalDistributor.class.getCanonicalName();
+ public static final String DEFAULT_DISTRIBUTOR_PLUGIN_CLASS = JvmLocalDistributor.class.getCanonicalName();
private String name;
private String pluginClass = DEFAULT_DISTRIBUTOR_PLUGIN_CLASS;
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java
index 27fc05a0b..ed23af1b6 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java
@@ -20,7 +20,7 @@
package org.onap.policy.apex.context.parameters;
-import org.onap.policy.apex.context.impl.locking.jvmlocal.JVMLocalLockManager;
+import org.onap.policy.apex.context.impl.locking.jvmlocal.JvmLocalLockManager;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.common.parameters.ParameterGroup;
@@ -35,7 +35,7 @@ public class LockManagerParameters implements ParameterGroup {
/**
* The default lock manager can lock context album instance across all threads in a single JVM.
*/
- public static final String DEFAULT_LOCK_MANAGER_PLUGIN_CLASS = JVMLocalLockManager.class.getCanonicalName();
+ public static final String DEFAULT_LOCK_MANAGER_PLUGIN_CLASS = JvmLocalLockManager.class.getCanonicalName();
private String name;
private String pluginClass = DEFAULT_LOCK_MANAGER_PLUGIN_CLASS;