@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()); } }); } }
public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ShellServiceOptions obj) { for (java.util.Map.Entry<String, Object> member : json) { switch (member.getKey()) { case "httpOptions": if (member.getValue() instanceof JsonObject) { obj.setHttpOptions(new io.vertx.ext.shell.term.HttpTermOptions((JsonObject)member.getValue())); } break; case "sshOptions": if (member.getValue() instanceof JsonObject) { obj.setSSHOptions(new io.vertx.ext.shell.term.SSHTermOptions((JsonObject)member.getValue())); } break; case "telnetOptions": if (member.getValue() instanceof JsonObject) { obj.setTelnetOptions(new io.vertx.ext.shell.term.TelnetTermOptions((JsonObject)member.getValue())); } break; } } }
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); }
ShellService service = ShellService.create(vertx, new ShellServiceOptions(). setTelnetOptions(new TelnetTermOptions().setPort(5000)). setSSHOptions(options). setHttpOptions(new HttpTermOptions(). setPort(8080).