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.

package

Default

Methods

__construct

__construct() 

Configures the action to execute when a <code>ABORT</code> frame is received.

abortHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when a <code>ACK</code> frame is received.

ackHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Configures the to be used to authenticate the user.

authProvider( $arg0) : $this

Arguments

$arg0

AuthProvider

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when a <code>BEGIN</code> frame is received.

beginHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

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

bridge( $arg0) : $this

Arguments

$arg0

array | BridgeOptions

Response

$this

the current {@link StompServerHandler}.

Configures the action to execute when a connection with the client is closed.

closeHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when a <code>COMMIT</code> frame is received.

commitHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when a <code>CONNECT</code> frame is received.

connectHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Creates an instance of @see \io\vertx\jphp\ext\stomp\StompServerHandler using the default (compliant) implementation.

create( $arg0) : \io\vertx\jphp\ext\stomp\StompServerHandler
static

Arguments

$arg0

Vertx

Response

\io\vertx\jphp\ext\stomp\StompServerHandler

the created {@link StompServerHandler}

Configures the @see \io\vertx\jphp\ext\stomp\DestinationFactory used to create @see \io\vertx\jphp\ext\stomp\Destination objects.

destinationFactory( $arg0) : $this

Arguments

$arg0

DestinationFactory

Response

$this

the current {@link StompServerHandler}.

Configures the action to execute when a <code>DISCONNECT</code> frame is received.

disconnectHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Gets the destination with the given name.

getDestination( $arg0) : \io\vertx\jphp\ext\stomp\Destination

Arguments

$arg0

string

Response

\io\vertx\jphp\ext\stomp\Destination

the {@link Destination}, {@code null} if not existing.

getDestinations

getDestinations() : array

Response

array

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

Gets a @see \io\vertx\jphp\ext\stomp\Destination object if existing, or create a new one. The creation is delegated to the

getOrCreateDestination( $arg0) : \io\vertx\jphp\ext\stomp\Destination
see \io\vertx\jphp\ext\stomp\DestinationFactory.

Arguments

$arg0

string

Response

\io\vertx\jphp\ext\stomp\Destination

the {@link Destination} instance, may have been created.

Provides for authorization matches on a destination level, this will return the User created by the .

getUserBySession( $arg0) : \io\vertx\jphp\ext\auth\User

Arguments

$arg0

string

Response

\io\vertx\jphp\ext\auth\User

null if not authenticated.

Something has happened, so handle it.

handle( $arg0) : void

Arguments

$arg0

ServerFrame

Configures the action to execute when a <code>NACK</code> frame is received.

nackHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Method called by single message (client-individual policy) or a set of message (client policy) are acknowledged.

onAck( $arg0,  $arg1,  $arg2) : $this

Implementations must call the handler configured using @see \io\vertx\jphp\ext\stomp\StompServerHandler::onAckHandler.

Arguments

$arg0

StompServerConnection

$arg1

Frame | array

$arg2

array

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when messages are acknowledged.

onAckHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Called when the client connects to a server requiring authentication. It invokes the configured using @see \io\vertx\jphp\ext\stomp\StompServerHandler::authProvider.

onAuthenticationRequest( $arg0,  $arg1,  $arg2,  $arg3) : $this

Arguments

$arg0

StompServerConnection

$arg1

string

$arg2

string

$arg3

callable

Response

$this

the current {@link StompServerHandler}

Called when the connection is closed. This method executes a default behavior and must calls the configured

onClose( $arg0) : void
see \io\vertx\jphp\ext\stomp\StompServerHandler::closeHandler

if any.

Arguments

$arg0

StompServerConnection

Method called by single message (client-individual policy) or a set of message (client policy) are <strong>not</strong> acknowledged. Not acknowledgment can result from a <code>NACK</code> frame or from a timeout (no <code>ACK</code> frame received in a given time. Implementations must call the handler configured using

onNack( $arg0,  $arg1,  $arg2) : $this
see \io\vertx\jphp\ext\stomp\StompServerHandler::onNackHandler.

Arguments

$arg0

StompServerConnection

$arg1

Frame | array

$arg2

array

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when messages are <strong>not</strong> acknowledged.

onNackHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link 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 <code>EOL</code> (specification). However, you can customize this and send another frame. However, be aware that this may requires a custom client.

pingHandler( $arg0) : $this

The handler will only be called if the connection supports heartbeats.

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Configures a handler that get notified when a STOMP frame is received by the server.

receivedFrameHandler( $arg0) : $this

This handler can be used for logging, debugging or ad-hoc behavior.

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when a <code>SEND</code> frame is received.

sendHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when a <code>STOMP</code> frame is received.

stompHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when a <code>SUBSCRIBE</code> frame is received.

subscribeHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}

Configures the action to execute when a <code>UNSUBSCRIBE</code> frame is received.

unsubscribeHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

the current {@link StompServerHandler}