Search in sources :

Example 61 with CIMObjectPath

use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.

the class CIMObjectPathCreatorFactory method getConfigSvcPath.

@Override
public CIMObjectPath getConfigSvcPath(StorageSystem storageDevice) {
    CIMObjectPath configSvcPath;
    try {
        CIMProperty[] configSvcPropKeys = { cimPropertyFactory.string(CP_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_CONFIGURATION_SERVICE)), cimPropertyFactory.string(CP_NAME, EMC_STORAGE_CONFIGURATION_SERVICE), cimPropertyFactory.string(CP_SYSTEM_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_SYSTEM)), cimPropertyFactory.string(CP_SYSTEM_NAME, getSystemName(storageDevice)) };
        configSvcPath = CimObjectPathCreator.createInstance(prefixWithParamName(STORAGE_CONFIGURATION_SERVICE), getCimConnectionFactory().getNamespace(storageDevice), configSvcPropKeys);
    } catch (Exception e) {
        _log.error(e.getMessage(), e);
        throw new IllegalStateException("Problem getting config service: " + storageDevice.getSerialNumber());
    }
    return configSvcPath;
}
Also used : CIMProperty(javax.cim.CIMProperty) CIMObjectPath(javax.cim.CIMObjectPath)

Example 62 with CIMObjectPath

use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.

the class CIMObjectPathCreatorFactory method getElementCompositionSvcPath.

@Override
public CIMObjectPath getElementCompositionSvcPath(StorageSystem storageDevice) {
    CIMObjectPath elementCompositionSvcPath;
    try {
        CIMProperty[] elementCompositionSvcPropKeys = { cimPropertyFactory.string(CP_CREATION_CLASS_NAME, prefixWithParamName(ELEMENT_COMPOSITION_SERVICE)), cimPropertyFactory.string(CP_NAME, EMC_ELEMENT_COMPOSITION_SERVICE), cimPropertyFactory.string(CP_SYSTEM_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_SYSTEM)), cimPropertyFactory.string(CP_SYSTEM_NAME, getSystemName(storageDevice)) };
        elementCompositionSvcPath = CimObjectPathCreator.createInstance(prefixWithParamName(ELEMENT_COMPOSITION_SERVICE), getCimConnectionFactory().getNamespace(storageDevice), elementCompositionSvcPropKeys);
    } catch (Exception e) {
        throw new IllegalStateException("Problem getting element composition service: " + storageDevice.getSerialNumber());
    }
    return elementCompositionSvcPath;
}
Also used : CIMProperty(javax.cim.CIMProperty) CIMObjectPath(javax.cim.CIMObjectPath)

Example 63 with CIMObjectPath

use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.

the class CIMObjectPathCreatorFactory method getVolumePaths.

@Override
public CIMObjectPath[] getVolumePaths(StorageSystem storageDevice, String[] volumeNames) throws Exception {
    ArrayList<CIMObjectPath> theElementsList = new ArrayList<CIMObjectPath>();
    for (String volumeName : volumeNames) {
        CIMProperty[] volumeKeys = { cimPropertyFactory.string(CP_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_VOLUME)), cimPropertyFactory.string(CP_DEVICE_ID, volumeName), cimPropertyFactory.string(CP_SYSTEM_CREATION_CLASS_NAME, prefixWithParamName(STORAGE_SYSTEM)), cimPropertyFactory.string(CP_SYSTEM_NAME, getSystemName(storageDevice)) };
        CIMObjectPath volumePath = CimObjectPathCreator.createInstance(prefixWithParamName(STORAGE_VOLUME), cimConnectionFactory.getNamespace(storageDevice), volumeKeys);
        theElementsList.add(volumePath);
    }
    CIMObjectPath[] volArray = {};
    volArray = theElementsList.toArray(volArray);
    return volArray;
}
Also used : CIMProperty(javax.cim.CIMProperty) CIMObjectPath(javax.cim.CIMObjectPath) ArrayList(java.util.ArrayList)

Example 64 with CIMObjectPath

use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.

the class CIMObjectPathCreatorFactory method getTargetPortPaths.

