new 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.
- Source:
Methods
-
abortHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
ABORTframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
ackHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
ACKframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
authProvider(handler) → {StompServerHandler}
-
Configures the to be used to authenticate the user.
Parameters:
Name Type Description handlerAuthProvider the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
beginHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
BEGINframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
bridge(options) → {StompServerHandler}
-
Configures the STOMP server to act as a bridge with the Vert.x event bus.
Parameters:
Name Type Description optionsObject the configuration options - Source:
Returns:
the current StompServerHandler.- Type
- StompServerHandler
-
closeHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a connection with the client is closed.
Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
commitHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
COMMITframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
connectHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
CONNECTframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
destinationFactory(factory) → {StompServerHandler}
-
Configures the DestinationFactory used to create Destination objects.
Parameters:
Name Type Description factoryDestinationFactory the factory - Source:
Returns:
the current StompServerHandler.- Type
- StompServerHandler
-
disconnectHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
DISCONNECTframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
getDestination(destination) → {Destination}
-
Gets the destination with the given name.
Parameters:
Name Type Description destinationstring the destination - Source:
Returns:
the Destination,nullif not existing.- Type
- Destination
-
getDestinations() → {Array.<Destination>}
-
- Source:
Returns:
-
the list of destination managed by the STOMP server. Don't forget the STOMP interprets destination as opaque Strings.
-
- Type
- Array.<Destination>
-
getOrCreateDestination(destination) → {Destination}
-
Gets a Destination object if existing, or create a new one. The creation is delegated to the DestinationFactory.
Parameters:
Name Type Description destinationstring the destination - Source:
Returns:
the Destination instance, may have been created.- Type
- Destination
-
handle(arg0)
-
Parameters:
Name Type Description arg0ServerFrame - Source:
-
nackHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
NACKframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
onAck(connection, subscribe, messages) → {StompServerHandler}
-
Method 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.
Parameters:
Name Type Description connectionStompServerConnection the connection subscribeObject the SUBSCRIBEframemessagesArray.<Object> the acknowledge messages - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
onAckHandler(handler) → {StompServerHandler}
-
Configures the action to execute when messages are acknowledged.
Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
onAuthenticationRequest(server, login, passcode, handler) → {StompServerHandler}
-
Called when the client connects to a server requiring authentication. It invokes the configured using StompServerHandler#authProvider.
Parameters:
Name Type Description serverStompServer the STOMP server. loginstring the login passcodestring the password handlerfunction handler receiving the authentication result - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
onClose(connection)
-
Called when the connection is closed. This method executes a default behavior and must calls the configured StompServerHandler#closeHandler if any.
Parameters:
Name Type Description connectionStompServerConnection the connection - Source:
-
onNack(connection, subscribe, messages) → {StompServerHandler}
-
Method called by single message (client-individual policy) or a set of message (client policy) are not acknowledged. Not acknowledgment can result from a
NACKframe or from a timeout (noACKframe received in a given time. Implementations must call the handler configured using StompServerHandler#onNackHandler.Parameters:
Name Type Description connectionStompServerConnection the connection subscribeObject the SUBSCRIBEframemessagesArray.<Object> the acknowledge messages - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
onNackHandler(handler) → {StompServerHandler}
-
Configures the action to execute when messages are not acknowledged.
Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
pingHandler(handler) → {StompServerHandler}
-
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. The handler will only be called if the connection supports heartbeats.Parameters:
Name Type Description handlerfunction the action to execute when a `PING` needs to be sent. - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
sendHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
SENDframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
stompHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
STOMPframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
subscribeHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
SUBSCRIBEframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler
-
unsubscribeHandler(handler) → {StompServerHandler}
-
Configures the action to execute when a
UNSUBSCRIBEframe is received.Parameters:
Name Type Description handlerfunction the handler - Source:
Returns:
the current StompServerHandler- Type
- StompServerHandler