use of com.emc.nas.vnxfile.xmlapi.QueryEx in project coprhd-controller by CoprHD.
the class VNXFileInputRequestBuilder method getQueryExParamPacket.
public InputStream getQueryExParamPacket(Object queryParam) throws JAXBException {
InputStream inputStream = null;
List<RequestEx> requests = new ArrayList<RequestEx>(1);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
RequestPacket requestPacket = new RequestPacket();
try {
QueryEx query = new QueryEx();
query.getQueryRequestChoiceEx().add(queryParam);
RequestEx request = new RequestEx();
request.setQuery(query);
requests.add(request);
APIVersion apiVer = APIVersion.V_1_1;
requestPacket.setApiVersion(apiVer);
requestPacket.getRequestOrRequestEx().addAll(requests);
_marshaller.marshal(requestPacket, outputStream);
inputStream = new ByteArrayInputStream(outputStream.toByteArray());
} finally {
try {
outputStream.close();
} catch (IOException e) {
_logger.error("Exception occurred while closing the stream due to ", e);
}
}
return inputStream;
}
Aggregations