Package ch.qos.logback.audit.client

Examples of ch.qos.logback.audit.client.AuditorFacade


    // First set the application name. Setting the application will
    // also cause logback-audit to configure itself.
    AuditorFactory.setApplicationName("BabyStep");
    // One the application name is set and logback-audit is configured, you
    // can start auditing
    new AuditorFacade("baby", "take", "step").audit();
  }
View Full Code Here


    // First set the application name. Setting the application will
    // also cause logback-audit to configure itself.
    AuditorFactory.setApplicationName("SecondStep");
    // One the application name is set and logback-audit is configured, you
    // can start auditing
    new AuditorFacade("baby", "take", "step").audit();
  }
View Full Code Here

   */
  public boolean hasPermission(User user, Permission permission)
      throws AccessException {
    boolean allowed = permissionMap.hasPermission(user, permission);
    if (!allowed) {
      AuditorFacade auditorFacade = new AuditorFacade(user.getName(),
          "ACCESS_DENIED", permission.getName());
      AuditHelper.audit(auditorFacade);
    }
    return allowed;
  }
View Full Code Here

    // let us now audit the code
   
    // The following will create an AuditEvent with a subject equal to the
    // user's name, a verb equal to ADD_PERMISSION, an the object
    // equal to the name of permission passed as argument
    AuditorFacade auditorFacade = new AuditorFacade(user.getName(),
        ADD_PERMISSION_VERB, permission.getName());
    try {
      // send the AuditEvent through an appender (usually to a server)
      auditorFacade.audit();
    } catch (AuditException e) {
      // if an AuditException occurs, rethrow it as
      // an application failure (AccessException)
      throw new AccessException("Audit failure", e);
    }
View Full Code Here

   */
  public void removePermission(User user, Permission permission)
      throws AccessException {
    permissionMap.removePermission(user, permission);

    AuditorFacade auditorFacade = new AuditorFacade(user.getName(),
        REMOVE_PERMISSION_VERB, permission.getName());
    AuditHelper.audit(auditorFacade);

  }
View Full Code Here

TOP

Related Classes of ch.qos.logback.audit.client.AuditorFacade

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.