Package: io.vertx.groovy.ext.stomp

## [Groovy] Class Destination

- io.vertx.groovy.ext.stomp.Destination

- Represents a STOMP destination. Depending on the implementation, the message delivery is different. Queue are sending message to only one subscribers, while topics are broadcasting the message to all subscribers.

  Implementations must be thread-safe.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `Destination (Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `boolean` | `ack(StompServerConnection connection, Map<String, Object> frame)` Handles a `ACK` frame.
    `static Destination` | `bridge(Vertx vertx, Map<String, Object> options)`
    `String` | `destination()` Returns: the destination address.
    `Destination` | `dispatch(StompServerConnection connection, Map<String, Object> frame)` Dispatches the given frame.
    `Object` | `getDelegate()`
    `List<String>` | `getSubscriptions(StompServerConnection connection)` Gets all subscription ids for the given destination hold by the given client
    `boolean` | `matches(String address)` Checks whether or not the given address matches with the current destination.
    `boolean` | `nack(StompServerConnection connection, Map<String, Object> frame)` Handles a `NACK` frame.
    `int` | `numberOfSubscriptions()` Gets the number of subscriptions attached to the current Destination.
    `static Destination` | `queue(Vertx vertx, String destination)`
    `Destination` | `subscribe(StompServerConnection connection, Map<String, Object> frame)` Handles a subscription request to the current Destination.
    `static Destination` | `topic(Vertx vertx, String destination)`
    `boolean` | `unsubscribe(StompServerConnection connection, Map<String, Object> frame)` Handles a un-subscription request to the current Destination.
    `Destination` | `unsubscribeConnection(StompServerConnection connection)` Removes all subscriptions of the given connection

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### Destination(Object delegate)

  - ### Method Detail

    - #### boolean ack(StompServerConnection connection, Map<String, Object> frame)

      Handles a `ACK` frame.

      Returns:
        `true` if the destination has handled the frame (meaning it has sent the message with id)
      Parameters:
        `connection` - the connection
        `frame` - the `ACK` frame (see Frame)

    - #### static Destination bridge(Vertx vertx, Map<String, Object> options)

    - #### String destination()

      Returns:
        the destination address.

    - #### Destination dispatch(StompServerConnection connection, Map<String, Object> frame)

      Dispatches the given frame.

      Returns:
        the current instance of Destination
      Parameters:
        `connection` - the connection
        `frame` - the frame (see Frame)

    - #### Object getDelegate()

    - #### List<String> getSubscriptions(StompServerConnection connection)

      Gets all subscription ids for the given destination hold by the given client

      Returns:
        the list of subscription id, empty if none
      Parameters:
        `connection` - the connection (client)

    - #### boolean matches(String address)

      Checks whether or not the given address matches with the current destination.

      Returns:
        `true` if it matches, `false` otherwise.
      Parameters:
        `address` - the address

    - #### boolean nack(StompServerConnection connection, Map<String, Object> frame)

      Handles a `NACK` frame.

      Returns:
        `true` if the destination has handled the frame (meaning it has sent the message with id)
      Parameters:
        `connection` - the connection
        `frame` - the `NACK` frame (see Frame)

    - #### int numberOfSubscriptions()

      Gets the number of subscriptions attached to the current Destination.

      Returns:
        the number of subscriptions.

    - #### static Destination queue(Vertx vertx, String destination)

    - #### Destination subscribe(StompServerConnection connection, Map<String, Object> frame)

      Handles a subscription request to the current Destination.

      Returns:
        the current instance of Destination
      Parameters:
        `connection` - the connection
        `frame` - the `SUBSCRIBE` frame (see Frame)

    - #### static Destination topic(Vertx vertx, String destination)

    - #### boolean unsubscribe(StompServerConnection connection, Map<String, Object> frame)

      Handles a un-subscription request to the current Destination.

      Returns:
        `true` if the un-subscription has been handled, `false` otherwise.
      Parameters:
        `connection` - the connection
        `frame` - the `UNSUBSCRIBE` frame (see Frame)

    - #### Destination unsubscribeConnection(StompServerConnection connection)

      Removes all subscriptions of the given connection

      Returns:
        the current instance of Destination
      Parameters:
        `connection` - the connection