Package com.rupertjones.globalcron.common.domain

Examples of com.rupertjones.globalcron.common.domain.AuditLog


    }

    private void audit(Auditable entity, AuditLogType type) {
        try {
            String user = sessionContextProvider.getCurrentUser();
            AuditLog log = new AuditLog();
            log.setType(type);
            log.setCreatedAt(new Date());
            log.setUser(user);
            log.setMessage(format("[Entity: %s] [Summary: %s] [by: %s]", entity.getClass().getName(), entity.toAuditLog(), user));
            auditLogDAO.upsert(log);
        } catch (Throwable th) {
            LOG.error("Audit Log could not be saved - actions are not recorded", th);
        }
    }
View Full Code Here


    private AuditLogService auditLogService;

    @DefaultHandler
    public Resolution view() {
        jobService.stopAll();
        AuditLog auditLog = new AuditLog();
        auditLog.setMessage("Stop All Jobs");
        auditLog.setUser(contextProvider.getCurrentUser());
        auditLog.setType(AuditLogType.STOP_ALL_JOBS);
        auditLog.setCreatedAt(new Date());
        auditLogService.audit(auditLog);
        return new ForwardResolution(HOME_ACTION);
    }
View Full Code Here

            auth.add(new Authority(role.getName()));
        }
        user.registerLogin();
        userDAO.upsert(user);

        AuditLog auditLog = new AuditLog();
        auditLog.setMessage("User logged in");
        auditLog.setUser(user.getUsername());
        auditLog.setType(AuditLogType.LOGIN);
        auditLogDAO.upsert(auditLog);

        LOG.info(format("User %s successfully logged in with roles [%s]", username, auth));
        return new UsernamePasswordAuthenticationToken(user.getUsername(), user.getPassword(), auth);
    }
View Full Code Here

TOP

Related Classes of com.rupertjones.globalcron.common.domain.AuditLog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.