org.hibernate.search.store.impl

## Class FSSlaveDirectoryProvider

- java.lang.Object
- - org.hibernate.search.store.impl.FSSlaveDirectoryProvider

- All Implemented Interfaces:
    DirectoryProvider<Directory>

      public class FSSlaveDirectoryProvider
      extends Object
      implements DirectoryProvider<Directory>

  File based directory provider that takes care of getting a version of the index from a given source. The base directory is represented by hibernate.search.<index>.indexBase The index is created in <base directory>/<index name> The source (aka copy) directory is built from <sourceBase>/<index name>

  A copy is triggered every refresh seconds

  Author:
    Emmanuel Bernard, Sanne Grinovero, Oliver Siegmar

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FSSlaveDirectoryProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `attemptInitializeAndStart()`
    `boolean` | `equals(Object obj)`
    `Directory` | `getDirectory()` Give access to the initialized Lucene Directory.
    `int` | `hashCode()`
    `void` | `initialize(String directoryProviderName, Properties properties, BuildContext context)` get the information to initialize the directory and build its hashCode/equals method
    `protected void` | `scheduleTask(TimerTask task, long period)`
    `void` | `start(DirectoryBasedIndexManager indexManager)` Executed after initialize, this method set up the heavy process of starting up the DirectoryProvider IO processing as well as background processing are expected to be set up here
    `void` | `stop()` Executed when the search factory is closed.

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

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

- - ### Constructor Detail

    - #### FSSlaveDirectoryProvider

          public FSSlaveDirectoryProvider()

  - ### Method Detail

    - #### initialize

          public void initialize(String directoryProviderName,
                                 Properties properties,
                                 BuildContext context)

      Description copied from interface: `DirectoryProvider`
      get the information to initialize the directory and build its hashCode/equals method
      Specified by:
        `initialize` in interface `DirectoryProvider<Directory>`
      Parameters:
        `directoryProviderName` - the name of the index (directory) to create
        `properties` - the configuration properties
        `context` - provide access to some services at initialization

    - #### start

          public void start(DirectoryBasedIndexManager indexManager)

      Description copied from interface: `DirectoryProvider`
      Executed after initialize, this method set up the heavy process of starting up the DirectoryProvider IO processing as well as background processing are expected to be set up here
      Specified by:
        `start` in interface `DirectoryProvider<Directory>`
      Parameters:
        `indexManager` - the index manager

    - #### getDirectory

          public Directory getDirectory()

      Description copied from interface: `DirectoryProvider`
      Give access to the initialized Lucene Directory. This method call must be threadsafe.
      Specified by:
        `getDirectory` in interface `DirectoryProvider<Directory>`
      Returns:
        an initialized Lucene Directory

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### attemptInitializeAndStart

          protected boolean attemptInitializeAndStart()

      Returns:
        true if both initialize and start succeeded

    - #### stop

          public void stop()

      Description copied from interface: `DirectoryProvider`
      Executed when the search factory is closed. This method should stop any background process as well as releasing any resource. This method should avoid raising exceptions and log potential errors instead
      Specified by:
        `stop` in interface `DirectoryProvider<Directory>`

    - #### scheduleTask

          protected void scheduleTask(TimerTask task,
                                      long period)

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