/** * An overloaded version of * {@link #connect(String, WebSocketHttpHeaders, StompSessionHandler, Object...)} * that accepts a fully prepared {@link java.net.URI}. * @param url the url to connect to * @param handshakeHeaders the headers for the WebSocket handshake * @param connectHeaders headers for the STOMP CONNECT frame * @param sessionHandler the STOMP session handler * @return a ListenableFuture for access to the session when ready for use */ public ListenableFuture<StompSession> connect(URI url, @Nullable WebSocketHttpHeaders handshakeHeaders, @Nullable StompHeaders connectHeaders, StompSessionHandler sessionHandler) { Assert.notNull(url, "'url' must not be null"); ConnectionHandlingStompSession session = createSession(connectHeaders, sessionHandler); WebSocketTcpConnectionHandlerAdapter adapter = new WebSocketTcpConnectionHandlerAdapter(session); getWebSocketClient().doHandshake(adapter, handshakeHeaders, url).addCallback(adapter); return session.getSessionFuture(); }
/** * An overloaded version of * {@link #connect(String, WebSocketHttpHeaders, StompSessionHandler, Object...)} * that accepts a fully prepared {@link java.net.URI}. * @param url the url to connect to * @param handshakeHeaders the headers for the WebSocket handshake * @param connectHeaders headers for the STOMP CONNECT frame * @param sessionHandler the STOMP session handler * @return a ListenableFuture for access to the session when ready for use */ public ListenableFuture<StompSession> connect(URI url, @Nullable WebSocketHttpHeaders handshakeHeaders, @Nullable StompHeaders connectHeaders, StompSessionHandler sessionHandler) { Assert.notNull(url, "'url' must not be null"); ConnectionHandlingStompSession session = createSession(connectHeaders, sessionHandler); WebSocketTcpConnectionHandlerAdapter adapter = new WebSocketTcpConnectionHandlerAdapter(session); getWebSocketClient().doHandshake(adapter, handshakeHeaders, url).addCallback(adapter); return session.getSessionFuture(); }
/** * An overloaded version of * {@link #connect(String, WebSocketHttpHeaders, StompSessionHandler, Object...)} * that accepts a fully prepared {@link java.net.URI}. * @param url the url to connect to * @param handshakeHeaders the headers for the WebSocket handshake * @param connectHeaders headers for the STOMP CONNECT frame * @param sessionHandler the STOMP session handler * @return a ListenableFuture for access to the session when ready for use */ public ListenableFuture<StompSession> connect(URI url, @Nullable WebSocketHttpHeaders handshakeHeaders, @Nullable StompHeaders connectHeaders, StompSessionHandler sessionHandler) { Assert.notNull(url, "'url' must not be null"); ConnectionHandlingStompSession session = createSession(connectHeaders, sessionHandler); WebSocketTcpConnectionHandlerAdapter adapter = new WebSocketTcpConnectionHandlerAdapter(session); getWebSocketClient().doHandshake(adapter, handshakeHeaders, url).addCallback(adapter); return session.getSessionFuture(); }