Package com.atlassian.jira.index.ha
Class DefaultIndexRecoveryService
java.lang.Object
com.atlassian.jira.index.ha.DefaultIndexRecoveryService
- All Implemented Interfaces:
IndexRecoveryService,Sized
Service for recovering an Index.
- Since:
- v6.1
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultIndexRecoveryService(IndexRecoveryManager indexRecoveryManager, PermissionManager permissionManager, ServiceManager serviceManager, FileFactory fileFactory, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionGet the schedule configured for taking recovery snapshotsbooleanisEmpty()booleanIs index recovery enabled.recoverIndexFromBackup(ApplicationUser user, Context context, I18nHelper i18n, String recoveryFilename, TaskProgressSink taskProgressSink) Recovers an index from an index backupintsize()voidupdateRecoverySettings(ApplicationUser user, boolean recoveryEnabled, String cronExpression) Update the recovery settings
-
Constructor Details
-
DefaultIndexRecoveryService
public DefaultIndexRecoveryService(IndexRecoveryManager indexRecoveryManager, PermissionManager permissionManager, ServiceManager serviceManager, FileFactory fileFactory, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
recoverIndexFromBackup
public IndexCommandResult recoverIndexFromBackup(ApplicationUser user, Context context, I18nHelper i18n, String recoveryFilename, TaskProgressSink taskProgressSink) throws IndexException Description copied from interface:IndexRecoveryServiceRecovers an index from an index backup- Specified by:
recoverIndexFromBackupin interfaceIndexRecoveryService- Parameters:
user- the logged in usercontext- Contexti18n-recoveryFilename- The backup filetaskProgressSink-- Throws:
IndexException- If we are unable to recover the index
-
size
public int size() -
isEmpty
public boolean isEmpty() -
updateRecoverySettings
public void updateRecoverySettings(ApplicationUser user, boolean recoveryEnabled, String cronExpression) throws Exception Description copied from interface:IndexRecoveryServiceUpdate the recovery settings- Specified by:
updateRecoverySettingsin interfaceIndexRecoveryService- Parameters:
user- the logged in userrecoveryEnabled- is recovery enabledcronExpression- Schedule at which to take snapshots- Throws:
Exception
-
isRecoveryEnabled
Description copied from interface:IndexRecoveryServiceIs index recovery enabled.- Specified by:
isRecoveryEnabledin interfaceIndexRecoveryService- Returns:
- true if it is.
-
getSnapshotCronExpression
Description copied from interface:IndexRecoveryServiceGet the schedule configured for taking recovery snapshots- Specified by:
getSnapshotCronExpressionin interfaceIndexRecoveryService- Parameters:
user- the logged in user- Returns:
- interval in Millis or null if this is undefined
-