use of com.emc.nas.vnxfile.xmlapi.VolumeStatsSetQueryParams in project coprhd-controller by CoprHD.
the class VNXFileArgsCreator method fetchVolumeStats.
/**
* Create volume stats XML request query and returns a stream after marshalling.
*
* @param argument
* @param keyMap
* @param index
* @return
* @throws VNXFilePluginException
*/
@SuppressWarnings("unchecked")
public InputStream fetchVolumeStats(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
_logger.info("Creating volume stats query");
InputStream iStream = null;
List<QueryStats> statList = new ArrayList<QueryStats>();
try {
Set<String> movers = (Set<String>) keyMap.get(VNXFileConstants.MOVERLIST);
if (null != movers && !movers.isEmpty()) {
for (String moverID : movers) {
QueryStats queryStats = new QueryStats();
VolumeStatsSetQueryParams params = new VolumeStatsSetQueryParams();
params.setStatsSet(VolumeStatsSetType.ALL);
params.setMover(moverID);
queryStats.setVolumeStats(params);
statList.add(queryStats);
}
iStream = _vnxFileInputRequestBuilder.getMultiRequestQueryStatsPacket(statList);
} else {
_logger.error("No movers found to construct volumeStats query.");
}
} catch (JAXBException jaxbException) {
throw new VNXFilePluginException("Exception occurred while fetching fileSystem info", jaxbException.getCause());
}
return iStream;
}
Aggregations