use of com.emc.storageos.api.service.impl.resource.utils.AuditLogMarshaller in project coprhd-controller by CoprHD.
the class DummyAuditLogRetriever method getBulkAuditLogs.
@Override
public void getBulkAuditLogs(AuditLogRequest auditLogRequest, MediaType type, Writer writer) throws MarshallingExcetion {
AuditLogMarshaller marshaller = null;
if (type == MediaType.APPLICATION_XML_TYPE) {
marshaller = new XMLAuditLogMarshaller();
} else if (type == MediaType.APPLICATION_JSON_TYPE) {
marshaller = new JSONAuditLogMarshaller();
}
marshaller.header(writer);
List<AuditLog> auditLogs = null;
try {
auditLogs = getDummyAuditLogs();
} catch (URISyntaxException e) {
_logger.error("Error getting logs", e);
}
for (AuditLog log : auditLogs) {
if (type == MediaType.APPLICATION_XML_TYPE) {
marshaller.marshal(log, writer);
} else if (type == MediaType.APPLICATION_JSON_TYPE) {
marshaller.marshal(log, writer);
}
}
marshaller.tailer(writer);
}
Aggregations