in priam/src/main/java/com/netflix/priam/restore/RestoreContext.java [42:84]
public void restore() throws Exception {
if (!isRestoreEnabled()) return;
// Restore is required.
if (StringUtils.isEmpty(config.getRestoreSourceType()) && !config.isRestoreEncrypted()) {
// Restore is needed and it will be done from the primary AWS account
scheduler.addTask(
Restore.JOBNAME,
Restore.class,
Restore.getTimer()); // restore from the AWS primary acct
logger.info("Scheduled task " + Restore.JOBNAME);
} else if (config.isRestoreEncrypted()) {
SourceType sourceType = SourceType.lookup(config.getRestoreSourceType(), true, false);
if (sourceType == null) {
scheduler.addTask(
EncryptedRestoreStrategy.JOBNAME,
EncryptedRestoreStrategy.class,
EncryptedRestoreStrategy.getTimer());
logger.info("Scheduled task " + Restore.JOBNAME);
return;
}
switch (sourceType) {
case AWSCROSSACCT:
scheduler.addTask(
AwsCrossAccountCryptographyRestoreStrategy.JOBNAME,
AwsCrossAccountCryptographyRestoreStrategy.class,
AwsCrossAccountCryptographyRestoreStrategy.getTimer());
logger.info(
"Scheduled task " + AwsCrossAccountCryptographyRestoreStrategy.JOBNAME);
break;
case GOOGLE:
scheduler.addTask(
GoogleCryptographyRestoreStrategy.JOBNAME,
GoogleCryptographyRestoreStrategy.class,
GoogleCryptographyRestoreStrategy.getTimer());
logger.info("Scheduled task " + GoogleCryptographyRestoreStrategy.JOBNAME);
break;
}
}
}