use of com.emc.storageos.storagedriver.task.RestoreFromSnapshotDriverTask in project coprhd-controller by CoprHD.
the class RestoreFromSnapshotSimulatorOperation method getSuccessMessage.
@SuppressWarnings("unchecked")
@Override
public String getSuccessMessage(Object... args) {
List<VolumeSnapshot> snapshots;
if ((args != null) && (args.length > 0)) {
snapshots = (List<VolumeSnapshot>) args[0];
} else {
// Must be asynchronous, so updated snapshots are in the task.
RestoreFromSnapshotDriverTask restoreSnapshotTask = (RestoreFromSnapshotDriverTask) _task;
snapshots = restoreSnapshotTask.getSnapshots();
}
return String.format("StorageDriver: restoreSnapshot for storage system %s, snapshots nativeId %s, snap group %s - end", snapshots.get(0).getStorageSystemId(), snapshots.toString(), snapshots.get(0).getConsistencyGroup());
}
use of com.emc.storageos.storagedriver.task.RestoreFromSnapshotDriverTask in project coprhd-controller by CoprHD.
the class RestoreFromSnapshotSimulatorOperation method createDriverTask.
/**
* Create the restore from snapshot task that is returned by the request.
*
* @param snapshots A list of the snapshots to be restored.
*/
private void createDriverTask(List<VolumeSnapshot> snapshots) {
String taskId = String.format("%s+%s+%s", StorageDriverSimulator.DRIVER_NAME, OP_NAME, UUID.randomUUID().toString());
_log.info("Creating task {} for operation of type {}", taskId, OP_NAME);
_task = new RestoreFromSnapshotDriverTask(taskId, snapshots);
_task.setStatus(DriverTask.TaskStatus.PROVISIONING);
}
Aggregations