@Override protected NettyRxWebSocketSession createWebSocketSession(ChannelHandlerContext ctx) { if (ctx != null) { return new NettyRxWebSocketSession( handshakeResponse.headers().get(HttpHeaderNames.SEC_WEBSOCKET_ACCEPT), ctx.channel(), originatingRequest, codecRegistry, handshaker.version().toHttpHeaderValue(), ctx.pipeline().get(SslHandler.class) != null ) { @Override public ConvertibleValues<Object> getUriVariables() { if (matchInfo != null) { return ConvertibleValues.of(matchInfo.getVariableValues()); } return ConvertibleValues.empty(); } }; } return null; }
/** * Default constructor. * @param request The originating request that created the WebSocket. * @param webSocketBean The WebSocket client bean. * @param handshaker The handshaker * @param requestBinderRegistry The request binder registry * @param mediaTypeCodecRegistry The media type codec registry * @param emitter The socket emitter */ public NettyWebSocketClientHandler( MutableHttpRequest<?> request, WebSocketBean<T> webSocketBean, final WebSocketClientHandshaker handshaker, RequestBinderRegistry requestBinderRegistry, MediaTypeCodecRegistry mediaTypeCodecRegistry, FlowableEmitter<T> emitter) { super(null, requestBinderRegistry, mediaTypeCodecRegistry, webSocketBean, request, Collections.emptyMap(), handshaker.version(), null); this.codecRegistry = mediaTypeCodecRegistry; this.handshaker = handshaker; this.webSocketBean = webSocketBean; this.originatingRequest = request; this.emitter = emitter; this.webSocketStateBinderRegistry = new WebSocketStateBinderRegistry(requestBinderRegistry != null ? requestBinderRegistry : new DefaultRequestBinderRegistry(ConversionService.SHARED)); String clientPath = webSocketBean.getBeanDefinition().getValue(ClientWebSocket.class, String.class).orElse(""); UriMatchTemplate matchTemplate = UriMatchTemplate.of(clientPath); this.matchInfo = matchTemplate.match(request.getPath()).orElse(null); }
@Override protected NettyRxWebSocketSession createWebSocketSession(ChannelHandlerContext ctx) { if (ctx != null) { return new NettyRxWebSocketSession( handshakeResponse.headers().get(HttpHeaderNames.SEC_WEBSOCKET_ACCEPT), ctx.channel(), originatingRequest, codecRegistry, handshaker.version().toHttpHeaderValue(), ctx.pipeline().get(SslHandler.class) != null ) { @Override public ConvertibleValues<Object> getUriVariables() { if (matchInfo != null) { return ConvertibleValues.of(matchInfo.getVariableValues()); } return ConvertibleValues.empty(); } }; } return null; }
@Override protected NettyRxWebSocketSession createWebSocketSession(ChannelHandlerContext ctx) { if (ctx != null) { return new NettyRxWebSocketSession( handshakeResponse.headers().get(HttpHeaderNames.SEC_WEBSOCKET_ACCEPT), ctx.channel(), originatingRequest, codecRegistry, handshaker.version().toHttpHeaderValue(), ctx.pipeline().get(SslHandler.class) != null ) { @Override public ConvertibleValues<Object> getUriVariables() { if (matchInfo != null) { return ConvertibleValues.of(matchInfo.getVariableValues()); } return ConvertibleValues.empty(); } }; } return null; }
/** * Default constructor. * @param request The originating request that created the WebSocket. * @param webSocketBean The WebSocket client bean. * @param handshaker The handshaker * @param requestBinderRegistry The request binder registry * @param mediaTypeCodecRegistry The media type codec registry * @param emitter The socket emitter */ public NettyWebSocketClientHandler( MutableHttpRequest<?> request, WebSocketBean<T> webSocketBean, final WebSocketClientHandshaker handshaker, RequestBinderRegistry requestBinderRegistry, MediaTypeCodecRegistry mediaTypeCodecRegistry, FlowableEmitter<T> emitter) { super(null, requestBinderRegistry, mediaTypeCodecRegistry, webSocketBean, request, Collections.emptyMap(), handshaker.version(), null); this.codecRegistry = mediaTypeCodecRegistry; this.handshaker = handshaker; this.webSocketBean = webSocketBean; this.originatingRequest = request; this.emitter = emitter; this.webSocketStateBinderRegistry = new WebSocketStateBinderRegistry(requestBinderRegistry != null ? requestBinderRegistry : new DefaultRequestBinderRegistry(ConversionService.SHARED)); String clientPath = webSocketBean.getBeanDefinition().getValue(ClientWebSocket.class, String.class).orElse(""); UriMatchTemplate matchTemplate = UriMatchTemplate.of(clientPath); this.matchInfo = matchTemplate.match(request.getPath()).orElse(null); }
/** * Default constructor. * @param request The originating request that created the WebSocket. * @param webSocketBean The WebSocket client bean. * @param handshaker The handshaker * @param requestBinderRegistry The request binder registry * @param mediaTypeCodecRegistry The media type codec registry * @param emitter The socket emitter */ public NettyWebSocketClientHandler( MutableHttpRequest<?> request, WebSocketBean<T> webSocketBean, final WebSocketClientHandshaker handshaker, RequestBinderRegistry requestBinderRegistry, MediaTypeCodecRegistry mediaTypeCodecRegistry, FlowableEmitter<T> emitter) { super(null, requestBinderRegistry, mediaTypeCodecRegistry, webSocketBean, request, Collections.emptyMap(), handshaker.version(), null); this.codecRegistry = mediaTypeCodecRegistry; this.handshaker = handshaker; this.webSocketBean = webSocketBean; this.originatingRequest = request; this.emitter = emitter; this.webSocketStateBinderRegistry = new WebSocketStateBinderRegistry(requestBinderRegistry != null ? requestBinderRegistry : new DefaultRequestBinderRegistry(ConversionService.SHARED)); String clientPath = webSocketBean.getBeanDefinition().getValue(ClientWebSocket.class, String.class).orElse(""); UriMatchTemplate matchTemplate = UriMatchTemplate.of(clientPath); this.matchInfo = matchTemplate.match(request.getPath()).orElse(null); }