@Override public void start(Future<Void> startFuture) throws Exception { termServer = TermServer.createTelnetTermServer(vertx, new TelnetTermOptions().setHost("localhost").setPort(3000).setInBinary(false)); Robot robot = new Robot(); termServer.termHandler(term -> { new ScreenCaster(vertx, robot, term).handle(); }); termServer.listen(ar -> { if (ar.succeeded()) { startFuture.complete(); } else { startFuture.fail(ar.cause()); } }); }
}); TelnetTermOptions tto = new TelnetTermOptions().setPort(3000).setHost("localhost"); TermServer telnetTermServer = TermServer.createTelnetTermServer(vertx,tto); server.registerTermServer(telnetTermServer);
/** * Create a term server for the Telnet protocol. * * @param vertx the vertx instance * @return the term server */ static TermServer createTelnetTermServer(Vertx vertx) { return createTelnetTermServer(vertx, new TelnetTermOptions()); }
/** * Create a term server for the Telnet protocol. * @param vertx the vertx instance * @return the term server */ public static io.vertx.rxjava.ext.shell.term.TermServer createTelnetTermServer(io.vertx.rxjava.core.Vertx vertx) { io.vertx.rxjava.ext.shell.term.TermServer ret = io.vertx.rxjava.ext.shell.term.TermServer.newInstance(io.vertx.ext.shell.term.TermServer.createTelnetTermServer(vertx.getDelegate())); return ret; }
/** * Create a term server for the Telnet protocol. * @param vertx the vertx instance * @param options the term options * @return the term server */ public static io.vertx.rxjava.ext.shell.term.TermServer createTelnetTermServer(io.vertx.rxjava.core.Vertx vertx, TelnetTermOptions options) { io.vertx.rxjava.ext.shell.term.TermServer ret = io.vertx.rxjava.ext.shell.term.TermServer.newInstance(io.vertx.ext.shell.term.TermServer.createTelnetTermServer(vertx.getDelegate(), options)); return ret; }
/** * Create a term server for the Telnet protocol. * @param vertx the vertx instance * @return the term server */ public static io.vertx.rxjava.ext.shell.term.TermServer createTelnetTermServer(io.vertx.rxjava.core.Vertx vertx) { io.vertx.rxjava.ext.shell.term.TermServer ret = io.vertx.rxjava.ext.shell.term.TermServer.newInstance(io.vertx.ext.shell.term.TermServer.createTelnetTermServer(vertx.getDelegate())); return ret; }
/** * Create a term server for the Telnet protocol. * @param vertx the vertx instance * @param options the term options * @return the term server */ public static io.vertx.rxjava.ext.shell.term.TermServer createTelnetTermServer(io.vertx.rxjava.core.Vertx vertx, TelnetTermOptions options) { io.vertx.rxjava.ext.shell.term.TermServer ret = io.vertx.rxjava.ext.shell.term.TermServer.newInstance(io.vertx.ext.shell.term.TermServer.createTelnetTermServer(vertx.getDelegate(), options)); return ret; }
public static io.vertx.ext.shell.term.TermServer createTelnetTermServer(io.vertx.ext.shell.term.TermServer j_receiver, io.vertx.core.Vertx vertx, java.util.Map<String, Object> options) { return io.vertx.core.impl.ConversionHelper.fromObject(io.vertx.ext.shell.term.TermServer.createTelnetTermServer(vertx, options != null ? new io.vertx.ext.shell.term.TelnetTermOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null)); } public static io.vertx.ext.shell.term.TermServer createHttpTermServer(io.vertx.ext.shell.term.TermServer j_receiver, io.vertx.core.Vertx vertx, java.util.Map<String, Object> options) {
private void startTelnet(TestContext context, TelnetTermOptions options, Handler<Term> termHandler) { server = TermServer.createTelnetTermServer(vertx, options.setPort(4000)); server.termHandler(termHandler); Async async = context.async(); server.listen(context.asyncAssertSuccess(v -> async.complete())); async.awaitSuccess(5000); }