aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/cds/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-04-26 18:16:36 -0400
committerJim Hahn <jrh3@att.com>2021-04-29 11:35:02 -0400
commit4fdecb037bd2609a6b977adba6d2f263c977d9e1 (patch)
treecac0861d73c073e33e2b677fc6c9356e3dcf3574 /models-interactions/model-impl/cds/src/main
parent6e589fc31f69482d2cf5bf57c733094394439b0f (diff)
Remove GroupValidationResult
Removed GroupValidationResult, replacing it with BeanValidationResult. Modified the ParameterGroup subclasses to use BeanValidator, adding annotations where needed to trigger the validations that had been automatically performed by GroupValidationResult. Issue-ID: POLICY-2059 Change-Id: I245e4a647fcbb718faa63a7543f9f81c85da958c Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-impl/cds/src/main')
-rw-r--r--models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java6
-rw-r--r--models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/properties/CdsServerProperties.java11
2 files changed, 6 insertions, 11 deletions
diff --git a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java
index 2dc128fd7..29fa687c0 100644
--- a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java
+++ b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorGrpcClient.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Bell Canada.
- * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import java.util.concurrent.CountDownLatch;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.policy.cds.api.CdsProcessorListener;
import org.onap.policy.cds.properties.CdsServerProperties;
-import org.onap.policy.common.parameters.GroupValidationResult;
+import org.onap.policy.common.parameters.ValidationResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -50,7 +50,7 @@ public class CdsProcessorGrpcClient implements AutoCloseable {
* @param listener the listener to listen on
*/
public CdsProcessorGrpcClient(final CdsProcessorListener listener, CdsServerProperties props) {
- final GroupValidationResult validationResult = props.validate();
+ final ValidationResult validationResult = props.validate();
Preconditions.checkState(validationResult.getStatus().isValid(), "Error validating CDS server "
+ "properties: " + validationResult.getResult());
diff --git a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/properties/CdsServerProperties.java b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/properties/CdsServerProperties.java
index 1b3149089..1c3eab805 100644
--- a/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/properties/CdsServerProperties.java
+++ b/models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/properties/CdsServerProperties.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Bell Canada.
+ * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,8 +24,7 @@ import java.util.Base64;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
-import org.onap.policy.common.parameters.GroupValidationResult;
-import org.onap.policy.common.parameters.ParameterGroup;
+import org.onap.policy.common.parameters.ParameterGroupImpl;
import org.onap.policy.common.parameters.ParameterRuntimeException;
import org.onap.policy.common.parameters.annotations.Max;
import org.onap.policy.common.parameters.annotations.Min;
@@ -33,7 +33,7 @@ import org.onap.policy.common.parameters.annotations.NotNull;
@Getter
@Setter
@ToString
-public class CdsServerProperties implements ParameterGroup {
+public class CdsServerProperties extends ParameterGroupImpl {
// Port range constants
private static final int MIN_USER_PORT = 1024;
@@ -71,11 +71,6 @@ public class CdsServerProperties implements ParameterGroup {
throw new ParameterRuntimeException("The name of this ParameterGroup implementation is always " + getName());
}
- @Override
- public GroupValidationResult validate() {
- return new GroupValidationResult(this);
- }
-
/**
* Generate base64-encoded Authorization header from username and password.
*