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 (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `boolean` | `ack(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.Object> frame)` Handles a `ACK` frame.
    `static Destination` | `bridge(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> options)`
    `java.lang.String` | `destination()` Returns: the destination address.
    `Destination` | `dispatch(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.Object> frame)` Dispatches the given frame.
    `java.lang.Object` | `getDelegate()`
    `java.util.List<java.lang.String>` | `getSubscriptions(StompServerConnection connection)` Gets all subscription ids for the given destination hold by the given client
    `boolean` | `matches(java.lang.String address)` Checks whether or not the given address matches with the current destination.
    `boolean` | `nack(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.Object> frame)` Handles a `NACK` frame.
    `int` | `numberOfSubscriptions()` Gets the number of subscriptions attached to the current Destination.
    `static Destination` | `queue(Vertx vertx, java.lang.String destination)`
    `Destination` | `subscribe(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.Object> frame)` Handles a subscription request to the current Destination.
    `static Destination` | `topic(Vertx vertx, java.lang.String destination)`
    `boolean` | `unsubscribe(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.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 java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### Destination(java.lang.Object delegate)

  - ### Method Detail

    - #### boolean ack(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.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, java.util.Map<java.lang.String, java.lang.Object> options)

    - #### java.lang.String destination()

      Returns:
        the destination address.

    - #### Destination dispatch(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.Object> frame)

      Dispatches the given frame.

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

    - #### java.lang.Object getDelegate()

    - #### java.util.List<java.lang.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(java.lang.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, java.util.Map<java.lang.String, java.lang.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, java.lang.String destination)

    - #### Destination subscribe(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.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, java.lang.String destination)

    - #### boolean unsubscribe(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.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