List of usage examples for io.vertx.core.json JsonObject JsonObject
public JsonObject()
From source file:examples.ShellExamples.java
License:Open Source License
public void runSSHServiceWithShiro(Vertx vertx) throws Exception { ShellService service = ShellService.create(vertx, new ShellServiceOptions().setSSHOptions(new SSHTermOptions().setHost("localhost").setPort(5000) .setKeyPairOptions(new JksOptions().setPath("server-keystore.jks").setPassword("wibble")) .setAuthOptions(new ShiroAuthOptions().setType(ShiroAuthRealmType.PROPERTIES).setConfig( new JsonObject().put("properties_path", "file:/path/to/my/auth.properties"))))); service.start();/*from w w w . j a v a 2s.co m*/ }
From source file:examples.ShellExamples.java
License:Open Source License
public void runSSHServiceWithMongo(Vertx vertx) throws Exception { ShellService service = ShellService.create(vertx, new ShellServiceOptions().setSSHOptions(new SSHTermOptions().setHost("localhost").setPort(5000) .setKeyPairOptions(new JksOptions().setPath("server-keystore.jks").setPassword("wibble")) .setAuthOptions(new MongoAuthOptions().setConfig( new JsonObject().put("connection_string", "mongodb://localhost:27018"))))); service.start();/*from ww w . ja va 2 s .c o m*/ }
From source file:examples.ShellExamples.java
License:Open Source License
public void runSSHServiceWithJDBC(Vertx vertx) throws Exception { ShellService service = ShellService.create(vertx, new ShellServiceOptions().setSSHOptions(new SSHTermOptions().setHost("localhost").setPort(5000) .setKeyPairOptions(new JksOptions().setPath("server-keystore.jks").setPassword("wibble")) .setAuthOptions(new JDBCAuthOptions() .setConfig(new JsonObject().put("url", "jdbc:hsqldb:mem:test?shutdown=true") .put("driver_class", "org.hsqldb.jdbcDriver"))))); service.start();/*from w w w . j a v a 2s. c o m*/ }
From source file:examples.ShellExamples.java
License:Open Source License
public void runHTTPServiceWithMongo(Vertx vertx) throws Exception { ShellService service = ShellService.create(vertx, new ShellServiceOptions().setHttpOptions( new HttpTermOptions().setHost("localhost").setPort(8080).setAuthOptions(new MongoAuthOptions() .setConfig(new JsonObject().put("connection_string", "mongodb://localhost:27018"))))); service.start();//w w w. j a v a 2 s .c o m }
From source file:examples.ShellExamples.java
License:Open Source License
public void runHTTPServiceWithJDBC(Vertx vertx) throws Exception { ShellService service = ShellService.create(vertx, new ShellServiceOptions().setHttpOptions(new HttpTermOptions().setHost("localhost").setPort(8080) .setAuthOptions(new JDBCAuthOptions() .setConfig(new JsonObject().put("url", "jdbc:hsqldb:mem:test?shutdown=true") .put("driver_class", "org.hsqldb.jdbcDriver"))))); service.start();/*from w w w. ja va 2 s. c om*/ }
From source file:examples.StompServerExamples.java
License:Open Source License
public void example6(Vertx vertx) { StompServer server = StompServer/*from w w w.j a va2 s.co m*/ .create(vertx, new StompServerOptions().setHeartbeat(new JsonObject().put("x", 1000).put("y", 1000))) .handler(StompServerHandler.create(vertx)).listen(); }
From source file:examples.StompServerExamples.java
License:Open Source License
public void example15(Vertx vertx) { StompServer server = StompServer.create(vertx) .handler(StompServerHandler.create(vertx).bridge(new BridgeOptions() .addInboundPermitted(new PermittedOptions().setAddress("/toBus") .setMatch(new JsonObject().put("foo", "bar"))) .addOutboundPermitted(new PermittedOptions().setAddress("/toStomp")).setPointToPoint(true))) .listen();// w w w. j a va 2s . co m }
From source file:examples.VertxAmqpBridgeExamples.java
License:Apache License
public void example1(Vertx vertx) { AmqpBridge bridge = AmqpBridge.create(vertx); // Start the bridge, then use the event loop thread to process things thereafter. bridge.start("localhost", 5672, res -> { // Set up a producer using the bridge, send a message with it. MessageProducer<JsonObject> producer = bridge.createProducer("myAmqpAddress"); JsonObject amqpMsgPayload = new JsonObject(); amqpMsgPayload.put("body", "myStringContent"); producer.send(amqpMsgPayload);// w w w . j ava 2 s . c om }); }
From source file:examples.VertxAmqpBridgeExamples.java
License:Apache License
public void example3(MessageProducer<JsonObject> producer) { JsonObject applicationProperties = new JsonObject(); applicationProperties.put("name", "value"); JsonObject amqpMsgPayload = new JsonObject(); amqpMsgPayload.put("application_properties", applicationProperties); producer.send(amqpMsgPayload);//ww w . j a va 2s. co m }
From source file:examples.VertxAmqpBridgeExamples.java
License:Apache License
@SuppressWarnings("unused") public void example10(MessageProducer<JsonObject> producer) { JsonObject amqpMsgPayload = new JsonObject(); amqpMsgPayload.put("body", "myRequest"); producer.<JsonObject>send(amqpMsgPayload, res -> { JsonObject amqpReplyMessagePayload = res.result().body(); // ...do something with reply message... });//w w w . ja v a2s.co m }