Codota Logo
PermittedOptions.setAddress
Code IndexAdd Codota to your IDE (free)

How to use
setAddress
method
in
io.vertx.ext.web.handler.sockjs.PermittedOptions

Best Java code snippets using io.vertx.ext.web.handler.sockjs.PermittedOptions.setAddress (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: be.fluid-it.reactive-microservice.bundle/bootique-vertx

@Singleton
@Nullable
@Provides
public BridgeOptions provideBridgeOptions(VertxFactory vertxFactory) {
  BridgeOptions opts = null;
  if (vertxFactory.isRouterDefined() && vertxFactory.router().isSockJSHandlerDefined()) {
    PermissionsConfig permissionsConfig = vertxFactory.router().sockjs().bridge().permissions();
    opts = new BridgeOptions();
    for (String inboundPermmited : permissionsConfig.inbound()) {
      opts.addInboundPermitted(new PermittedOptions().setAddress(inboundPermmited));
    }
    for (String inboundPermmited : permissionsConfig.inboundRegex()) {
      opts.addInboundPermitted(new PermittedOptions().setAddressRegex(inboundPermmited));
    }
    for (String outboundPermmited : permissionsConfig.outbound()) {
      opts.addOutboundPermitted(new PermittedOptions().setAddress(outboundPermmited));
    }
    for (String outboundPermmited : permissionsConfig.outboundRegex()) {
      opts.addOutboundPermitted(new PermittedOptions().setAddressRegex(outboundPermmited));
    }
  }
  return opts;
}
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("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()
      .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

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

.setAddress("vtoons.listAlbums"))
.setAddress("vtoons.login"))
.setAddress("vtoons.placeOrder")
.setRequiredAuthority("place_order"))
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: advantageous/vertx-node-ec2-eventbus-example

final BridgeOptions options = new BridgeOptions()
    .addInboundPermitted(
        new PermittedOptions().setAddress(Services.HELLO_WORLD.toString()))
    .addInboundPermitted(new PermittedOptions().setAddress(HELLO_WORLD_SERVICE))
    .addOutboundPermitted(new PermittedOptions().setAddress(HELLO_WORLD_SERVICE));
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: cescoffier/vertx-kubernetes-workshop

BridgeOptions options = new BridgeOptions();
options
  .addOutboundPermitted(new PermittedOptions().setAddress("market"))
  .addOutboundPermitted(new PermittedOptions().setAddress("portfolio"))
  .addOutboundPermitted(new PermittedOptions().setAddress("service.portfolio"))
  .addInboundPermitted(new PermittedOptions().setAddress("service.portfolio"))
  .addOutboundPermitted(new PermittedOptions().setAddress("vertx.circuit-breaker"));
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;
  }
}
origin: sczyh30/vertx-blueprint-microservice

.addOutboundPermitted(new PermittedOptions().setAddress("microservice.monitor.metrics"))
.addOutboundPermitted(new PermittedOptions().setAddress("events.log"));
io.vertx.ext.web.handler.sockjsPermittedOptionssetAddress

Popular methods of PermittedOptions

  • <init>
  • setAddressRegex
  • setRequiredAuthority

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JCheckBox (javax.swing)
  • JLabel (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