Class WebSocketSession
- java.lang.Object
-
- io.fabric8.mockwebserver.http.WebSocketListener
-
- io.fabric8.mockwebserver.internal.WebSocketSession
-
public class WebSocketSession extends WebSocketListener
-
-
Constructor Summary
Constructors Constructor Description WebSocketSession(List<WebSocketMessage> open, WebSocketMessage failure, Exception cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseActiveSocketsIfApplicable()voiddispatch(RecordedRequest request)ExceptiongetCause()WebSocketMessagegetFailure()Map<SimpleRequest,Queue<WebSocketMessage>>getHttpRequestEvents()List<WebSocketMessage>getOpen()Map<Object,Queue<WebSocketMessage>>getRequestEvents()Map<Object,Queue<WebSocketMessage>>getSentWebSocketMessagesRequestEvents()List<WebSocketMessage>getTimedEvents()voidonBeforeAccept(WebSocket webSocket, Response response)Invoked before the web socket is accepted and the handshake is completevoidonClosed(WebSocket webSocket, int code, String reason)Invoked when both peers have indicated that no more messages will be transmitted and the connection has been successfully released.voidonClosing(WebSocket webSocket, int code, String reason)Invoked when the remote peer has indicated that no more incoming messages will be transmitted.voidonMessage(WebSocket webSocket, String in)voidonOpen(WebSocket webSocket, Response response)Invoked when a web socket has been accepted by the remote peer and may begin transmitting messages.voidshutdown()-
Methods inherited from class io.fabric8.mockwebserver.http.WebSocketListener
onFailure, onMessage, onMessage
-
-
-
-
Constructor Detail
-
WebSocketSession
public WebSocketSession(List<WebSocketMessage> open, WebSocketMessage failure, Exception cause)
-
-
Method Detail
-
onClosing
public void onClosing(WebSocket webSocket, int code, String reason)
Description copied from class:WebSocketListenerInvoked when the remote peer has indicated that no more incoming messages will be transmitted.- Overrides:
onClosingin classWebSocketListener
-
onBeforeAccept
public void onBeforeAccept(WebSocket webSocket, Response response)
Description copied from class:WebSocketListenerInvoked before the web socket is accepted and the handshake is complete- Overrides:
onBeforeAcceptin classWebSocketListener
-
onOpen
public void onOpen(WebSocket webSocket, Response response)
Description copied from class:WebSocketListenerInvoked when a web socket has been accepted by the remote peer and may begin transmitting messages.- Overrides:
onOpenin classWebSocketListener
-
onMessage
public void onMessage(WebSocket webSocket, String in)
- Overrides:
onMessagein classWebSocketListener
-
onClosed
public void onClosed(WebSocket webSocket, int code, String reason)
Description copied from class:WebSocketListenerInvoked when both peers have indicated that no more messages will be transmitted and the connection has been successfully released. No further calls to this listener will be made.- Overrides:
onClosedin classWebSocketListener
-
dispatch
public void dispatch(RecordedRequest request)
-
getOpen
public List<WebSocketMessage> getOpen()
-
getFailure
public WebSocketMessage getFailure()
-
getCause
public Exception getCause()
-
getRequestEvents
public Map<Object,Queue<WebSocketMessage>> getRequestEvents()
-
getTimedEvents
public List<WebSocketMessage> getTimedEvents()
-
getSentWebSocketMessagesRequestEvents
public Map<Object,Queue<WebSocketMessage>> getSentWebSocketMessagesRequestEvents()
-
getHttpRequestEvents
public Map<SimpleRequest,Queue<WebSocketMessage>> getHttpRequestEvents()
-
closeActiveSocketsIfApplicable
public void closeActiveSocketsIfApplicable()
-
shutdown
public void shutdown()
-
-