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