org.hibernate.search.elasticsearch.work.impl

## Class SimpleElasticsearchWork<R>

- java.lang.Object
- - org.hibernate.search.elasticsearch.work.impl.SimpleElasticsearchWork<R>

- All Implemented Interfaces:
    ElasticsearchWork<R>
  Direct Known Subclasses:
    ClearScrollWork, CloseIndexWork, CreateIndexWork, DropIndexWork, ES2DeleteByQueryWork, ES2FlushWork, ES2OptimizeWork, ES5DeleteByQueryWork, ES5FlushWork, ES5OptimizeWork, ExplainWork, GetIndexSettingsWork, GetIndexTypeMappingsWork, IndexExistsWork, OpenIndexWork, PutIndexSettingsWork, PutIndexTypeMappingWork, RefreshWork, ScrollWork, SearchWork, SimpleBulkableElasticsearchWork, WaitForIndexStatusWork

      public abstract class SimpleElasticsearchWork<R>
      extends Object
      implements ElasticsearchWork<R>

  Author:
    Gunnar Morling, Yoann Rodiere

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `SimpleElasticsearchWork.Builder<B>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected URLEncodedString` | `dirtiedIndexName`
    `protected boolean` | `markIndexDirty`
    `protected ElasticsearchRequest` | `request`
    `protected ElasticsearchRequestSuccessAssessor` | `resultAssessor`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SimpleElasticsearchWork(SimpleElasticsearchWork.Builder<?> builder)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected CompletableFuture<?>` | `afterSuccess(ElasticsearchWorkExecutionContext executionContext)`
    `void` | `aggregate(ElasticsearchWorkAggregator aggregator)`
    `protected CompletableFuture<?>` | `beforeExecute(ElasticsearchWorkExecutionContext executionContext, ElasticsearchRequest request)`
    `CompletableFuture<R>` | `execute(ElasticsearchWorkExecutionContext executionContext)`
    `protected abstract R` | `generateResult(ElasticsearchWorkExecutionContext context, ElasticsearchResponse response)`
    `LuceneWork` | `getLuceneWork()`
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### request

          protected final ElasticsearchRequest request

    - #### dirtiedIndexName

          protected final URLEncodedString dirtiedIndexName

    - #### resultAssessor

          protected final ElasticsearchRequestSuccessAssessor resultAssessor

    - #### markIndexDirty

          protected final boolean markIndexDirty

  - ### Constructor Detail

    - #### SimpleElasticsearchWork

          protected SimpleElasticsearchWork(SimpleElasticsearchWork.Builder<?> builder)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### execute

          public final CompletableFuture<R> execute(ElasticsearchWorkExecutionContext executionContext)

      Specified by:
        `execute` in interface `ElasticsearchWork<R>`

    - #### beforeExecute

          protected CompletableFuture<?> beforeExecute(ElasticsearchWorkExecutionContext executionContext,
                                                       ElasticsearchRequest request)

    - #### afterSuccess

          protected CompletableFuture<?> afterSuccess(ElasticsearchWorkExecutionContext executionContext)

    - #### generateResult

          protected abstract R generateResult(ElasticsearchWorkExecutionContext context,
                                              ElasticsearchResponse response)

    - #### aggregate

          public void aggregate(ElasticsearchWorkAggregator aggregator)

      Specified by:
        `aggregate` in interface `ElasticsearchWork<R>`

    - #### getLuceneWork

          public LuceneWork getLuceneWork()

      Specified by:
        `getLuceneWork` in interface `ElasticsearchWork<R>`
      Returns:
        the original Lucene works from which this work was derived.

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved