Search in sources :

Example 1 with AuditLogMarshaller

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);
}
Also used : JSONAuditLogMarshaller(com.emc.storageos.api.service.impl.resource.utils.JSONAuditLogMarshaller) JSONAuditLogMarshaller(com.emc.storageos.api.service.impl.resource.utils.JSONAuditLogMarshaller) XMLAuditLogMarshaller(com.emc.storageos.api.service.impl.resource.utils.XMLAuditLogMarshaller) AuditLogMarshaller(com.emc.storageos.api.service.impl.resource.utils.AuditLogMarshaller) URISyntaxException(java.net.URISyntaxException) XMLAuditLogMarshaller(com.emc.storageos.api.service.impl.resource.utils.XMLAuditLogMarshaller) AuditLog(com.emc.storageos.db.client.model.AuditLog)

Aggregations

AuditLogMarshaller (com.emc.storageos.api.service.impl.resource.utils.AuditLogMarshaller)1 JSONAuditLogMarshaller (com.emc.storageos.api.service.impl.resource.utils.JSONAuditLogMarshaller)1 XMLAuditLogMarshaller (com.emc.storageos.api.service.impl.resource.utils.XMLAuditLogMarshaller)1 AuditLog (com.emc.storageos.db.client.model.AuditLog)1 URISyntaxException (java.net.URISyntaxException)1