org.hibernate.search.backend

## Class LuceneWork

- java.lang.Object
- - org.hibernate.search.backend.LuceneWork

- Direct Known Subclasses:
    AddLuceneWork, DeleteByQueryLuceneWork, DeleteLuceneWork, FlushLuceneWork, OptimizeLuceneWork, PurgeAllLuceneWork, UpdateLuceneWork

      public abstract class LuceneWork
      extends Object

  Represent a unit of work to be applied against the Lucene index.

  Note:
  Instances of this class are passed between Virtual Machines when a master/slave configuration of Search is used. It is the responsibility of the `LuceneWorkSerializer` respectively `SerializationProvider` to serialize and de-serialize `LuceneWork` instances.

  Author:
    Emmanuel Bernard, Hardy Ferentschik, Sanne Grinovero

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LuceneWork(String tenantId, Serializable id, String idInString, IndexedTypeIdentifier typeIdentifier)`
    `LuceneWork(String tenantId, Serializable id, String idInString, IndexedTypeIdentifier typeIdentifier, Document document)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract <P,R> R` | `acceptIndexWorkVisitor(IndexWorkVisitor<P,R> visitor, P p)` Accepts the given visitor by dispatching the correct visit method for the specific `LuceneWork` sub-type.
    `Document` | `getDocument()`
    `Class<?>` | `getEntityClass()` Deprecated. use `getEntityType()`: this method will be removed!
    `IndexedTypeIdentifier` | `getEntityType()`
    `Map<String,String>` | `getFieldToAnalyzerMap()`
    `Serializable` | `getId()`
    `String` | `getIdInString()`
    `String` | `getTenantId()`

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

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

- - ### Constructor Detail

    - #### LuceneWork

          public LuceneWork(String tenantId,
                            Serializable id,
                            String idInString,
                            IndexedTypeIdentifier typeIdentifier)

    - #### LuceneWork

          public LuceneWork(String tenantId,
                            Serializable id,
                            String idInString,
                            IndexedTypeIdentifier typeIdentifier,
                            Document document)

  - ### Method Detail

    - #### getDocument

          public Document getDocument()

    - #### getEntityClass

          @Deprecated
          public Class<?> getEntityClass()

      Deprecated. use `getEntityType()`: this method will be removed!
      Returns:
        the Class identifying the entity type

    - #### getEntityType

          public IndexedTypeIdentifier getEntityType()

    - #### getId

          public Serializable getId()

    - #### getIdInString

          public String getIdInString()

    - #### getTenantId

          public String getTenantId()

    - #### acceptIndexWorkVisitor

          public abstract <P,R> R acceptIndexWorkVisitor(IndexWorkVisitor<P,R> visitor,
                                                         P p)

      Accepts the given visitor by dispatching the correct visit method for the specific `LuceneWork` sub-type.
      Type Parameters:
        `P` - Context parameter type expected by a specific visitor
        `R` - Return type provided by a specific visitor
      Parameters:
        `visitor` - the visitor to accept
        `p` - a visitor-specific context parameter
      Returns:
        a visitor-specific return value or `null` if this visitor doesn't return a result

    - #### getFieldToAnalyzerMap

          public Map<String,String> getFieldToAnalyzerMap()

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