private String anonymizedSessionKey(String sessionKey, int length) { return Utilities.createAlphanumericHash(sessionKey, length); } }
private String anonymizedSessionKey(String sessionKey, int length) { return Utilities.createAlphanumericHash(sessionKey, length); }
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception { final TraceeFilterConfiguration configuration = backend.getConfiguration(profileName); if (configuration.shouldProcessContext(IncomingRequest)) mergeIncomingContextToBackend(request, configuration); // create random RequestId if not already set if (!backend.containsKey(TraceeConstants.REQUEST_ID_KEY) && configuration.shouldGenerateRequestId()) { backend.put(TraceeConstants.REQUEST_ID_KEY, Utilities.createRandomAlphanumeric(configuration.generatedRequestIdLength())); } // create another random id to identify the http session if (!backend.containsKey(TraceeConstants.SESSION_ID_KEY) && configuration.shouldGenerateSessionId()) { final HttpSession session = request.getSession(false); if (session != null) { backend.put(TraceeConstants.SESSION_ID_KEY, Utilities.createAlphanumericHash(session.getId(), configuration.generatedSessionIdLength())); } } return true; }