Search in sources :

Example 1 with TreeQuotaQueryParams

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

the class VNXFileArgsCreator method fetchQuotaDirInfo.

/**
 * Create Quota Tree information input XML request and returns stream after marshalling.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @return
 * @throws VNXFilePluginException
 */
public InputStream fetchQuotaDirInfo(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("Creating quota tree info query");
    InputStream iStream = null;
    try {
        Query query = new Query();
        // Verify that the prior command quota create/update executed properly.
        verifyPreviousResults(keyMap);
        TreeQuotaQueryParams queryParam = new TreeQuotaQueryParams();
        TreeQuotaQueryParams.AspectSelection selection = new TreeQuotaQueryParams.AspectSelection();
        selection.setTreeQuotas(true);
        queryParam.setAspectSelection(selection);
        // Set the parent file system.
        String fsId = (String) keyMap.get(VNXFileConstants.FILESYSTEM_ID);
        _logger.info("fetchQuotaDirectories for file system id {}", fsId);
        if (!isInValid(fsId)) {
            queryParam.setFileSystem(fsId);
        }
        query.getQueryRequestChoice().add(queryParam);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(queryParam, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for fileSystem info", jaxbException.getCause());
    }
    return iStream;
}
Also used : Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) AspectSelection(com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams.AspectSelection) JAXBException(javax.xml.bind.JAXBException) TreeQuotaQueryParams(com.emc.nas.vnxfile.xmlapi.TreeQuotaQueryParams)

Aggregations

AspectSelection (com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams.AspectSelection)1 Query (com.emc.nas.vnxfile.xmlapi.Query)1 TreeQuotaQueryParams (com.emc.nas.vnxfile.xmlapi.TreeQuotaQueryParams)1 InputStream (java.io.InputStream)1 JAXBException (javax.xml.bind.JAXBException)1