Package org.beangle.security.core.session

Examples of org.beangle.security.core.session.SessionStatus


  @Override
  protected void doFilterHttp(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
      throws IOException, ServletException {
    HttpSession session = request.getSession(false);
    SessionStatus info = null;
    if (session != null) {
      info = sessionRegistry.getSessionStatus(session.getId());
      // Expired - abort processing
      if (null != info) {
        if (info.isExpired()) {
          doLogout(request, response);
          sessionRegistry.remove(session.getId());
          String targetUrl = determineExpiredUrl(request, info);
          if (targetUrl != null) {
            RedirectUtils.sendRedirect(request, response, targetUrl);
View Full Code Here


    if (infos.isEmpty()) return null;
    else return infos.get(0);
  }

  public void register(Authentication auth, String sessionId) throws SessionException {
    SessionStatus existed = getSessionStatus(sessionId);
    String principal = auth.getName();
    // 是否为重复注册
    if (null != existed && ObjectUtils.equals(existed.getUsername(), principal)) return;
    // 争取名额
    boolean success = controller.onRegister(auth, sessionId, this);
    if (!success) throw new SessionException("security.OvermaxSession");
    // 注销同会话的其它账户
    if (null != existed) {
View Full Code Here

  }

  public SessionStatus getSessionStatus(String sessionid) {
    Sessioninfo info = getSessioninfo(sessionid);
    if (null == info) return null;
    else return new SessionStatus(info);
  }
View Full Code Here

  }

  public SessionStatus getSessionStatus(String sessionid) {
    Sessioninfo info = getSessioninfo(sessionid);
    if (null == info) return null;
    else return new SessionStatus(info);
  }
View Full Code Here

    if (infos.isEmpty()) return null;
    else return infos.get(0);
  }

  public void register(Authentication auth, String sessionId) throws SessionException {
    SessionStatus existed = getSessionStatus(sessionId);
    String principal = auth.getName();
    // 是否为重复注册
    if (null != existed && ObjectUtils.equals(existed.getUsername(), principal)) return;
    // 争取名额
    boolean success = controller.onRegister(auth, sessionId, this);
    if (!success) throw new SessionException("security.OvermaxSession");
    // 注销同会话的其它账户
    if (null != existed) {
View Full Code Here

  @Override
  protected void doFilterHttp(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
      throws IOException, ServletException {
    HttpSession session = request.getSession(false);
    SessionStatus info = null;
    if (session != null && shouldCare(request)) {
      info = sessionRegistry.getSessionStatus(session.getId());
      // Expired - abort processing
      if (null != info) {
        if (info.isExpired()) {
          doLogout(request, response);
          sessionRegistry.remove(session.getId());
          String targetUrl = determineExpiredUrl(request, info);
          if (targetUrl != null) {
            RedirectUtils.sendRedirect(request, response, targetUrl);
View Full Code Here

TOP

Related Classes of org.beangle.security.core.session.SessionStatus

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.