Package com.jalios.jcms.search
Class IndexSnapshotManager
- java.lang.Object
-
- com.jalios.jcms.search.IndexSnapshotManager
-
public class IndexSnapshotManager extends java.lang.Object
Provide management of lucene index snapshot- Since:
- jcms-10.0.5 / JCMS-8395
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexSnapshotManager.UpcomingSnapshotInfo
Class holding information about pending snapshot
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SNAPSHOT_COMPLETE_FILENAME
Name of file created in a snapshot directory when it is known to be completestatic 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.static java.lang.String
SNAPSHOTS_DIRNAME
Name of directory in WEB-INF/data in which snaphots are stored
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexSnapshotManager.UpcomingSnapshotInfo
createSnapshot()
Request asynchronous creation of a new snapshot of all search engine.static IndexSnapshotManager
getInstance()
java.io.File
getLastCompletedSnapshotDirectory()
Retrieve the last snapshot directory which is complete.boolean
isSnapshotComplete(java.io.File snapshotDir)
Check if the specified snaphot is complete
-
-
-
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
-
getInstance
public static IndexSnapshotManager getInstance()
-
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
-
-