package com.jay.monitor.data.server.config;

import com.jay.monitor.data.server.componts.ElasticSearchPartition;
import com.jay.monitor.data.server.componts.ElasticSearchPartitionImpl;
import com.jay.monitor.data.server.store.es.*;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.zxp.esclientrhl.annotation.EnableESTools;

@Configuration
@EnableESTools(basePackages = "com.jay.monitor.data.server.models.entity.es", printregmsg = true)
@ConditionalOnProperty(prefix = "spring.monitor-server", name = "store-type", havingValue = "es")
public class ElasticSearchBeanConfig {

    @Bean
    public ElasticSearchPartition elasticSearchPartition() {
        return new ElasticSearchPartitionImpl();
    }

    @Bean
    public ElasticMQStoreProcess elasticMQStoreProcess() {
        return new ElasticMQStoreProcess();
    }

    @Bean
    public ElasticSQLStoreProcess elasticSQLStoreProcess() {
        return new ElasticSQLStoreProcess();
    }

    @Bean
    public ElasticURLStoreProcess elasticURLStoreProcess() {
        return new ElasticURLStoreProcess();
    }

    @Bean
    public MQElasticSearchProcess mqElasticSearchProcess() {
        return new MQElasticSearchProcess();
    }

    @Bean
    public SQLElasticSearchProcess sqlElasticSearchProcess() {
        return new SQLElasticSearchProcess();
    }

    @Bean
    public URLElasticSearchProcess urlElasticSearchProcess() {
        return new URLElasticSearchProcess();
    }

}
