use of com.emc.nas.vnxfile.xmlapi.MoverStatsSetQueryParams in project coprhd-controller by CoprHD.
the class VNXFileArgsCreator method fetchMoverStats.
/**
* create Mover stats query and returns its stream after marshalling.
*
* @param argument
* @param keyMap
* @param index
* @return
* @throws VNXFilePluginException
*/
public InputStream fetchMoverStats(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
_logger.info("VNX Mover Stats query");
InputStream iStream = null;
List<QueryStats> statsList = 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();
MoverStatsSetQueryParams moverStatsSetQueryParams = new MoverStatsSetQueryParams();
moverStatsSetQueryParams.setStatsSet(MoverStatsSetType.NETWORK_DEVICES);
moverStatsSetQueryParams.setMover(moverID);
queryStats.setMoverStats(moverStatsSetQueryParams);
statsList.add(queryStats);
}
iStream = _vnxFileInputRequestBuilder.getMultiRequestQueryStatsPacket(statsList);
} else {
_logger.error("No movers found to construct volumeStats query.");
}
} catch (JAXBException jaxbException) {
throw new VNXFilePluginException("Exception occurred while generating input xml for celerra mover stats", jaxbException.getCause());
}
return iStream;
}
Aggregations