From e168ce2fad71650ad730519c772a9b093c0a8f43 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 28 Apr 2021 15:45:22 -0400 Subject: 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: I2c0c01fac355e6cde4d8d6998dc42f8a2e2ebb65 Signed-off-by: Jim Hahn --- .../services/onappf/parameters/ApexStarterParameterGroup.java | 8 +++++--- .../services/onappf/parameters/ApexStarterParameterHandler.java | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'services/services-onappf/src/main/java') diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterGroup.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterGroup.java index 17550d003..f752348b4 100644 --- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterGroup.java +++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterGroup.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * 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. @@ -26,6 +27,7 @@ import org.onap.policy.common.endpoints.parameters.TopicParameterGroup; import org.onap.policy.common.parameters.ParameterGroupImpl; import org.onap.policy.common.parameters.annotations.NotBlank; import org.onap.policy.common.parameters.annotations.NotNull; +import org.onap.policy.common.parameters.annotations.Valid; /** * Class to hold all parameters needed for apex starter component. @@ -36,9 +38,9 @@ import org.onap.policy.common.parameters.annotations.NotNull; @NotBlank @Getter public class ApexStarterParameterGroup extends ParameterGroupImpl { - private RestServerParameters restServerParameters; - private PdpStatusParameters pdpStatusParameters; - private TopicParameterGroup topicParameterGroup; + private @Valid RestServerParameters restServerParameters; + private @Valid PdpStatusParameters pdpStatusParameters; + private @Valid TopicParameterGroup topicParameterGroup; /** * Create the apex starter parameter group. diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterHandler.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterHandler.java index 05ae8fd57..691b30d2d 100644 --- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterHandler.java +++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterHandler.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2020 Nordix Foundation. + * 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,7 +24,7 @@ package org.onap.policy.apex.services.onappf.parameters; import java.io.File; import org.onap.policy.apex.services.onappf.ApexStarterCommandLineArguments; import org.onap.policy.apex.services.onappf.exception.ApexStarterException; -import org.onap.policy.common.parameters.GroupValidationResult; +import org.onap.policy.common.parameters.ValidationResult; import org.onap.policy.common.utils.coder.Coder; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; @@ -70,7 +71,7 @@ public class ApexStarterParameterHandler { } // validate the parameters - final GroupValidationResult validationResult = apexStarterParameterGroup.validate(); + final ValidationResult validationResult = apexStarterParameterGroup.validate(); if (!validationResult.isValid()) { String returnMessage = "validation error(s) on parameters from \"" + arguments.getConfigurationFilePath() + "\"\n"; -- cgit 1.2.3-korg