aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-03-02 14:50:11 -0500
committerJim Hahn <jrh3@att.com>2020-03-02 14:54:59 -0500
commit0c7c1085d77033334a5bb78a8b7c04ff204cb99e (patch)
tree279d85d17de55f85f2c7f4a07ad6d2a06963b2fb
parentd0ba41b23a788bc557f451a0c66f0095c10dd390 (diff)
Log Actor parameter error message
When an operation cannot be configured, the message did not include information describing the issue. Fixed it. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I671bf27693a8bfa87305099fcefa0e4e0c48928d
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java10
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImpl.java7
2 files changed, 3 insertions, 14 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java
index 49379b28c..4347c1d10 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/ActorService.java
@@ -31,7 +31,6 @@ import java.util.Map;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
import java.util.Set;
-import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.controlloop.actorserviceprovider.impl.StartConfigPartial;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ParameterValidationRuntimeException;
import org.onap.policy.controlloop.actorserviceprovider.spi.Actor;
@@ -139,8 +138,6 @@ public class ActorService extends StartConfigPartial<Map<String, Object>> {
protected void doConfigure(Map<String, Object> parameters) {
logger.info("configuring actors");
- BeanValidationResult valres = new BeanValidationResult("ActorService", parameters);
-
for (Actor actor : name2actor.values()) {
String actorName = actor.getName();
Object paramValue = parameters.get(actorName);
@@ -153,8 +150,7 @@ public class ActorService extends StartConfigPartial<Map<String, Object>> {
actor.configure(subparams);
} catch (ParameterValidationRuntimeException e) {
- logger.warn("failed to configure actor {}", actorName, e);
- valres.addResult(e.getResult());
+ logger.warn("failed to configure actor {} because:\n{}", actorName, e.getResult().getResult(), e);
} catch (RuntimeException e) {
logger.warn("failed to configure actor {}", actorName, e);
@@ -167,10 +163,6 @@ public class ActorService extends StartConfigPartial<Map<String, Object>> {
logger.warn("missing configuration parameters for actor {}; actor cannot be started", actorName);
}
}
-
- if (!valres.isValid() && logger.isWarnEnabled()) {
- logger.warn("actor services validation errors:\n{}", valres.getResult());
- }
}
@Override
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImpl.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImpl.java
index 12af030d5..6113f9391 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImpl.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/ActorImpl.java
@@ -27,7 +27,6 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
-import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.controlloop.actorserviceprovider.Operator;
import org.onap.policy.controlloop.actorserviceprovider.Util;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ParameterValidationRuntimeException;
@@ -124,8 +123,6 @@ public class ActorImpl extends StartConfigPartial<Map<String, Object>> implement
final String actorName = getName();
logger.info("configuring operations for actor {}", actorName);
- BeanValidationResult valres = new BeanValidationResult(actorName, parameters);
-
// function that creates operator-specific parameters, given the operation name
Function<String, Map<String, Object>> opParamsMaker = makeOperatorParameters(parameters);
@@ -139,8 +136,8 @@ public class ActorImpl extends StartConfigPartial<Map<String, Object>> implement
operator.configure(subparams);
} catch (ParameterValidationRuntimeException e) {
- logger.warn("failed to configure operation {}.{}", actorName, operName, e);
- valres.addResult(e.getResult());
+ logger.warn("failed to configure operation {}.{} because:\n{}", actorName, operName,
+ e.getResult().getResult(), e);
} catch (RuntimeException e) {
logger.warn("failed to configure operation {}.{}", actorName, operName, e);