com.atlassian.jira.index.ha
Class DefaultIndexRecoveryService

java.lang.Object
  extended by com.atlassian.jira.index.ha.DefaultIndexRecoveryService
All Implemented Interfaces:
IndexRecoveryService, Sized

public class DefaultIndexRecoveryService
extends Object
implements IndexRecoveryService

Service for recovering an Index.

Since:
v6.1

Constructor Summary
DefaultIndexRecoveryService(IndexRecoveryManager indexRecoveryManager, PermissionManager permissionManager, IndexPathManager indexPathManager, ServiceManager serviceManager, FileFactory fileFactory)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIndexRecoveryService

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

recoverIndexFromBackup

public IndexCommandResult recoverIndexFromBackup(ApplicationUser user,
                                                 Context context,
                                                 I18nHelper i18n,
                                                 String recoveryFilename,
                                                 TaskProgressSink taskProgressSink)
                                          throws IndexException
Description copied from interface: IndexRecoveryService
Recovers an index from an index backup

Specified by:
recoverIndexFromBackup in interface IndexRecoveryService
Parameters:
user - the logged in user
context - Context
recoveryFilename - The backup file
Throws:
IndexException - If we are unable to recover the index

validIndexZipFile

public boolean validIndexZipFile(ApplicationUser user,
                                 File zipFile)
Description copied from interface: IndexRecoveryService
Validate the passed in file to be a valid zip file containing a set of Lucene Index directories.

Specified by:
validIndexZipFile in interface IndexRecoveryService
Parameters:
user - the logged in user
zipFile - File to validate
Returns:
true if all OK

size

public int size()
Specified by:
size in interface Sized

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Sized

updateRecoverySettings

public void updateRecoverySettings(ApplicationUser user,
                                   boolean recoveryEnabled,
                                   long snapshotInterval)
                            throws Exception
Description copied from interface: IndexRecoveryService
Update the recovery settings

Specified by:
updateRecoverySettings in interface IndexRecoveryService
Parameters:
user - the logged in user
recoveryEnabled - is recovery enabled
snapshotInterval - Interval at which ti take snapshots
Throws:
Exception

isRecoveryEnabled

public boolean isRecoveryEnabled(ApplicationUser user)
Description copied from interface: IndexRecoveryService
Is index recovery enabled.

Specified by:
isRecoveryEnabled in interface IndexRecoveryService
Returns:
true if it is.

getSnapshotInterval

public Long getSnapshotInterval(ApplicationUser user)
Description copied from interface: IndexRecoveryService
Get the interval configured for taking recovery snapshots

Specified by:
getSnapshotInterval in interface IndexRecoveryService
Parameters:
user - the logged in user
Returns:
interval in Millis or null if this is undefined


Copyright © 2002-2014 Atlassian. All Rights Reserved.