@Override public void start(Future<Void> startFuture) throws Exception { ShellService service = ShellService.create(vertx, new ShellServiceOptions(). setHttpOptions( new HttpTermOptions(). setHost("localhost"). setPort(8080). setAuthOptions(new ShiroAuthOptions(). setConfig(new JsonObject().put("properties_path", "auth.properties"))))); service.start(ar -> { if (ar.succeeded()) { startFuture.succeeded(); } else { startFuture.fail(ar.cause()); } }); } }
ShellService service = ShellService.create(vertx, new ShellServiceOptions().setTelnetOptions( new TelnetTermOptions().setHost("localhost").setPort(3000) ));
@Override public void start() throws Exception { ShellService service = ShellService.create(vertx, new ShellServiceOptions().setTelnetOptions( new TelnetTermOptions().setHost("localhost").setPort(3000) )); service.start(); } }
@Override public void start(Future<Void> startFuture) throws Exception { ShellService service = ShellService.create(vertx, new ShellServiceOptions(). setSSHOptions( new SSHTermOptions(). setHost("localhost"). setPort(3000). setKeyPairOptions(new JksOptions(). setPath("keystore.jks"). setPassword("wibble")). setAuthOptions(new ShiroAuthOptions(). setConfig(new JsonObject().put("properties_path", "auth.properties"))))); service.start(ar -> { if (ar.succeeded()) { startFuture.succeeded(); } else { startFuture.fail(ar.cause()); } }); } }
@Override public void start() throws Exception { Command helloWorld = CommandBuilder.command("hello-world"). processHandler(process -> { process.write("hello world\n"); process.end(); }).build(vertx); ShellService service = ShellService.create(vertx, new ShellServiceOptions().setTelnetOptions( new TelnetTermOptions().setHost("localhost").setPort(3000) )); CommandRegistry.getShared(vertx).registerCommand(helloWorld); service.start(ar -> { if (!ar.succeeded()) { ar.cause().printStackTrace(); } }); } }
@Override public void start() throws Exception { Command starwars = CommandBuilder.command("echokeyboard"). processHandler(process -> { // Echo process.stdinHandler(keys -> { process.write(keys.replace('\r', '\n')); }); // Terminate when user hits Ctrl-C process.interruptHandler(v -> { process.end(); }); }).build(vertx); ShellService service = ShellService.create(vertx, new ShellServiceOptions().setTelnetOptions( new TelnetTermOptions().setHost("localhost").setPort(3000) )); CommandRegistry.getShared(vertx).registerCommand(starwars); service.start(ar -> { if (!ar.succeeded()) { ar.cause().printStackTrace(); } }); } }
}).build(vertx); ShellService service = ShellService.create(vertx, new ShellServiceOptions().setTelnetOptions( new TelnetTermOptions().setHost("localhost").setPort(3000) ));
ShellService service = ShellService.create(vertx, new ShellServiceOptions().setTelnetOptions( new TelnetTermOptions().setHost("localhost").setPort(3000) ));
/** * Like {@link #create(Vertx, ShellServiceOptions)}, with default options. */ static ShellService create(Vertx vertx) { return create(vertx, new ShellServiceOptions()); }
@Override public void start(Future<Void> startFuture) throws Exception { ShellServiceOptions options = new ShellServiceOptions(context.config()); ShellService service = ShellService.create(vertx, options); service.start(ar -> { if (ar.succeeded()) { startFuture.complete(); } else { startFuture.fail(ar.cause()); } }); } }
/** * Like {@link io.vertx.rxjava.ext.shell.ShellService#create}, with default options. * @param vertx * @return */ public static io.vertx.rxjava.ext.shell.ShellService create(io.vertx.rxjava.core.Vertx vertx) { io.vertx.rxjava.ext.shell.ShellService ret = io.vertx.rxjava.ext.shell.ShellService.newInstance(io.vertx.ext.shell.ShellService.create(vertx.getDelegate())); return ret; }
/** * Create a new shell service. * @param vertx the Vert.x instance * @param options the service config options * @return the shell service */ public static io.vertx.rxjava.ext.shell.ShellService create(io.vertx.rxjava.core.Vertx vertx, ShellServiceOptions options) { io.vertx.rxjava.ext.shell.ShellService ret = io.vertx.rxjava.ext.shell.ShellService.newInstance(io.vertx.ext.shell.ShellService.create(vertx.getDelegate(), options)); return ret; }
/** * Like {@link io.vertx.rxjava.ext.shell.ShellService#create}, with default options. * @param vertx * @return */ public static io.vertx.rxjava.ext.shell.ShellService create(io.vertx.rxjava.core.Vertx vertx) { io.vertx.rxjava.ext.shell.ShellService ret = io.vertx.rxjava.ext.shell.ShellService.newInstance(io.vertx.ext.shell.ShellService.create(vertx.getDelegate())); return ret; }
/** * Create a new shell service. * @param vertx the Vert.x instance * @param options the service config options * @return the shell service */ public static io.vertx.rxjava.ext.shell.ShellService create(io.vertx.rxjava.core.Vertx vertx, ShellServiceOptions options) { io.vertx.rxjava.ext.shell.ShellService ret = io.vertx.rxjava.ext.shell.ShellService.newInstance(io.vertx.ext.shell.ShellService.create(vertx.getDelegate(), options)); return ret; }
public static io.vertx.ext.shell.ShellService create(io.vertx.ext.shell.ShellService j_receiver, io.vertx.core.Vertx vertx, java.util.Map<String, Object> options) { return io.vertx.core.impl.ConversionHelper.fromObject(io.vertx.ext.shell.ShellService.create(vertx, options != null ? new io.vertx.ext.shell.ShellServiceOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null)); } }
protected void startShell(SSHTermOptions options) throws ExecutionException, InterruptedException, TimeoutException { if (service != null) { throw new IllegalStateException(); } service = ShellService.create(vertx, new ShellServiceOptions(). setWelcomeMessage(""). setSSHOptions(options)); CompletableFuture<Void> fut = new CompletableFuture<>(); service.start(ar -> { if (ar.succeeded()) { fut.complete(null); } else { fut.completeExceptionally(ar.cause()); } }); fut.get(10, TimeUnit.SECONDS); }
authOptions ); ShellService service = ShellService.create(vertx, new ShellServiceOptions(). setTelnetOptions(new TelnetTermOptions().setPort(5000)). setSSHOptions(options).