Search in sources :

Example 6 with EnumerateResponse

use of javax.wbem.client.EnumerateResponse in project coprhd-controller by CoprHD.

the class CapacityPoolProcessor method processResult.

@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
    EnumerateResponse<CIMInstance> volumeInstanceChunks = (EnumerateResponse<CIMInstance>) resultObj;
    WBEMClient client = SMICommunicationInterface.getCIMClient(keyMap);
    CloseableIterator<CIMInstance> volumeInstances = volumeInstanceChunks.getResponses();
    try {
        processVolumeCapacity(volumeInstances, keyMap);
        while (!volumeInstanceChunks.isEnd()) {
            CIMObjectPath storagePoolPath = getObjectPathfromCIMArgument(_args);
            _logger.info("Processing Next Volume Chunk of size {}", BATCH_SIZE);
            volumeInstanceChunks = client.getInstancesWithPath(storagePoolPath, volumeInstanceChunks.getContext(), new UnsignedInteger32(BATCH_SIZE));
            processVolumeCapacity(volumeInstanceChunks.getResponses(), keyMap);
        }
    } catch (Exception e) {
        _logger.error("Provisioned Capacity failure :", e);
    } finally {
        resultObj = null;
        if (null != volumeInstances) {
            volumeInstances.close();
        }
    }
}
Also used : CIMObjectPath(javax.cim.CIMObjectPath) UnsignedInteger32(javax.cim.UnsignedInteger32) WBEMClient(javax.wbem.client.WBEMClient) CIMInstance(javax.cim.CIMInstance) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) EnumerateResponse(javax.wbem.client.EnumerateResponse)

Aggregations

BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)6 CIMObjectPath (javax.cim.CIMObjectPath)6 EnumerateResponse (javax.wbem.client.EnumerateResponse)6 UnsignedInteger32 (javax.cim.UnsignedInteger32)5 WBEMClient (javax.wbem.client.WBEMClient)5 CIMInstance (javax.cim.CIMInstance)4 UnManagedVolume (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedVolume)3 BlockMirror (com.emc.storageos.db.client.model.BlockMirror)2 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)2 Volume (com.emc.storageos.db.client.model.Volume)2 StoragePool (com.emc.storageos.db.client.model.StoragePool)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1