use of com.emc.vipr.model.sys.backup.BackupOperationStatus in project coprhd-controller by CoprHD.
the class BackupScheduler method updateBackupUploadStatus.
public void updateBackupUploadStatus(String backupName, long operationTime, boolean success) {
log.info(String.format("Updating backup upload status(name=%s, time=%s, success=%s) to ZK", backupName, operationTime, success));
BackupOperationStatus backupOperationStatus = backupOps.queryBackupOperationStatus();
backupOperationStatus.setLastUpload(backupName, operationTime, (success) ? BackupOperationStatus.OpMessage.OP_SUCCESS : BackupOperationStatus.OpMessage.OP_FAILED);
backupOps.persistBackupOperationStatus(backupOperationStatus);
}
use of com.emc.vipr.model.sys.backup.BackupOperationStatus in project coprhd-controller by CoprHD.
the class BackupOps method queryBackupOperationStatus.
/**
* Query backup operation status from ZK
*/
public BackupOperationStatus queryBackupOperationStatus() {
BackupOperationStatus backupOperationStatus = new BackupOperationStatus();
Configuration config = coordinatorClient.queryConfiguration(Constants.BACKUP_OPERATION_STATUS, Constants.GLOBAL_ID);
if (config != null) {
backupOperationStatus.setLastSuccessfulCreation(getOperationStatus(config, BackupConstants.LAST_SUCCESSFUL_CREATION));
backupOperationStatus.setLastManualCreation(getOperationStatus(config, BackupConstants.LAST_MANUAL_CREATION));
backupOperationStatus.setLastScheduledCreation(getOperationStatus(config, BackupConstants.LAST_SCHEDULED_CREATION));
backupOperationStatus.setLastUpload(getOperationStatus(config, BackupConstants.LAST_UPLOAD));
}
log.info("Get backup operation status from ZK: {}", backupOperationStatus);
return backupOperationStatus;
}
use of com.emc.vipr.model.sys.backup.BackupOperationStatus in project coprhd-controller by CoprHD.
the class BackupOps method updateBackupCreationStatus.
/**
* Updates backup creation related status in ZK
*/
public void updateBackupCreationStatus(String backupName, long operationTime, boolean success) {
log.info("Updating backup creation status(name={}, time={}, success={}) to ZK", new Object[] { backupName, operationTime, success });
BackupOperationStatus backupOperationStatus = queryBackupOperationStatus();
boolean isScheduledBackup = isScheduledBackupTag(backupName);
if (isScheduledBackup) {
log.info("updating scheduled backup creation status");
backupOperationStatus.setLastScheduledCreation(backupName, operationTime, (success) ? BackupOperationStatus.OpMessage.OP_SUCCESS : BackupOperationStatus.OpMessage.OP_FAILED);
} else {
log.info("updating manual backup creation status");
backupOperationStatus.setLastManualCreation(backupName, operationTime, (success) ? BackupOperationStatus.OpMessage.OP_SUCCESS : BackupOperationStatus.OpMessage.OP_FAILED);
}
if (success) {
log.info("updating successful backup creation status");
backupOperationStatus.setLastSuccessfulCreation(backupName, operationTime, (isScheduledBackup) ? BackupOperationStatus.OpMessage.OP_SCHEDULED : BackupOperationStatus.OpMessage.OP_MANUAL);
}
persistBackupOperationStatus(backupOperationStatus);
}
Aggregations