org.springframework.web.socket.sockjs.transport.SockJsServiceConfig Java Examples

The following examples show how to use org.springframework.web.socket.sockjs.transport.SockJsServiceConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractSockJsSession.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * Create a new instance.
 * @param id the session ID
 * @param config the SockJS service configuration options
 * @param handler the recipient of SockJS messages
 * @param attributes attributes from the HTTP handshake to associate with the WebSocket
 * session; the provided attributes are copied, the original map is not used.
 */
public AbstractSockJsSession(String id, SockJsServiceConfig config, WebSocketHandler handler,
		@Nullable Map<String, Object> attributes) {

	Assert.notNull(id, "Session id must not be null");
	Assert.notNull(config, "SockJsServiceConfig must not be null");
	Assert.notNull(handler, "WebSocketHandler must not be null");

	this.id = id;
	this.config = config;
	this.handler = handler;

	if (attributes != null) {
		this.attributes.putAll(attributes);
	}
}
 
Example #2
Source File: AbstractSockJsSession.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
/**
 * Create a new instance.
 * @param id the session ID
 * @param config SockJS service configuration options
 * @param handler the recipient of SockJS messages
 * @param attributes attributes from the HTTP handshake to associate with the WebSocket
 * session; the provided attributes are copied, the original map is not used.
 */
public AbstractSockJsSession(String id, SockJsServiceConfig config, WebSocketHandler handler,
		Map<String, Object> attributes) {

	Assert.notNull(id, "SessionId must not be null");
	Assert.notNull(config, "SockJsConfig must not be null");
	Assert.notNull(handler, "WebSocketHandler must not be null");

	this.id = id;
	this.config = config;
	this.handler = handler;

	if (attributes != null) {
		this.attributes.putAll(attributes);
	}
}
 
Example #3
Source File: AbstractSockJsSession.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * Create a new instance.
 * @param id the session ID
 * @param config the SockJS service configuration options
 * @param handler the recipient of SockJS messages
 * @param attributes attributes from the HTTP handshake to associate with the WebSocket
 * session; the provided attributes are copied, the original map is not used.
 */
public AbstractSockJsSession(String id, SockJsServiceConfig config, WebSocketHandler handler,
		@Nullable Map<String, Object> attributes) {

	Assert.notNull(id, "Session id must not be null");
	Assert.notNull(config, "SockJsServiceConfig must not be null");
	Assert.notNull(handler, "WebSocketHandler must not be null");

	this.id = id;
	this.config = config;
	this.handler = handler;

	if (attributes != null) {
		this.attributes.putAll(attributes);
	}
}
 
Example #4
Source File: SockJsWebSocketHandler.java    From java-technology-stack with MIT License 5 votes vote down vote up
public SockJsWebSocketHandler(SockJsServiceConfig serviceConfig, WebSocketHandler webSocketHandler,
		WebSocketServerSockJsSession sockJsSession) {

	Assert.notNull(serviceConfig, "serviceConfig must not be null");
	Assert.notNull(webSocketHandler, "webSocketHandler must not be null");
	Assert.notNull(sockJsSession, "session must not be null");

	this.sockJsServiceConfig = serviceConfig;
	this.sockJsSession = sockJsSession;

	webSocketHandler = WebSocketHandlerDecorator.unwrap(webSocketHandler);
	this.subProtocols = ((webSocketHandler instanceof SubProtocolCapable) ?
			new ArrayList<>(((SubProtocolCapable) webSocketHandler).getSubProtocols()) : Collections.emptyList());
}
 
Example #5
Source File: SockJsWebSocketHandler.java    From spring-analysis-note with MIT License 5 votes vote down vote up
public SockJsWebSocketHandler(SockJsServiceConfig serviceConfig, WebSocketHandler webSocketHandler,
		WebSocketServerSockJsSession sockJsSession) {

	Assert.notNull(serviceConfig, "serviceConfig must not be null");
	Assert.notNull(webSocketHandler, "webSocketHandler must not be null");
	Assert.notNull(sockJsSession, "session must not be null");

	this.sockJsServiceConfig = serviceConfig;
	this.sockJsSession = sockJsSession;

	webSocketHandler = WebSocketHandlerDecorator.unwrap(webSocketHandler);
	this.subProtocols = ((webSocketHandler instanceof SubProtocolCapable) ?
			new ArrayList<>(((SubProtocolCapable) webSocketHandler).getSubProtocols()) : Collections.emptyList());
}
 
