2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 package org.onap.aai.sa.searchdbabstraction.elasticsearch.config;
23 import java.util.Properties;
25 public class ElasticSearchConfig {
26 private String ipAddress;
27 private String httpPort;
28 private String javaApiPort;
29 private String clusterName;
31 public static final String ES_CLUSTER_NAME = "es.cluster-name";
32 public static final String ES_IP_ADDRESS = "es.ip-address";
33 public static final String ES_HTTP_PORT = "es.http-port";
35 private static final String JAVA_API_PORT_DEFAULT = "9300";
37 public ElasticSearchConfig(Properties props) {
39 setClusterName(props.getProperty(ES_CLUSTER_NAME));
40 setIpAddress(props.getProperty(ES_IP_ADDRESS));
41 setHttpPort(props.getProperty(ES_HTTP_PORT));
42 setJavaApiPort(JAVA_API_PORT_DEFAULT);
45 public String getIpAddress() {
49 public void setIpAddress(String ipAddress) {
50 this.ipAddress = ipAddress;
53 public String getHttpPort() {
57 public void setHttpPort(String httpPort) {
58 this.httpPort = httpPort;
61 public String getJavaApiPort() {
65 public void setJavaApiPort(String javaApiPort) {
66 this.javaApiPort = javaApiPort;
69 public String getClusterName() {
73 public void setClusterName(String clusterName) {
74 this.clusterName = clusterName;
78 public String toString() {
79 return "ElasticSearchConfig [ipAddress=" + ipAddress + ", httpPort=" + httpPort + ", javaApiPort=" + javaApiPort
80 + ", clusterName=" + clusterName + "]";