001/* 002 * (C) Copyright 2016 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Funsho David 018 */ 019 020package org.nuxeo.elasticsearch.api; 021 022import org.elasticsearch.client.transport.TransportClient; 023import org.elasticsearch.common.settings.Settings; 024import org.nuxeo.elasticsearch.config.ElasticSearchRemoteConfig; 025 026/** 027 * This service enables the initialization of the Elasticsearch transport client and his settings 028 * 029 * @since 9.1 030 */ 031public interface ESClientInitializationService { 032 033 /** 034 * Initialize Elasticsearch client settings 035 * 036 * @param config the cluster configuration 037 * @return the client settings 038 */ 039 Settings initializeSettings(ElasticSearchRemoteConfig config); 040 041 /** 042 * Initialize Elasticsearch client 043 * 044 * @param settings the client settings 045 * @return the client 046 */ 047 TransportClient initializeClient(Settings settings); 048 049 /** 050 * Get username if authentication is required 051 * 052 * @return the username 053 */ 054 String getUsername(); 055 056 /** 057 * Set username for authentication 058 * 059 * @param username the username 060 */ 061 void setUsername(String username); 062 063 /** 064 * Get password if authentication is required 065 * 066 * @return the password 067 */ 068 String getPassword(); 069 070 /** 071 * Set password for authentication 072 * 073 * @param password the password 074 */ 075 void setPassword(String password); 076 077 /** 078 * Get ssl keystore path 079 * 080 * @return the keystore path 081 * @since 8.10-HF08, 9.2 082 */ 083 String getSslKeystorePath(); 084 085 /** 086 * Set ssl keystore path 087 * 088 * @param sslKeystorePath the keystore path 089 * @since 8.10-HF08, 9.2 090 */ 091 void setSslKeystorePath(String sslKeystorePath); 092 093 /** 094 * Get ssl keystore password 095 * 096 * @return the keystore password 097 * @since 8.10-HF08, 9.2 098 */ 099 String getSslKeystorePassword(); 100 101 /** 102 * Set ssl keystore password 103 * 104 * @param sslKeystorePassword the keystore password 105 * @since 8.10-HF08, 9.2 106 */ 107 void setSslKeystorePassword(String sslKeystorePassword); 108}