Package org.jboss.security.audit

Examples of org.jboss.security.audit.AuditEvent


      {
         if (trace)
            log.trace("Error obtaining the servlet request:", pe);
      }
      contextMap.put("Source", getClass().getName());
      AuditEvent ae = new AuditEvent(level);
      ae.setContextMap(contextMap);
      ae.setUnderlyingException(e);

      SecurityContext sc = SecurityAssociationActions.getSecurityContext();
      if (sc != null)
      {
         AuditManager auditManager = sc.getAuditManager();
View Full Code Here


    // Audit Methods
    private void successAudit(Principal userPrincipal, Map<String, Object> entries) {
        if (userPrincipal != null && !disableAudit) {
            if (auditManager != null) {
                AuditEvent auditEvent = new AuditEvent(AuditLevel.SUCCESS);
                Map<String, Object> ctxMap = new HashMap<String, Object>();
                ctxMap.put("principal", userPrincipal);
                HttpServletRequest hsr = getServletRequest();
                if (hsr != null) {
                    ctxMap.put("request", WebUtil.deriveUsefulInfo(hsr));
                }
                ctxMap.put("Source", getClass().getCanonicalName());
                if (entries != null) {
                    ctxMap.putAll(entries);
                }
                auditEvent.setContextMap(ctxMap);
                auditManager.audit(auditEvent);
            }
        }
    }
View Full Code Here

        }
    }

    private void failureAudit(Principal userPrincipal, Map<String, Object> entries) {
        if (auditManager != null && !disableAudit) {
            AuditEvent auditEvent = new AuditEvent(AuditLevel.FAILURE);
            Map<String, Object> ctxMap = new HashMap<String, Object>();
            ctxMap.put("principal", userPrincipal);
            HttpServletRequest hsr = getServletRequest();
            if (hsr != null) {
                ctxMap.put("request", WebUtil.deriveUsefulInfo(hsr));
            }
            ctxMap.put("Source", getClass().getCanonicalName());
            if (entries != null) {
                ctxMap.putAll(entries);
            }
            auditEvent.setContextMap(ctxMap);
            auditManager.audit(auditEvent);
        }
    }
View Full Code Here

        }
    }

    private void exceptionAudit(Principal userPrincipal, Map<String, Object> entries, Exception e) {
        if (auditManager != null && !disableAudit) {
            AuditEvent auditEvent = new AuditEvent(AuditLevel.ERROR);
            Map<String, Object> ctxMap = new HashMap<String, Object>();
            ctxMap.put("principal", userPrincipal);
            ctxMap.putAll(entries);
            HttpServletRequest hsr = getServletRequest();
            if (hsr != null) {
                ctxMap.put("request", WebUtil.deriveUsefulInfo(hsr));
            }
            ctxMap.put("source", getClass().getCanonicalName());
            if (entries != null) {
                ctxMap.putAll(entries);
            }
            auditEvent.setContextMap(ctxMap);
            auditEvent.setUnderlyingException(e);
            auditManager.audit(auditEvent);
        }
    }
View Full Code Here

      {
         if (trace)
            log.trace("Error obtaining the servlet request:", pe);
      }
      contextMap.put("Source", getClass().getName());
      AuditEvent ae = new AuditEvent(level);
      ae.setContextMap(contextMap);
      ae.setUnderlyingException(e);

      SecurityContext sc = SecurityAssociationActions.getSecurityContext();
      if (sc != null)
      {
         AuditManager auditManager = sc.getAuditManager();
View Full Code Here

     {
        AuditManager am = securityContext.getAuditManager();
        if(am == null)
           return;
        contextMap.put("Source", getClass().getName());
        AuditEvent ae = new AuditEvent(level,contextMap,e);
        am.audit(ae);
     }   
View Full Code Here

    // Audit Methods
    private void successAudit(Principal userPrincipal, Map<String, Object> entries) {
        if (userPrincipal != null && !disableAudit) {
            if (auditManager != null) {
                AuditEvent auditEvent = new AuditEvent(AuditLevel.SUCCESS);
                Map<String, Object> ctxMap = new HashMap<String, Object>();
                ctxMap.put("principal", userPrincipal);
                HttpServletRequest hsr = getServletRequest();
                if (hsr != null) {
                    ctxMap.put("request", WebUtil.deriveUsefulInfo(hsr));
                }
                ctxMap.put("Source", getClass().getCanonicalName());
                if (entries != null) {
                    ctxMap.putAll(entries);
                }
                auditEvent.setContextMap(ctxMap);
                auditManager.audit(auditEvent);
            }
        }
    }
View Full Code Here

        }
    }

    private void failureAudit(Principal userPrincipal, Map<String, Object> entries) {
        if (auditManager != null && !disableAudit) {
            AuditEvent auditEvent = new AuditEvent(AuditLevel.FAILURE);
            Map<String, Object> ctxMap = new HashMap<String, Object>();
            ctxMap.put("principal", userPrincipal);
            HttpServletRequest hsr = getServletRequest();
            if (hsr != null) {
                ctxMap.put("request", WebUtil.deriveUsefulInfo(hsr));
            }
            ctxMap.put("Source", getClass().getCanonicalName());
            if (entries != null) {
                ctxMap.putAll(entries);
            }
            auditEvent.setContextMap(ctxMap);
            auditManager.audit(auditEvent);
        }
    }
View Full Code Here

        }
    }

    private void exceptionAudit(Principal userPrincipal, Map<String, Object> entries, Exception e) {
        if (auditManager != null && !disableAudit) {
            AuditEvent auditEvent = new AuditEvent(AuditLevel.ERROR);
            Map<String, Object> ctxMap = new HashMap<String, Object>();
            ctxMap.put("principal", userPrincipal);
            ctxMap.putAll(entries);
            HttpServletRequest hsr = getServletRequest();
            if (hsr != null) {
                ctxMap.put("request", WebUtil.deriveUsefulInfo(hsr));
            }
            ctxMap.put("source", getClass().getCanonicalName());
            if (entries != null) {
                ctxMap.putAll(entries);
            }
            auditEvent.setContextMap(ctxMap);
            auditEvent.setUnderlyingException(e);
            auditManager.audit(auditEvent);
        }
    }
View Full Code Here

    @Override
    public void handleNotification(SecurityNotification notification) {
        EventType event = notification.getEventType();
        if (event == EventType.AUTHENTICATED || event == EventType.FAILED_AUTHENTICATION) {
            AuditEvent auditEvent = new AuditEvent(event == EventType.AUTHENTICATED ? AuditLevel.SUCCESS : AuditLevel.FAILURE);
            Map<String, Object> ctxMap = new HashMap<String, Object>();
            Account account = notification.getAccount();
            if (account != null) {
                ctxMap.put("principal", account.getPrincipal().getName());
            }
            ctxMap.put("message", notification.getMessage());
            /*
             * HttpServletRequest hsr = getServletRequest(); if (hsr != null) { ctxMap.put("request",
             * WebUtil.deriveUsefulInfo(hsr)); }
             */
            ctxMap.put("Source", getClass().getCanonicalName());
            auditEvent.setContextMap(ctxMap);
            auditManager.audit(auditEvent);

        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.security.audit.AuditEvent

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.