Package de.chojo.universalis.websocket
Interface UniversalisWs
- All Known Implementing Classes:
UniversalisWsImpl
public interface UniversalisWs
Interface for universalis websocket implementation.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Suspends the thread until the websocket is connected.void
Disconnect the websocket.static UniversalisWsBuilder
Get a universalis builder for websockets.void
subscribe
(Subscription subscription) Add a subscription.void
unsubscribe
(Subscription subscription) Remove a subscription.static WebsocketFactoryBuilder
Get a websocket builder.
-
Method Details
-
subscribe
Add a subscription.- Parameters:
subscription
- subcription to add
-
unsubscribe
Remove a subscription.- Parameters:
subscription
- subscription to remove
-
disconnect
void disconnect()Disconnect the websocket. Once disconnected the socket can no longer be used. -
awaitReady
void awaitReady()Suspends the thread until the websocket is connected. -
websocketBuilder
Get a websocket builder. Use this if you want more control about the socket itself.Use
getDefault()
if your don't know that this means.- Returns:
- websocket factory builder
-
getDefault
Get a universalis builder for websockets.- Returns:
- universalis websocket builder
-