org.hibernate.search.indexes.serialization.impl

## Class LuceneWorkSerializerImpl

- java.lang.Object
- - org.hibernate.search.indexes.serialization.impl.LuceneWorkSerializerImpl

- All Implemented Interfaces:
    Service, Startable, Stoppable, LuceneWorkSerializer

      public class LuceneWorkSerializerImpl
      extends Object
      implements LuceneWorkSerializer, Startable, Stoppable

  Serializes `List<LuceneWork>` instances back and forth using a pluggable `SerializerProvider`. This class controls the overall traversal process and delegates true serialization work to the `SerializerProvider`.
  Author:
    Emmanuel Bernard <emmanuel@hibernate.org>, Hardy Ferentschik

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LuceneWorkSerializerImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `describeSerializer()`
    `void` | `start(Properties properties, BuildContext context)` Start phase notification.
    `void` | `stop()` Stop phase notification
    `List<LuceneWork>` | `toLuceneWorks(byte[] data)` Convert a byte[] to a List of LuceneWork (assuming the same SerializationProvider is used of course)
    `byte[]` | `toSerializedModel(List<LuceneWork> works)` Convert a List of LuceneWork into a byte[]

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

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

- - ### Constructor Detail

    - #### LuceneWorkSerializerImpl

          public LuceneWorkSerializerImpl()

  - ### Method Detail

    - #### start

          public void start(Properties properties,
                            BuildContext context)

      Description copied from interface: `Startable`
      Start phase notification.
      Specified by:
        `start` in interface `Startable`
      Parameters:
        `properties` - the configuration properties
        `context` - the current context instance

    - #### stop

          public void stop()

      Description copied from interface: `Stoppable`
      Stop phase notification
      Specified by:
        `stop` in interface `Stoppable`

    - #### toSerializedModel

          public byte[] toSerializedModel(List<LuceneWork> works)

      Convert a List of LuceneWork into a byte[]
      Specified by:
        `toSerializedModel` in interface `LuceneWorkSerializer`
      Parameters:
        `works` - the list of `LuceneWork`
      Returns:
        the list of `LuceneWork` as byte[]

    - #### toLuceneWorks

          public List<LuceneWork> toLuceneWorks(byte[] data)

      Convert a byte[] to a List of LuceneWork (assuming the same SerializationProvider is used of course)
      Specified by:
        `toLuceneWorks` in interface `LuceneWorkSerializer`
      Parameters:
        `data` - the byte array to convert
      Returns:
        the list of `LuceneWork`

    - #### describeSerializer

          public String describeSerializer()

      Specified by:
        `describeSerializer` in interface `LuceneWorkSerializer`
      Returns:
        a short label of this implementation and optionally version

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