Subversion Repositories SmartDukaan

Rev

Rev 33766 | Rev 34824 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33766 Rev 34819
Line 49... Line 49...
49
            if (idempotencyKey == null || idempotencyKey.isEmpty()) {
49
            if (idempotencyKey == null || idempotencyKey.isEmpty()) {
50
//                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Missing idempotency token in header");
50
//                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Missing idempotency token in header");
51
                return true;
51
                return true;
52
            }
52
            }
53
 
53
 
54
            Cache cache = timeoutCacheManager.getCache("IdempotencyKey");
54
            /*Cache cache = timeoutCacheManager.getCache("IdempotencyKey");
55
            if (cache != null) {
55
            if (cache != null) {
56
                if (cache.get(idempotencyKey) != null) {
56
                if (cache.get(idempotencyKey) != null) {
57
                    response.setStatus(HttpServletResponse.SC_OK);
57
                    response.setStatus(HttpServletResponse.SC_OK);
58
                    response.getWriter().write("Duplicate request. Idempotency Key already processed.");
58
                    response.getWriter().write("Duplicate request. Idempotency Key already processed.");
59
                    return false;
59
                    return false;
60
                } else {
60
                } else {
61
                    cache.put(idempotencyKey, "PROCESSED");
61
                    cache.put(idempotencyKey, "PROCESSED");
62
                    return true;
62
                    return true;
63
                }
63
                }
64
            }
64
            }*/
65
        }
65
        }
66
        return true;
66
        return true;
67
    }
67
    }
68
 
68
 
69
    private UserInfo getUserInfo(String token) throws ProfitMandiBusinessException{
69
    private UserInfo getUserInfo(String token) throws ProfitMandiBusinessException{