use of com.emc.storageos.management.backup.exceptions.BackupException in project coprhd-controller by CoprHD.
the class BackupOps method deleteBackupFromNode.
private void deleteBackupFromNode(String backupTag, String host, int port) {
JMXConnector conn = connect(host, port);
try {
BackupManagerMBean backupMBean = getBackupManagerMBean(conn);
backupMBean.delete(backupTag);
log.info(String.format("Node(%s:%d) - Delete backup(name=%s) success", host, port, backupTag));
} catch (BackupException e) {
log.error(String.format("Node(%s:%d) - Delete backup(name=%s) failed", host, port, backupTag));
throw e;
} finally {
close(conn);
}
}
use of com.emc.storageos.management.backup.exceptions.BackupException in project coprhd-controller by CoprHD.
the class BackupOps method listBackupFromNode.
private List<BackupSetInfo> listBackupFromNode(String host, int port) {
JMXConnector conn = connect(host, port);
try {
BackupManagerMBean backupMBean = getBackupManagerMBean(conn);
List<BackupSetInfo> backupFileList = backupMBean.list();
if (backupFileList == null) {
throw new IllegalStateException("Get backup list is null");
}
log.info(String.format("Node(%s:%d) - List backup success", host, port));
return backupFileList;
} catch (BackupException e) {
log.error(String.format("Node(%s:%d) - List backup failed", host, port));
throw e;
} finally {
close(conn);
}
}
use of com.emc.storageos.management.backup.exceptions.BackupException in project coprhd-controller by CoprHD.
the class BackupOps method createBackupFromNode.
private void createBackupFromNode(String backupTag, String host, int port) throws IOException {
JMXConnector conn = connect(host, port);
try {
BackupManagerMBean backupMBean = getBackupManagerMBean(conn);
backupMBean.create(backupTag);
log.info(String.format("Node(%s:%d) - Create backup(name=%s) success", host, port, backupTag));
} catch (BackupException e) {
if (ignoreError(e)) {
log.info(String.format("Node(%s:%d) - Create backup(name=%s) finished", host, port, backupTag));
} else {
log.error(String.format("Node(%s:%d) - Create backup(name=%s) failed", host, port, backupTag));
}
throw e;
} finally {
close(conn);
}
}
use of com.emc.storageos.management.backup.exceptions.BackupException in project coprhd-controller by CoprHD.
the class BackupOps method queryBackupFromNode.
private BackupInfo queryBackupFromNode(String backupName, String host, int port) {
JMXConnector conn = connect(host, port);
try {
BackupManagerMBean backupMBean = getBackupManagerMBean(conn);
BackupInfo backupInfo = backupMBean.queryBackupInfo(backupName);
if (backupInfo == null) {
throw new IllegalStateException(String.format("Get backup info of %s returns null", backupName));
}
log.info("Node({}:{}) - Get backup info {} success", new Object[] { host, port, backupName });
log.info("backupInfo={}", backupInfo);
return backupInfo;
} catch (BackupException e) {
log.error("Node({}:{}) - Query backup info {} failed", host, port, backupName);
throw e;
} finally {
close(conn);
}
}
Aggregations