2  * ============LICENSE_START=======================================================
 
   3  *  Copyright (C) 2018 Ericsson. All rights reserved.
 
   4  *  Copyright (C) 2019 Nordix Foundation.
 
   5  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
 
   6  * ================================================================================
 
   7  * Licensed under the Apache License, Version 2.0 (the "License");
 
   8  * you may not use this file except in compliance with the License.
 
   9  * You may obtain a copy of the License at
 
  11  *      http://www.apache.org/licenses/LICENSE-2.0
 
  13  * Unless required by applicable law or agreed to in writing, software
 
  14  * distributed under the License is distributed on an "AS IS" BASIS,
 
  15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  16  * See the License for the specific language governing permissions and
 
  17  * limitations under the License.
 
  19  * SPDX-License-Identifier: Apache-2.0
 
  20  * ============LICENSE_END=========================================================
 
  23 package org.onap.policy.distribution.reception.parameters;
 
  27 import org.onap.policy.common.parameters.BeanValidationResult;
 
  28 import org.onap.policy.common.parameters.BeanValidator;
 
  29 import org.onap.policy.common.parameters.ParameterGroup;
 
  30 import org.onap.policy.common.parameters.annotations.ClassName;
 
  31 import org.onap.policy.common.parameters.annotations.NotBlank;
 
  32 import org.onap.policy.common.parameters.annotations.NotNull;
 
  33 import org.onap.policy.common.parameters.annotations.Valid;
 
  36  * Class to hold all the reception handler parameters.
 
  38  * @author Ram Krishna Verma (ram.krishna.verma@ericsson.com)
 
  43 public class ReceptionHandlerParameters implements ParameterGroup {
 
  44     private @Setter String name;
 
  45     private String receptionHandlerType;
 
  46     private @ClassName String receptionHandlerClassName;
 
  47     private String receptionHandlerConfigurationName;
 
  48     private @Valid PluginHandlerParameters pluginHandlerParameters;
 
  51      * Constructor for instantiating ReceptionHandlerParameters.
 
  53      * @param receptionHandlerType the reception handler type
 
  54      * @param receptionHandlerClassName the reception handler class name
 
  55      * @param receptionHandlerConfigurationName the name of the configuration for the reception handler
 
  56      * @param pluginHandlerParameters the plugin handler parameters
 
  58     public ReceptionHandlerParameters(final String receptionHandlerType, final String receptionHandlerClassName,
 
  59             final String receptionHandlerConfigurationName, final PluginHandlerParameters pluginHandlerParameters) {
 
  60         this.receptionHandlerType = receptionHandlerType;
 
  61         this.receptionHandlerClassName = receptionHandlerClassName;
 
  62         this.receptionHandlerConfigurationName = receptionHandlerConfigurationName;
 
  63         this.pluginHandlerParameters = pluginHandlerParameters;
 
  67     public String getName() {
 
  68         return name + "_" + receptionHandlerType;
 
  72      * Validate the reception handler parameters.
 
  76     public BeanValidationResult validate() {
 
  77         return new BeanValidator().validateTop(getClass().getSimpleName(), this);