Example usage for javax.websocket.server HandshakeRequest getQueryString

List of usage examples for javax.websocket.server HandshakeRequest getQueryString

Introduction

In this page you can find the example usage for javax.websocket.server HandshakeRequest getQueryString.

Prototype

String getQueryString();

Source Link

Usage

From source file:freddo.dtalk2.broker.servlet.DTalkServerEndpoint.java

@OnOpen
public void onOpen(Session session, EndpointConfig config) {
    LOG.trace(">>> onOpen: {}, userProperties: {}", session.getId(), config.getUserProperties());

    mConfig = config;// w w  w  .  ja v  a 2s  .c o  m
    mSession = session;

    if (LOG.isDebugEnabled()) {
        HandshakeRequest req = getHandshakeRequest();
        HttpSession httpSession = (HttpSession) req.getHttpSession();
        LOG.debug("=================================");
        LOG.debug("QueryString   : {}", req.getQueryString());
        LOG.debug("RequestURI    : {}", req.getRequestURI());
        LOG.debug("Headers       : {}", req.getHeaders());
        LOG.debug("UserPrincipal : {}", req.getUserPrincipal());
        LOG.debug("ParameterMap  : {}", req.getParameterMap());
        LOG.debug("=================================");
        if (httpSession != null) {
            Enumeration<String> e = httpSession.getAttributeNames();
            while (e.hasMoreElements()) {
                final String attr = e.nextElement();
                LOG.debug("Session[{}]: {}", attr, httpSession.getAttribute(attr));
            }
            LOG.debug("=================================");
        }
    }

    // TODO register connection & notify context listener

}