Class StompSession

  • All Implemented Interfaces:

    
    public final class StompSession
    
                        

    A STOMP session that can connect to a STOMP server and send/receive messages.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Unit sendText(String destination, String body) Sends text message to the given destination.
      final <T extends Any> Unit send(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 Unit disconnect() Disconnects from the STOMP server.
      final static String getUrl(String destination) Gets the URL of the given mobile services destination.
      final static StompSession connect(String destination, String scheme, String path, String webSocketUrl, OAuth2TokenStore tokenStore, WebSocketListener webSocketListener) Connects to the given STOMP server.
      final static StompSession connect(String destination, String scheme, String path, String webSocketUrl, OAuth2TokenStore tokenStore) Connects to the given STOMP server.
      final static StompSession connect(String destination, String scheme, String path, String webSocketUrl) Connects to the given STOMP server.
      final static StompSession connect(String destination, String scheme, String path) Connects to the given STOMP server.
      final static StompSession connect(String destination, String scheme) Connects to the given STOMP server.
      final static StompSession connect(String destination) Connects to the given STOMP server.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.