This is a bit off topic for Dropwizard now :-)
Why do you need to get the unique id of a session? That is like meddling with the JSESSIONID in stateful servlet containers. To add your own identifiers, add them as parameters to the upgrade request, so that you get hold of them on the jetty/framework callback to org.eclipse.jetty.websocket.servlet.WebSocketCreator#createWebSocket
I see that I did not describe the WebSocketCreator in the other thread, so it would be something like this:
public class MyWebSocketServlet extends WebSocketServlet implements WebSocketCreator {
@Override
public void configure(WebSocketServletFactory factory) {
factory.register(MyWebSocketEndpoint.class);
factory.setCreator(this);
}
@Override
public Object createWebSocket(UpgradeRequest req, UpgradeResponse resp) {
MyWebSocketEndpoint ep = new MyWebSocketEndpoint(req.getgetParameterMap());
registerMyEndpoint(ep);
return ep;
}
}
Put the endpoint you create (and return) from this method in a storage of liking (e.g. a map with some id and the endpoint as value) and you have your session-lookup utility if you want to do server-side initiated push events.
You have to register the endpoint class yes - I described that in the other thread:
https://groups.google.com/d/msg/dropwizard-user/doNCx_35urk/5PIvd8_NHIcJ
HTH
--
You received this message because you are subscribed to a topic in the Google Groups "dropwizard-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dropwizard-user/GTQrzYiVA5Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dropwizard-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "dropwizard-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dropwizard-user/GTQrzYiVA5Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dropwizard-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to dropwizard-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.