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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations