public static BridgeEvent newInstance(io.vertx.ext.web.handler.sockjs.BridgeEvent arg) { return arg != null ? new BridgeEvent(arg) : null; } }
public void handle(io.vertx.ext.web.handler.sockjs.BridgeEvent event) { bridgeEventHandler.handle(io.vertx.rxjava.ext.web.handler.sockjs.BridgeEvent.newInstance(event)); } });
@Override public void handle(BridgeEvent bridgeEvent) { switch (bridgeEvent.type()) { case REGISTER: JsonObject message = bridgeEvent.getRawMessage(); String address = message.getString("address"); ar.result().getRegistration() + "]...\n"); this.registrations.put(bridgeEvent.socket().writeHandlerID(), ar.result().getRegistration()); String writeHandlerID = bridgeEvent.socket().writeHandlerID();
@Bean public SockJSHandler sockJSHandler() { EventBusBridgeEvents eventBusBridgeEvents = eventBusBridgeEvents(); SockJSHandler sockJSHandler = SockJSHandler.create(vertx); BridgeOptions options = new BridgeOptions() .addInboundPermitted(new PermittedOptions().setAddressRegex(eventBusBridgeEvents.toIncomingEventName(".*"))) .addOutboundPermitted(new PermittedOptions().setAddressRegex(eventBusBridgeEvents.toOutgoingEventName(".*"))); sockJSHandler.bridge(options, event -> { if (event.type() == BridgeEventType.SOCKET_CREATED) { if (log.isDebugEnabled()) { log.debug("Socket connection created {}", event.socket().remoteAddress().host()); } } event.complete(true); }); return sockJSHandler; } }
/** * Set a handler for the result. * <p> * If the future has already been completed it will be called immediately. Otherwise it will be called when the * future is completed. * @return a reference to this, so it can be used fluently * @deprecated use {@link #rxSetHandler} instead */ @Deprecated() public Observable<Boolean> setHandlerObservable() { io.vertx.rx.java.ObservableFuture<Boolean> handler = io.vertx.rx.java.RxHelper.observableFuture(); setHandler(handler.toHandler()); return handler; }
/** * Set a handler for the result. * <p> * If the future has already been completed it will be called immediately. Otherwise it will be called when the * future is completed. * @return a reference to this, so it can be used fluently */ public Single<Boolean> rxSetHandler() { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { setHandler(fut); })); }
/** * Set a handler for the result. * <p> * If the future has already been completed it will be called immediately. Otherwise it will be called when the * future is completed. * @return a reference to this, so it can be used fluently */ public Single<Boolean> rxSetHandler() { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { setHandler(fut); })); }
public void handle(io.vertx.ext.web.handler.sockjs.BridgeEvent event) { bridgeEventHandler.handle(io.vertx.rxjava.ext.web.handler.sockjs.BridgeEvent.newInstance(event)); } });
public static BridgeEvent newInstance(io.vertx.ext.web.handler.sockjs.BridgeEvent arg) { return arg != null ? new BridgeEvent(arg) : null; } }