public class

DefaultIndexRecoveryService

extends Object
implements IndexRecoveryService
java.lang.Object
   ↳ com.atlassian.jira.index.ha.DefaultIndexRecoveryService

Class Overview

Service for recovering an Index.

Summary

Public Constructors
DefaultIndexRecoveryService(IndexRecoveryManager indexRecoveryManager, PermissionManager permissionManager, IndexPathManager indexPathManager, ServiceManager serviceManager, FileFactory fileFactory)
Public Methods
Long getSnapshotInterval(ApplicationUser user)
Get the interval configured for taking recovery snapshots
boolean isEmpty()
boolean isRecoveryEnabled(ApplicationUser user)
Is index recovery enabled.
IndexCommandResult recoverIndexFromBackup(ApplicationUser user, Context context, I18nHelper i18n, String recoveryFilename, TaskProgressSink taskProgressSink)
Recovers an index from an index backup
int size()
void updateRecoverySettings(ApplicationUser user, boolean recoveryEnabled, long snapshotInterval)
Update the recovery settings
boolean validIndexZipFile(ApplicationUser user, File zipFile)
Validate the passed in file to be a valid zip file containing a set of Lucene Index directories.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.index.ha.IndexRecoveryService
From interface com.atlassian.jira.util.collect.Sized

Public Constructors

public DefaultIndexRecoveryService (IndexRecoveryManager indexRecoveryManager, PermissionManager permissionManager, IndexPathManager indexPathManager, ServiceManager serviceManager, FileFactory fileFactory)

Public Methods

public Long getSnapshotInterval (ApplicationUser user)

Get the interval configured for taking recovery snapshots

Parameters
user the logged in user
Returns
  • interval in Millis or null if this is undefined

public boolean isEmpty ()

public boolean isRecoveryEnabled (ApplicationUser user)

Is index recovery enabled.

Returns
  • true if it is.

public IndexCommandResult recoverIndexFromBackup (ApplicationUser user, Context context, I18nHelper i18n, String recoveryFilename, TaskProgressSink taskProgressSink)

Recovers an index from an index backup

Parameters
user the logged in user
context Context
recoveryFilename The backup file

public int size ()

public void updateRecoverySettings (ApplicationUser user, boolean recoveryEnabled, long snapshotInterval)

Update the recovery settings

Parameters
user the logged in user
recoveryEnabled is recovery enabled
snapshotInterval Interval at which ti take snapshots
Throws
Exception

public boolean validIndexZipFile (ApplicationUser user, File zipFile)

Validate the passed in file to be a valid zip file containing a set of Lucene Index directories.

Parameters
user the logged in user
zipFile File to validate
Returns
  • true if all OK