public class DefaultIndexRecoveryService extends Object implements IndexRecoveryService
Constructor and Description |
---|
DefaultIndexRecoveryService(IndexRecoveryManager indexRecoveryManager,
PermissionManager permissionManager,
IndexPathManager indexPathManager,
ServiceManager serviceManager,
FileFactory fileFactory,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
String |
getSnapshotCronExpression(ApplicationUser user)
Get the schedule 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,
String cronExpression)
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.
|
public DefaultIndexRecoveryService(IndexRecoveryManager indexRecoveryManager, PermissionManager permissionManager, IndexPathManager indexPathManager, ServiceManager serviceManager, FileFactory fileFactory, com.atlassian.event.api.EventPublisher eventPublisher)
public IndexCommandResult recoverIndexFromBackup(ApplicationUser user, Context context, I18nHelper i18n, String recoveryFilename, TaskProgressSink taskProgressSink) throws IndexException
IndexRecoveryService
recoverIndexFromBackup
in interface IndexRecoveryService
user
- the logged in usercontext
- ContextrecoveryFilename
- The backup fileIndexException
- If we are unable to recover the indexpublic boolean validIndexZipFile(ApplicationUser user, File zipFile)
IndexRecoveryService
validIndexZipFile
in interface IndexRecoveryService
user
- the logged in userzipFile
- File to validatepublic void updateRecoverySettings(ApplicationUser user, boolean recoveryEnabled, String cronExpression) throws Exception
IndexRecoveryService
updateRecoverySettings
in interface IndexRecoveryService
user
- the logged in userrecoveryEnabled
- is recovery enabledcronExpression
- Schedule at which to take snapshotsException
public boolean isRecoveryEnabled(ApplicationUser user)
IndexRecoveryService
isRecoveryEnabled
in interface IndexRecoveryService
public String getSnapshotCronExpression(ApplicationUser user)
IndexRecoveryService
getSnapshotCronExpression
in interface IndexRecoveryService
user
- the logged in userCopyright © 2002-2016 Atlassian. All Rights Reserved.