@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()); } }); } }
)); CommandRegistry.getShared(vertx).registerCommand(starwars); service.start(ar -> { if (!ar.succeeded()) { ar.cause().printStackTrace();
@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(); } }); } }
)); CommandRegistry.getShared(vertx).registerCommand(starwars); service.start(ar -> { if (!ar.succeeded()) { ar.cause().printStackTrace();
)); CommandRegistry.getShared(vertx).registerCommand(helloWorld); service.start(ar -> { if (!ar.succeeded()) { ar.cause().printStackTrace();
/** * Start the shell service, this is an asynchronous start. * * @param startHandler handler for getting notified when service is started */ void start(Handler<AsyncResult<Void>> startHandler);
/** * Start the shell service, this is an asynchronous start. * @param startHandler handler for getting notified when service is started */ public void start(Handler<AsyncResult<Void>> startHandler) { delegate.start(startHandler); }
/** * Start the shell service, this is an asynchronous start. * @param startHandler handler for getting notified when service is started */ public void start(Handler<AsyncResult<Void>> startHandler) { delegate.start(startHandler); }
/** * Start the shell service, this is an asynchronous start. */ public void start() { delegate.start(); }
/** * Start the shell service, this is an asynchronous start. */ public void start() { delegate.start(); }
@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()); } }); } }
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); }
service.start();