public final MultiValueMap<HttpRequestHandler, String> getMappings() { MultiValueMap<HttpRequestHandler, String> mappings = new LinkedMultiValueMap<>(); if (this.registration != null) { SockJsService sockJsService = this.registration.getSockJsService(); for (String path : this.paths) { String pattern = (path.endsWith("/") ? path + "**" : path + "/**"); SockJsHttpRequestHandler handler = new SockJsHttpRequestHandler(sockJsService, this.webSocketHandler); mappings.add(handler, pattern); } } else { for (String path : this.paths) { WebSocketHttpRequestHandler handler; if (this.handshakeHandler != null) { handler = new WebSocketHttpRequestHandler(this.webSocketHandler, this.handshakeHandler); } else { handler = new WebSocketHttpRequestHandler(this.webSocketHandler); } HandshakeInterceptor[] interceptors = getInterceptors(); if (interceptors.length > 0) { handler.setHandshakeInterceptors(Arrays.asList(interceptors)); } mappings.add(handler, path); } } return mappings; }
@Override public SockJsServiceRegistration withSockJS() { this.registration = new SockJsServiceRegistration(); this.registration.setTaskScheduler(this.sockJsTaskScheduler); HandshakeInterceptor[] interceptors = getInterceptors(); if (interceptors.length > 0) { this.registration.setInterceptors(interceptors); } if (this.handshakeHandler != null) { WebSocketTransportHandler handler = new WebSocketTransportHandler(this.handshakeHandler); this.registration.setTransportHandlerOverrides(handler); } if (!this.allowedOrigins.isEmpty()) { this.registration.setAllowedOrigins(StringUtils.toStringArray(this.allowedOrigins)); } return this.registration; }
public final MultiValueMap<HttpRequestHandler, String> getMappings() { MultiValueMap<HttpRequestHandler, String> mappings = new LinkedMultiValueMap<>(); if (this.registration != null) { SockJsService sockJsService = this.registration.getSockJsService(); for (String path : this.paths) { String pattern = (path.endsWith("/") ? path + "**" : path + "/**"); SockJsHttpRequestHandler handler = new SockJsHttpRequestHandler(sockJsService, this.webSocketHandler); mappings.add(handler, pattern); } } else { for (String path : this.paths) { WebSocketHttpRequestHandler handler; if (this.handshakeHandler != null) { handler = new WebSocketHttpRequestHandler(this.webSocketHandler, this.handshakeHandler); } else { handler = new WebSocketHttpRequestHandler(this.webSocketHandler); } HandshakeInterceptor[] interceptors = getInterceptors(); if (interceptors.length > 0) { handler.setHandshakeInterceptors(Arrays.asList(interceptors)); } mappings.add(handler, path); } } return mappings; }
public final MultiValueMap<HttpRequestHandler, String> getMappings() { MultiValueMap<HttpRequestHandler, String> mappings = new LinkedMultiValueMap<>(); if (this.registration != null) { SockJsService sockJsService = this.registration.getSockJsService(); for (String path : this.paths) { String pattern = (path.endsWith("/") ? path + "**" : path + "/**"); SockJsHttpRequestHandler handler = new SockJsHttpRequestHandler(sockJsService, this.webSocketHandler); mappings.add(handler, pattern); } } else { for (String path : this.paths) { WebSocketHttpRequestHandler handler; if (this.handshakeHandler != null) { handler = new WebSocketHttpRequestHandler(this.webSocketHandler, this.handshakeHandler); } else { handler = new WebSocketHttpRequestHandler(this.webSocketHandler); } HandshakeInterceptor[] interceptors = getInterceptors(); if (interceptors.length > 0) { handler.setHandshakeInterceptors(Arrays.asList(interceptors)); } mappings.add(handler, path); } } return mappings; }
@Override public SockJsServiceRegistration withSockJS() { this.registration = new SockJsServiceRegistration(); this.registration.setTaskScheduler(this.sockJsTaskScheduler); HandshakeInterceptor[] interceptors = getInterceptors(); if (interceptors.length > 0) { this.registration.setInterceptors(interceptors); } if (this.handshakeHandler != null) { WebSocketTransportHandler handler = new WebSocketTransportHandler(this.handshakeHandler); this.registration.setTransportHandlerOverrides(handler); } if (!this.allowedOrigins.isEmpty()) { this.registration.setAllowedOrigins(StringUtils.toStringArray(this.allowedOrigins)); } return this.registration; }
@Override public SockJsServiceRegistration withSockJS() { this.registration = new SockJsServiceRegistration(); this.registration.setTaskScheduler(this.sockJsTaskScheduler); HandshakeInterceptor[] interceptors = getInterceptors(); if (interceptors.length > 0) { this.registration.setInterceptors(interceptors); } if (this.handshakeHandler != null) { WebSocketTransportHandler handler = new WebSocketTransportHandler(this.handshakeHandler); this.registration.setTransportHandlerOverrides(handler); } if (!this.allowedOrigins.isEmpty()) { this.registration.setAllowedOrigins(StringUtils.toStringArray(this.allowedOrigins)); } return this.registration; }