Commit 5e39648d authored by Noel Alonso's avatar Noel Alonso
Browse files

Elimina beans no necesarios

parent a8b3328a
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;

import es.redmic.api.common.converter.QueryDTOMessageConverter;
import es.redmic.api.config.GenerateJsonSchemaScanBean;
import es.redmic.api.config.OrikaScanBean;
import es.redmic.api.config.ResourceBundleMessageSource;
import es.redmic.databaselib.common.repository.BaseRepositoryImpl;
import es.redmic.db.config.EntityManagerWrapper;
@@ -81,12 +80,6 @@ public class ApiApplication {
		return new EntityManagerWrapper();
	}

	@PostConstruct
	@Bean
	public OrikaScanBean orikaScanBean() {
		return new OrikaScanBean();
	}

	@PostConstruct
	@Bean
	public GenerateJsonSchemaScanBean generateSchemaScanBean() {
+0 −54
Original line number Diff line number Diff line
package es.redmic.api.config;

/*-
 * #%L
 * API
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import es.redmic.es.config.EsClientProvider;
import es.redmic.es.config.EsConfig;

@Configuration
public class ElasticsearchConfiguration {

	@Value("#{'${elastic.addresses}'.split(',')}")
	private List<String> addresses;
	@Value("${elastic.port}")
	private Integer port;
	@Value("${elastic.clusterName}")
	private String clusterName;
	@Value("${elastic.xpackSecurityUser}")
	private String xpackSecurityUser;
	
	@Bean
	public EsClientProvider esClientProvider() {

		EsConfig elastic = new EsConfig();
		elastic.setAddresses(addresses);
		elastic.setPort(port);
		elastic.setClusterName(clusterName);
		elastic.setXpackSecurityUser(xpackSecurityUser);
		return new EsClientProvider(elastic);
	}
}