public class EventBusBridge extends java.lang.Object implements Handler<SockJSSocket>
Instances of this class are not thread-safe.
Constructor and Description |
---|
EventBusBridge(Vertx vertx,
JsonArray inboundPermitted,
JsonArray outboundPermitted) |
EventBusBridge(Vertx vertx,
JsonArray inboundPermitted,
JsonArray outboundPermitted,
JsonObject conf) |
EventBusBridge(Vertx vertx,
JsonArray inboundPermitted,
JsonArray outboundPermitted,
long authTimeout) |
EventBusBridge(Vertx vertx,
JsonArray inboundPermitted,
JsonArray outboundPermitted,
long authTimeout,
java.lang.String authAddress) |
Modifier and Type | Method and Description |
---|---|
EventBusBridgeHook |
getHook() |
void |
handle(SockJSSocket sock)
Something has happened, so handle it.
|
protected boolean |
handleAuthorise(JsonObject message,
java.lang.String sessionID,
Handler<AsyncResult<java.lang.Boolean>> handler)
Called before authorisation
You can use this to override default authorisation
|
protected void |
handlePostRegister(SockJSSocket sock,
java.lang.String address)
Called after client has registered
|
protected boolean |
handlePreRegister(SockJSSocket sock,
java.lang.String address)
Client is about to register a handler
|
protected boolean |
handleSendOrPub(SockJSSocket sock,
boolean send,
JsonObject msg,
java.lang.String address)
Client is sending or publishing on the socket
|
protected void |
handleSocketClosed(SockJSSocket sock)
The socket has been closed
|
protected boolean |
handleSocketCreated(SockJSSocket sock)
The socket has been created
|
protected boolean |
handleUnregister(SockJSSocket sock,
java.lang.String address)
Client is unregistering a handler
|
void |
setHook(EventBusBridgeHook hook) |
public EventBusBridge(Vertx vertx, JsonArray inboundPermitted, JsonArray outboundPermitted)
public EventBusBridge(Vertx vertx, JsonArray inboundPermitted, JsonArray outboundPermitted, long authTimeout)
public EventBusBridge(Vertx vertx, JsonArray inboundPermitted, JsonArray outboundPermitted, long authTimeout, java.lang.String authAddress)
public EventBusBridge(Vertx vertx, JsonArray inboundPermitted, JsonArray outboundPermitted, JsonObject conf)
public void handle(SockJSSocket sock)
Handler
handle
in interface Handler<SockJSSocket>
public void setHook(EventBusBridgeHook hook)
public EventBusBridgeHook getHook()
protected boolean handleSocketCreated(SockJSSocket sock)
sock
- The socketprotected void handleSocketClosed(SockJSSocket sock)
sock
- The socketprotected boolean handleSendOrPub(SockJSSocket sock, boolean send, JsonObject msg, java.lang.String address)
sock
- The socksend
- if true it's a send else it's a publishmsg
- The messageaddress
- The address the message is being sent/published toprotected boolean handlePreRegister(SockJSSocket sock, java.lang.String address)
sock
- The socketaddress
- The addressprotected void handlePostRegister(SockJSSocket sock, java.lang.String address)
sock
- The socketaddress
- The addressprotected boolean handleUnregister(SockJSSocket sock, java.lang.String address)
sock
- The socketaddress
- The addressprotected boolean handleAuthorise(JsonObject message, java.lang.String sessionID, Handler<AsyncResult<java.lang.Boolean>> handler)