Search in sources :

Example 1 with CifsServerQueryParams

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

the class VNXFileArgsCreator method fetchCifsServerInfo.

/**
 * Create CIFS Config XML request and return stream after marhalling.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @throws com.emc.storageos.plugins.metering.vnxfile.VNXFilePluginException
 */
public InputStream fetchCifsServerInfo(final Argument argument, final Map<String, Object> keyMap, // final Boolean moverOrVdm,
int index) throws VNXFilePluginException {
    _logger.info("Creating CIFS Server info Query");
    InputStream iStream = null;
    try {
        _logger.info("Creating CIFS Server info Query for Mover {} {} isVDM? {}", (String) keyMap.get(VNXFileConstants.MOVER_ID) + ":" + (String) keyMap.get(VNXFileConstants.DATAMOVER_NAME), keyMap.get(VNXFileConstants.ISVDM));
        MoverOrVdmRef mover = new MoverOrVdmRef();
        mover.setMover((String) keyMap.get(VNXFileConstants.MOVER_ID));
        mover.setMoverIdIsVdm(Boolean.valueOf((String) keyMap.get(VNXFileConstants.ISVDM)));
        CifsServerQueryParams cifsQuery = new CifsServerQueryParams();
        cifsQuery.setMoverOrVdm(mover);
        Query query = new Query();
        query.getQueryRequestChoice().add(cifsQuery);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(cifsQuery, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for file export info", jaxbException.getCause());
    }
    return iStream;
}
Also used : Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) JAXBException(javax.xml.bind.JAXBException) MoverOrVdmRef(com.emc.nas.vnxfile.xmlapi.MoverOrVdmRef) CifsServerQueryParams(com.emc.nas.vnxfile.xmlapi.CifsServerQueryParams)

Example 2 with CifsServerQueryParams

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

the class VNXFileArgsCreator method fetchCifsServerParams.

/**
 * Create CIFS Config XML request and return stream after marhalling.
 *
 * @param argument
 * @param keyMap
 * @param index
 * @throws com.emc.storageos.plugins.metering.vnxfile.VNXFilePluginException
 */
public InputStream fetchCifsServerParams(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
    _logger.info("Creating CIFS Server Params Query");
    InputStream iStream = null;
    try {
        String moverId = (String) keyMap.get(VNXFileConstants.MOVER_ID);
        String isVDM = (String) keyMap.get(VNXFileConstants.ISVDM);
        CifsServerQueryParams cifsQuery = new CifsServerQueryParams();
        MoverOrVdmRef mover = new MoverOrVdmRef();
        Boolean moverIsVdm = new Boolean(false);
        if (moverId != null) {
            mover.setMover(moverId);
            if (isVDM != null) {
                if (isVDM.equalsIgnoreCase("true")) {
                    moverIsVdm = new Boolean(true);
                }
            }
            mover.setMoverIdIsVdm(moverIsVdm);
            cifsQuery.setMoverOrVdm(mover);
        }
        Query query = new Query();
        query.getQueryRequestChoice().add(cifsQuery);
        iStream = _vnxFileInputRequestBuilder.getQueryParamPacket(cifsQuery, false);
    } catch (JAXBException jaxbException) {
        throw new VNXFilePluginException("Exception occurred while generating input xml for  Cifs server info", jaxbException.getCause());
    }
    return iStream;
}
Also used : Query(com.emc.nas.vnxfile.xmlapi.Query) InputStream(java.io.InputStream) JAXBException(javax.xml.bind.JAXBException) MoverOrVdmRef(com.emc.nas.vnxfile.xmlapi.MoverOrVdmRef) CifsServerQueryParams(com.emc.nas.vnxfile.xmlapi.CifsServerQueryParams)

Aggregations

CifsServerQueryParams (com.emc.nas.vnxfile.xmlapi.CifsServerQueryParams)2 MoverOrVdmRef (com.emc.nas.vnxfile.xmlapi.MoverOrVdmRef)2 Query (com.emc.nas.vnxfile.xmlapi.Query)2 InputStream (java.io.InputStream)2 JAXBException (javax.xml.bind.JAXBException)2