Example usage for javax.websocket.server HandshakeRequest getRequestURI

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

Introduction

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

Prototype

URI getRequestURI();

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;/*from   w w  w.  java2 s.co  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

}