Codota Logo
PermittedOptions.<init>
Code IndexAdd Codota to your IDE (free)

How to use
io.vertx.ext.web.handler.sockjs.PermittedOptions
constructor

Best Java code snippets using io.vertx.ext.web.handler.sockjs.PermittedOptions.<init> (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {

  Router router = Router.router(vertx);

  // Allow events for the designated addresses in/out of the event bus bridge
  BridgeOptions opts = new BridgeOptions()
    .addOutboundPermitted(new PermittedOptions().setAddress("feed"));

  // Create the event bus bridge and add it to the router.
  SockJSHandler ebHandler = SockJSHandler.create(vertx).bridge(opts);
  router.route("/eventbus/*").handler(ebHandler);

  // Start the web server and tell it to use the router to handle requests.
  vertx.createHttpServer().requestHandler(router).listen(8080);

  EventBus eb = vertx.eventBus();

  vertx.setPeriodic(1000l, t -> {
   // Create a timestamp string
   String timestamp = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(Date.from(Instant.now()));

   eb.send("feed", new JsonObject().put("now", timestamp));
  });
 }
}
origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {

  Router router = Router.router(vertx);

  // Allow events for the designated addresses in/out of the event bus bridge
  BridgeOptions opts = new BridgeOptions()
    .addInboundPermitted(new PermittedOptions().setAddress("com.example:cmd:poke-server"))
    .addOutboundPermitted(new PermittedOptions().setAddress("com.example:stat:server-info"));

  // Create the event bus bridge and add it to the router.
  SockJSHandler ebHandler = SockJSHandler.create(vertx).bridge(opts);
  router.route("/eventbus/*").handler(ebHandler);

  // Create a router endpoint for the static content.
  router.route().handler(StaticHandler.create());

  // Start the web server and tell it to use the router to handle requests.
  vertx.createHttpServer().requestHandler(router).listen(8080);

  EventBus eb = vertx.eventBus();

  vertx.setPeriodic(1000l, t -> {
   // Create a timestamp string
   String timestamp = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(Date.from(Instant.now()));
   eb.send("com.example:stat:server-info", new JsonObject().put("systemTime", timestamp));
  });
 }
}
origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {

  Router router = Router.router(vertx);

  // Allow events for the designated addresses in/out of the event bus bridge
  BridgeOptions opts = new BridgeOptions()
   .addOutboundPermitted(new PermittedOptions().setAddress("feed"));

  // Create the event bus bridge and add it to the router.
  SockJSHandler ebHandler = SockJSHandler.create(vertx).bridge(opts);
  router.route("/eventbus/*").handler(ebHandler);

  // Create a router endpoint for the static content.
  router.route().handler(StaticHandler.create());

  // Start the web server and tell it to use the router to handle requests.
  vertx.createHttpServer().requestHandler(router).listen(8080);

  EventBus eb = vertx.eventBus();

  vertx.setPeriodic(1000l, t -> {
   // Create a timestamp string
   String timestamp = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(Date.from(Instant.now()));

   eb.send("feed", new JsonObject().put("now", timestamp));
  });
 }
}
origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {

  Router router = Router.router(vertx);

  // Allow events for the designated addresses in/out of the event bus bridge
  BridgeOptions opts = new BridgeOptions()
    .addOutboundPermitted(new PermittedOptions().setAddress("feed"));

  // Create the event bus bridge and add it to the router.
  SockJSHandler ebHandler = SockJSHandler.create(vertx).bridge(opts);
  router.route("/eventbus/*").handler(ebHandler);

  // Create a router endpoint for the static content.
  router.route().handler(StaticHandler.create());

  // Start the web server and tell it to use the router to handle requests.
  vertx.createHttpServer().requestHandler(router).listen(8080);

  EventBus eb = vertx.eventBus();

  vertx.setPeriodic(1000l, t -> {
   // Create a timestamp string
   String timestamp = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(Date.from(Instant.now()));

   eb.send("feed", new JsonObject().put("now", timestamp));
  });
 }
}
origin: vert-x3/vertx-examples

 @Override
 public void start() throws Exception {

  Router router = Router.router(vertx);

  // Allow events for the designated addresses in/out of the event bus bridge
  BridgeOptions opts = new BridgeOptions()
      .addInboundPermitted(new PermittedOptions().setAddress("chat.message"))
      .addOutboundPermitted(new PermittedOptions().setAddress("chat.message"));

  // Create the event bus bridge and add it to the router.
  SockJSHandler ebHandler = SockJSHandler.create(vertx).bridge(opts);
  router.route("/eventbus/*").handler(ebHandler);

  // Create a router endpoint for the static content.
  router.route().handler(StaticHandler.create());

  // Start the web server and tell it to use the router to handle requests.
  vertx.createHttpServer().requestHandler(router).listen(8080);
 }
}
origin: vert-x3/vertx-examples

