Package com.knife.web.threading.exception

Examples of com.knife.web.threading.exception.InvalidRequestTokenException


   */
  public static void validateUniqueRequestIdentifier(String key, HttpServletRequest request, String requestIdentifierSessionKey) throws InvalidRequestTokenException,
      InterruptedException {
    synchronized (request.getSession()) {
      if (!StringUtils.equals(key, String.valueOf(request.getSession().getAttribute(requestIdentifierSessionKey)))) {
        throw new InvalidRequestTokenException("User does not have token in session");
      }
    }
  }
View Full Code Here


  public static void validateAndRemoveUniqueRequestIdentifier(String key, HttpServletRequest request, String requestIdentifierSessionKey) throws InvalidRequestTokenException,
      InterruptedException {
    synchronized (request.getSession()) {

      if (!StringUtils.equals(key, String.valueOf(request.getSession().getAttribute(requestIdentifierSessionKey)))) {
        throw new InvalidRequestTokenException("User does not have token in session");
      }
      request.getSession().removeAttribute(requestIdentifierSessionKey);
    }
  }
View Full Code Here

    DoubleSubmitLock dsl = (DoubleSubmitLock) request.getSession().getAttribute(getSessionId(callerId));

    if ((dsl == null) || (!dsl.isSameRequestId(requestId))) {
      String msg = "DoubleSubmitLock not bound to session [callerId=" + callerId + "; requestId=" + requestId + "]";
      System.out.println(msg);
      throw new InvalidRequestTokenException(msg);
    }
    return dsl;
  }
View Full Code Here

TOP

Related Classes of com.knife.web.threading.exception.InvalidRequestTokenException

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.