View Javadoc
1   /*
2    * Copyright 2002-2014 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.web.socket.sockjs.transport;
18  
19  import org.springframework.web.socket.WebSocketSession;
20  
21  /**
22   * SockJS extension of Spring's standard {@link WebSocketSession}.
23   *
24   * @author Juergen Hoeller
25   * @author Rossen Stoyanchev
26   * @since 4.0
27   */
28  public interface SockJsSession extends WebSocketSession {
29  
30  	/**
31  	 * Return the time (in ms) since the session was last active, or otherwise
32  	 * if the session is new, then the time since the session was created.
33  	 */
34  	long getTimeSinceLastActive();
35  
36  	/**
37  	 * Disable SockJS heartbeat, presumably because a higher level protocol has
38  	 * heartbeats enabled for the session. It is not recommended to disable this
39  	 * otherwise as it helps proxies to know the connection is not hanging.
40  	 */
41  	void disableHeartbeat();
42  
43  }