io.vertx.rxjava.ext.stomp

## Class StompServerHandler

- java.lang.Object
- - io.vertx.rxjava.ext.stomp.StompServerHandler

- All Implemented Interfaces:
    Handler<ServerFrame>

      public class StompServerHandler
      extends Object
      implements Handler<ServerFrame>

  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.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<StompServerHandler>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StompServerHandler(Object delegate)`
    `StompServerHandler(StompServerHandler delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `StompServerHandler` | `abortHandler(Handler<ServerFrame> handler)` Configures the action to execute when a `ABORT` frame is received.
    `StompServerHandler` | `ackHandler(Handler<ServerFrame> handler)` Configures the action to execute when a `ACK` frame is received.
    `StompServerHandler` | `authProvider(AuthenticationProvider handler)` Configures the to be used to authenticate the user.
    `StompServerHandler` | `beginHandler(Handler<ServerFrame> handler)` Configures the action to execute when a `BEGIN` frame is received.
    `StompServerHandler` | `bridge(BridgeOptions options)` Configures the STOMP server to act as a bridge with the Vert.x event bus.
    `StompServerHandler` | `closeHandler(Handler<StompServerConnection> handler)` Configures the action to execute when a connection with the client is closed.
    `StompServerHandler` | `commitHandler(Handler<ServerFrame> handler)` Configures the action to execute when a `COMMIT` frame is received.
    `StompServerHandler` | `connectHandler(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(Handler<ServerFrame> handler)` Configures the action to execute when a `DISCONNECT` frame is received.
    `boolean` | `equals(Object o)`
    `StompServerHandler` | `getDelegate()`
    `Destination` | `getDestination(String destination)` Gets the destination with the given name.
    `List<Destination>` | `getDestinations()`
    `Destination` | `getOrCreateDestination(String destination)` Gets a `Destination` object if existing, or create a new one.
    `User` | `getUserBySession(String session)` Provides for authorization matches on a destination level, this will return the User created by the .
    `void` | `handle(ServerFrame event)` Something has happened, so handle it.
    `int` | `hashCode()`
    `StompServerHandler` | `nackHandler(Handler<ServerFrame> handler)` Configures the action to execute when a `NACK` frame is received.
    `static StompServerHandler` | `newInstance(StompServerHandler arg)`
    `StompServerHandler` | `onAck(StompServerConnection connection, Frame subscribe, List<Frame> messages)` Method called by single message (client-individual policy) or a set of message (client policy) are acknowledged.
    `StompServerHandler` | `onAckHandler(Handler<Acknowledgement> handler)` Configures the action to execute when messages are acknowledged.
    `StompServerHandler` | `onAuthenticationRequest(StompServerConnection connection, String login, String passcode)` Called when the client connects to a server requiring authentication.
    `StompServerHandler` | `onAuthenticationRequest(StompServerConnection connection, String login, String passcode, Handler<AsyncResult<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, Frame subscribe, List<Frame> messages)` Method called by single message (client-individual policy) or a set of message (client policy) are not acknowledged.
    `StompServerHandler` | `onNackHandler(Handler<Acknowledgement> handler)` Configures the action to execute when messages are not acknowledged.
    `StompServerHandler` | `pingHandler(Handler<StompServerConnection> handler)` Allows customizing the action to do when the server needs to send a `PING` to the client.
    `StompServerHandler` | `receivedFrameHandler(Handler<ServerFrame> handler)` Configures a handler that get notified when a STOMP frame is received by the server.
    `Single<Boolean>` | `rxOnAuthenticationRequest(StompServerConnection connection, String login, String passcode)` Called when the client connects to a server requiring authentication.
    `StompServerHandler` | `sendHandler(Handler<ServerFrame> handler)` Configures the action to execute when a `SEND` frame is received.
    `StompServerHandler` | `stompHandler(Handler<ServerFrame> handler)` Configures the action to execute when a `STOMP` frame is received.
    `StompServerHandler` | `subscribeHandler(Handler<ServerFrame> handler)` Configures the action to execute when a `SUBSCRIBE` frame is received.
    `String` | `toString()`
    `StompServerHandler` | `unsubscribeHandler(Handler<ServerFrame> handler)` Configures the action to execute when a `UNSUBSCRIBE` frame is received.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<StompServerHandler> __TYPE_ARG

  - ### Constructor Detail

    - #### StompServerHandler

          public StompServerHandler(StompServerHandler delegate)

    - #### StompServerHandler

          public StompServerHandler(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public StompServerHandler getDelegate()

    - #### handle

          public void handle(ServerFrame event)

      Something has happened, so handle it.
      Specified by:
        `handle` in interface `Handler<ServerFrame>`
      Parameters:
        `event` - the event to handle

    - #### create

          public static StompServerHandler create(Vertx vertx)

      Creates an instance of `StompServerHandler` using the default (compliant) implementation.
      Parameters:
        `vertx` - the vert.x instance to use
      Returns:
        the created `StompServerHandler`

    - #### receivedFrameHandler

          public StompServerHandler receivedFrameHandler(Handler<ServerFrame> handler)

      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.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### connectHandler

          public StompServerHandler connectHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `CONNECT` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### stompHandler

          public StompServerHandler stompHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `STOMP` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### subscribeHandler

          public StompServerHandler subscribeHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `SUBSCRIBE` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### unsubscribeHandler

          public StompServerHandler unsubscribeHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `UNSUBSCRIBE` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### sendHandler

          public StompServerHandler sendHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `SEND` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### closeHandler

          public StompServerHandler closeHandler(Handler<StompServerConnection> handler)

      Configures the action to execute when a connection with the client is closed.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### onClose

          public void onClose(StompServerConnection connection)

      Called when the connection is closed. This method executes a default behavior and must calls the configured `closeHandler(io.vertx.core.Handler<io.vertx.rxjava.ext.stomp.StompServerConnection>)` if any.
      Parameters:
        `connection` - the connection

    - #### commitHandler

          public StompServerHandler commitHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `COMMIT` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### abortHandler

          public StompServerHandler abortHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `ABORT` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### beginHandler

          public StompServerHandler beginHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `BEGIN` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### disconnectHandler

          public StompServerHandler disconnectHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `DISCONNECT` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### ackHandler

          public StompServerHandler ackHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `ACK` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### nackHandler

          public StompServerHandler nackHandler(Handler<ServerFrame> handler)

      Configures the action to execute when a `NACK` frame is received.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### onAuthenticationRequest

          public StompServerHandler onAuthenticationRequest(StompServerConnection connection,
                                                            String login,
                                                            String passcode,
                                                            Handler<AsyncResult<Boolean>> handler)

      Called when the client connects to a server requiring authentication. It invokes the configured using `authProvider(io.vertx.rxjava.ext.auth.authentication.AuthenticationProvider)`.
      Parameters:
        `connection` - server connection that contains session ID
        `login` - the login
        `passcode` - the password
        `handler` - handler receiving the authentication result
      Returns:
        the current `StompServerHandler`

    - #### onAuthenticationRequest

          public StompServerHandler onAuthenticationRequest(StompServerConnection connection,
                                                            String login,
                                                            String passcode)

      Called when the client connects to a server requiring authentication. It invokes the configured using `authProvider(io.vertx.rxjava.ext.auth.authentication.AuthenticationProvider)`.
      Parameters:
        `connection` - server connection that contains session ID
        `login` - the login
        `passcode` - the password
      Returns:
        the current `StompServerHandler`

    - #### rxOnAuthenticationRequest

          public Single<Boolean> rxOnAuthenticationRequest(StompServerConnection connection,
                                                           String login,
                                                           String passcode)

      Called when the client connects to a server requiring authentication. It invokes the configured using `authProvider(io.vertx.rxjava.ext.auth.authentication.AuthenticationProvider)`.
      Parameters:
        `connection` - server connection that contains session ID
        `login` - the login
        `passcode` - the password
      Returns:
        the current `StompServerHandler`

    - #### getUserBySession

          public User getUserBySession(String session)

      Provides for authorization matches on a destination level, this will return the User created by the .
      Parameters:
        `session` - session ID for the server connection.
      Returns:
        null if not authenticated.

    - #### authProvider

          public StompServerHandler authProvider(AuthenticationProvider handler)

      Configures the to be used to authenticate the user.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### getDestinations

          public List<Destination> getDestinations()

      Returns:
        the list of destination managed by the STOMP server. Don't forget the STOMP interprets destination as opaque Strings.

    - #### getDestination

          public Destination getDestination(String destination)

      Gets the destination with the given name.
      Parameters:
        `destination` - the destination
      Returns:
        the `Destination`, `null` if not existing.

    - #### onAck

          public StompServerHandler onAck(StompServerConnection connection,
                                          Frame subscribe,
                                          List<Frame> messages)

      Method called by single message (client-individual policy) or a set of message (client policy) are acknowledged. Implementations must call the handler configured using `onAckHandler(io.vertx.core.Handler<io.vertx.rxjava.ext.stomp.Acknowledgement>)`.
      Parameters:
        `connection` - the connection
        `subscribe` - the `SUBSCRIBE` frame
        `messages` - the acknowledge messages
      Returns:
        the current `StompServerHandler`

    - #### onNack

          public StompServerHandler onNack(StompServerConnection connection,
                                           Frame subscribe,
                                           List<Frame> messages)

      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 `onNackHandler(io.vertx.core.Handler<io.vertx.rxjava.ext.stomp.Acknowledgement>)`.
      Parameters:
        `connection` - the connection
        `subscribe` - the `SUBSCRIBE` frame
        `messages` - the acknowledge messages
      Returns:
        the current `StompServerHandler`

    - #### onAckHandler

          public StompServerHandler onAckHandler(Handler<Acknowledgement> handler)

      Configures the action to execute when messages are acknowledged.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### onNackHandler

          public StompServerHandler onNackHandler(Handler<Acknowledgement> handler)

      Configures the action to execute when messages are not acknowledged.
      Parameters:
        `handler` - the handler
      Returns:
        the current `StompServerHandler`

    - #### pingHandler

          public StompServerHandler pingHandler(Handler<StompServerConnection> 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.

      The handler will only be called if the connection supports heartbeats.
      Parameters:
        `handler` - the action to execute when a `PING` needs to be sent.
      Returns:
        the current `StompServerHandler`

    - #### getOrCreateDestination

          public Destination getOrCreateDestination(String destination)

      Gets a `Destination` object if existing, or create a new one. The creation is delegated to the `DestinationFactory`.
      Parameters:
        `destination` - the destination
      Returns:
        the `Destination` instance, may have been created.

    - #### destinationFactory

          public StompServerHandler destinationFactory(DestinationFactory factory)

      Configures the `DestinationFactory` used to create `Destination` objects.
      Parameters:
        `factory` - the factory
      Returns:
        the current `StompServerHandler`.

    - #### bridge

          public StompServerHandler bridge(BridgeOptions options)

      Configures the STOMP server to act as a bridge with the Vert.x event bus.
      Parameters:
        `options` - the configuration options
      Returns:
        the current `StompServerHandler`.

    - #### newInstance

          public static StompServerHandler newInstance(StompServerHandler arg)

Copyright © 2020 Eclipse. All rights reserved.