Search in sources :

Example 1 with Query

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

the class VNXFileArgsCreator method fetchCheckpointInfo.

/**
 * create checkpoint information query and returns its stream after marshalling.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @return
 * @throws VNXFilePluginException
 */
public InputStream fetchCheckpointInfo(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("Creating checkpoint info query");
    InputStream iStream = null;
    try {
        Query query = new Query();
        CheckpointQueryParams ckptParams = new CheckpointQueryParams();
        query.getQueryRequestChoice().add(ckptParams);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(ckptParams, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for celerra system info", jaxbException.getCause());
    }
    return iStream;
}
Also used : CheckpointQueryParams(com.emc.nas.vnxfile.xmlapi.CheckpointQueryParams) Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) JAXBException(javax.xml.bind.JAXBException)

Example 2 with Query

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

the class VNXFileArgsCreator method fetchMountFSInfo.

/**
 * create Mount query and returns its stream after marshalling.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @return
 * @throws VNXFilePluginException
 */
public InputStream fetchMountFSInfo(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("VNX File System Mount info query");
    InputStream iStream = null;
    try {
        Query query = new Query();
        MountQueryParams mountQueryParams = new MountQueryParams();
        query.getQueryRequestChoice().add(mountQueryParams);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(mountQueryParams, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for celerra system info", jaxbException.getCause());
    }
    return iStream;
}
Also used : Query(com.emc.nas.vnxfile.xmlapi.Query) MountQueryParams(com.emc.nas.vnxfile.xmlapi.MountQueryParams) InputStream(java.io.InputStream) JAXBException(javax.xml.bind.JAXBException)

Example 3 with Query

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

the class VNXFileArgsCreator method fetchVdmInfo.

public InputStream fetchVdmInfo(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("Creating VDM info query");
    InputStream iStream = null;
    try {
        Query query = new Query();
        VdmQueryParams vdmQuery = new VdmQueryParams();
        query.getQueryRequestChoice().add(vdmQuery);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(vdmQuery, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for VDM info", jaxbException.getCause());
    }
    return iStream;
}
Also used : Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) VdmQueryParams(com.emc.nas.vnxfile.xmlapi.VdmQueryParams) JAXBException(javax.xml.bind.JAXBException)

Example 4 with Query

use of com.emc.nas.vnxfile.xmlapi.Query 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)

Example 5 with Query

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

the class VNXFileArgsCreator method fetchUserAccounts.

/**
 * Performs a query for the user accounts on the specified data mover.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @return iStream
 * @throws VNXFilePluginException
 */
public InputStream fetchUserAccounts(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("Creating User Accounts Query");
    InputStream iStream = null;
    try {
        String dataMover = (String) keyMap.get(VNXFileConstants.DATAMOVER_ID);
        _logger.info("using data mover {}", dataMover);
        Query query = new Query();
        UserAccountQueryParams userQuery = new UserAccountQueryParams();
        userQuery.setMover(dataMover);
        query.getQueryRequestChoice().add(userQuery);
        iStream = _vnxFileInputRequestBuilder.getQueryExParamPacket(userQuery);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for user account info", jaxbException.getCause());
    }
    return iStream;
}
Also used : Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) UserAccountQueryParams(com.emc.nas.vnxfile.xmlapi.UserAccountQueryParams) JAXBException(javax.xml.bind.JAXBException)

Aggregations

Query (com.emc.nas.vnxfile.xmlapi.Query)20 InputStream (java.io.InputStream)20 JAXBException (javax.xml.bind.JAXBException)19 AspectSelection (com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams.AspectSelection)10 FileSystemQueryParams (com.emc.nas.vnxfile.xmlapi.FileSystemQueryParams)5 MoverQueryParams (com.emc.nas.vnxfile.xmlapi.MoverQueryParams)4 FileSystemAlias (com.emc.nas.vnxfile.xmlapi.FileSystemAlias)3 CifsServerQueryParams (com.emc.nas.vnxfile.xmlapi.CifsServerQueryParams)2 MoverOrVdmRef (com.emc.nas.vnxfile.xmlapi.MoverOrVdmRef)2 APIVersion (com.emc.nas.vnxfile.xmlapi.APIVersion)1 CelerraSystemQueryParams (com.emc.nas.vnxfile.xmlapi.CelerraSystemQueryParams)1 CheckpointQueryParams (com.emc.nas.vnxfile.xmlapi.CheckpointQueryParams)1 MountQueryParams (com.emc.nas.vnxfile.xmlapi.MountQueryParams)1 NfsExportQueryParams (com.emc.nas.vnxfile.xmlapi.NfsExportQueryParams)1 Request (com.emc.nas.vnxfile.xmlapi.Request)1 RequestPacket (com.emc.nas.vnxfile.xmlapi.RequestPacket)1 StoragePoolQueryParams (com.emc.nas.vnxfile.xmlapi.StoragePoolQueryParams)1 TreeQuotaQueryParams (com.emc.nas.vnxfile.xmlapi.TreeQuotaQueryParams)1 UserAccountQueryParams (com.emc.nas.vnxfile.xmlapi.UserAccountQueryParams)1 VdmQueryParams (com.emc.nas.vnxfile.xmlapi.VdmQueryParams)1