use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowUtils method generateExportGroupRemoveVolumes.
public String generateExportGroupRemoveVolumes(Workflow workflow, String wfGroupId, String waitFor, URI storage, URI export, List<URI> volumes) throws WorkflowException {
DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storage);
Workflow.Method method = ExportWorkflowEntryPoints.exportRemoveVolumesMethod(storage, export, volumes);
return newWorkflowStep(workflow, wfGroupId, String.format("Removing volumes from export (%s) on storage array %s", export, storageSystem.getNativeGuid()), storageSystem, method, null, waitFor, null);
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class ExportWorkflowUtils method generateExportChangePathParams.
/**
* Generates a Workflow Step to change the path parameters of a Volume in a specific Export Group.
*
* @param workflow
* @param wfGroupId - Workflow group for the Step
* @param waitFor - Wait on this step/group to complete in the workflow before execution
* @param storageURI - Storage system containing the volume
* @param exportGroupURI - Export group that has exported the volume
* @param volumeURI - Volume we are changing the path parameters for
* @return stepId for the generated workflow Step
* @throws ControllerException
*/
public String generateExportChangePathParams(Workflow workflow, String wfGroupId, String waitFor, URI storageURI, URI exportGroupURI, URI volumeURI) throws ControllerException {
DiscoveredSystemObject storageSystem = getStorageSystem(_dbClient, storageURI);
BlockObject volume = BlockObject.fetch(_dbClient, volumeURI);
Workflow.Method method = ExportWorkflowEntryPoints.exportGroupChangePathParamsMethod(storageURI, exportGroupURI, volumeURI);
return newWorkflowStep(workflow, wfGroupId, String.format("Updated Export PathParams on storage array %s (%s, args) for volume %s (%s)", storageSystem.getNativeGuid(), storageURI, volume.getLabel(), volumeURI), storageSystem, method, null, waitFor, null);
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class RPControllerImpl method getCopyAccessStates.
@Override
public Map<URI, String> getCopyAccessStates(URI protectionDevice, List<URI> volumeURIs) {
final DiscoveredSystemObject device = _dbClient.queryObject(ProtectionSystem.class, protectionDevice);
final Controller controller = lookupDeviceController(device);
// Try to grab a handle on the RPDeviceController so we can call directly into it.
if (controller instanceof RPDeviceController) {
return ((RPDeviceController) controller).getCopyAccessStates(protectionDevice, volumeURIs);
}
// Problem calling the controller so just return an empty map
return new HashMap<URI, String>();
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class DiscoverTaskCompleter method setSuccessTime.
@Override
public final void setSuccessTime(DbClient dbClient, long time) {
Class type = getType();
if (DiscoveredSystemObject.class.isAssignableFrom(type)) {
try {
DiscoveredSystemObject dbObject = (DiscoveredSystemObject) DataObject.createInstance(type, getId());
dbObject.trackChanges();
dbObject.setSuccessDiscoveryTime(time);
dbClient.persistObject(dbObject);
} catch (InstantiationException ex) {
DatabaseException.fatals.queryFailed(ex);
} catch (IllegalAccessException ex) {
DatabaseException.fatals.queryFailed(ex);
}
} else {
throw new RuntimeException("Unsupported system Type : " + type.toString());
}
}
use of com.emc.storageos.db.client.model.DiscoveredSystemObject in project coprhd-controller by CoprHD.
the class MeteringTaskCompleter method setSuccessTime.
@Override
public final void setSuccessTime(DbClient dbClient, long time) {
Class type = getType();
if (DiscoveredSystemObject.class.isAssignableFrom(type)) {
try {
DiscoveredSystemObject dbObject = (DiscoveredSystemObject) DataObject.createInstance(type, getId());
dbObject.trackChanges();
dbObject.setSuccessMeteringTime(time);
dbClient.persistObject(dbObject);
} catch (InstantiationException ex) {
DatabaseException.fatals.queryFailed(ex);
} catch (IllegalAccessException ex) {
DatabaseException.fatals.queryFailed(ex);
}
} else {
throw new RuntimeException("Unsupported system Type : " + type.toString());
}
}
Aggregations