Interface Destination
- All Superinterfaces:
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
Modifier and TypeMethodDescriptionbooleanack(StompServerConnection connection, Frame frame) Handles aACKframe.static Destinationbridge(Vertx vertx, BridgeOptions options) dispatch(StompServerConnection connection, Frame frame) Dispatches the given frame.getSubscriptions(StompServerConnection connection) Gets all subscription ids for the given destination hold by the given clientbooleanChecks whether or not the given address matches with the current destination.booleannack(StompServerConnection connection, Frame frame) Handles aNACKframe.intGets the number of subscriptions attached to the currentDestination.static Destinationsubscribe(StompServerConnection connection, Frame frame) Handles a subscription request to the currentDestination.static Destinationbooleanunsubscribe(StompServerConnection connection, Frame frame) Handles a un-subscription request to the currentDestination.unsubscribeConnection(StompServerConnection connection) Removes all subscriptions of the given connection
-
Method Details
-
topic
-
queue
-
bridge
-
destination
String destination()- Returns:
- the destination address.
-
dispatch
Dispatches the given frame.- Parameters:
connection- the connectionframe- the frame- Returns:
- the current instance of
Destination
-
subscribe
Handles a subscription request to the currentDestination.- Parameters:
connection- the connectionframe- theSUBSCRIBEframe- Returns:
- the current instance of
Destination
-
unsubscribe
Handles a un-subscription request to the currentDestination.- Parameters:
connection- the connectionframe- theUNSUBSCRIBEframe- Returns:
trueif the un-subscription has been handled,falseotherwise.
-
unsubscribeConnection
Removes all subscriptions of the given connection- Parameters:
connection- the connection- Returns:
- the current instance of
Destination
-
ack
Handles aACKframe.- Parameters:
connection- the connectionframe- theACKframe- Returns:
trueif the destination has handled the frame (meaning it has sent the message with id)
-
nack
Handles aNACKframe.- Parameters:
connection- the connectionframe- theNACKframe- Returns:
trueif the destination has handled the frame (meaning it has sent the message with id)
-
getSubscriptions
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
Checks whether or not the given address matches with the current destination.- Parameters:
address- the address- Returns:
trueif it matches,falseotherwise.
-