Class StompSession
-
- All Implemented Interfaces:
public final class StompSessionA STOMP session that can connect to a STOMP server and send/receive messages.
-
-
Method Summary
Modifier and Type Method Description final UnitsendText(String destination, String body)Sends text message to the given destination. final <T extends Any> Unitsend(String destination, T body, SerializationStrategy<T> serializer)Sends message in json format to the given destination. final Flow<String>subscribeText(String destination)Subscribes to the given destination and receives text messages. final <T extends Any> Flow<T>subscribe(String destination, DeserializationStrategy<T> deserializer)Subscribes to the given destination and receives messages in json format. final Unitdisconnect()Disconnects from the STOMP server. final static StringgetUrl(String destination)Gets the URL of the given mobile services destination. final static StompSessionconnect(String destination, String scheme, String path, String webSocketUrl, OAuth2TokenStore tokenStore, WebSocketListener webSocketListener)Connects to the given STOMP server. final static StompSessionconnect(String destination, String scheme, String path, String webSocketUrl, OAuth2TokenStore tokenStore)Connects to the given STOMP server. final static StompSessionconnect(String destination, String scheme, String path, String webSocketUrl)Connects to the given STOMP server. final static StompSessionconnect(String destination, String scheme, String path)Connects to the given STOMP server. final static StompSessionconnect(String destination, String scheme)Connects to the given STOMP server. final static StompSessionconnect(String destination)Connects to the given STOMP server. -
-
Method Detail
-
sendText
final Unit sendText(String destination, String body)
Sends text message to the given destination.
-
send
final <T extends Any> Unit send(String destination, T body, SerializationStrategy<T> serializer)
Sends message in json format to the given destination.
-
subscribeText
final Flow<String> subscribeText(String destination)
Subscribes to the given destination and receives text messages.
-
subscribe
final <T extends Any> Flow<T> subscribe(String destination, DeserializationStrategy<T> deserializer)
Subscribes to the given destination and receives messages in json format.
-
disconnect
final Unit disconnect()
Disconnects from the STOMP server.
-
getUrl
final static String getUrl(String destination)
Gets the URL of the given mobile services destination.
- Parameters:
destination- The mobile services destination to get the URL for.- Returns:
The URL of the destination.
-
connect
@JvmOverloads() final static StompSession connect(String destination, String scheme, String path, String webSocketUrl, OAuth2TokenStore tokenStore, WebSocketListener webSocketListener)
Connects to the given STOMP server.
- Parameters:
destination- The mobile services destination to connect to, which has the server URL.scheme- The scheme to use for the STOMP server URL.path- The path to the STOMP server.webSocketUrl- The optional URL of the STOMP server.webSocketListener- An optional listener for websocket events.- Returns:
A StompSession connected to the STOMP server.
-
connect
@JvmOverloads() final static StompSession connect(String destination, String scheme, String path, String webSocketUrl, OAuth2TokenStore tokenStore)
Connects to the given STOMP server.
- Parameters:
destination- The mobile services destination to connect to, which has the server URL.scheme- The scheme to use for the STOMP server URL.path- The path to the STOMP server.webSocketUrl- The optional URL of the STOMP server.- Returns:
A StompSession connected to the STOMP server.
-
connect
@JvmOverloads() final static StompSession connect(String destination, String scheme, String path, String webSocketUrl)
Connects to the given STOMP server.
- Parameters:
destination- The mobile services destination to connect to, which has the server URL.scheme- The scheme to use for the STOMP server URL.path- The path to the STOMP server.webSocketUrl- The optional URL of the STOMP server.- Returns:
A StompSession connected to the STOMP server.
-
connect
@JvmOverloads() final static StompSession connect(String destination, String scheme, String path)
Connects to the given STOMP server.
- Parameters:
destination- The mobile services destination to connect to, which has the server URL.scheme- The scheme to use for the STOMP server URL.path- The path to the STOMP server.- Returns:
A StompSession connected to the STOMP server.
-
connect
@JvmOverloads() final static StompSession connect(String destination, String scheme)
Connects to the given STOMP server.
- Parameters:
destination- The mobile services destination to connect to, which has the server URL.scheme- The scheme to use for the STOMP server URL.- Returns:
A StompSession connected to the STOMP server.
-
connect
@JvmOverloads() final static StompSession connect(String destination)
Connects to the given STOMP server.
- Parameters:
destination- The mobile services destination to connect to, which has the server URL.- Returns:
A StompSession connected to the STOMP server.
-
-
-
-