2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
4 * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.api.main.parameters;
24 import java.util.List;
26 import org.onap.policy.common.endpoints.parameters.RestServerParameters;
27 import org.onap.policy.common.parameters.ParameterGroupImpl;
28 import org.onap.policy.common.parameters.annotations.NotBlank;
29 import org.onap.policy.common.parameters.annotations.NotNull;
30 import org.onap.policy.common.parameters.annotations.Valid;
31 import org.onap.policy.models.provider.PolicyModelsProviderParameters;
34 * Class to hold all parameters needed for Api component.
38 public class ApiParameterGroup extends ParameterGroupImpl {
41 private final RestServerParameters restServerParameters;
43 private final PolicyModelsProviderParameters databaseProviderParameters;
44 private final List<@NotNull @NotBlank String> preloadPolicyTypes;
45 private final List<@NotNull @NotBlank String> preloadPolicies;
48 * Create the api parameter group.
50 * @param name the parameter group name
51 * @param restServerParameters the parameters for instantiating API rest server
52 * @param databaseProviderParameters the parameters for instantiating database provider
53 * @param preloadPolicyTypes the list of preloaded policy types
54 * @param preloadPolicies the list of preloaded policies
56 public ApiParameterGroup(final String name, final RestServerParameters restServerParameters,
57 final PolicyModelsProviderParameters databaseProviderParameters, final List<String> preloadPolicyTypes,
58 final List<String> preloadPolicies) {
60 this.restServerParameters = restServerParameters;
61 this.databaseProviderParameters = databaseProviderParameters;
62 this.preloadPolicyTypes = preloadPolicyTypes;
63 this.preloadPolicies = preloadPolicies;