2 * ===============================LICENSE_START======================================
\r
4 * ================================================================================
\r
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============================LICENSE_END===========================================
\r
21 package org.openecomp.dcae.apod.analytics.cdap.tca.validator;
\r
23 import org.openecomp.dcae.apod.analytics.cdap.common.validation.CDAPAppSettingsValidator;
\r
24 import org.openecomp.dcae.apod.analytics.cdap.tca.settings.TCAAppConfig;
\r
25 import org.openecomp.dcae.apod.analytics.common.validation.GenericValidationResponse;
\r
27 import static org.openecomp.dcae.apod.analytics.cdap.common.utils.ValidationUtils.isEmpty;
\r
31 * TCA App Config Validator validates any TCA App Config parameter values
\r
34 * @author Rajiv Singla . Creation Date: 10/24/2016.
\r
36 public class TCAAppConfigValidator implements CDAPAppSettingsValidator<TCAAppConfig,
\r
37 GenericValidationResponse<TCAAppConfig>> {
\r
39 private static final long serialVersionUID = 1L;
\r
42 public GenericValidationResponse<TCAAppConfig> validateAppSettings(TCAAppConfig tcaAppConfig) {
\r
44 final GenericValidationResponse<TCAAppConfig> validationResponse = new GenericValidationResponse<>();
\r
46 if (isEmpty(tcaAppConfig.getTcaSubscriberOutputStreamName())) {
\r
47 validationResponse.addErrorMessage("tcaSubscriberOutputStreamName",
\r
48 "tcaSubscriberOutputStreamName must be present");
\r
51 if (isEmpty(tcaAppConfig.getTcaVESMessageStatusTableName())) {
\r
52 validationResponse.addErrorMessage("tcaVESMessageStatusTableName",
\r
53 "tcaVESMessageStatusTableName must be present");
\r
55 if (isEmpty(tcaAppConfig.getTcaVESAlertsTableName())) {
\r
56 validationResponse.addErrorMessage("tcaVESAlertsTableName",
\r
57 "tcaVESAlertsTableName must be present");
\r
60 return validationResponse;
\r