Search in sources :

Example 1 with IRequestLogger

use of org.apache.wicket.protocol.http.IRequestLogger in project wicket by apache.

the class HttpSessionStore method removeAttribute.

@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);
    }
}
Also used : IRequestLogger(org.apache.wicket.protocol.http.IRequestLogger) HttpSession(javax.servlet.http.HttpSession)

Example 2 with IRequestLogger

use of org.apache.wicket.protocol.http.IRequestLogger in project wicket by apache.

the class HttpSessionStore method getSessionId.

@Override
public String getSessionId(final Request request, final boolean create) {
    String id = null;
    HttpSession httpSession = getHttpSession(request, false);
    if (httpSession != null) {
        id = httpSession.getId();
    } else if (create) {
        httpSession = getHttpSession(request, true);
        id = httpSession.getId();
        IRequestLogger logger = Application.get().getRequestLogger();
        if (logger != null) {
            logger.sessionCreated(id);
        }
    }
    return id;
}
Also used : IRequestLogger(org.apache.wicket.protocol.http.IRequestLogger) HttpSession(javax.servlet.http.HttpSession)

Example 3 with IRequestLogger

use of org.apache.wicket.protocol.http.IRequestLogger in project wicket by apache.

the class HttpSessionStore method setAttribute.

@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);
    }
}
Also used : IRequestLogger(org.apache.wicket.protocol.http.IRequestLogger) HttpSession(javax.servlet.http.HttpSession)

Example 4 with IRequestLogger

use of org.apache.wicket.protocol.http.IRequestLogger in project wicket by apache.

the class LiveSessionsPage method getRequestLogger.

IRequestLogger getRequestLogger() {
    WebApplication webApplication = (WebApplication) Application.get();
    IRequestLogger requestLogger = webApplication.getRequestLogger();
    if (requestLogger == null)
        requestLogger = new RequestLogger();
    return requestLogger;
}
Also used : IRequestLogger(org.apache.wicket.protocol.http.IRequestLogger) IRequestLogger(org.apache.wicket.protocol.http.IRequestLogger) RequestLogger(org.apache.wicket.protocol.http.RequestLogger) WebApplication(org.apache.wicket.protocol.http.WebApplication)

Example 5 with IRequestLogger

use of org.apache.wicket.protocol.http.IRequestLogger in project wicket by apache.

the class RequestsPage method getRequestLogger.

IRequestLogger getRequestLogger() {
    WebApplication webApplication = (WebApplication) Application.get();
    IRequestLogger requestLogger = webApplication.getRequestLogger();
    if (webApplication.getRequestLogger() == null)
        requestLogger = new RequestLogger();
    return requestLogger;
}
Also used : IRequestLogger(org.apache.wicket.protocol.http.IRequestLogger) IRequestLogger(org.apache.wicket.protocol.http.IRequestLogger) RequestLogger(org.apache.wicket.protocol.http.RequestLogger) WebApplication(org.apache.wicket.protocol.http.WebApplication)

Aggregations

IRequestLogger (org.apache.wicket.protocol.http.IRequestLogger)6 HttpSession (javax.servlet.http.HttpSession)3 RequestLogger (org.apache.wicket.protocol.http.RequestLogger)2 WebApplication (org.apache.wicket.protocol.http.WebApplication)2 IRequestCycleListener (org.apache.wicket.request.cycle.IRequestCycleListener)1 RequestCycle (org.apache.wicket.request.cycle.RequestCycle)1 RequestCycleContext (org.apache.wicket.request.cycle.RequestCycleContext)1