Search in sources :

Example 1 with MoverStatsSetQueryParams

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;
}
Also used : FileSystemUsageSet(com.emc.nas.vnxfile.xmlapi.FileSystemUsageSet) Set(java.util.Set) QueryStats(com.emc.nas.vnxfile.xmlapi.QueryStats) InputStream(java.io.InputStream) JAXBException(javax.xml.bind.JAXBException) ArrayList(java.util.ArrayList) MoverStatsSetQueryParams(com.emc.nas.vnxfile.xmlapi.MoverStatsSetQueryParams)

Aggregations

FileSystemUsageSet (com.emc.nas.vnxfile.xmlapi.FileSystemUsageSet)1 MoverStatsSetQueryParams (com.emc.nas.vnxfile.xmlapi.MoverStatsSetQueryParams)1 QueryStats (com.emc.nas.vnxfile.xmlapi.QueryStats)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 JAXBException (javax.xml.bind.JAXBException)1