Search in sources :

Example 1 with SshAuditEvent

use of com.google.gerrit.audit.SshAuditEvent in project gerrit by GerritCodeReview.

the class SshLog method audit.

private void audit(Context ctx, Object result, String cmd, ListMultimap<String, ?> params) {
    String sessionId;
    CurrentUser currentUser;
    long created;
    if (ctx == null) {
        sessionId = null;
        currentUser = null;
        created = TimeUtil.nowMs();
    } else {
        SshSession session = ctx.getSession();
        sessionId = IdGenerator.format(session.getSessionId());
        currentUser = session.getUser();
        created = ctx.created;
    }
    auditService.dispatch(new SshAuditEvent(sessionId, currentUser, cmd, created, params, result));
}
Also used : SshAuditEvent(com.google.gerrit.audit.SshAuditEvent) CurrentUser(com.google.gerrit.server.CurrentUser)

Aggregations

SshAuditEvent (com.google.gerrit.audit.SshAuditEvent)1 CurrentUser (com.google.gerrit.server.CurrentUser)1