Class IndexSnapshotManager

java.lang.Object
com.jalios.jcms.search.IndexSnapshotManager

public class IndexSnapshotManager extends Object
Provide management of lucene index snapshot
Since:
jcms-10.0.5 / JCMS-8395
  • Field Details

    • SNAPSHOTS_DIRNAME

      public static final String SNAPSHOTS_DIRNAME
      Name of directory in WEB-INF/data in which snaphots are stored
      See Also:
    • SNAPSHOT_COMPLETE_FILENAME

      public static final String SNAPSHOT_COMPLETE_FILENAME
      Name of file created in a snapshot directory when it is known to be complete
      See Also:
    • SNAPSHOT_DO_NOT_DELETE_FILENAME

      public static final String SNAPSHOT_DO_NOT_DELETE_FILENAME
      Name of file which can be place inside a snapshot directory when it must not be deleted.
      See Also:
  • Method Details

    • getInstance

      public static IndexSnapshotManager getInstance()
    • getLastCompletedSnapshotDirectory

      public File getLastCompletedSnapshotDirectory()
      Retrieve the last snapshot directory which is complete.
      Returns:
      a File or null if there it no yet any completed snapshot
    • isSnapshotComplete

      public boolean isSnapshotComplete(File snapshotDir)
      Check if the specified snaphot is complete
      Parameters:
      snapshotDir - the directory to check
      Returns:
      true if snapshot is complete, false otherwise
    • createSnapshot

      Request asynchronous creation of a new snapshot of all search engine. If a snapshot is already in progress request is ignored (but return value is still be valid).
      Returns:
      the information about the snapshot in which it will be stored when completed sucessfully