@Override
public CIMObjectPath[] getTargetPortPaths(StorageSystem storageDevice, List<URI> targetURIList) throws Exception {
    List<CIMObjectPath> objectPaths = new ArrayList<CIMObjectPath>();
    Set<String> portSet = new HashSet<String>();
    for (URI target : targetURIList) {
        StoragePort storagePort = dbClient.queryObject(StoragePort.class, target);
        String portName;
        if (storagePort.getTransportType().equals("FC")) {
            portName = storagePort.getPortNetworkId().replaceAll(":", "");
        } else {
            portName = storagePort.getPortEndPointID();
        }
        portSet.add(portName);
    }
    CIMObjectPath storageSystemPath = getStorageSystem(storageDevice);
    CloseableIterator<CIMInstance> storageProcessorSystemItr = null;
    CloseableIterator<CIMInstance> protocolEndpointItr = null;
    try {
        // Get all of the Storage Processor Systems associated with the Storage System
        storageProcessorSystemItr = cimConnectionFactory.getConnection(storageDevice).getCimClient().associatorInstances(storageSystemPath, null, EMC_STORAGE_PROCESSOR_SYSTEM, null, null, false, null);
        while (storageProcessorSystemItr.hasNext()) {
            CIMInstance cimSPSInstance = storageProcessorSystemItr.next();
            // Get all of the Protocol Endpoints associated with the Storage Processor System
            protocolEndpointItr = cimConnectionFactory.getConnection(storageDevice).getCimClient().associatorInstances(cimSPSInstance.getObjectPath(), null, CIM_PROTOCOL_ENDPOINT, null, null, false, null);
            while (protocolEndpointItr.hasNext()) {
                CIMInstance cimPEInstance = protocolEndpointItr.next();
                String protocolEndpointName = CIMPropertyFactory.getPropertyValue(cimPEInstance, SmisConstants.CP_NAME);
                if (portSet.contains(protocolEndpointName)) {
                    objectPaths.add(cimPEInstance.getObjectPath());
                }
            }
        }
    } catch (Exception e) {
        _log.error("Failed trying to find suitable target protocol endpoints for Storage System {}", storageDevice.getId(), e);
        throw e;
    } finally {
        closeCIMIterator(storageProcessorSystemItr);
        closeCIMIterator(protocolEndpointItr);
    }
    CIMObjectPath[] objectPathArray = {};
    objectPathArray = objectPaths.toArray(objectPathArray);
    return objectPathArray;
}
Also used : CIMObjectPath(javax.cim.CIMObjectPath) ArrayList(java.util.ArrayList) StoragePort(com.emc.storageos.db.client.model.StoragePort) URI(java.net.URI) CIMInstance(javax.cim.CIMInstance) HashSet(java.util.HashSet)

Example 65 with CIMObjectPath

use of javax.cim.CIMObjectPath in project coprhd-controller by CoprHD.

the class CIMObjectPathQueryFactory method getSyncAspectPath.

@Override
public CIMObjectPath getSyncAspectPath(StorageSystem storage, String aspectInstanceId) {
    String syncAspectPathStr = storage.checkIfVmax3() ? SYMM_SYNCHRONIZATION_ASPECT_FOR_SOURCE : CLAR_SYNCHRONIZATION_ASPECT_FOR_SOURCE;
    String wql1 = format("SELECT * FROM %s WHERE InstanceID like '%s' AND InstanceID like '%s'", syncAspectPathStr, aspectInstanceId, storage.getSerialNumber());
    // TODO instanceID is stored in DB, so ideally this should work for V3
    // REVIST : This class is not found for V2.
    CIMObjectPath queryClass = getQueryClass(syncAspectPathStr);
    CIMObjectPath[] paths = execQuery(storage, queryClass, wql1);
    if (paths.length == 0) {
        return null;
    }
    return paths[0];
}
Also used : CIMObjectPath(javax.cim.CIMObjectPath)

Aggregations

CIMObjectPath (javax.cim.CIMObjectPath)582 CIMInstance (javax.cim.CIMInstance)254 WBEMException (javax.wbem.WBEMException)236 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)208 CIMArgument (javax.cim.CIMArgument)190 ArrayList (java.util.ArrayList)139 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)118 Volume (com.emc.storageos.db.client.model.Volume)108 URI (java.net.URI)108 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)82 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)76 WBEMClient (javax.wbem.client.WBEMClient)75 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)72 HashSet (java.util.HashSet)68 HashMap (java.util.HashMap)63 SmisException (com.emc.storageos.volumecontroller.impl.smis.SmisException)57 CIMProperty (javax.cim.CIMProperty)57 IOException (java.io.IOException)55 BlockObject (com.emc.storageos.db.client.model.BlockObject)52 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)52