Search in sources :

Example 41 with DiscoveredSystemObject

use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.

the class ExportWorkflowEntryPoints method exportRemoveInitiators.

public void exportRemoveInitiators(URI storageURI, URI exportGroupURI, List<URI> initiatorURIs, String token) throws ControllerException {
    try {
        WorkflowStepCompleter.stepExecuting(token);
        final String workflowKey = "exportRemoveInitiators";
        if (!WorkflowService.getInstance().hasWorkflowBeenCreated(token, workflowKey)) {
            DiscoveredSystemObject storage = ExportWorkflowUtils.getStorageSystem(_dbClient, storageURI);
            MaskingOrchestrator orchestrator = getOrchestrator(storage.getSystemType());
            orchestrator.exportGroupRemoveInitiators(storageURI, exportGroupURI, initiatorURIs, token);
            // Mark this workflow as created/executed so we don't do it again on retry/resume
            WorkflowService.getInstance().markWorkflowBeenCreated(token, workflowKey);
        }
    } catch (Exception e) {
        DeviceControllerException exception = DeviceControllerException.exceptions.exportRemoveInitiators(e);
        WorkflowStepCompleter.stepFailed(token, exception);
        throw exception;
    }
}
Also used : DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WorkflowException(com.emc.storageos.workflow.WorkflowException) ControllerException(com.emc.storageos.volumecontroller.ControllerException)

Example 42 with DiscoveredSystemObject

use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.

the class ExportWorkflowEntryPoints method exportChangePolicyAndLimits.

public void exportChangePolicyAndLimits(URI storageURI, URI exportMaskURI, URI exportGroupURI, List<URI> volumeURIs, URI newVpoolURI, boolean rollback, String token) throws ControllerException {
    try {
        WorkflowStepCompleter.stepExecuting(token);
        DiscoveredSystemObject storage = ExportWorkflowUtils.getStorageSystem(_dbClient, storageURI);
        MaskingOrchestrator orchestrator = getOrchestrator(storage.getSystemType());
        ((AbstractBasicMaskingOrchestrator) orchestrator).exportGroupChangePolicyAndLimits(storageURI, exportMaskURI, exportGroupURI, volumeURIs, newVpoolURI, rollback, token);
    } catch (Exception e) {
        DeviceControllerException exception = DeviceControllerException.exceptions.exportChangePolicyAndLimits(e);
        WorkflowStepCompleter.stepFailed(token, exception);
        throw exception;
    }
}
Also used : DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WorkflowException(com.emc.storageos.workflow.WorkflowException) ControllerException(com.emc.storageos.volumecontroller.ControllerException)

Example 43 with DiscoveredSystemObject

use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.

the class ExportWorkflowEntryPoints method exportRemoveVolumes.

public void exportRemoveVolumes(URI storageURI, URI exportGroupURI, List<URI> volumes, String token) throws ControllerException {
    try {
        WorkflowStepCompleter.stepExecuting(token);
        final String workflowKey = "exportRemoveVolumes";
        if (!WorkflowService.getInstance().hasWorkflowBeenCreated(token, workflowKey)) {
            DiscoveredSystemObject storage = ExportWorkflowUtils.getStorageSystem(_dbClient, storageURI);
            MaskingOrchestrator orchestrator = getOrchestrator(storage.getSystemType());
            orchestrator.exportGroupRemoveVolumes(storageURI, exportGroupURI, volumes, token);
            // Mark this workflow as created/executed so we don't do it again on retry/resume
            WorkflowService.getInstance().markWorkflowBeenCreated(token, workflowKey);
        }
    } catch (Exception e) {
        DeviceControllerException exception = DeviceControllerException.exceptions.exportRemoveVolumes(e);
        WorkflowStepCompleter.stepFailed(token, exception);
        throw exception;
    }
}
Also used : DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WorkflowException(com.emc.storageos.workflow.WorkflowException) ControllerException(com.emc.storageos.volumecontroller.ControllerException)

Aggregations

DiscoveredSystemObject (com.emc.storageos.db.client.model.DiscoveredSystemObject)43 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)15 ControllerException (com.emc.storageos.volumecontroller.ControllerException)14 WorkflowException (com.emc.storageos.workflow.WorkflowException)14 Workflow (com.emc.storageos.workflow.Workflow)13 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)4 URI (java.net.URI)3 Controller (com.emc.storageos.Controller)2 BlockObject (com.emc.storageos.db.client.model.BlockObject)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 CompatibilityException (com.emc.storageos.computesystemcontroller.exceptions.CompatibilityException)1 StoragePortGroup (com.emc.storageos.db.client.model.StoragePortGroup)1 RetryableDatabaseException (com.emc.storageos.db.exceptions.RetryableDatabaseException)1 AbstractDiscoveredSystemController (com.emc.storageos.impl.AbstractDiscoveredSystemController)1 ProtectionExportController (com.emc.storageos.protectioncontroller.ProtectionExportController)1 RPController (com.emc.storageos.protectioncontroller.RPController)1 RPDeviceController (com.emc.storageos.protectioncontroller.impl.recoverpoint.RPDeviceController)1 WorkflowRestartedException (com.emc.storageos.workflow.WorkflowRestartedException)1 IOException (java.io.IOException)1