use of com.emc.storageos.api.service.impl.resource.utils.StatMarshaller in project coprhd-controller by CoprHD.
the class DummyStatRetriever method getBulkStats.
@Override
public void getBulkStats(DateTime timeBucket, TimeBucket granularity, MediaType mediaType, PrintWriter out) throws MarshallingExcetion {
StatMarshaller marshaller = StatMarshallerFactory.getMarshaller(mediaType);
marshaller.header(out);
List<Stat> stats = null;
try {
stats = getDummyStats();
} catch (URISyntaxException e) {
_logger.error("Error getting stats", e);
}
for (Stat stat : stats) {
if (mediaType == MediaType.APPLICATION_XML_TYPE) {
try {
marshaller.marshall(stat, out);
} catch (Exception e) {
_logger.error(e.getMessage(), e);
}
} else if (mediaType == MediaType.APPLICATION_JSON_TYPE) {
try {
marshaller.marshall(stat, out);
} catch (Exception e) {
_logger.error(e.getMessage(), e);
}
}
}
marshaller.tailer(out);
}
Aggregations