Package org.beangle.security.core.session.impl

Examples of org.beangle.security.core.session.impl.AccessLog


public class DefaultResourceAccessor implements ResourceAccessor {

  protected final Logger logger = LoggerFactory.getLogger(getClass());

  protected static AccessLog buildLog(HttpServletRequest request) {
    AccessLog log = new AccessLog();
    log.setUsername(SecurityContextHolder.getContext().getAuthentication().getName());
    log.setResource(RequestUtils.getServletPath(request));
    //log.setParams(request.getQueryString());
    return log;
  }
View Full Code Here


    //log.setParams(request.getQueryString());
    return log;
  }

  public AccessLog beginAccess(HttpServletRequest request, Date date) {
    AccessLog accessLog = buildLog(request);
    accessLog.setBeginAt(date);
    if (logger.isDebugEnabled()) {
      logger.debug(accessLog.toString());
    }
    return accessLog;
  }
View Full Code Here

    Validate.isTrue(minDuration > 0, "minDuration must greater then 0");
    Validate.isTrue(cacheSize > 100, "cacheSize should greate then 100");
  }

  public AccessLog beginAccess(HttpServletRequest request, Date date) {
    AccessLog accessLog = buildLog(request);
    accessLog.setBeginAt(date);
    synchronized (accessLogs) {
      accessLogs.add(accessLog);
      if (accessLogs.size() >= cacheSize) {
        shrink(accessLogs);
        if (accessLogs.size() >= cacheSize) {
View Full Code Here

    return accessLogs;
  }

  protected void shrink(List<AccessLog> accessLogs) {
    for (Iterator<AccessLog> iterator = accessLogs.iterator(); iterator.hasNext();) {
      AccessLog accessLog = (AccessLog) iterator.next();
      if (accessLog.getDuration() < minDuration) {
        iterator.remove();
      }
    }
  }
View Full Code Here

    Validate.isTrue(minDuration > 0, "minDuration must greater then 0");
    Validate.isTrue(cacheSize > 100, "cacheSize should greate then 100");
  }

  public AccessLog beginAccess(HttpServletRequest request, Date date) {
    AccessLog accessLog = buildLog(request);
    accessLog.setBeginAt(date);
    synchronized (accessLogs) {
      accessLogs.add(accessLog);
      if (accessLogs.size() >= cacheSize) {
        shrink(accessLogs);
        if (accessLogs.size() >= cacheSize) {
View Full Code Here

    return accessLogs;
  }

  protected void shrink(List<AccessLog> accessLogs) {
    for (Iterator<AccessLog> iterator = accessLogs.iterator(); iterator.hasNext();) {
      AccessLog accessLog = (AccessLog) iterator.next();
      if (accessLog.getDuration() < minDuration) {
        iterator.remove();
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.beangle.security.core.session.impl.AccessLog

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.