Package io.vertx.ext.stomp.lite
Interface StompServerConnection
-
public interface StompServerConnectionCreated by Navid Mitchell on 2019-01-10.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.lang.StringbinaryHandlerID()When aWebsocketis created it automatically registers an event handler with the event bus - the ID of that handler is given by this method.voidclose()Closes the connection with the client.voidfetch(long amount)Fetch the specifiedamountof elements.booleanisSsl()io.vertx.core.net.SocketAddresslocalAddress()voidpause()Pause the client from sending data.javax.security.cert.X509Certificate[]peerCertificateChain()Note: Java SE 5+ recommends to use javax.net.ssl.SSLSession#getPeerCertificates() instead of of javax.net.ssl.SSLSession#getPeerCertificateChain() which this method is based on.io.vertx.core.net.SocketAddressremoteAddress()voidresume()Resume reading, and sets the buffer inflowingmode.io.vertx.core.Promise<java.lang.Void>sendError(java.lang.Throwable throwable)Deprecated.does not comply to the STOMP specio.vertx.core.Promise<java.lang.Void>sendErrorAndDisconnect(java.lang.Throwable throwable)Sends an error frame to the client and then disconnects the client per the Stomp Specio.vertx.core.Promise<java.lang.Void>sendReceiptIfNeeded(Frame frame)Will send receipt frame acknowledgement to clients when requested by a receipt headerjavax.net.ssl.SSLSessionsslSession()java.lang.StringtextHandlerID()When aWebsocketis created it automatically registers an event handler with the eventbus, the ID of that handler is given bytextHandlerID.io.vertx.core.Promise<java.lang.Void>write(io.vertx.core.buffer.Buffer buffer)Writes the given buffer to the socket.io.vertx.core.Promise<java.lang.Void>write(Frame frame)Writes the given frame to the socket.
-
-
-
Method Detail
-
binaryHandlerID
java.lang.String binaryHandlerID()
When aWebsocketis created it automatically registers an event handler with the event bus - the ID of that handler is given by this method. Given this ID, a different event loop can send a binary frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other WebSockets which are owned by different event loops.- Returns:
- the binary handler id
-
textHandlerID
java.lang.String textHandlerID()
When aWebsocketis created it automatically registers an event handler with the eventbus, the ID of that handler is given bytextHandlerID. Given this ID, a different event loop can send a text frame to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other WebSockets which are owned by different event loops.- Returns:
- the text handler id
-
remoteAddress
io.vertx.core.net.SocketAddress remoteAddress()
- Returns:
- the remote address for this socket
-
localAddress
io.vertx.core.net.SocketAddress localAddress()
- Returns:
- the local address for this socket
-
isSsl
boolean isSsl()
- Returns:
- true if this
HttpConnectionis encrypted via SSL/TLS.
-
sslSession
javax.net.ssl.SSLSession sslSession()
- Returns:
- SSLSession associated with the underlying socket. Returns null if connection is not SSL.
- See Also:
SSLSession
-
peerCertificateChain
javax.security.cert.X509Certificate[] peerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedExceptionNote: Java SE 5+ recommends to use javax.net.ssl.SSLSession#getPeerCertificates() instead of of javax.net.ssl.SSLSession#getPeerCertificateChain() which this method is based on. UsesslSession()to access that method.- Returns:
- an ordered array of the peer certificates. Returns null if connection is not SSL.
- Throws:
javax.net.ssl.SSLPeerUnverifiedException- SSL peer's identity has not been verified.- See Also:
SSLSession.getPeerCertificateChain(),sslSession()
-
write
io.vertx.core.Promise<java.lang.Void> write(Frame frame)
Writes the given frame to the socket.- Parameters:
frame- the frame, must not benull.- Returns:
- a
Promisethat will be completed when the data is successfully sent. Will be failed if there is a problem sending the data or the underlying TCP connection is already closed.
-
write
io.vertx.core.Promise<java.lang.Void> write(io.vertx.core.buffer.Buffer buffer)
Writes the given buffer to the socket. This is a low level API that should be used carefully.- Parameters:
buffer- the buffer- Returns:
- a
Promisethat will be completed when the data is successfully sent. Will be failed if there is a problem sending the data or the underlying TCP connection is already closed.
-
sendReceiptIfNeeded
io.vertx.core.Promise<java.lang.Void> sendReceiptIfNeeded(Frame frame)
Will send receipt frame acknowledgement to clients when requested by a receipt header- Parameters:
frame- to check for a receipt header- Returns:
- a
Promisethat will be completed when the data is successfully sent. Will be failed if there is a problem sending the data or the underlying TCP connection is already closed.
-
sendError
@Deprecated(since="3.9.17") io.vertx.core.Promise<java.lang.Void> sendError(java.lang.Throwable throwable)
Deprecated.does not comply to the STOMP specSends an error frame to the client and leaves the client connected- Parameters:
throwable- the error that occurred- Returns:
- a
Promisethat will be completed when the data is successfully sent. Will be failed if there is a problem sending the data or the underlying TCP connection is already closed.
-
sendErrorAndDisconnect
io.vertx.core.Promise<java.lang.Void> sendErrorAndDisconnect(java.lang.Throwable throwable)
Sends an error frame to the client and then disconnects the client per the Stomp Spec- Parameters:
throwable- the error that occurred- Returns:
- a
Promisethat will be completed when the data is successfully sent. Will be failed if there is a problem sending the data or the underlying TCP connection is already closed.
-
pause
void pause()
Pause the client from sending data. it sets the buffer infetchmode and clears the actual demand. While it's paused, no data will be sent to the dataStompServerHandler.
-
resume
void resume()
Resume reading, and sets the buffer inflowingmode. If this has been paused, data receiving recommence on it.
-
fetch
void fetch(long amount)
Fetch the specifiedamountof elements. If this has been paused, reading will recommence with the specifiedamountof items, otherwise the specifiedamountwill be added to the current client demand.- Parameters:
amount- to fetch
-
close
void close()
Closes the connection with the client.
-
-