Package io.appium.java_client.ws
Class StringWebSocketClient
java.lang.Object
io.appium.java_client.ws.StringWebSocketClient
- All Implemented Interfaces:
CanHandleConnects,CanHandleDisconnects,CanHandleErrors,CanHandleMessages<String>,Consumer<org.openqa.selenium.remote.http.Message>,org.openqa.selenium.remote.http.WebSocket.Listener
public class StringWebSocketClient
extends Object
implements org.openqa.selenium.remote.http.WebSocket.Listener, CanHandleMessages<String>, CanHandleErrors, CanHandleConnects, CanHandleDisconnects
-
Constructor Summary
ConstructorsConstructorDescriptionStringWebSocketClient(org.openqa.selenium.remote.http.HttpClient httpClient) -
Method Summary
Modifier and TypeMethodDescriptionvoidConnects web socket client.Returns a list of all registered web socket connection handlers.Returns a list of all registered web socket disconnection handlers.@Nullable URIReturns a list of all registered web socket error handlers.Returns a list of all registered web socket messages handlers.booleanvoidvoidvoidonOpen()The callback method invoked on websocket opening.voidonText(CharSequence data) voidRemove all the registered handlers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.appium.java_client.ws.CanHandleConnects
addConnectionHandler, removeConnectionHandlersMethods inherited from interface io.appium.java_client.ws.CanHandleDisconnects
addDisconnectionHandler, removeDisconnectionHandlersMethods inherited from interface io.appium.java_client.ws.CanHandleErrors
addErrorHandler, removeErrorHandlersMethods inherited from interface io.appium.java_client.ws.CanHandleMessages
addMessageHandler, removeMessageHandlersMethods inherited from interface org.openqa.selenium.remote.http.WebSocket.Listener
accept, onBinary
-
Constructor Details
-
StringWebSocketClient
public StringWebSocketClient(org.openqa.selenium.remote.http.HttpClient httpClient)
-
-
Method Details
-
getEndpoint
-
isListening
public boolean isListening() -
connect
Connects web socket client.- Parameters:
endpoint- The full address of an endpoint to connect to. Usually starts with 'ws://'.
-
onOpen
public void onOpen()The callback method invoked on websocket opening. -
onClose
- Specified by:
onClosein interfaceorg.openqa.selenium.remote.http.WebSocket.Listener
-
onError
- Specified by:
onErrorin interfaceorg.openqa.selenium.remote.http.WebSocket.Listener
-
onText
- Specified by:
onTextin interfaceorg.openqa.selenium.remote.http.WebSocket.Listener
-
getMessageHandlers
Description copied from interface:CanHandleMessagesReturns a list of all registered web socket messages handlers.- Specified by:
getMessageHandlersin interfaceCanHandleMessages<String>- Returns:
- The list of web socket message handlers.
-
getErrorHandlers
Description copied from interface:CanHandleErrorsReturns a list of all registered web socket error handlers.- Specified by:
getErrorHandlersin interfaceCanHandleErrors- Returns:
- The list of web socket error handlers.
-
getConnectionHandlers
Description copied from interface:CanHandleConnectsReturns a list of all registered web socket connection handlers.- Specified by:
getConnectionHandlersin interfaceCanHandleConnects- Returns:
- The list of web socket connection handlers.
-
getDisconnectionHandlers
Description copied from interface:CanHandleDisconnectsReturns a list of all registered web socket disconnection handlers.- Specified by:
getDisconnectionHandlersin interfaceCanHandleDisconnects- Returns:
- The list of web socket disconnection handlers.
-
removeAllHandlers
public void removeAllHandlers()Remove all the registered handlers.
-