2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2016-2018 Ericsson. All rights reserved.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.apex.plugins.context.distribution.infinispan;
23 import org.onap.policy.apex.context.parameters.DistributorParameters;
24 import org.onap.policy.apex.model.basicmodel.service.ParameterService;
27 * Distributor parameters for the Infinspan Distributor.
29 * @author Liam Fallon (liam.fallon@ericsson.com)
31 public class InfinispanDistributorParameters extends DistributorParameters {
34 /** The default Infinispan configuration file location. */
35 public static final String DEFAULT_INFINISPAN_DISTRIBUTION_CONFIG_FILE = "/infinispan/infinispan.xml";
37 /** The default Infinispan jgroups configuration file location. */
38 public static final String DEFAULT_INFINISPAN_DISTRIBUTION_JGROUPS_FILE = null;
40 /** The default Infinispan IP stack is IPV4. */
41 public static final boolean DEFAULT_INFINISPAN_JAVA_NET_PREFER_IPV4_STACK = true;
43 /** The default Infinispan bind address is localhost. */
44 public static final String DEFAULT_INFINSPAN_JGROUPS_BIND_ADDRESS = "localhost";
46 // Infinspan configuration file names
47 private String configFile = DEFAULT_INFINISPAN_DISTRIBUTION_CONFIG_FILE;
48 private String jgroupsFile = DEFAULT_INFINISPAN_DISTRIBUTION_JGROUPS_FILE;
49 private boolean preferIPv4Stack = DEFAULT_INFINISPAN_JAVA_NET_PREFER_IPV4_STACK;
50 private String jGroupsBindAddress = DEFAULT_INFINSPAN_JGROUPS_BIND_ADDRESS;
56 public InfinispanDistributorParameters() {
57 super(InfinispanDistributorParameters.class.getCanonicalName());
58 ParameterService.registerParameters(InfinispanDistributorParameters.class, this);
59 ParameterService.registerParameters(DistributorParameters.class, this);
63 * Gets the config file.
65 * @return the config file
67 public String getConfigFile() {
72 * Sets the config file.
74 * @param configFile the config file
76 public void setConfigFile(final String configFile) {
77 this.configFile = configFile;
81 * Gets the jgroups file.
83 * @return the jgroups file
85 public String getJgroupsFile() {
90 * Sets the jgroups file.
92 * @param jgroupsFile the jgroups file
94 public void setJgroupsFile(final String jgroupsFile) {
95 this.jgroupsFile = jgroupsFile;
99 * Prefer I pv 4 stack.
101 * @return true, if prefer I pv 4 stack
103 public boolean preferIPv4Stack() {
104 return preferIPv4Stack;
108 * Sets the prefer I pv 4 stack.
110 * @param preferIPv4Stack the prefer I pv 4 stack
112 public void setPreferIPv4Stack(final boolean preferIPv4Stack) {
113 this.preferIPv4Stack = preferIPv4Stack;
117 * Getj groups bind address.
119 * @return the j groups bind address
121 public String getjGroupsBindAddress() {
122 return jGroupsBindAddress;
126 * Setj groups bind address.
128 * @param jGroupsBindAddress the j groups bind address
130 public void setjGroupsBindAddress(final String jGroupsBindAddress) {
131 this.jGroupsBindAddress = jGroupsBindAddress;
137 * @see com.ericsson.apex.context.parameters.DistributorParameters#toString()
140 public String toString() {
141 return "InfinispanDistributorParameters [configFile=" + configFile + ", jgroupsFile=" + jgroupsFile
142 + ", preferIPv4Stack=" + preferIPv4Stack + ", jGroupsBindAddress=" + jGroupsBindAddress + "]";