Class ElasticsearchIndexManager


  • public class ElasticsearchIndexManager
    extends Object
    Listen to any create / update and delete in order to keep the Elasticsearch indexes consistent.
    • Field Detail

      • client

        protected final co.elastic.clients.elasticsearch.ElasticsearchClient client
      • numberOfShards

        protected final String numberOfShards
      • numberOfReplicas

        protected final String numberOfReplicas
    • Constructor Detail

      • ElasticsearchIndexManager

        public ElasticsearchIndexManager​(co.elastic.clients.elasticsearch.ElasticsearchClient client,
                                         ElasticsearchUtils elasticsearchUtils,
                                         String numberOfShards,
                                         String numberOfReplicas)
    • Method Detail

      • defaultSettings

        public co.elastic.clients.elasticsearch.indices.IndexSettings defaultSettings()
                                                                               throws IOException
        Throws:
        IOException
      • defaultAnyMapping

        public co.elastic.clients.elasticsearch._types.mapping.TypeMapping defaultAnyMapping()
                                                                                      throws IOException
        Throws:
        IOException
      • defaultRealmMapping

        public co.elastic.clients.elasticsearch._types.mapping.TypeMapping defaultRealmMapping()
                                                                                        throws IOException
        Throws:
        IOException
      • defaultAuditMapping

        public co.elastic.clients.elasticsearch._types.mapping.TypeMapping defaultAuditMapping()
                                                                                        throws IOException
        Throws:
        IOException
      • doCreateAnyIndex

        protected co.elastic.clients.elasticsearch.indices.CreateIndexResponse doCreateAnyIndex​(String domain,
                                                                                                AnyTypeKind kind,
                                                                                                co.elastic.clients.elasticsearch.indices.IndexSettings settings,
                                                                                                co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings)
                                                                                         throws IOException
        Throws:
        IOException
      • createAnyIndex

        public void createAnyIndex​(String domain,
                                   AnyTypeKind kind,
                                   co.elastic.clients.elasticsearch.indices.IndexSettings settings,
                                   co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings)
                            throws IOException
        Throws:
        IOException
      • doCreateRealmIndex

        protected co.elastic.clients.elasticsearch.indices.CreateIndexResponse doCreateRealmIndex​(String domain,
                                                                                                  co.elastic.clients.elasticsearch.indices.IndexSettings settings,
                                                                                                  co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings)
                                                                                           throws IOException
        Throws:
        IOException
      • createRealmIndex

        public void createRealmIndex​(String domain,
                                     co.elastic.clients.elasticsearch.indices.IndexSettings settings,
                                     co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings)
                              throws IOException
        Throws:
        IOException
      • doCreateAuditIndex

        protected co.elastic.clients.elasticsearch.indices.CreateIndexResponse doCreateAuditIndex​(String domain,
                                                                                                  co.elastic.clients.elasticsearch.indices.IndexSettings settings,
                                                                                                  co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings)
                                                                                           throws IOException
        Throws:
        IOException
      • createAuditIndex

        public void createAuditIndex​(String domain,
                                     co.elastic.clients.elasticsearch.indices.IndexSettings settings,
                                     co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings)
                              throws IOException
        Throws:
        IOException