Once a connection to the STOMP server has been made, client receives a @see \io\vertx\jphp\ext\stomp\StompClientConnection, that let send and receive STOMP frames.
package |
Default |
---|
__construct()
abort( $arg0, $arg1 = null, $arg2 = null) : $this
param $id [string] the transaction id, must not be {@code null} abort($id)
Aborts a transaction.
param $id [string] the transaction id, must not be {@code null} param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the transaction cancellation has been processed by the server. The handler receives the sent frame ({@code ABORT}). abort($id, $receiptHandler)
Aborts a transaction.
param $id [string] the transaction id, must not be {@code null} param $headers [array] additional headers to send to the server. The {@code transaction} header is replaced by the value passed in the @{code id} parameter abort($id, $headers)
Aborts a transaction.
param $id [string] the transaction id, must not be {@code null} param $headers [array] additional headers to send to the server. The {@code transaction} header is replaced by the value passed in the @{code id} parameter param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the transaction cancellation has been processed by the server. The handler receives the sent frame ({@code ABORT}). abort($id, $headers, $receiptHandler)
string
callable | array
callable
$this
the current {@link StompClientConnection}
ack( $arg0, $arg1 = null, $arg2 = null) : $this
param $id [string] the message id of the message to acknowledge ack($id)
Sends an acknowledgement for a specific message. It means that the message has been handled and processed by the
client. The id
parameter is the message id received in the frame.
param $id [string] the message id of the message to acknowledge param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the acknowledgment has been processed by the server. The handler receives the sent frame ({@code ACK}). ack($id, $receiptHandler)
Sends an acknowledgement for the given frame. It means that the frame has been handled and processed by the client. The sent acknowledgement is part of the transaction identified by the given id.
param $id [string] the message id of the message to acknowledge param $txId [string] the transaction id ack($id, $txId)
Sends an acknowledgement for the given frame. It means that the frame has been handled and processed by the client. The sent acknowledgement is part of the transaction identified by the given id.
param $id [string] the message id of the message to acknowledge param $txId [string] the transaction id param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the acknowledgment has been processed by the server. The handler receives the sent frame ({@code ACK}). ack($id, $txId, $receiptHandler)
string
callable | string
callable
$this
the current {@link StompClientConnection}
beginTX( $arg0, $arg1 = null, $arg2 = null) : $this
param $id [string] the transaction id, must not be {@code null} beginTX($id)
Begins a transaction.
param $id [string] the transaction id, must not be {@code null} param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the transaction begin has been processed by the server. The handler receives the sent frame ({@code BEGIN}). beginTX($id, $receiptHandler)
Begins a transaction.
param $id [string] the transaction id, must not be {@code null} param $headers [array] additional headers to send to the server. The {@code transaction} header is replaced by the value passed in the @{code id} parameter beginTX($id, $headers)
Begins a transaction.
param $id [string] the transaction id, must not be {@code null} param $headers [array] additional headers to send to the server. The {@code transaction} header is replaced by the value passed in the @{code id} parameter param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the transaction begin has been processed by the server. The handler receives the sent frame ({@code BEGIN}). beginTX($id, $headers, $receiptHandler)
string
callable | array
callable
$this
the current {@link StompClientConnection}
close() : void
closeHandler( $arg0) : $this
callable
$this
the current {@link StompClientConnection}
commit( $arg0, $arg1 = null, $arg2 = null) : $this
param $id [string] the transaction id, must not be {@code null} commit($id)
Commits a transaction.
param $id [string] the transaction id, must not be {@code null} param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the transaction commit has been processed by the server. The handler receives the sent frame ({@code COMMIT}). commit($id, $receiptHandler)
Commits a transaction.
param $id [string] the transaction id, must not be {@code null} param $headers [array] additional headers to send to the server. The {@code transaction} header is replaced by the value passed in the @{code id} parameter commit($id, $headers)
Commits a transaction.
param $id [string] the transaction id, must not be {@code null} param $headers [array] additional headers to send to the server. The {@code transaction} header is replaced by the value passed in the @{code id} parameter param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the transaction commit has been processed by the server. The handler receives the sent frame ({@code COMMIT}). commit($id, $headers, $receiptHandler)
string
callable | array
callable
$this
the current {@link StompClientConnection}
connectionDroppedHandler( $arg0) : $this
The handler can decide to reconnect to the server.
callable
$this
the current {@link StompClientConnection} receiving the dropped connection.
disconnect( $arg0 = null, $arg1 = null) : $this
disconnect()
Disconnects the client. Unlike the @see \io\vertx\jphp\ext\stomp\StompClientConnection::close method, this method send the DISCONNECT
frame to the
server.
param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the disconnection has been processed by the server. The handler receives the sent frame ({@code DISCONNECT}). disconnect($receiptHandler)
Disconnects the client. Unlike the @see \io\vertx\jphp\ext\stomp\StompClientConnection::close method, this method send the DISCONNECT
frame to the
server. This method lets you customize the DISCONNECT
frame.
param $frame [Frame | array] the {@code DISCONNECT} frame. disconnect($frame)
Disconnects the client. Unlike the @see \io\vertx\jphp\ext\stomp\StompClientConnection::close method, this method send the DISCONNECT
frame to the
server. This method lets you customize the DISCONNECT
frame.
param $frame [Frame | array] the {@code DISCONNECT} frame. param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the disconnection has been processed by the server. The handler receives the sent frame ({@code DISCONNECT}). disconnect($frame, $receiptHandler)
Frame | callable | array
callable
$this
the current {@link StompClientConnection}
errorHandler( $arg0) : $this
callable
$this
the current {@link StompClientConnection}
exceptionHandler( $arg0) : $this
callable
$this
the current {@link StompClientConnection}
isConnected() : boolean
boolean
{@code true} if the connection is established, {@code false} otherwise
nack( $arg0, $arg1 = null, $arg2 = null) : $this
The id
parameter is the message id received in the frame.
param $id [string] the message id of the message to acknowledge nack($id)
Sends a non-acknowledgement for the given message. It means that the message has not been handled by the client.
The id
parameter is the message id received in the frame.
param $id [string] the message id of the message to acknowledge param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the non-acknowledgment has been processed by the server. The handler receives the sent frame ({@code NACK}). nack($id, $receiptHandler)
Sends a non-acknowledgement for the given frame. It means that the frame has not been handled by the client. The sent non-acknowledgement is part of the transaction identified by the given id.
param $id [string] the message id of the message to acknowledge param $txId [string] the transaction id nack($id, $txId)
Sends a non-acknowledgement for the given frame. It means that the frame has not been handled by the client. The sent non-acknowledgement is part of the transaction identified by the given id.
param $id [string] the message id of the message to acknowledge param $txId [string] the transaction id param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the non-acknowledgment has been processed by the server. The handler receives the sent frame ({@code NACK}). nack($id, $txId, $receiptHandler)
string
callable | string
callable
$this
the current {@link StompClientConnection}
pingHandler( $arg0) : $this
callable
$this
the current {@link StompClientConnection}
receivedFrameHandler( $arg0) : $this
This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified by the handler.
Unlike @see \io\vertx\jphp\ext\stomp\StompClient::receivedFrameHandler, the given handler won't receive the CONNECTED
frame. If a received frame handler is set on the @see \io\vertx\jphp\ext\stomp\StompClient, it will be used by all
clients connection, so calling this method is useless, except if you want to use a different handler.
callable
$this
the current {@link StompClientConnection}
send( $arg0, $arg1 = null, $arg2 = null, $arg3 = null) : $this
param $frame [Frame | array] the frame send($frame)
Sends a SEND
frame to the server.
param $headers [array] the headers, must not be {@code null} param $body [Buffer] the body, may be {@code null} send($headers, $body)
Sends a SEND
frame to the server to the given destination. The message does not have any other header.
param $destination [string] the destination, must not be {@code null} param $body [Buffer] the body, may be {@code null} send($destination, $body)
Sends the given frame to the server.
param $frame [Frame | array] the frame param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the sent frame has been received. The handler receives the sent frame. send($frame, $receiptHandler)
Sends a SEND
frame to the server.
param $headers [array] the headers, must not be {@code null} param $body [Buffer] the body, may be {@code null} param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the sent frame has been received. The handler receives the sent frame. send($headers, $body, $receiptHandler)
Sends a SEND
frame to the server to the given destination. The message does not have any other header.
param $destination [string] the destination, must not be {@code null} param $body [Buffer] the body, may be {@code null} param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the sent frame has been received. The handler receives the sent frame. send($destination, $body, $receiptHandler)
Sends a SEND
frame to the server to the given destination.
param $destination [string] the destination, must not be {@code null} param $headers [array] the header. The {@code destination} header is replaced by the value given to the {@code destination} parameter param $body [Buffer] the body, may be {@code null} send($destination, $headers, $body)
Sends a SEND
frame to the server to the given destination.
param $destination [string] the destination, must not be {@code null} param $headers [array] the header. The {@code destination} header is replaced by the value given to the {@code destination} parameter param $body [Buffer] the body, may be {@code null} param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the sent frame has been received. The handler receives the sent frame. send($destination, $headers, $body, $receiptHandler)
Frame | string | array
Buffer | callable | array
Buffer | callable
callable
$this
the current {@link StompClientConnection}
server() : string
string
the server name.
session() : string
string
the session id.
subscribe( $arg0, $arg1, $arg2 = null, $arg3 = null) : string
param $destination [string] the destination, must not be {@code null} param $handler [callable] the handler invoked when a message is received on the given destination. Must not be {@code null}. subscribe($destination, $handler)
Subscribes to the given destination. This destination is used as subscription id.
param $destination [string] the destination, must not be {@code null} param $handler [callable] the handler invoked when a message is received on the given destination. Must not be {@code null}. param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the subscription has been received. The handler receives the sent frame ({@code SUBSCRIBE}). subscribe($destination, $handler, $receiptHandler)
Subscribes to the given destination.
param $destination [string] the destination, must not be {@code null}. param $headers [array] the headers to configure the subscription. It may contain the {@code ack} header to configure the acknowledgment policy. If the given set of headers contains the {@code id} header, this value is used as subscription id. param $handler [callable] the handler invoked when a message is received on the given destination. Must not be {@code null}. subscribe($destination, $headers, $handler)
Subscribes to the given destination.
param $destination [string] the destination, must not be {@code null} param $headers [array] the headers to configure the subscription. It may contain the {@code ack} header to configure the acknowledgment policy. If the given set of headers contains the {@code id} header, this value is used as subscription id. param $handler [callable] the handler invoked when a message is received on the given destination. Must not be {@code null}. param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the subscription has been received. The handler receives the sent frame ({@code SUBSCRIBE}). subscribe($destination, $headers, $handler, $receiptHandler)
string
callable | array
callable
callable
string
the subscription id.
unsubscribe( $arg0, $arg1 = null, $arg2 = null) : $this
param $destination [string] the destination unsubscribe($destination)
Un-subscribes from the given destination. This method only works if the subscription did not specifies a
subscription id (using the id
header).
param $destination [string] the destination param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the un-subscription has been received. The handler receives the sent frame ({@code UNSUBSCRIBE}). unsubscribe($destination, $receiptHandler)
Un-subscribes from the given destination. This method computes the subscription id as follows. If the given
headers contains the id
header, the header value is used. Otherwise the destination is used.
param $destination [string] the destination param $headers [array] the headers unsubscribe($destination, $headers)
Un-subscribes from the given destination. This method computes the subscription id as follows. If the given
headers contains the id
header, the header value is used. Otherwise the destination is used.
param $destination [string] the destination param $headers [array] the headers param $receiptHandler [callable] the handler invoked when the {@code RECEIPT} frame associated with the un-subscription has been received. The handler receives the sent frame ({@code UNSUBSCRIBE}). unsubscribe($destination, $headers, $receiptHandler)
string
callable | array
callable
$this
the current {@link StompClientConnection}
version() : string
string
the STOMP protocol version negotiated with the server.
writingFrameHandler( $arg0) : $this
If a writing frame handler is set on the @see \io\vertx\jphp\ext\stomp\StompClient, it will be used by all clients connection, so calling this method is useless, except if you want to use a different handler.
callable
$this
the current {@link StompClientConnection}