public BackupInfo getBackupInfo(String name, boolean isLocal) { UriBuilder builder = client.uriBuilder(BACKUP_INFO_URL); addQueryParam(builder, "backupname", name); if (isLocal) { addQueryParam(builder, "isLocal", isLocal); } return client.getURI(BackupInfo.class, builder.build()); }
public BackupUploadStatus uploadBackupStatus(String name) { BackupUploadStatus status = null; UriBuilder builder = client.uriBuilder(BACKUP_UPLOAD_URL); addQueryParam(builder, "tag", name); try { status = client.getURI(BackupUploadStatus.class, builder.build()); } catch (Exception e) { status = new BackupUploadStatus(); } return status; }
public BackupRestoreStatus getRestoreStatus(String name, boolean isLocal) { BackupRestoreStatus status = null; UriBuilder builder = client.uriBuilder(RESTORE_STATUS_URL); addQueryParam(builder, "backupname", name); addQueryParam(builder, "isLocal", isLocal); try { status = client.getURI(BackupRestoreStatus.class, builder.build()); } catch (Exception e) { status = new BackupRestoreStatus(); status.setStatus(BackupRestoreStatus.Status.DOWNLOAD_FAILED); status.setDetails(e.getMessage()); } return status; }
public BackupSet getBackup(String name) { UriBuilder builder = client.uriBuilder(BACKUP_URL + "backup"); addQueryParam(builder, "tag", name); return client.getURI(BackupSet.class, builder.build()); }