Package io.vertx.ext.stomp
Interface Destination
-
- All Superinterfaces:
Shareable
public interface Destination extends Shareable
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.- Author:
- Clement Escoffier
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
ack(StompServerConnection connection, Frame frame)
Handles aACK
frame.static Destination
bridge(Vertx vertx, BridgeOptions options)
String
destination()
Destination
dispatch(StompServerConnection connection, Frame frame)
Dispatches the given frame.List<String>
getSubscriptions(StompServerConnection connection)
Gets all subscription ids for the given destination hold by the given clientboolean
matches(String address)
Checks whether or not the given address matches with the current destination.boolean
nack(StompServerConnection connection, Frame frame)
Handles aNACK
frame.int
numberOfSubscriptions()
Gets the number of subscriptions attached to the currentDestination
.static Destination
queue(Vertx vertx, String destination)
Destination
subscribe(StompServerConnection connection, Frame frame)
Handles a subscription request to the currentDestination
.static Destination
topic(Vertx vertx, String destination)
boolean
unsubscribe(StompServerConnection connection, Frame frame)
Handles a un-subscription request to the currentDestination
.Destination
unsubscribeConnection(StompServerConnection connection)
Removes all subscriptions of the given connection
-
-
-
Method Detail
-
topic
static Destination topic(Vertx vertx, String destination)
-
queue
static Destination queue(Vertx vertx, String destination)
-
bridge
static Destination bridge(Vertx vertx, BridgeOptions options)
-
destination
String destination()
- Returns:
- the destination address.
-
dispatch
Destination dispatch(StompServerConnection connection, Frame frame)
Dispatches the given frame.- Parameters:
connection
- the connectionframe
- the frame- Returns:
- the current instance of
Destination
-
subscribe
Destination subscribe(StompServerConnection connection, Frame frame)
Handles a subscription request to the currentDestination
.- Parameters:
connection
- the connectionframe
- theSUBSCRIBE
frame- Returns:
- the current instance of
Destination
-
unsubscribe
boolean unsubscribe(StompServerConnection connection, Frame frame)
Handles a un-subscription request to the currentDestination
.- Parameters:
connection
- the connectionframe
- theUNSUBSCRIBE
frame- Returns:
true
if the un-subscription has been handled,false
otherwise.
-
unsubscribeConnection
Destination unsubscribeConnection(StompServerConnection connection)
Removes all subscriptions of the given connection- Parameters:
connection
- the connection- Returns:
- the current instance of
Destination
-
ack
boolean ack(StompServerConnection connection, Frame frame)
Handles aACK
frame.- Parameters:
connection
- the connectionframe
- theACK
frame- Returns:
true
if the destination has handled the frame (meaning it has sent the message with id)
-
nack
boolean nack(StompServerConnection connection, Frame frame)
Handles aNACK
frame.- Parameters:
connection
- the connectionframe
- theNACK
frame- Returns:
true
if the destination has handled the frame (meaning it has sent the message with id)
-
getSubscriptions
List<String> getSubscriptions(StompServerConnection connection)
Gets all subscription ids for the given destination hold by the given client- Parameters:
connection
- the connection (client)- Returns:
- the list of subscription id, empty if none
-
numberOfSubscriptions
int numberOfSubscriptions()
Gets the number of subscriptions attached to the currentDestination
.- Returns:
- the number of subscriptions.
-
matches
boolean matches(String address)
Checks whether or not the given address matches with the current destination.- Parameters:
address
- the address- Returns:
true
if it matches,false
otherwise.
-
-