2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License ati
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
25 package org.openecomp.sa.searchdbabstraction.elasticsearch.config;
27 import java.util.Properties;
29 public class ElasticSearchConfig {
30 private String ipAddress;
31 private String httpPort;
32 private String javaApiPort;
33 private String clusterName;
35 public static final String ES_CLUSTER_NAME = "es.cluster-name";
36 public static final String ES_IP_ADDRESS = "es.ip-address";
37 public static final String ES_HTTP_PORT = "es.http-port";
39 private static final String JAVA_API_PORT_DEFAULT = "9300";
41 public ElasticSearchConfig(Properties props) {
43 setClusterName(props.getProperty(ES_CLUSTER_NAME));
44 setIpAddress(props.getProperty(ES_IP_ADDRESS));
45 setHttpPort(props.getProperty(ES_HTTP_PORT));
46 setJavaApiPort(JAVA_API_PORT_DEFAULT);
49 public String getIpAddress() {
53 public void setIpAddress(String ipAddress) {
54 this.ipAddress = ipAddress;
57 public String getHttpPort() {
61 public void setHttpPort(String httpPort) {
62 this.httpPort = httpPort;
65 public String getJavaApiPort() {
69 public void setJavaApiPort(String javaApiPort) {
70 this.javaApiPort = javaApiPort;
73 public String getClusterName() {
77 public void setClusterName(String clusterName) {
78 this.clusterName = clusterName;
82 public String toString() {
83 return "ElasticSearchConfig [ipAddress=" + ipAddress + ", httpPort=" + httpPort
84 + ", javaApiPort=" + javaApiPort + ", clusterName=" + clusterName + "]";