@Override public List<SessionData> getObject() { return new ArrayList<>( Arrays.asList(getRequestLogger().getLiveSessions())); } };
@Override public Integer getObject() { return getRequestLogger().getPeakSessions(); } }));
@Override public Integer getObject() { return getRequestLogger().getTotalCreatedSessions(); } }));
/** * Registers the handler with the request logger. The first handler is used as the incoming * request handler, and the last registered handler as the outgoing response handler. * * @param handler */ private void registerHandler(IRequestHandler handler) { IRequestLogger requestLogger = Application.get().getRequestLogger(); if (first.get() == null) { first.set(handler); requestLogger.logEventTarget(handler); } requestLogger.logResponseTarget(handler); } }
@Override public final void setAttribute(final Request request, final String name, final Serializable value) { // ignore call if the session was marked invalid HttpSession httpSession = getHttpSession(request, false); if (httpSession != null) { String attributeName = getSessionAttributePrefix(request) + name; IRequestLogger logger = Application.get().getRequestLogger(); if (logger != null) { if (httpSession.getAttribute(attributeName) == null) { logger.objectCreated(value); } else { logger.objectUpdated(value); } } httpSession.setAttribute(attributeName, value); } }
/** * @see org.apache.wicket.Application#logEventTarget(org.apache.wicket.IRequestTarget) */ public void logEventTarget(IRequestTarget target) { super.logEventTarget(target); IRequestLogger rl = getRequestLogger(); if (rl != null) { rl.logEventTarget(target); } }
/** * @see org.apache.wicket.Application#logResponseTarget(org.apache.wicket.request.IRequestHandler) */ @Override public void logResponseTarget(IRequestHandler target) { super.logResponseTarget(target); IRequestLogger rl = getRequestLogger(); if (rl != null) { rl.logResponseTarget(target); } }
@Override public final void removeAttribute(final Request request, final String name) { HttpSession httpSession = getHttpSession(request, false); if (httpSession != null) { String attributeName = getSessionAttributePrefix(request) + name; IRequestLogger logger = Application.get().getRequestLogger(); if (logger != null) { Object value = httpSession.getAttribute(attributeName); if (value != null) { logger.objectRemoved(value); } } httpSession.removeAttribute(attributeName); } }
@Override public void onDetach(final RequestCycle requestCycle) { if (Session.exists()) { Session.get().getPageManager().commitRequest(); } if (Application.exists()) { IRequestLogger requestLogger = Application.get().getRequestLogger(); if (requestLogger != null) { requestLogger.requestTime((System.currentTimeMillis() - requestCycle.getStartTime())); } } } });
/** * @see org.apache.wicket.session.ISessionStore#getSessionId(org.apache.wicket.Request, boolean) */ public String getSessionId(final Request request, final boolean create) { String id = null; WebRequest webRequest = toWebRequest(request); HttpSession httpSession = webRequest.getHttpServletRequest().getSession(false); if (httpSession != null) { id = httpSession.getId(); } else if (create) { httpSession = webRequest.getHttpServletRequest().getSession(true); id = httpSession.getId(); IRequestLogger logger = application.getRequestLogger(); if (logger != null) { logger.sessionCreated(id); } } return id; }
@Override public final void setAttribute(final Request request, final String name, final Serializable value) { // ignore call if the session was marked invalid HttpSession httpSession = getHttpSession(request, false); if (httpSession != null) { String attributeName = getSessionAttributePrefix(request) + name; IRequestLogger logger = Application.get().getRequestLogger(); if (logger != null) { if (httpSession.getAttribute(attributeName) == null) { logger.objectCreated(value); } else { logger.objectUpdated(value); } } httpSession.setAttribute(attributeName, value); } }
/** * Registers the handler with the request logger. The first handler is used as the incoming * request handler, and the last registered handler as the outgoing response handler. * * @param handler */ private void registerHandler(IRequestHandler handler) { IRequestLogger requestLogger = Application.get().getRequestLogger(); if (first.get() == null) { first.set(handler); requestLogger.logEventTarget(handler); } requestLogger.logResponseTarget(handler); } }
/** * @see org.apache.wicket.Application#logEventTarget(org.apache.wicket.request.IRequestHandler) */ @Override public void logEventTarget(IRequestHandler target) { super.logEventTarget(target); IRequestLogger rl = getRequestLogger(); if (rl != null) { rl.logEventTarget(target); } }
/** * @see org.apache.wicket.Application#logResponseTarget(org.apache.wicket.request.IRequestHandler) */ @Override public void logResponseTarget(IRequestHandler target) { super.logResponseTarget(target); IRequestLogger rl = getRequestLogger(); if (rl != null) { rl.logResponseTarget(target); } }
@Override public final void removeAttribute(final Request request, final String name) { HttpSession httpSession = getHttpSession(request, false); if (httpSession != null) { String attributeName = getSessionAttributePrefix(request) + name; IRequestLogger logger = Application.get().getRequestLogger(); if (logger != null) { Object value = httpSession.getAttribute(attributeName); if (value != null) { logger.objectRemoved(value); } } httpSession.removeAttribute(attributeName); } }
@Override public void onDetach(final RequestCycle requestCycle) { if (Session.exists()) { Session.get().getPageManager().commitRequest(); } if (Application.exists()) { IRequestLogger requestLogger = Application.get().getRequestLogger(); if (requestLogger != null) { requestLogger.requestTime((System.currentTimeMillis() - requestCycle.getStartTime())); } } } });
/** * @see org.apache.wicket.session.ISessionStore#getSessionId(org.apache.wicket.Request, boolean) */ public final String getSessionId(Request request, boolean create) { String id = null; WebRequest webRequest = toWebRequest(request); HttpSession httpSession = webRequest.getHttpServletRequest().getSession(false); if (httpSession != null) { id = httpSession.getId(); } else if (create) { httpSession = webRequest.getHttpServletRequest().getSession(true); id = httpSession.getId(); IRequestLogger logger = application.getRequestLogger(); if (logger != null) { logger.sessionCreated(id); } } return id; }
logger.objectCreated(value); logger.objectUpdated(value);
@Override public Integer getObject() { return getRequestLogger().getPeakSessions(); } }));
/** * Gets the live sessions. * * @return the live sessions */ public static List<SessionData> getLiveSessions() { return new ArrayList<>(Arrays.asList(getRequestLogger().getLiveSessions())); }