Format Java code to ONAP standard
[aai/search-data-service.git] / src / main / java / org / onap / aai / sa / searchdbabstraction / elasticsearch / config / ElasticSearchConfig.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
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
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
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=========================================================
20  */
21 package org.onap.aai.sa.searchdbabstraction.elasticsearch.config;
22
23 import java.util.Properties;
24
25 public class ElasticSearchConfig {
26     private String ipAddress;
27     private String httpPort;
28     private String javaApiPort;
29     private String clusterName;
30
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";
34
35     private static final String JAVA_API_PORT_DEFAULT = "9300";
36
37     public ElasticSearchConfig(Properties props) {
38
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);
43     }
44
45     public String getIpAddress() {
46         return ipAddress;
47     }
48
49     public void setIpAddress(String ipAddress) {
50         this.ipAddress = ipAddress;
51     }
52
53     public String getHttpPort() {
54         return httpPort;
55     }
56
57     public void setHttpPort(String httpPort) {
58         this.httpPort = httpPort;
59     }
60
61     public String getJavaApiPort() {
62         return javaApiPort;
63     }
64
65     public void setJavaApiPort(String javaApiPort) {
66         this.javaApiPort = javaApiPort;
67     }
68
69     public String getClusterName() {
70         return clusterName;
71     }
72
73     public void setClusterName(String clusterName) {
74         this.clusterName = clusterName;
75     }
76
77     @Override
78     public String toString() {
79         return "ElasticSearchConfig [ipAddress=" + ipAddress + ", httpPort=" + httpPort + ", javaApiPort=" + javaApiPort
80                 + ", clusterName=" + clusterName + "]";
81     }
82
83 }