Search in sources :

Example 1 with AuditEventComparator

use of com.sequenceiq.cloudbreak.comparator.audit.AuditEventComparator in project cloudbreak by hortonworks.

the class AuditEventService method getAuditEventsByWorkspaceId.

public List<AuditEventV4Response> getAuditEventsByWorkspaceId(Long workspaceId, String resourceType, Long resourceId, String resourceCrn) {
    User user = userService.getOrCreate(legacyRestRequestThreadLocalService.getCloudbreakUser());
    Workspace workspace = getWorkspaceService().get(workspaceId, user);
    List<AuditEventV4Response> auditEventV4Responses = getEventsForUserWithTypeAndResourceIdByWorkspace(workspace, resourceType, resourceId, resourceCrn);
    auditEventV4Responses.sort(new AuditEventComparator().reversed());
    return auditEventV4Responses;
}
Also used : User(com.sequenceiq.cloudbreak.workspace.model.User) AuditEventComparator(com.sequenceiq.cloudbreak.comparator.audit.AuditEventComparator) Workspace(com.sequenceiq.cloudbreak.workspace.model.Workspace) AuditEventV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.audits.responses.AuditEventV4Response)

Aggregations

AuditEventV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.audits.responses.AuditEventV4Response)1 AuditEventComparator (com.sequenceiq.cloudbreak.comparator.audit.AuditEventComparator)1 User (com.sequenceiq.cloudbreak.workspace.model.User)1 Workspace (com.sequenceiq.cloudbreak.workspace.model.Workspace)1