Java implementation of websocket