Package de.pangaea.metadataportal.processor

## Class ElasticsearchConnection

- java.lang.Object
- - de.pangaea.metadataportal.processor.ElasticsearchConnection

- All Implemented Interfaces:
    `Closeable`, `AutoCloseable`

      public final class ElasticsearchConnection
      extends Object
      implements Closeable

  TODO
  Author:
    Uwe Schindler

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `ELASTICSEARCH_DEFAULT_PORT` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ElasticsearchConnection​(Config config)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `org.elasticsearch.client.Client` | `client()` |
    `void` | `close()` |
    `void` | `closeIndex​(TargetIndexConfig ticonf, String realIndexName, boolean cleanShutdown)` | Closes the index after harvesting and update the aliases to point to the active index.
    `String` | `createIndex​(TargetIndexConfig ticonf, boolean rebuilder)` | Creates the index (if needed), configures it (mapping), and creates aliases.
    `DocumentProcessor` | `getDocumentProcessor​(HarvesterConfig iconfig, String targetIndex)` |
    `void` | `updateAliases​(TargetIndexConfig ticonf)` | Closes the index after harvesting and update the aliases to point to the active index.
    `void` | `waitForYellow​(TargetIndexConfig ticonf)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ELASTICSEARCH_DEFAULT_PORT

          public static final int ELASTICSEARCH_DEFAULT_PORT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ElasticsearchConnection

          public ElasticsearchConnection​(Config config)

  - ### Method Detail

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Closeable`

    - #### client

          public org.elasticsearch.client.Client client()

    - #### getDocumentProcessor

          public DocumentProcessor getDocumentProcessor​(HarvesterConfig iconfig,
                                                        String targetIndex)

    - #### waitForYellow

          public void waitForYellow​(TargetIndexConfig ticonf)

    - #### createIndex

          public String createIndex​(TargetIndexConfig ticonf,
                                    boolean rebuilder)

      Creates the index (if needed), configures it (mapping), and creates aliases. The real index name to be used is returned.

    - #### closeIndex

          public void closeIndex​(TargetIndexConfig ticonf,
                                 String realIndexName,
                                 boolean cleanShutdown)

      Closes the index after harvesting and update the aliases to point to the active index.

    - #### updateAliases

          public void updateAliases​(TargetIndexConfig ticonf)

      Closes the index after harvesting and update the aliases to point to the active index.