Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

  • StompServerHandler

Implements

  • any

Index

Methods

abortHandler

  • Configures the action to execute when a ABORT frame is received.

    Parameters

    Returns StompServerHandler

ackHandler

  • Configures the action to execute when a ACK frame is received.

    Parameters

    Returns StompServerHandler

authProvider

  • Configures the to be used to authenticate the user.

    Parameters

    • handler: AuthenticationProvider

    Returns StompServerHandler

beginHandler

  • Configures the action to execute when a BEGIN frame is received.

    Parameters

    Returns StompServerHandler

bridge

  • Configures the STOMP server to act as a bridge with the Vert.x event bus.

    Parameters

    Returns StompServerHandler

closeHandler

commitHandler

  • Configures the action to execute when a COMMIT frame is received.

    Parameters

    Returns StompServerHandler

connectHandler

  • Configures the action to execute when a CONNECT frame is received.

    Parameters

    Returns StompServerHandler

destinationFactory

disconnectHandler

  • Configures the action to execute when a DISCONNECT frame is received.

    Parameters

    Returns StompServerHandler

getDestination

  • Gets the destination with the given name.

    Parameters

    • destination: string

    Returns Destination

getDestinations

  • Returns Destination

getOrCreateDestination

  • getOrCreateDestination(destination: string): Destination
  • Gets a Destination object if existing, or create a new one. The creation is delegated to the DestinationFactory.

    Parameters

    • destination: string

    Returns Destination

getUserBySession

  • getUserBySession(session: string): User
  • Provides for authorization matches on a destination level, this will return the User created by the .

    Parameters

    • session: string

    Returns User

handle

  • Parameters

    Returns void

nackHandler

  • Configures the action to execute when a NACK frame is received.

    Parameters

    Returns StompServerHandler

onAck

  • Method called by single message (client-individual policy) or a set of message (client policy) are acknowledged. Implementations must call the handler configured using {@link StompServerHandler#onAckHandler}.

    Parameters

    Returns StompServerHandler

onAckHandler

onAuthenticationRequest

  • onAuthenticationRequest(connection: StompServerConnection, login: string, passcode: string): PromiseLike<boolean>
  • onAuthenticationRequest(connection: StompServerConnection, login: string, passcode: string, handler: ((res: AsyncResult<boolean>) => void) | Handler<AsyncResult<boolean>>): StompServerHandler
  • Called when the client connects to a server requiring authentication. It invokes the configured using {@link StompServerHandler#authProvider}.

    Parameters

    Returns PromiseLike<boolean>

  • Called when the client connects to a server requiring authentication. It invokes the configured using {@link StompServerHandler#authProvider}.

    Parameters

    • connection: StompServerConnection
    • login: string
    • passcode: string
    • handler: ((res: AsyncResult<boolean>) => void) | Handler<AsyncResult<boolean>>

    Returns StompServerHandler

onClose

  • Called when the connection is closed. This method executes a default behavior and must calls the configured {@link StompServerHandler#closeHandler} if any.

    Parameters

    Returns void

onNack

  • 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 {@link StompServerHandler#onNackHandler}.

    Parameters

    Returns StompServerHandler

onNackHandler

pingHandler

  • 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

    Returns StompServerHandler

receivedFrameHandler

  • 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

    Returns StompServerHandler

sendHandler

  • Configures the action to execute when a SEND frame is received.

    Parameters

    Returns StompServerHandler

stompHandler

  • Configures the action to execute when a STOMP frame is received.

    Parameters

    Returns StompServerHandler

subscribeHandler

  • Configures the action to execute when a SUBSCRIBE frame is received.

    Parameters

    Returns StompServerHandler

unsubscribeHandler

  • Configures the action to execute when a UNSUBSCRIBE frame is received.

    Parameters

    Returns StompServerHandler

Static create

  • Creates an instance of StompServerHandler using the default (compliant) implementation.

    Parameters

    • vertx: Vertx

    Returns StompServerHandler

Generated using TypeDoc