Search in sources :

Example 76 with CIMObjectPath

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

the class VMAXTiersToPoolProcessor method processResult.

/**
 * {@inheritDoc}
 */
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
    try {
        _dbClient = (DbClient) keyMap.get(Constants.dbClient);
        @SuppressWarnings("unchecked") final Iterator<CIMObjectPath> it = (Iterator<CIMObjectPath>) resultObj;
        // value set at runtime already
        Object[] arguments = (Object[]) _args.get(0);
        CIMObjectPath tierPath = (CIMObjectPath) arguments[0];
        String tierID = (String) tierPath.getKey(Constants.INSTANCEID).getValue();
        // Mapping had been already constructed between TierID --> Policy
        List<CIMObjectPath> policyPaths = (List<CIMObjectPath>) keyMap.get(tierID);
        // add Policy to Tier
        addFastPolicyToTier(policyPaths, tierID);
        // add Pools to Policy
        addStoragePoolstoPolicy(policyPaths, it, _dbClient, keyMap, tierID);
    } catch (Exception e) {
        _logger.error("Tiers to Pool Processing failed:", e);
    }
}
Also used : CIMObjectPath(javax.cim.CIMObjectPath) Iterator(java.util.Iterator) List(java.util.List) IOException(java.io.IOException) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 77 with CIMObjectPath

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

the class CommitedSettingsInstanceProcessor method processResult.

@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
    try {
        CIMInstance modifiedInstance = getObjectPathfromCIMArgument();
        DbClient _dbClient = (DbClient) keyMap.get(Constants.dbClient);
        AccessProfile profile = (AccessProfile) keyMap.get(Constants.ACCESSPROFILE);
        CIMObjectPath poolSettingPath = modifiedInstance.getObjectPath();
        String poolSettingId = poolSettingPath.getKey(Constants.INSTANCEID).getValue().toString();
        CIMObjectPath poolCapabilities_Associated_With_Setting = CimObjectPathCreator.createInstance(keyMap.get(poolSettingPath.toString()).toString());
        String poolID = getNativeIDFromInstance(poolCapabilities_Associated_With_Setting.getKey(Constants.INSTANCEID).getValue().toString());
        StorageSystem device = getStorageSystem(_dbClient, profile.getSystemId());
        StoragePool pool = checkStoragePoolExistsInDB(poolID, _dbClient, device);
        int tierMethodologyUsedForThisCreatedSetting = Integer.parseInt((String) keyMap.get(poolSettingPath.toString() + Constants.HYPHEN + Constants.TIERMETHODOLOGY));
        if (null != pool) {
            updatePoolSettingId(tierMethodologyUsedForThisCreatedSetting, pool, poolSettingId);
            _dbClient.persistObject(pool);
        }
    } catch (Exception e) {
        _logger.error("Commiting Modified Settign Instance failed", e);
    }
}
Also used : DbClient(com.emc.storageos.db.client.DbClient) StoragePool(com.emc.storageos.db.client.model.StoragePool) CIMObjectPath(javax.cim.CIMObjectPath) AccessProfile(com.emc.storageos.plugins.AccessProfile) CIMInstance(javax.cim.CIMInstance) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Example 78 with CIMObjectPath

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

the class CreatePoolSettingProcessor method processResult.

@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
    String tierMethodologyToBeUsedForThisCreatedSetting = null;
    try {
        if (resultObj instanceof CIMArgument<?>[]) {
            CIMArgument<?>[] outputArguments = (CIMArgument<?>[]) resultObj;
            CIMObjectPath path = (CIMObjectPath) outputArguments[0].getValue();
            // always set
            int index = (Integer) _args.get(1);
            @SuppressWarnings("unchecked") List<String> poolSettingsList = (List<String>) keyMap.get(Constants.VNXPOOLCAPABILITIES_TIER);
            String poolSettingToTierMethodology = poolSettingsList.get(index);
            tierMethodologyToBeUsedForThisCreatedSetting = poolSettingToTierMethodology.substring(poolSettingToTierMethodology.lastIndexOf(Constants.HYPHEN) + 1, poolSettingToTierMethodology.length());
            String poolCapabilitiesPathAssociatedWiththisSetting = poolSettingToTierMethodology.substring(0, poolSettingToTierMethodology.lastIndexOf(Constants.HYPHEN));
            keyMap.put(path.toString(), poolCapabilitiesPathAssociatedWiththisSetting);
            keyMap.put(path.toString() + Constants.HYPHEN + Constants.TIERMETHODOLOGY, tierMethodologyToBeUsedForThisCreatedSetting);
            addPath(keyMap, operation.getResult(), path);
        }
    } catch (Exception e) {
        _logger.error("Error processing Create Pool Setting with Initial Storage Tiering Methodology : {} : ", tierMethodologyToBeUsedForThisCreatedSetting, e);
    }
}
Also used : CIMObjectPath(javax.cim.CIMObjectPath) List(java.util.List) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) CIMArgument(javax.cim.CIMArgument)

Example 79 with CIMObjectPath

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

the class VNXPolicyToVolumeProcessor method processResult.

@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
    try {
        @SuppressWarnings("unchecked") final Iterator<CIMObjectPath> it = (Iterator<CIMObjectPath>) resultObj;
        // value will be set already always
        Object[] arguments = (Object[]) _args.get(0);
        CIMObjectPath vnxFastPolicyRule = (CIMObjectPath) arguments[0];
        // construct VolumeID-->PolicyRule mapping
        while (it.hasNext()) {
            CIMObjectPath volumePath = it.next();
            String volumeID = volumePath.getKey(Constants.DEVICEID).getValue().toString();
            keyMap.put(volumeID, vnxFastPolicyRule);
            addPath(keyMap, Constants.STORAGEVOLUMES, volumePath);
        }
    } catch (Exception e) {
        _logger.error("FAST Policy Discovery : DiscoveryExtracting Volumes from Policy failed", e);
    }
}
Also used : CIMObjectPath(javax.cim.CIMObjectPath) Iterator(java.util.Iterator) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 80 with CIMObjectPath

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

the class VNXTierDomainToTiersProcessor method processResult.

@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
    try {
        _dbClient = (DbClient) keyMap.get(Constants.dbClient);
        @SuppressWarnings("unchecked") final Iterator<CIMInstance> it = (Iterator<CIMInstance>) resultObj;
        // indicates ExtremePerformance or Performance or Capacity Tier
        Object[] arguments = (Object[]) _args.get(0);
        CIMObjectPath tierDomainPath = (CIMObjectPath) arguments[0];
        CIMObjectPath storagePoolpath = (CIMObjectPath) keyMap.get(tierDomainPath.getKey(Constants.NAME).getValue());
        addTiersToPool(storagePoolpath, it, _dbClient, keyMap);
    } catch (Exception e) {
        _logger.error("VNX TierDomain to Tier Processing failed :", e);
    }
}
Also used : Iterator(java.util.Iterator) CIMObjectPath(javax.cim.CIMObjectPath) CIMInstance(javax.cim.CIMInstance) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

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