summaryrefslogtreecommitdiffstats
path: root/model/policy-model/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 /model/policy-model/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 'model/policy-model/src/main/java')
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java67
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java79
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java124
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java20
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java42
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateFinalizerLogic.java8
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java6
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java7
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java4
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java24
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskLogic.java8
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java2
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskSelectionLogic.java8
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java10
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyException.java6
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyRuntimeException.java6
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java3
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java10
-rw-r--r--model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelComparer.java19
19 files changed, 215 insertions, 238 deletions
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java
index 2fc4467dc..99642d1ae 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java
@@ -47,18 +47,16 @@ import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter;
import org.onap.policy.apex.model.utilities.Assertions;
/**
- * This class holds Logic for executing a task or task selection on an Apex policy state. The
- * flavour of the logic describes the type of logic being used and it may be a language identifier
- * such as "Javascript" or "Jython". The logic itself is held as a string. The {@link AxLogic}
- * instance is used by the Apex engine to start an executor with the required flavour. Once the
- * executor is started, the Apex engine passes the logic to the executor and the executor executes
- * it. In the Apex engine, executors are deployed as plugins. Apex also provides the executor with
- * run-time context, which makes context such as input fields, output fields, and context albums
- * available to the task at runtime.
- * <p>
- * Validation checks that the logic key is valid, that the logic flavour is defined and is valid
- * when checked against the {@code LOGIC_FLAVOUR_REGEXP} regular expression, and that the specified
- * logic string is not null or blank.
+ * This class holds Logic for executing a task or task selection on an Apex policy state. The flavour of the logic
+ * describes the type of logic being used and it may be a language identifier such as "Javascript" or "Jython". The
+ * logic itself is held as a string. The {@link AxLogic} instance is used by the Apex engine to start an executor with
+ * the required flavour. Once the executor is started, the Apex engine passes the logic to the executor and the executor
+ * executes it. In the Apex engine, executors are deployed as plugins. Apex also provides the executor with run-time
+ * context, which makes context such as input fields, output fields, and context albums available to the task at
+ * runtime.
+ *
+ * <p>Validation checks that the logic key is valid, that the logic flavour is defined and is valid when checked against
+ * the {@code LOGIC_FLAVOUR_REGEXP} regular expression, and that the specified logic string is not null or blank.
*/
@Entity
@@ -67,8 +65,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "apexLogic", namespace = "http://www.onap.org/policy/apex-pdp")
-@XmlType(name = "AxLogic", namespace = "http://www.onap.org/policy/apex-pdp",
- propOrder = {"key", "logicFlavour", "logic"})
+@XmlType(name = "AxLogic", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
+ { "key", "logicFlavour", "logic" })
public class AxLogic extends AxConcept {
private static final long serialVersionUID = -4260562004005697328L;
@@ -105,8 +103,8 @@ public class AxLogic extends AxConcept {
private String logic;
/**
- * The Default Constructor creates a logic instance with a null key, undefined logic flavour and
- * a null logic string.
+ * The Default Constructor creates a logic instance with a null key, undefined logic flavour and a null logic
+ * string.
*/
public AxLogic() {
this(new AxReferenceKey());
@@ -114,7 +112,7 @@ public class AxLogic extends AxConcept {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -123,8 +121,8 @@ public class AxLogic extends AxConcept {
}
/**
- * The Key Constructor creates a logic instance with the given reference key, undefined logic
- * flavour and a null logic string.
+ * The Key Constructor creates a logic instance with the given reference key, undefined logic flavour and a null
+ * logic string.
*
* @param key the reference key of the logic
*/
@@ -133,8 +131,8 @@ public class AxLogic extends AxConcept {
}
/**
- * This Constructor creates a logic instance with a reference key constructed from the parents
- * key and the logic local name and all of its fields defined.
+ * This Constructor creates a logic instance with a reference key constructed from the parents key and the logic
+ * local name and all of its fields defined.
*
* @param parentKey the reference key of the parent of this logic
* @param logicName the logic name, held as the local name of the reference key of this logic
@@ -142,13 +140,12 @@ public class AxLogic extends AxConcept {
* @param logic the actual logic as a string
*/
public AxLogic(final AxReferenceKey parentKey, final String logicName, final String logicFlavour,
- final String logic) {
+ final String logic) {
this(new AxReferenceKey(parentKey, logicName), logicFlavour, logic);
}
/**
- * This Constructor creates a logic instance with the given reference key and all of its fields
- * defined.
+ * This Constructor creates a logic instance with the given reference key and all of its fields defined.
*
* @param key the reference key of this logic
* @param logicFlavour the flavour of this logic
@@ -166,8 +163,8 @@ public class AxLogic extends AxConcept {
}
/**
- * This Constructor creates a logic instance with the given reference key and logic flavour, the
- * logic is provided by the given logic reader instance.
+ * This Constructor creates a logic instance with the given reference key and logic flavour, the logic is provided
+ * by the given logic reader instance.
*
* @param key the reference key of this logic
* @param logicFlavour the flavour of this logic
@@ -254,8 +251,7 @@ public class AxLogic extends AxConcept {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.
* basicmodel.concepts.AxValidationResult)
*/
@Override
@@ -263,28 +259,28 @@ public class AxLogic extends AxConcept {
AxValidationResult result = resultIn;
if (key.equals(AxReferenceKey.getNullKey())) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key is a null key"));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "key is a null key"));
}
result = key.validate(result);
if (logicFlavour.replaceAll(WHITESPACE_REGEXP, "").length() == 0
- || logicFlavour.equals(LOGIC_FLAVOUR_UNDEFINED)) {
+ || logicFlavour.equals(LOGIC_FLAVOUR_UNDEFINED)) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "logic flavour is not defined"));
+ "logic flavour is not defined"));
}
try {
Assertions.validateStringParameter(LOGIC_FLAVOUR_TOKEN, logicFlavour, LOGIC_FLAVOUR_REGEXP);
} catch (final IllegalArgumentException e) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "logic flavour invalid-" + e.getMessage()));
+ "logic flavour invalid-" + e.getMessage()));
}
if (logic.replaceAll(WHITESPACE_REGEXP, "").length() == 0) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "no logic specified, logic may not be blank"));
+ "no logic specified, logic may not be blank"));
}
return result;
@@ -327,8 +323,7 @@ public class AxLogic extends AxConcept {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.
* basicmodel.concepts.AxConcept)
*/
@Override
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java
index 1937edac0..3be3e4a31 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java
@@ -51,22 +51,21 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.Validat
import org.onap.policy.apex.model.utilities.Assertions;
/**
- * This class is a policy container and holds a map of the policies for an entire Apex model. All
- * Apex models that use policies must have an {@link AxPolicies} field. The {@link AxPolicies} class
- * implements the helper methods of the {@link AxConceptGetter} interface to allow {@link AxPolicy}
- * instances to be retrieved by calling methods directly on this class without referencing the
- * contained map.
- * <p>
- * Validation checks that the container key is not null. An error is issued if no policies are
- * defined in the container. Each policy entry is checked to ensure that its key and value are not
- * null and that the key matches the key in the map value. Each policy entry is then validated
- * individually.
+ * This class is a policy container and holds a map of the policies for an entire Apex model. All Apex models that use
+ * policies must have an {@link AxPolicies} field. The {@link AxPolicies} class implements the helper methods of the
+ * {@link AxConceptGetter} interface to allow {@link AxPolicy} instances to be retrieved by calling methods directly on
+ * this class without referencing the contained map.
+ *
+ * <p>Validation checks that the container key is not null. An error is issued if no policies are defined in the
+ * container. Each policy entry is checked to ensure that its key and value are not null and that the key matches the
+ * key in the map value. Each policy entry is then validated individually.
*/
@Entity
@Table(name = "AxPolicies")
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "AxPolicies", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = {"key", "policyMap"})
+@XmlType(name = "AxPolicies", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
+ { "key", "policyMap" })
public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
private static final long serialVersionUID = 4290442590545820316L;
@@ -87,16 +86,16 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
// @formatter:on
/**
- * The Default Constructor creates a {@link AxPolicies} object with a null artifact key and
- * creates an empty event map.
+ * The Default Constructor creates a {@link AxPolicies} object with a null artifact key and creates an empty event
+ * map.
*/
public AxPolicies() {
this(new AxArtifactKey());
}
/**
- * The Key Constructor creates a {@link AxPolicies} object with the given artifact key and
- * creates an empty event map.
+ * The Key Constructor creates a {@link AxPolicies} object with the given artifact key and creates an empty event
+ * map.
*
* @param key the key
*/
@@ -105,7 +104,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -130,15 +129,14 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
}
/**
- * When a model is unmarshalled from disk or from the database, the policy map is returned as a
- * raw hash map. This method is called by JAXB after unmarshaling and is used to convert the
- * hash map to a {@link NavigableMap} so that it will work with the {@link AxConceptGetter}
- * interface.
+ * When a model is unmarshalled from disk or from the database, the policy map is returned as a raw hash map. This
+ * method is called by JAXB after unmarshaling and is used to convert the hash map to a {@link NavigableMap} so that
+ * it will work with the {@link AxConceptGetter} interface.
*
- * @param u the unmarshaler that is unmarshaling the model
+ * @param unmarshaler the unmarshaler that is unmarshaling the model
* @param parent the parent object of this object in the unmarshaler
*/
- public void afterUnmarshal(final Unmarshaller u, final Object parent) {
+ public void afterUnmarshal(final Unmarshaller unmarshaler, final Object parent) {
// The map must be navigable to allow name and version searching, unmarshaling returns a
// hash map
final NavigableMap<AxArtifactKey, AxPolicy> navigablePolicyMap = new TreeMap<>();
@@ -205,8 +203,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.
* basicmodel.concepts.AxValidationResult)
*/
@Override
@@ -214,24 +211,24 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
AxValidationResult result = resultIn;
if (key.equals(AxArtifactKey.getNullKey())) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key is a null key"));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "key is a null key"));
}
result = key.validate(result);
if (policyMap.size() == 0) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "policyMap may not be empty"));
+ "policyMap may not be empty"));
} else {
for (final Entry<AxArtifactKey, AxPolicy> policyEntry : policyMap.entrySet()) {
final AxArtifactKey entryKey = policyEntry.getKey();
if (entryKey.equals(AxArtifactKey.getNullKey())) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "key on policy entry " + entryKey + " may not be the null key"));
+ "key on policy entry " + entryKey + " may not be the null key"));
} else if (policyEntry.getValue() == null) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "value on policy entry " + entryKey + " may not be null"));
+ "value on policy entry " + entryKey + " may not be null"));
} else {
validate(result, policyEntry, entryKey);
result = policyEntry.getValue().validate(result);
@@ -243,11 +240,11 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
}
private void validate(final AxValidationResult result, final Entry<AxArtifactKey, AxPolicy> policyEntry,
- final AxArtifactKey entryKey) {
+ final AxArtifactKey entryKey) {
if (!entryKey.equals(policyEntry.getValue().getKey())) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key on policy entry key "
- + entryKey + " does not equal policy value key " + policyEntry.getValue().getKey()));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "key on policy entry key " + entryKey + " does not equal policy value key "
+ + policyEntry.getValue().getKey()));
}
}
@@ -286,8 +283,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.
* basicmodel.concepts.AxConcept)
*/
@Override
@@ -379,8 +375,7 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#get(org.onap.policy.apex.model
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#get(org.onap.policy.apex.model
* .basicmodel.concepts.AxArtifactKey)
*/
@Override
@@ -401,13 +396,12 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
/*
* (non-Javadoc)
*
- * @see org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#get(java.lang.String,
- * java.lang.String)
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#get(java.lang.String, java.lang.String)
*/
@Override
public AxPolicy get(final String conceptKeyName, final String conceptKeyVersion) {
return new AxConceptGetterImpl<>((NavigableMap<AxArtifactKey, AxPolicy>) policyMap).get(conceptKeyName,
- conceptKeyVersion);
+ conceptKeyVersion);
}
/*
@@ -423,12 +417,11 @@ public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
/*
* (non-Javadoc)
*
- * @see org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#getAll(java.lang.String,
- * java.lang.String)
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#getAll(java.lang.String, java.lang.String)
*/
@Override
public Set<AxPolicy> getAll(final String conceptKeyName, final String conceptKeyVersion) {
return new AxConceptGetterImpl<>((NavigableMap<AxArtifactKey, AxPolicy>) policyMap).getAll(conceptKeyName,
- conceptKeyVersion);
+ conceptKeyVersion);
}
}
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java
index 8b87c41ce..a03b49f13 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java
@@ -51,39 +51,30 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.Validat
import org.onap.policy.apex.model.utilities.Assertions;
/**
- * This class holds the definition of an Apex policy. A policy is made up of a tree of states, each
- * represented by an {@link AxState} instance. The states of a policy are held in a map in the
- * policy. The state tree is built up at policy design time by a policy editor and each state is
- * connected to its next state by an {@link AxStateOutput} instance.
- * <p>
- * Execution of a policy is triggered by an event. A policy starts execution from its first state so
- * the trigger event for the first sate is the trigger event for the entire policy. Execution from
- * that first state can continue to one or more subsequent states and so on down branches of states.
- * The state output of the final state in a branch has no next state, indicating the end of
- * execution of that branch. Therefore, the set of output events from final states in the policy are
- * the possible set of output events on the policy. A state may only be used once in the state tree
- * of a policy and recursive execution of states in the same execution branch is not allowed, so the
- * same state may not execute more than once on a single execution of a policy.
- * <p>
- * The template of a policy is a string that can be used by policy editors to store meta information
- * on the policy that can be used at design time. The policy template string is not used during
- * policy execution.
- * <p>
- * During validation of a policy, the validation checks listed below are executed:
- * <ol>
- * <li>The policy key must not be a null key
- * <li>The policy key must be valid
- * <li>If the policy template is not set, an observation is issued
- * <li>At least one state must be defined
- * <li>Keys and values must all be defined, that is not null
- * <li>The key on each entry in the state map must match the key in the entry's value
- * <li>The parent key of each state in the state map of a policy must be the key of that policy
- * <li>Each state must itself be valid, see validation in {@link AxState}
- * <li>The next state of the state output of each state must be defined as a state in the policy
- * <li>The first state of a policy must be set
- * <li>The first state of a policy must be defined in the policy
- * <li>If a state is defined but is not used in a policy,a warning is issued
- * <li>The state tree of the policy must be valid, see validation in {@link AxStateTree}
+ * This class holds the definition of an Apex policy. A policy is made up of a tree of states, each represented by an
+ * {@link AxState} instance. The states of a policy are held in a map in the policy. The state tree is built up at
+ * policy design time by a policy editor and each state is connected to its next state by an {@link AxStateOutput}
+ * instance.
+ *
+ * <p>Execution of a policy is triggered by an event. A policy starts execution from its first state so the trigger
+ * event for the first sate is the trigger event for the entire policy. Execution from that first state can continue to
+ * one or more subsequent states and so on down branches of states. The state output of the final state in a branch has
+ * no next state, indicating the end of execution of that branch. Therefore, the set of output events from final states
+ * in the policy are the possible set of output events on the policy. A state may only be used once in the state tree of
+ * a policy and recursive execution of states in the same execution branch is not allowed, so the same state may not
+ * execute more than once on a single execution of a policy.
+ *
+ * <p>The template of a policy is a string that can be used by policy editors to store meta information on the policy
+ * that can be used at design time. The policy template string is not used during policy execution.
+ *
+ * <p>During validation of a policy, the validation checks listed below are executed: <ol> <li>The policy key must not
+ * be a null key <li>The policy key must be valid <li>If the policy template is not set, an observation is issued <li>At
+ * least one state must be defined <li>Keys and values must all be defined, that is not null <li>The key on each entry
+ * in the state map must match the key in the entry's value <li>The parent key of each state in the state map of a
+ * policy must be the key of that policy <li>Each state must itself be valid, see validation in {@link AxState} <li>The
+ * next state of the state output of each state must be defined as a state in the policy <li>The first state of a policy
+ * must be set <li>The first state of a policy must be defined in the policy <li>If a state is defined but is not used
+ * in a policy,a warning is issued <li>The state tree of the policy must be valid, see validation in {@link AxStateTree}
* </ol>
*/
@@ -91,8 +82,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
@Table(name = "AxPolicy")
@XmlRootElement(name = "apexPolicy", namespace = "http://www.onap.org/policy/apex-pdp")
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "AxPolicy", namespace = "http://www.onap.org/policy/apex-pdp",
- propOrder = {"key", "template", "stateMap", "firstState"})
+@XmlType(name = "AxPolicy", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
+ { "key", "template", "stateMap", "firstState" })
public class AxPolicy extends AxConcept {
private static final long serialVersionUID = -1775614096390365941L;
@@ -118,15 +109,14 @@ public class AxPolicy extends AxConcept {
private String firstState;
/**
- * The Default Constructor creates a policy instance with a null key, a blank template and
- * undefined first state.
+ * The Default Constructor creates a policy instance with a null key, a blank template and undefined first state.
*/
public AxPolicy() {
this(new AxArtifactKey());
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -135,8 +125,7 @@ public class AxPolicy extends AxConcept {
}
/**
- * The Key Constructor creates a policy instance with the given key, a blank template and
- * undefined first state.
+ * The Key Constructor creates a policy instance with the given key, a blank template and undefined first state.
*
* @param key the key of the policy
*/
@@ -153,7 +142,7 @@ public class AxPolicy extends AxConcept {
* @param firstState the first state that will execute on this policy
*/
public AxPolicy(final AxArtifactKey key, final String template, final Map<String, AxState> stateMap,
- final String firstState) {
+ final String firstState) {
super();
Assertions.argumentNotNull(key, "key may not be null");
Assertions.argumentNotNull(template, "template may not be null");
@@ -167,12 +156,10 @@ public class AxPolicy extends AxConcept {
}
/**
- * Gets a tree that holds all the possible execution paths for this policy. This method may be
- * used for verification of policies, to find the branches of policy execution and the final
- * states of policies.
+ * Gets a tree that holds all the possible execution paths for this policy. This method may be used for verification
+ * of policies, to find the branches of policy execution and the final states of policies.
*
- * @return the state tree of the policy, a tree representing the execution branches of the
- * policy
+ * @return the state tree of the policy, a tree representing the execution branches of the policy
*/
public AxStateTree getStateTree() {
return new AxStateTree(this, stateMap.get(firstState), null);
@@ -272,8 +259,7 @@ public class AxPolicy extends AxConcept {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.
* basicmodel.concepts.AxValidationResult)
*/
@Override
@@ -281,20 +267,20 @@ public class AxPolicy extends AxConcept {
AxValidationResult result = resultIn;
if (key.equals(AxArtifactKey.getNullKey())) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key is a null key"));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "key is a null key"));
}
result = key.validate(result);
if (template.trim().length() == 0) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.OBSERVATION,
- "a policy template has not been specified"));
+ "a policy template has not been specified"));
}
if (stateMap.size() == 0) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "stateMap may not be empty"));
+ "stateMap may not be empty"));
} else {
for (final Entry<String, AxState> stateEntry : stateMap.entrySet()) {
result = validateStateEntry(stateEntry, result);
@@ -310,11 +296,11 @@ public class AxPolicy extends AxConcept {
// We only check the unused states on models validated this far
if (firstState.trim().length() == 0) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "no first state specified, first state may not be blank"));
+ "no first state specified, first state may not be blank"));
} else {
if (!stateMap.containsKey(firstState)) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "first state not found in stateMap"));
+ "first state not found in stateMap"));
} else {
validateStateTree(result);
}
@@ -324,7 +310,7 @@ public class AxPolicy extends AxConcept {
}
/**
- * Validate a state entry
+ * Validate a state entry.
*
* @param stateEntry the state entry to validate
* @param result The validation result to append to
@@ -333,35 +319,37 @@ public class AxPolicy extends AxConcept {
private AxValidationResult validateStateEntry(final Entry<String, AxState> stateEntry, AxValidationResult result) {
if (stateEntry.getKey() == null || stateEntry.getKey().equals(AxKey.NULL_KEY_NAME)) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "key on state entry key " + stateEntry.getKey() + " may not be the null key"));
+ "key on state entry key " + stateEntry.getKey() + " may not be the null key"));
return result;
}
if (stateEntry.getValue() == null) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "value on state entry value " + stateEntry.getKey() + " may not be null"));
+ "value on state entry value " + stateEntry.getKey() + " may not be null"));
return result;
}
if (!stateEntry.getKey().equals(stateEntry.getValue().getKey().getLocalName())) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "key on state entry key " + stateEntry.getKey() + " does not equal state entry value local name "
- + stateEntry.getValue().getKey().getLocalName()));
+ "key on state entry key " + stateEntry.getKey()
+ + " does not equal state entry value local name "
+ + stateEntry.getValue().getKey().getLocalName()));
}
if (!stateEntry.getValue().getKey().getParentArtifactKey().equals(key)) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "parent key on state entry key " + stateEntry.getValue().getKey() + " does not equal policy key"));
+ "parent key on state entry key " + stateEntry.getValue().getKey()
+ + " does not equal policy key"));
}
result = stateEntry.getValue().validate(result);
for (final AxStateOutput stateOutput : stateEntry.getValue().getStateOutputs().values()) {
if (!stateOutput.getNextState().equals(AxReferenceKey.getNullKey())
- && !stateMap.containsKey(stateOutput.getNextState().getLocalName())) {
+ && !stateMap.containsKey(stateOutput.getNextState().getLocalName())) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- " nextState of state " + stateEntry.getKey() + " not found in StateMap: "
- + stateOutput.getNextState().getId()));
+ " nextState of state " + stateEntry.getKey() + " not found in StateMap: "
+ + stateOutput.getNextState().getId()));
}
}
@@ -369,7 +357,7 @@ public class AxPolicy extends AxConcept {
}
/**
- * Validate a state tree to ensure there are no circular references in it
+ * Validate a state tree to ensure there are no circular references in it.
*
* @param result The validation result to append to
* @return The result of the validation
@@ -386,11 +374,12 @@ public class AxPolicy extends AxConcept {
for (final AxState unreferencedState : unreferencedStateSet) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.WARNING,
- "state " + unreferencedState.getKey() + " is not referenced in the policy execution tree"));
+ "state " + unreferencedState.getKey()
+ + " is not referenced in the policy execution tree"));
}
} catch (PolicyRuntimeException pre) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.WARNING,
- "state tree in policy is invalid"));
+ "state tree in policy is invalid"));
}
return result;
@@ -432,8 +421,7 @@ public class AxPolicy extends AxConcept {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.
* basicmodel.concepts.AxConcept)
*/
@Override
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java
index ad465a48e..8233a0517 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java
@@ -62,19 +62,19 @@ import org.onap.policy.apex.model.utilities.Assertions;
* required to run policies in Apex. The model contains schema definitions, definitions of events
* and context albums that use those schemas, definitions of tasks for policies and definitions of
* the policies themselves.
- * <p>
- * An Apex policy model is an important artifact in Apex. At editing time, an Apex editor creates
+ *
+ * <p>An Apex policy model is an important artifact in Apex. At editing time, an Apex editor creates
* and edits a policy model and a policy model is loaded into and is executed by an Apex engine.
* Therefore, an Apex model and the set of policies that it holds is the way that the policy domain
* that an Apex engine or a group of Apex engines executes across is expressed, both at design time
* and run time. The Apex deployment system is responsible for deploying Apex models to and the
* context they need the appropriate engines for execution.
- * <p>
- * Model registration is carried out by calling the {@code register()} method, which registers the
+ *
+ * <p>Model registration is carried out by calling the {@code register()} method, which registers the
* policy model and all its constituent containers with the model service. The containers for
* context schemas, events, context albums, tasks, policies, and key information are all registered.
- * <p>
- * Once a policy model is composed, the overall structure of the policy model and all its references
+ *
+ * <p>Once a policy model is composed, the overall structure of the policy model and all its references
* can be validated. During validation of a policy model, the validation checks listed below are
* executed:
* <ol>
@@ -155,7 +155,7 @@ public class AxPolicyModel extends AxModel {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -467,7 +467,7 @@ public class AxPolicyModel extends AxModel {
}
/**
- * Validate that the references used on a state are valid
+ * Validate that the references used on a state are valid.
*
* @param state The state to check
* @param result the validation result to append to
@@ -518,7 +518,7 @@ public class AxPolicyModel extends AxModel {
/**
* Validate that the fields on tasks and events that trigger them and are output by them are
- * compatible for all tasks used on a state
+ * compatible for all tasks used on a state.
*
* @param state The state to check
* @param result the validation result to append to
@@ -545,7 +545,7 @@ public class AxPolicyModel extends AxModel {
/**
* Validate that the fields on a task of a state output and the events that trigger it are
- * compatible
+ * compatible.
*
* @param state The state to check
* @param task The task to check
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java
index 6851e4859..fd1519620 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java
@@ -67,30 +67,30 @@ import org.onap.policy.apex.model.utilities.Assertions;
* next state. The outputs of a state {@link AxStateOutput} are held as a map in the state. Each
* state output contains the outgoing event of the state and optionally the next state to pass
* control to.
- * <p>
- * A state uses tasks {@link AxTask} to execute its logic. A state holds its tasks in a map and must
+ *
+ * <p>A state uses tasks {@link AxTask} to execute its logic. A state holds its tasks in a map and must
* have at least one task. A state uses Task Selection Logic {@link AxTaskSelectionLogic} to select
* which task should be executed in a given execution cycle. Optional Task Selection Logic can use
* fields on the incoming event and information from the context albums available on the state to
* decide what task to execute in a given context. The default task of a state is the task that is
* executed when task Selection Logic is not specified. In cases where only a single task is
* specified on a state, the default task must be that task and the state always executes that task.
- * <p>
- * What happens when a state completes its execution cycle depends on the task that is selected for
+ *
+ * <p>What happens when a state completes its execution cycle depends on the task that is selected for
* execution by the state. Therefore, the action to be performed a state on execution of each task
* must be defined in the state as a {@link AxStateTaskReference} instance for each task defined in
* the state. The {@link AxStateTaskReference} instance defines the action to be performed as either
* a {@link AxStateTaskOutputType} of {@link AxStateTaskOutputType#DIRECT} or
* {@link AxStateTaskOutputType#LOGIC} and contains an {@link AxReferenceKey} reference to the
* instance that will complete the state output.
- * <p>
- * In the case of direct output, the {@link AxReferenceKey} reference in the
+ *
+ * <p>In the case of direct output, the {@link AxReferenceKey} reference in the
* {@link AxStateTaskReference} instance is a reference to an {@link AxStateOutput} instance. The
* state output defines the event to be emitted by the state and the next state to pass control to
* if any. All fields of the executed task are marshaled onto the outgoing event automatically by
* Apex.
- * <p>
- * In the case of logic output, the {@link AxReferenceKey} reference in the
+ *
+ * <p>In the case of logic output, the {@link AxReferenceKey} reference in the
* {@link AxStateTaskReference} instance is a reference to State Finalizer Logic in an
* {@link AxStateFinalizerLogic} instance, which selects the {@link AxStateOutput} that the state
* will use. The state finalizer logic uses fields emitted by the executed task and information from
@@ -100,13 +100,13 @@ import org.onap.policy.apex.model.utilities.Assertions;
* the state. State Finalizer Logic must marshal the fields of the output event in whatever manner
* it wishes; Apex does not automatically transfer the output fields from the task directly to the
* output event.
- * <p>
- * The Task Selection Logic instance or State Finalizer Logic instances in a state may use
+ *
+ * <p>The Task Selection Logic instance or State Finalizer Logic instances in a state may use
* information in context albums to arrive at their task or state output selections. The context
* albums that the state uses and that should be made available to the state by Apex policy
* distribution are held as a set of references to context albums in the state.
- * <p>
- * During validation of a state, the validation checks listed below are executed:
+ *
+ * <p>During validation of a state, the validation checks listed below are executed:
* <ol>
* <li>The policy key must not be a null key and must be valid, see validation in
* {@link AxReferenceKey}
@@ -247,7 +247,7 @@ public class AxState extends AxConcept {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -322,10 +322,10 @@ public class AxState extends AxConcept {
* parent keys of all {@link AxTaskSelectionLogic}, {@link AxStateOutput}, and
* {@link AxStateFinalizerLogic} instance in the state.
*
- * @param u the unmarshaler that is unmarshaling the model
+ * @param unmarshaler the unmarshaler that is unmarshaling the model
* @param parent the parent object of this object in the unmarshaler
*/
- public void afterUnmarshal(final Unmarshaller u, final Object parent) {
+ public void afterUnmarshal(final Unmarshaller unmarshaler, final Object parent) {
if (!taskSelectionLogic.getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) {
taskSelectionLogic.getKey().setParentReferenceKey(key);
}
@@ -623,7 +623,7 @@ public class AxState extends AxConcept {
}
/**
- * Validate the state outputs of the state
+ * Validate the state outputs of the state.
*
* @param result the validation result to append to
*/
@@ -659,7 +659,7 @@ public class AxState extends AxConcept {
}
/**
- * Validate the context album references of the state
+ * Validate the context album references of the state.
*
* @param result the validation result to append to
*/
@@ -676,7 +676,7 @@ public class AxState extends AxConcept {
}
/**
- * Validate the task selection logic of the state
+ * Validate the task selection logic of the state.
*
* @param result the validation result to append to
* @return the result of the validation
@@ -694,7 +694,7 @@ public class AxState extends AxConcept {
}
/**
- * Validate all the state finalizer logic of the state
+ * Validate all the state finalizer logic of the state.
*
* @param result the validation result to append to
*/
@@ -717,7 +717,7 @@ public class AxState extends AxConcept {
}
/**
- * Validate the tasks used the state
+ * Validate the tasks used the state.
*
* @param result the validation result to append to
*/
@@ -762,7 +762,7 @@ public class AxState extends AxConcept {
}
/**
- * Validate the references of a task used in a state
+ * Validate the references of a task used in a state.
*
* @param taskKey The key of the task
* @param taskReference the task reference of the task
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateFinalizerLogic.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateFinalizerLogic.java
index 76704b051..d8ab0ce77 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateFinalizerLogic.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateFinalizerLogic.java
@@ -34,14 +34,14 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
/**
* This class holds State Finalizer Logic for {@link AxState} states in Apex. It is a specialization
* of the {@link AxLogic} class, so that State Finalizer Logic in Apex states can be strongly typed.
- * <p>
- * State Finalizer Logic is used to select the output {@link AxStateOutput} that a state will use.
+ *
+ * <p>State Finalizer Logic is used to select the output {@link AxStateOutput} that a state will use.
* The logic uses fields emitted by the executed {@link AxTask} task and information from the
* context albums available on a state to decide what state output {@link AxStateOutput} to select
* in a given context. State Finalizer Logic must marshal the output fields from the task onto the
* output event in whatever manner is appropriate for the domain being handled.
- * <p>
- * Validation uses standard Apex Logic validation, see validation in {@link AxLogic}.
+ *
+ * <p>Validation uses standard Apex Logic validation, see validation in {@link AxLogic}.
*/
@Entity
@Table(name = "AxStateFinalizerLogic")
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java
index a0c73c260..6f6117027 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java
@@ -52,8 +52,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
* state output is selected. If no next state is defined (the next state is a null
* {@link AxReferenceKey} key), then this state output outputs its event to an external system and
* is an output state for the full policy.
- * <p>
- * During validation of a state output, the validation checks listed below are executed:
+ *
+ * <p>During validation of a state output, the validation checks listed below are executed:
* <ol>
* <li>The state output key must not be a null key and must be valid, see validation in
* {@link AxReferenceKey}
@@ -105,7 +105,7 @@ public class AxStateOutput extends AxConcept {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java
index 8a43e371d..fdf73149f 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java
@@ -59,9 +59,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
* case of {@link AxStateTaskOutputType#LOGIC} output selection, the output reference key held in
* this {@link AxStateTaskReference} instance to an instance of an {@link AxStateFinalizerLogic}
* class. See the explanation in the {@link AxState} class for a full description of this handling.
- * <p>
- *
- * During validation of a state task reference, the validation checks listed below are executed:
+ *
+ * <p>During validation of a state task reference, the validation checks listed below are executed:
* <ol>
* <li>The state task reference key must not be a null key and must be valid, see validation in
* {@link AxReferenceKey}
@@ -111,7 +110,7 @@ public class AxStateTaskReference extends AxConcept {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java
index 478608ca4..0233aa6bf 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java
@@ -34,8 +34,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
* creates a tree that holds the state fan out branches in a policy that starts from the given top
* state of the tree. Each branch from a state is held in a set of next states for the top state and
* each branch in the state tree is itself a {@link AxStateTree} instance.
- * <p>
- * Validation checks for recursive state use, in other words validation forbids the use of a given
+ *
+ * <p>Validation checks for recursive state use, in other words validation forbids the use of a given
* state more than once in a state tree.
*/
public class AxStateTree implements Comparable<AxStateTree> {
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java
index f26331671..cf8f34ce7 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java
@@ -60,16 +60,16 @@ import org.onap.policy.apex.model.utilities.Assertions;
* This class holds the definition of a task in Apex. A task is executed by a state and performs
* some domain specific logic to carry out work required to be done by a policy. The Task Logic that
* is executed by a task is held in a {@link AxTaskLogic} instance.
- * <p>
- * A task has a set of input fields and output fields, which are passed to and are emitted from the
+ *
+ * <p>A task has a set of input fields and output fields, which are passed to and are emitted from the
* task during a task execution cycle. A task may have task parameters {@link AxTaskParameter},
* which are configuration values passed to a task at initialization time.
- * <p>
- * The Task Logic in a task may use information in context albums to perform their domain specific
+ *
+ * <p>The Task Logic in a task may use information in context albums to perform their domain specific
* work. The context albums that the task uses and that should be made available to the task by Apex
* policy distribution are held as a set of references to context albums in the task.
- * <p>
- * During validation of a task, the validation checks listed below are executed:
+ *
+ * <p>During validation of a task, the validation checks listed below are executed:
* <ol>
* <li>The task key must not be a null key and must be valid, see validation in
* {@link AxArtifactKey}
@@ -137,7 +137,7 @@ public class AxTask extends AxConcept {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -197,10 +197,10 @@ public class AxTask extends AxConcept {
* parent keys of all {@link AxInputField}, {@link AxOutputField}, and {@link AxTaskParameter}
* instance in the task.
*
- * @param u the unmarshaler that is unmarshaling the model
+ * @param unmarshaler the unmarshaler that is unmarshaling the model
* @param parent the parent object of this object in the unmarshaler
*/
- public void afterUnmarshal(final Unmarshaller u, final Object parent) {
+ public void afterUnmarshal(final Unmarshaller unmarshaler, final Object parent) {
taskLogic.getKey().setParentArtifactKey(key);
for (final AxInputField inputField : inputFields.values()) {
@@ -490,7 +490,7 @@ public class AxTask extends AxConcept {
}
/**
- * Validate a field
+ * Validate a field.
*
* @param key the key of the field to validate
* @param field the field to validate
@@ -516,7 +516,7 @@ public class AxTask extends AxConcept {
}
/**
- * Validate a task parameter entry
+ * Validate a task parameter entry.
*
* @param taskParameterEntry the task parameter entry to validate
* @param result The validation result to append to
@@ -540,7 +540,7 @@ public class AxTask extends AxConcept {
}
/**
- * Validate a context album reference entry
+ * Validate a context album reference entry.
*
* @param taskParameterEntry the context album reference entry to validate
* @param result The validation result to append to
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskLogic.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskLogic.java
index 00513e8f7..30f37ffe2 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskLogic.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskLogic.java
@@ -35,12 +35,12 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
/**
* This class holds Task Logic for {@link AxTask} tasks in Apex. It is a specialization of the
* {@link AxLogic} class, so that Task Logic in Apex states can be strongly typed.
- * <p>
- * Task Logic is used to execute tasks {@link AxTask} in Apex. The logic uses fields on the incoming
+ *
+ * <p>Task Logic is used to execute tasks {@link AxTask} in Apex. The logic uses fields on the incoming
* trigger event and information from the context albums available on a task to get context during
* execution. The task logic populates the output fields of the task.
- * <p>
- * Validation uses standard Apex Logic validation, see validation in {@link AxLogic}.
+ *
+ * <p>Validation uses standard Apex Logic validation, see validation in {@link AxLogic}.
*/
@Entity
@Table(name = "AxTaskLogic")
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java
index 5ae3bfa42..236956020 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java
@@ -76,7 +76,7 @@ public class AxTaskParameter extends AxConcept {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskSelectionLogic.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskSelectionLogic.java
index 89c9418a4..32d8ef3b3 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskSelectionLogic.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskSelectionLogic.java
@@ -34,12 +34,12 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
/**
* This class holds Task Selection Logic for {@link AxState} states in Apex. It is a specialization
* of the {@link AxLogic} class, so that Task Selection Logic in Apex states can be strongly typed.
- * <p>
- * Task Selection Logic is used to select the task {@link AxTask} that a state will execute. The
+ *
+ * <p>Task Selection Logic is used to select the task {@link AxTask} that a state will execute. The
* logic uses fields on the incoming trigger event and information from the context albums available
* on a state to decide what task {@link AxTask} to select for execution in a given context.
- * <p>
- * Validation uses standard Apex Logic validation, see validation in {@link AxLogic}.
+ *
+ * <p>Validation uses standard Apex Logic validation, see validation in {@link AxLogic}.
*/
@Entity
@Table(name = "AxTaskSelectionLogic")
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java
index 532d7d017..75fe632a6 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java
@@ -55,8 +55,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
* models that use tasks must have an {@link AxTasks} field. The {@link AxTasks} class implements
* the helper methods of the {@link AxConceptGetter} interface to allow {@link AxTask} instances to
* be retrieved by calling methods directly on this class without referencing the contained map.
- * <p>
- * Validation checks that the container key is not null. An error is issued if no tasks are defined
+ *
+ * <p>Validation checks that the container key is not null. An error is issued if no tasks are defined
* in the container. Each task entry is checked to ensure that its key and value are not null and
* that the key matches the key in the map value. Each task entry is then validated individually.
*/
@@ -92,7 +92,7 @@ public class AxTasks extends AxConcept implements AxConceptGetter<AxTask> {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -132,10 +132,10 @@ public class AxTasks extends AxConcept implements AxConceptGetter<AxTask> {
* hash map to a {@link NavigableMap} so that it will work with the {@link AxConceptGetter}
* interface.
*
- * @param u the unmarshaler that is unmarshaling the model
+ * @param unmarshaler the unmarshaler that is unmarshaling the model
* @param parent the parent object of this object in the unmarshaler
*/
- public void afterUnmarshal(final Unmarshaller u, final Object parent) {
+ public void afterUnmarshal(final Unmarshaller unmarshaler, final Object parent) {
// The map must be navigable to allow name and version searching, unmarshaling returns a
// hash map
final NavigableMap<AxArtifactKey, AxTask> navigableTaskMap = new TreeMap<>();
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyException.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyException.java
index 3b0d53f9c..271e0c2af 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyException.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyException.java
@@ -43,9 +43,9 @@ public class PolicyException extends ApexException {
* Instantiates a new apex policy exception with a message and a caused by exception.
*
* @param message the message
- * @param e the exception that caused this exception to be thrown
+ * @param exception the exception that caused this exception to be thrown
*/
- public PolicyException(final String message, final Exception e) {
- super(message, e);
+ public PolicyException(final String message, final Exception exception) {
+ super(message, exception);
}
}
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyRuntimeException.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyRuntimeException.java
index dbd2fb64f..7ad293187 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyRuntimeException.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/PolicyRuntimeException.java
@@ -43,9 +43,9 @@ public class PolicyRuntimeException extends ApexRuntimeException {
* Instantiates a new apex policy runtime exception with a message and a caused by exception.
*
* @param message the message
- * @param e the exception that caused this exception to be thrown
+ * @param exception the exception that caused this exception to be thrown
*/
- public PolicyRuntimeException(final String message, final Exception e) {
- super(message, e);
+ public PolicyRuntimeException(final String message, final Exception exception) {
+ super(message, exception);
}
}
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java
index 99058484b..244346c99 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalyser.java
@@ -38,7 +38,8 @@ import org.onap.policy.apex.model.policymodel.concepts.AxTask;
import org.onap.policy.apex.model.utilities.Assertions;
/**
- * This class analyses a policy model and shows what the usage of each context album, context item, data type, and event is.
+ * This class analyses a policy model and shows what the usage of each context album, context item, data type, and event
+ * is.
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java
index 2f5cd43d8..654ab2fc5 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java
@@ -32,7 +32,8 @@ import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum;
import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
/**
- * This class finds and holds the usage of context schemas, context albums, events, and tasks by the policies in a policy model.
+ * This class finds and holds the usage of context schemas, context albums, events, and tasks by the policies in a
+ * policy model.
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
@@ -50,8 +51,8 @@ public class PolicyAnalysisResult {
private final Map<AxArtifactKey, Set<AxKey>> taskUsage = new TreeMap<>();
/**
- * This constructor creates a {@link PolicyAnalysisResult} instance that holds maps that contain the usage of context schemas, contxt albums, events, and
- * tasks by all policies in a policy model.
+ * This constructor creates a {@link PolicyAnalysisResult} instance that holds maps that contain the usage of
+ * context schemas, contxt albums, events, and tasks by all policies in a policy model.
*
* @param policyModel the policy model to analyse
*/
@@ -60,7 +61,8 @@ public class PolicyAnalysisResult {
contextSchemaUsage.put(contextSchemaKey, new TreeSet<AxKey>());
}
- for (final Entry<AxArtifactKey, AxContextAlbum> contextAlbumEntry : policyModel.getAlbums().getAlbumsMap().entrySet()) {
+ for (final Entry<AxArtifactKey, AxContextAlbum> contextAlbumEntry : policyModel.getAlbums().getAlbumsMap()
+ .entrySet()) {
contextAlbumUsage.put(contextAlbumEntry.getKey(), new TreeSet<AxKey>());
}
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelComparer.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelComparer.java
index 545a02e89..723e8b235 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelComparer.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyModelComparer.java
@@ -34,10 +34,9 @@ import org.onap.policy.apex.model.utilities.comparison.KeyedMapComparer;
import org.onap.policy.apex.model.utilities.comparison.KeyedMapDifference;
/**
- * This class compares two policy models {@link AxPolicyModel} and holds the result of that
- * comparison. It compares policy models on their keys, their context schema differences, their
- * event differences, their context album differences, their task differences, their policy
- * differences, and their key information differences.
+ * This class compares two policy models {@link AxPolicyModel} and holds the result of that comparison. It compares
+ * policy models on their keys, their context schema differences, their event differences, their context album
+ * differences, their task differences, their policy differences, and their key information differences.
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
@@ -47,8 +46,7 @@ public class PolicyModelComparer {
// Comparison of context schemas
private final KeyDifference<AxArtifactKey> contextSchemasKeyDifference;
- private KeyedMapDifference<AxArtifactKey, AxContextSchema> contextSchemaComparisonResult =
- new KeyedMapDifference<>();
+ private KeyedMapDifference<AxArtifactKey, AxContextSchema> contextSchemaCompareResult = new KeyedMapDifference<>();
// Comparison of events
private final KeyDifference<AxArtifactKey> eventsKeyDifference;
@@ -86,13 +84,14 @@ public class PolicyModelComparer {
policiesKeyDifference = new KeyComparer<AxArtifactKey>().compareKeys(left.getKey(), right.getKey());
keyInformationKeyDifference = new KeyComparer<AxArtifactKey>().compareKeys(left.getKey(), right.getKey());
- contextSchemaComparisonResult = new KeyedMapComparer<AxArtifactKey, AxContextSchema>().compareMaps(
+ contextSchemaCompareResult = new KeyedMapComparer<AxArtifactKey, AxContextSchema>().compareMaps(
left.getSchemas().getSchemasMap(), right.getSchemas().getSchemasMap());
eventComparisonResult = new KeyedMapComparer<AxArtifactKey, AxEvent>().compareMaps(
left.getEvents().getEventMap(), right.getEvents().getEventMap());
contextAlbumComparisonResult = new KeyedMapComparer<AxArtifactKey, AxContextAlbum>().compareMaps(
left.getAlbums().getAlbumsMap(), right.getAlbums().getAlbumsMap());
- taskComparisonResult = new KeyedMapComparer<AxArtifactKey, AxTask>().compareMaps(left.getTasks().getTaskMap(), right.getTasks().getTaskMap());
+ taskComparisonResult = new KeyedMapComparer<AxArtifactKey, AxTask>()
+ .compareMaps(left.getTasks().getTaskMap(), right.getTasks().getTaskMap());
policyComparisonResult = new KeyedMapComparer<AxArtifactKey, AxPolicy>().compareMaps(
left.getPolicies().getPolicyMap(), right.getPolicies().getPolicyMap());
keyInfoComparisonResult = new KeyedMapComparer<AxArtifactKey, AxKeyInfo>().compareMaps(
@@ -124,7 +123,7 @@ public class PolicyModelComparer {
* @return the difference between context schemas
*/
public KeyedMapDifference<AxArtifactKey, AxContextSchema> getContextSchemaComparisonResult() {
- return contextSchemaComparisonResult;
+ return contextSchemaCompareResult;
}
/**
@@ -242,7 +241,7 @@ public class PolicyModelComparer {
builder.append("*** context schema differences ***\n");
builder.append(contextSchemasKeyDifference.asString(diffsOnly));
- builder.append(contextSchemaComparisonResult.asString(diffsOnly, keysOnly));
+ builder.append(contextSchemaCompareResult.asString(diffsOnly, keysOnly));
builder.append("*** event differences ***\n");
builder.append(eventsKeyDifference.asString(diffsOnly));