.addInboundPermitted(new PermittedOptions().setAddress("chat.to.server"))
.addOutboundPermitted(new PermittedOptions().setAddress("chat.to.client"));
origin: vert-x3/vertx-examples

options.setOutboundPermitted(Collections.singletonList(new PermittedOptions().setAddress("dashboard")));
router.route("/eventbus/*").handler(SockJSHandler.create(vertx).bridge(options));
origin: vert-x3/vertx-examples

BridgeOptions options = new BridgeOptions().addOutboundPermitted(new PermittedOptions().setAddress("news-feed"));
origin: vert-x3/vertx-examples

  new PermittedOptions().
    setAddress("metrics")
);
origin: vert-x3/vertx-examples

.addInboundPermitted(new PermittedOptions()
 .setAddress("vtoons.listAlbums"))
.addInboundPermitted(new PermittedOptions()
 .setAddress("vtoons.login"))
.addInboundPermitted(new PermittedOptions()
 .setAddress("vtoons.placeOrder")
 .setRequiredAuthority("place_order"))
.addOutboundPermitted(new PermittedOptions());
origin: stackoverflow.com

 BridgeOptions options = new BridgeOptions()
.addInboundPermitted(new PermittedOptions().setAddress("news-feed"))
.addOutboundPermitted(new PermittedOptions().setAddress("news-feed"));
origin: advantageous/qbit

@Override
public void start() throws Exception {
  /* test service */
  final TestService testService = new TestService();
  /* address */
  final String address = "testservice";
  /* service builder */
  final ServiceBuilder serviceBuilder = ServiceBuilder.serviceBuilder();
  serviceBuilder.setServiceObject(testService);
  final ServiceQueue serviceQueue = serviceBuilder.build();
  /* vertx event bus bridge to qbit. */
  final VertxEventBusBridgeBuilder vertxEventBusBridgeBuilder = VertxEventBusBridgeBuilder
      .vertxEventBusBridgeBuilder()
      .setVertx(vertx);
  vertxEventBusBridgeBuilder.addBridgeAddress(address, TestService.class);
  final Router router = Router.router(vertx);
  router.route("/health/").handler(routingContext -> routingContext.response().end("\"ok\""));
    /* Configure bridge at this HTTP/WebSocket URI. */
  router.route("/eventbus/*").handler(SockJSHandler.create(vertx).bridge(
      new BridgeOptions()
          .addInboundPermitted(new PermittedOptions().setAddress(address))
          .addOutboundPermitted(new PermittedOptions().setAddress(address))
  ));
  vertxEventBusBridgeBuilder.setServiceQueue(serviceQueue);
  serviceQueue.startAll(); //startall not supported yet for bridge.
  vertxEventBusBridgeBuilder.build();
  vertx.createHttpServer().requestHandler(router::accept).listen(8080);
  System.out.println("Bound to 8080");
}
origin: com.progressoft.brix.domino/vertx-domino-event-bus-backend

private void addInboundPermitted(BridgeOptions bridgeOptions, JsonObject inbound) {
  PermittedOptions permittedOptions=new PermittedOptions();
  permittedOptions.setAddress(inbound.getString(ADDRESS));
  String authority=inbound.getString(REQUIRED_AUTHORITY, EMPTY_CSRF_SECRET);
  if(!authority.isEmpty())
    permittedOptions.setRequiredAuthority(authority);
  bridgeOptions.addInboundPermitted(permittedOptions);
}
origin: com.progressoft.brix.domino/vertx-domino-event-bus-backend

private void addOutboundPermitted(BridgeOptions bridgeOptions, JsonObject outbound) {
  PermittedOptions permittedOptions=new PermittedOptions();
  permittedOptions.setAddress(outbound.getString(ADDRESS));
  String authority=outbound.getString(REQUIRED_AUTHORITY, EMPTY_CSRF_SECRET);
  if(!authority.isEmpty())
    permittedOptions.setRequiredAuthority(authority);
  bridgeOptions.addOutboundPermitted(permittedOptions);
}
origin: stackoverflow.com

 Router router = Router.router(vertx);
