Class IndexSnapshotManager


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

      • SNAPSHOTS_DIRNAME

        public static final java.lang.String SNAPSHOTS_DIRNAME
        Name of directory in WEB-INF/data in which snaphots are stored
        See Also:
        Constant Field Values
      • SNAPSHOT_COMPLETE_FILENAME

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

        public static final java.lang.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:
        Constant Field Values
    • Method Detail

      • getLastCompletedSnapshotDirectory

        public java.io.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​(java.io.File snapshotDir)
        Check if the specified snaphot is complete
        Parameters:
        snapshotDir - the directory to check
        Returns:
        true if snapshot is complete, false otherwise
      • createSnapshot

        public IndexSnapshotManager.UpcomingSnapshotInfo 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