use of com.emc.vipr.model.sys.backup.BackupInfo in project coprhd-controller by CoprHD.
the class BackupDataTable method fetch.
public static List<Backup> fetch(Type type) {
List<Backup> results = Lists.newArrayList();
if (type == Type.LOCAL) {
for (BackupSet backupSet : BackupUtils.getBackups()) {
Backup backup = new Backup(backupSet);
BackupInfo backupInfo = BackupUtils.getBackupInfo(backupSet.getName(), true);
backup.alterLocalBackupInfo(backupInfo);
results.add(backup);
}
} else if (type == Type.REMOTE) {
try {
for (String name : BackupUtils.getExternalBackups()) {
results.add(new Backup(name, true));
}
} catch (Exception e) {
// should trim the error message, otherwise datatable.js#getErrorMessage will fail to parse the response
throw new RuntimeException(e.getMessage().trim());
}
}
return results;
}
Aggregations