vertx.createHttpServer().requestHandler(router::accept).listen(8080);
BridgeOptions options = new BridgeOptions();
options.addInboundPermitted(new PermittedOptions().setAddress("client-to-server"));
options.addOutboundPermitted(new PermittedOptions().setAddress("server-to-client"));
SockJSHandler sockJSHandler = SockJSHandler.create(vertx).bridge(options);

router.route("/loginUrl/*").handler(sockJSHandler);

EventBus eb = vertx.eventBus();

eb.consumer("client-to-server").handler(
 sockJSHand -> {
  System.out.println("Sending Message "+ sockJSHand.body());//It prints the message from client
  eb.publish("server-to-client", "Message");
 }
);
origin: org.swisspush/gateleen-core

/**
 * Configures and binds the SockJS bridge to an HttpServer.
 * 
 * @param router router
 */
public void install(Router router) {
  BridgeOptions bridgeOptions = new BridgeOptions()
      .addOutboundPermitted(new PermittedOptions().setAddressRegex(addressPrefix + "(.*)"));
  if (eventbusBridgePingInterval != null) {
    bridgeOptions = bridgeOptions.setPingTimeout(eventbusBridgePingInterval);
  }
  router.route(sockPath).handler(SockJSHandler.create(vertx).bridge(bridgeOptions));
  log.info("Installed SockJS endpoint on " + sockPath);
  log.info("Listening to requests on " + adressPathPattern.pattern());
  log.info("Using address prefix " + addressPrefix);
}
origin: mpusher/mpns

private void initWebSocket() {
  Router router = Router.router(vertx);
  SockJSHandlerOptions options = new SockJSHandlerOptions()
      .setHeartbeatInterval(1000 * 60);
  SockJSHandler sockJSHandler = SockJSHandler.create(vertx, options);
  PermittedOptions inboundPermitted = new PermittedOptions().setAddressRegex("server/.*");
  PermittedOptions outboundPermitted = new PermittedOptions().setAddressRegex("client/.*");
  BridgeOptions ops = new BridgeOptions()
      .addInboundPermitted(inboundPermitted)
      .addOutboundPermitted(outboundPermitted);
  sockJSHandler.bridge(ops);
  router.route("/eb/*").handler(sockJSHandler);
  mainRouter.mountSubRouter("/ws", router);
}
origin: FroMage/redpipe

  @Override
  public Completable preRoute() {
    return Completable.defer(() -> {
      AppGlobals globals = AppGlobals.get();
      SockJSHandler sockJSHandler = SockJSHandler.create(globals.getVertx());
      BridgeOptions bridgeOptions = new BridgeOptions()
          .addInboundPermitted(new PermittedOptions().setAddress("app.markdown"))
          .addOutboundPermitted(new PermittedOptions().setAddress("page.saved"));
      sockJSHandler.bridge(bridgeOptions);
      globals.getRouter().route("/eventbus/*").handler(sockJSHandler);
      return super.preRoute();
    });
  }
});
origin: FroMage/redpipe

  @Override
  public Completable preRoute() {
    return Completable.defer(() -> {
      AppGlobals globals = AppGlobals.get();
      SockJSHandler sockJSHandler = SockJSHandler.create(globals.getVertx());
      BridgeOptions bridgeOptions = new BridgeOptions()
          .addInboundPermitted(new PermittedOptions().setAddress("app.markdown"))
          .addOutboundPermitted(new PermittedOptions().setAddress("page.saved"));
      sockJSHandler.bridge(bridgeOptions);
      globals.getRouter().route("/eventbus/*").handler(sockJSHandler);
      return super.preRoute();
    });
  }
});
origin: com.progressoft.brix.domino/vertx-domino-event-bus-backend

  @Override
  public SockJSHandler configure(VertxContext vertxContext, ServerConfiguration<JsonObject, JsonObject[]> config) {
    BridgeOptions bridgeOptions=new BridgeOptions();
    bridgeOptions.addOutboundPermitted(new PermittedOptions().setAddress(VertxBusContext.DEFAULT_SOCKJS_ADDRESS));

    SockJSHandler sockJSHandler = SockJSHandler.create(vertxContext.vertx());
    sockJSHandler.bridge(bridgeOptions, event -> event.complete(true));

    sockJSHandler.socketHandler(event -> event.headers().set(ACCESS_CONTROL_ALLOW_ORIGIN, ALLOW_ALL));
    return sockJSHandler;
  }
}
io.vertx.ext.web.handler.sockjsPermittedOptions<init>

Popular methods of PermittedOptions

  • setAddress
  • setAddressRegex
  • setRequiredAuthority

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now