@groovy.transform.CompileStatic class StompServerHandler
STOMP server handler implements the behavior of the STOMP server when a specific event occurs. For instance, if let customize the behavior when specific STOMP frames arrives or when a connection is closed. This class has been designed to let you customize the server behavior. The default implementation is compliant with the STOMP specification. In this default implementation, not acknowledge frames are dropped.
Constructor and description |
---|
StompServerHandler
(java.lang.Object delegate) |
Type | Name and description |
---|---|
StompServerHandler |
abortHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a ABORT frame is received. |
StompServerHandler |
ackHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a ACK frame is received. |
StompServerHandler |
authProvider(AuthProvider handler) Configures the to be used to authenticate the user. |
StompServerHandler |
beginHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a BEGIN frame is received. |
StompServerHandler |
bridge(java.util.Map<java.lang.String, java.lang.Object> options = [:]) Configures the STOMP server to act as a bridge with the Vert.x event bus. |
StompServerHandler |
closeHandler(io.vertx.core.Handler<StompServerConnection> handler) Configures the action to execute when a connection with the client is closed. |
StompServerHandler |
commitHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a COMMIT frame is received. |
StompServerHandler |
connectHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a CONNECT frame is received. |
static StompServerHandler |
create(Vertx vertx) Creates an instance of StompServerHandler using the default (compliant) implementation. |
StompServerHandler |
destinationFactory(DestinationFactory factory) Configures the DestinationFactory used to create Destination objects. |
StompServerHandler |
disconnectHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a DISCONNECT frame is received. |
java.lang.Object |
getDelegate() |
Destination |
getDestination(java.lang.String destination) Gets the destination with the given name. |
java.util.List<Destination> |
getDestinations()
|
Destination |
getOrCreateDestination(java.lang.String destination) Gets a Destination object if existing, or create a new one. |
void |
handle(ServerFrame arg0) |
StompServerHandler |
nackHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a NACK frame is received. |
StompServerHandler |
onAck(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.Object> subscribe, java.util.List<java.util.Map<java.lang.String, java.lang.Object>> messages) Method called by single message (client-individual policy) or a set of message (client policy) are acknowledged. |
StompServerHandler |
onAckHandler(io.vertx.core.Handler<Acknowledgement> handler) Configures the action to execute when messages are acknowledged. |
StompServerHandler |
onAuthenticationRequest(StompServer server, java.lang.String login, java.lang.String passcode, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Boolean>> handler) Called when the client connects to a server requiring authentication. |
void |
onClose(StompServerConnection connection) Called when the connection is closed. |
StompServerHandler |
onNack(StompServerConnection connection, java.util.Map<java.lang.String, java.lang.Object> subscribe, java.util.List<java.util.Map<java.lang.String, java.lang.Object>> messages) Method called by single message (client-individual policy) or a set of message (client policy) are not acknowledged. |
StompServerHandler |
onNackHandler(io.vertx.core.Handler<Acknowledgement> handler) Configures the action to execute when messages are not acknowledged. |
StompServerHandler |
pingHandler(io.vertx.core.Handler<StompServerConnection> handler) Allows customizing the action to do when the server needs to send a `PING` to the client. |
StompServerHandler |
receivedFrameHandler(io.vertx.core.Handler<ServerFrame> handler) Configures a handler that get notified when a STOMP frame is received by the server. |
StompServerHandler |
sendHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a SEND frame is received. |
StompServerHandler |
stompHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a STOMP frame is received. |
StompServerHandler |
subscribeHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a SUBSCRIBE frame is received. |
StompServerHandler |
unsubscribeHandler(io.vertx.core.Handler<ServerFrame> handler) Configures the action to execute when a UNSUBSCRIBE frame is received. |
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() |
Configures the action to execute when a ABORT
frame is received.
handler
- the handler Configures the action to execute when a ACK
frame is received.
handler
- the handlerConfigures the to be used to authenticate the user.
handler
- the handler Configures the action to execute when a BEGIN
frame is received.
handler
- the handlerConfigures the STOMP server to act as a bridge with the Vert.x event bus.
options
- the configuration options (see BridgeOptions)Configures the action to execute when a connection with the client is closed.
handler
- the handler Configures the action to execute when a COMMIT
frame is received.
handler
- the handler Configures the action to execute when a CONNECT
frame is received.
handler
- the handlerCreates an instance of StompServerHandler using the default (compliant) implementation.
vertx
- the vert.x instance to useConfigures the DestinationFactory used to create Destination objects.
factory
- the factory Configures the action to execute when a DISCONNECT
frame is received.
handler
- the handlerGets the destination with the given name.
null
if not existing.destination
- the destination
Gets a Destination object if existing, or create a new one. The creation is delegated to the DestinationFactory.
destination
- the destination Configures the action to execute when a NACK
frame is received.
handler
- the handlerMethod called by single message (client-individual policy) or a set of message (client policy) are acknowledged. Implementations must call the handler configured using StompServerHandler.onAckHandler.
connection
- the connectionsubscribe
- the SUBSCRIBE
frame (see Frame)messages
- the acknowledge messagesConfigures the action to execute when messages are acknowledged.
handler
- the handlerCalled when the client connects to a server requiring authentication. It invokes the configured using StompServerHandler.authProvider.
server
- the STOMP server.login
- the loginpasscode
- the passwordhandler
- handler receiving the authentication resultCalled when the connection is closed. This method executes a default behavior and must calls the configured StompServerHandler.closeHandler if any.
connection
- the connection Method called by single message (client-individual policy) or a set of message (client policy) are
not acknowledged. Not acknowledgment can result from a NACK
frame or from a timeout (no
ACK
frame received in a given time. Implementations must call the handler configured using
StompServerHandler.onNackHandler.
connection
- the connectionsubscribe
- the SUBSCRIBE
frame (see Frame)messages
- the acknowledge messagesConfigures the action to execute when messages are not acknowledged.
handler
- the handler Allows customizing the action to do when the server needs to send a `PING` to the client. By default it send a
frame containing EOL
(specification). However, you can customize this and send another frame. However,
be aware that this may requires a custom client.
handler
- the action to execute when a `PING` needs to be sent.Configures a handler that get notified when a STOMP frame is received by the server. This handler can be used for logging, debugging or ad-hoc behavior.
handler
- the handler Configures the action to execute when a SEND
frame is received.
handler
- the handler Configures the action to execute when a STOMP
frame is received.
handler
- the handler Configures the action to execute when a SUBSCRIBE
frame is received.
handler
- the handler Configures the action to execute when a UNSUBSCRIBE
frame is received.
handler
- the handler