2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2016-2018 Ericsson. 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.apex.context.parameters;
24 import org.onap.policy.common.parameters.ParameterGroupImpl;
25 import org.onap.policy.common.parameters.annotations.NotNull;
26 import org.onap.policy.common.parameters.annotations.Valid;
30 * Bean class to hold parameters for context handling in Apex. This class contains all the context parameters for schema
31 * handling, distribution, locking, and persistence of context albums.
33 * <p>The following parameters are defined:
35 * <li>flushPeriod: Context is flushed to any persistor plugin that is defined periodically, and the period for flushing
36 * is the flush period.
37 * <li>distributorParameters: The parameters (a {@link DistributorParameters} instance) for the distributor plugin that
38 * is being used for context album distribution
39 * <li>schemaParameters: The parameters (a {@link SchemaParameters} instance) for the schema plugin that is being used
40 * for context album schemas
41 * <li>lockManagerParameters: The parameters (a {@link LockManagerParameters} instance) for the locking mechanism plugin
42 * that is being used for context album locking
43 * <li>persistorParameters: The parameters (a {@link PersistorParameters} instance) for the persistence plugin that is
44 * being used for context album persistence
48 public class ContextParameters extends ParameterGroupImpl {
49 private @Valid DistributorParameters distributorParameters = new DistributorParameters();
50 private @Valid SchemaParameters schemaParameters = new SchemaParameters();
51 private @Valid LockManagerParameters lockManagerParameters = new LockManagerParameters();
52 private @Valid PersistorParameters persistorParameters = new PersistorParameters();
56 * Constructor to create a context parameters instance and register the instance with the parameter service.
58 public ContextParameters() {
59 super(ContextParameterConstants.MAIN_GROUP_NAME);
63 * Gets the distributor parameters.
65 * @return the distributor parameters
67 public DistributorParameters getDistributorParameters() {
68 return distributorParameters;
72 * Sets the distributor parameters.
74 * @param distributorParameters the distributor parameters
76 public void setDistributorParameters(final DistributorParameters distributorParameters) {
77 this.distributorParameters = distributorParameters;
81 * Gets the schema parameters.
83 * @return the schema parameters
85 public SchemaParameters getSchemaParameters() {
86 return schemaParameters;
90 * Sets the schema parameters.
92 * @param schemaParameters the schema parameters
94 public void setSchemaParameters(final SchemaParameters schemaParameters) {
95 this.schemaParameters = schemaParameters;
99 * Gets the lock manager parameters.
101 * @return the lock manager parameters
103 public LockManagerParameters getLockManagerParameters() {
104 return lockManagerParameters;
108 * Sets the lock manager parameters.
110 * @param lockManagerParameters the lock manager parameters
112 public void setLockManagerParameters(final LockManagerParameters lockManagerParameters) {
113 this.lockManagerParameters = lockManagerParameters;
117 * Gets the persistor parameters.
119 * @return the persistor parameters
121 public PersistorParameters getPersistorParameters() {
122 return persistorParameters;
126 * Sets the persistor parameters.
128 * @param persistorParameters the persistor parameters
130 public void setPersistorParameters(final PersistorParameters persistorParameters) {
131 this.persistorParameters = persistorParameters;
135 public String toString() {
136 return "ContextParameters [name=" + getName() + ", distributorParameters=" + distributorParameters
137 + ", schemaParameters=" + schemaParameters + ", lockManagerParameters=" + lockManagerParameters
138 + ", persistorParameters=" + persistorParameters + "]";