Example #6
Source File: SockJsWebSocketHandler.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
public SockJsWebSocketHandler(SockJsServiceConfig serviceConfig, WebSocketHandler webSocketHandler,
		WebSocketServerSockJsSession sockJsSession) {

	Assert.notNull(serviceConfig, "serviceConfig must not be null");
	Assert.notNull(webSocketHandler, "webSocketHandler must not be null");
	Assert.notNull(sockJsSession, "session must not be null");

	this.sockJsServiceConfig = serviceConfig;
	this.sockJsSession = sockJsSession;

	webSocketHandler = WebSocketHandlerDecorator.unwrap(webSocketHandler);
	this.subProtocols = ((webSocketHandler instanceof SubProtocolCapable) ?
			new ArrayList<String>(((SubProtocolCapable) webSocketHandler).getSubProtocols()) : null);
}
 
Example #7
Source File: WebSocketServerSockJsSession.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public WebSocketServerSockJsSession(String id, SockJsServiceConfig config,
		WebSocketHandler handler, Map<String, Object> attributes) {

	super(id, config, handler, attributes);
}
 
Example #8
Source File: EventSourceTransportHandler.java    From java-technology-stack with MIT License 4 votes vote down vote up
public EventSourceStreamingSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #9
Source File: XhrStreamingTransportHandler.java    From java-technology-stack with MIT License 4 votes vote down vote up
public XhrStreamingSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #10
Source File: HttpSockJsSessionTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
public TestAbstractHttpSockJsSession(SockJsServiceConfig config, WebSocketHandler handler,
		Map<String, Object> attributes) {

	super("1", config, handler, attributes);
}
 
Example #11
Source File: TestHttpSockJsSession.java    From java-technology-stack with MIT License 4 votes vote down vote up
public TestHttpSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #12
Source File: WebSocketServerSockJsSessionTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
public TestWebSocketServerSockJsSession(SockJsServiceConfig config, WebSocketHandler handler,
		Map<String, Object> attributes) {

	super("1", config, handler, attributes);
}
 
Example #13
Source File: TestSockJsSession.java    From java-technology-stack with MIT License 4 votes vote down vote up
public TestSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #14
Source File: AbstractSockJsSession.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public SockJsServiceConfig getSockJsServiceConfig() {
	return this.config;
}
 
Example #15
Source File: PollingSockJsSession.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public PollingSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #16
Source File: AbstractHttpSockJsSession.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public AbstractHttpSockJsSession(String id, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(id, config, wsHandler, attributes);
	this.messageCache = new LinkedBlockingQueue<String>(config.getHttpMessageCacheSize());
}
 
Example #17
Source File: HtmlFileTransportHandler.java    From java-technology-stack with MIT License 4 votes vote down vote up
public HtmlFileStreamingSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #18
Source File: StreamingSockJsSession.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public StreamingSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #19
Source File: SockJsWebSocketHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
protected SockJsServiceConfig getSockJsConfig() {
	return this.sockJsServiceConfig;
}
 
Example #20
Source File: HtmlFileTransportHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public HtmlFileStreamingSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #21
Source File: AbstractTransportHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public void initialize(SockJsServiceConfig serviceConfig) {
	this.serviceConfig = serviceConfig;
}
 
Example #22
Source File: AbstractTransportHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public SockJsServiceConfig getServiceConfig() {
	return this.serviceConfig;
}
 
Example #23
Source File: EventSourceTransportHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public EventSourceStreamingSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #24
Source File: XhrStreamingTransportHandler.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public XhrStreamingSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #25
Source File: HttpSockJsSessionTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public TestAbstractHttpSockJsSession(SockJsServiceConfig config, WebSocketHandler handler,
		Map<String, Object> attributes) {

	super("1", config, handler, attributes);
}
 
Example #26
Source File: TestHttpSockJsSession.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public TestHttpSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #27
Source File: WebSocketServerSockJsSessionTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public TestWebSocketServerSockJsSession(SockJsServiceConfig config, WebSocketHandler handler,
		Map<String, Object> attributes) {

	super("1", config, handler, attributes);
}
 
Example #28
Source File: TestSockJsSession.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
public TestSockJsSession(String sessionId, SockJsServiceConfig config,
		WebSocketHandler wsHandler, Map<String, Object> attributes) {

	super(sessionId, config, wsHandler, attributes);
}
 
Example #29
Source File: HttpSockJsSessionTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
public TestAbstractHttpSockJsSession(SockJsServiceConfig config, WebSocketHandler handler,
		Map<String, Object> attributes) {

	super("1", config, handler, attributes);
}
 
Example #30
Source File: AbstractSockJsSession.java    From spring-analysis-note with MIT License 4 votes vote down vote up
public SockJsServiceConfig getSockJsServiceConfig() {
	return this.config;
}