Search in sources :

Example 6 with FileSystem

use of com.emc.nas.vnxfile.xmlapi.FileSystem in project coprhd-controller by CoprHD.

the class VNXFileSystemMoverInfoProcessor method processFilesystemList.

/**
 * Process the fileSystemList which are received from XMLAPI server.
 *
 * @param filesystemList : List of FileSystem objects.
 * @param keyMap : keyMap.
 */
private void processFilesystemList(List<Object> filesystemList, Map<String, Object> keyMap) throws VNXFilePluginException {
    Iterator<Object> iterator = filesystemList.iterator();
    Set<String> moverIds = new HashSet<String>();
    if (iterator.hasNext()) {
        Status status = (Status) iterator.next();
        if (status.getMaxSeverity() == Severity.OK) {
            keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_SUCCESS);
            while (iterator.hasNext()) {
                FileSystem fileSystem = (FileSystem) iterator.next();
                _logger.info("Processing result for file system {}", fileSystem.getName());
                List<MoverOrVdmRef> roFileSysHosts = fileSystem.getRoFileSystemHosts();
                if (null != roFileSysHosts) {
                    Iterator<MoverOrVdmRef> roFileSysHostItr = roFileSysHosts.iterator();
                    while (roFileSysHostItr.hasNext()) {
                        MoverOrVdmRef mover = roFileSysHostItr.next();
                        moverIds.add(mover.getMover());
                        _logger.debug("Mover id for read only host is {}", mover.getMover());
                    }
                }
                List<MoverOrVdmRef> rwFileSysHosts = fileSystem.getRwFileSystemHosts();
                if (null != rwFileSysHosts) {
                    Iterator<MoverOrVdmRef> rwFileSysHostItr = rwFileSysHosts.iterator();
                    while (rwFileSysHostItr.hasNext()) {
                        MoverOrVdmRef mover = rwFileSysHostItr.next();
                        moverIds.add(mover.getMover());
                        _logger.debug("Mover id for read write host is {}", mover.getMover());
                    }
                }
            }
        } else {
            keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_FAILURE);
            throw new VNXFilePluginException("Fault response received from XMLAPI Server.", VNXFilePluginException.ERRORCODE_INVALID_RESPONSE);
        }
    }
    keyMap.put(VNXFileConstants.MOVERLIST, moverIds);
}
Also used : Status(com.emc.nas.vnxfile.xmlapi.Status) FileSystem(com.emc.nas.vnxfile.xmlapi.FileSystem) VNXFilePluginException(com.emc.storageos.plugins.metering.vnxfile.VNXFilePluginException) MoverOrVdmRef(com.emc.nas.vnxfile.xmlapi.MoverOrVdmRef) HashSet(java.util.HashSet)

Aggregations

FileSystem (com.emc.nas.vnxfile.xmlapi.FileSystem)6 Status (com.emc.nas.vnxfile.xmlapi.Status)4 VNXFilePluginException (com.emc.storageos.plugins.metering.vnxfile.VNXFilePluginException)4 DeleteFileSystem (com.emc.nas.vnxfile.xmlapi.DeleteFileSystem)2 ExtendFileSystem (com.emc.nas.vnxfile.xmlapi.ExtendFileSystem)2 ModifyFileSystem (com.emc.nas.vnxfile.xmlapi.ModifyFileSystem)2 MoverOrVdmRef (com.emc.nas.vnxfile.xmlapi.MoverOrVdmRef)2 NewFileSystem (com.emc.nas.vnxfile.xmlapi.NewFileSystem)2 Task (com.emc.nas.vnxfile.xmlapi.Task)2 InputStream (java.io.InputStream)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 JAXBException (javax.xml.bind.JAXBException)2 StoragePool (com.emc.nas.vnxfile.xmlapi.ExtendFileSystem.StoragePool)1 FileSystemAutoExtInfo (com.emc.nas.vnxfile.xmlapi.FileSystemAutoExtInfo)1 FileSystemCapacityInfo (com.emc.nas.vnxfile.xmlapi.FileSystemCapacityInfo)1 AutoExtend (com.emc.nas.vnxfile.xmlapi.ModifyFileSystem.AutoExtend)1 UnManagedDiscoveredObject (com.emc.storageos.db.client.model.UnManagedDiscoveredObject)1 VNXFileSystem (com.emc.storageos.vnx.xmlapi.VNXFileSystem)1 ArrayList (java.util.ArrayList)1