Class: VertxShell::TermServer
- Inherits:
-
Object
- Object
- VertxShell::TermServer
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb
Overview
A server for terminal based applications.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
-
+ (::VertxShell::TermServer) create_http_term_server(*args)
Create a term server for the HTTP protocol, using an existing router.
-
+ (::VertxShell::TermServer) create_ssh_term_server(*args)
Create a term server for the SSH protocol.
-
+ (::VertxShell::TermServer) create_telnet_term_server(*args)
Create a term server for the Telnet protocol.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (Fixnum) actualPort
The actual port the server is listening on.
-
- (self) authProvider(provider)
Set an auth provider to use, any provider configured in options will override this provider.
-
- (void) close(completionHandler) { ... }
Like #close but supplying a handler that will be notified when close is complete.
-
- (self) listen(listenHandler) { ... }
Bind the term server, the #term_handler must be set before.
-
- (self) termHandler(handler) { ... }
Set the term handler that will receive incoming client connections.
Class Method Details
+ (Boolean) accept?(obj)
23 24 25 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 23 def @@j_api_type.accept?(obj) obj.class == TermServer end |
+ (::VertxShell::TermServer) createHttpTermServer(vertx) + (::VertxShell::TermServer) createHttpTermServer(vertx, options) + (::VertxShell::TermServer) createHttpTermServer(vertx, router) + (::VertxShell::TermServer) createHttpTermServer(vertx, router, options)
Create a term server for the HTTP protocol, using an existing router.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 118 def self.create_http_term_server(*args) if args[0].class.method_defined?(:j_del) && !block_given? && args[1] == nil && args[2] == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellTerm::TermServer.java_method(:createHttpTermServer, [Java::IoVertxCore::Vertx.java_class]).call(args[0].j_del),::VertxShell::TermServer) elsif args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given? && args[2] == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellTerm::TermServer.java_method(:createHttpTermServer, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtShellTerm::HttpTermOptions.java_class]).call(args[0].j_del,Java::IoVertxExtShellTerm::HttpTermOptions.new(::Vertx::Util::Utils.to_json_object(args[1]))),::VertxShell::TermServer) elsif args[0].class.method_defined?(:j_del) && args[1].class.method_defined?(:j_del) && !block_given? && args[2] == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellTerm::TermServer.java_method(:createHttpTermServer, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtWeb::Router.java_class]).call(args[0].j_del,args[1].j_del),::VertxShell::TermServer) elsif args[0].class.method_defined?(:j_del) && args[1].class.method_defined?(:j_del) && args[2].class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellTerm::TermServer.java_method(:createHttpTermServer, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtWeb::Router.java_class,Java::IoVertxExtShellTerm::HttpTermOptions.java_class]).call(args[0].j_del,args[1].j_del,Java::IoVertxExtShellTerm::HttpTermOptions.new(::Vertx::Util::Utils.to_json_object(args[2]))),::VertxShell::TermServer) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling create_http_term_server(#{args[0]},#{args[1]},#{args[2]})" end end |
+ (::VertxShell::TermServer) createSSHTermServer(vertx) + (::VertxShell::TermServer) createSSHTermServer(vertx, options)
Create a term server for the SSH protocol.
182 183 184 185 186 187 188 189 190 191 192 193 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 182 def self.create_ssh_term_server(*args) if args[0].class.method_defined?(:j_del) && !block_given? && args[1] == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellTerm::TermServer.java_method(:createSSHTermServer, [Java::IoVertxCore::Vertx.java_class]).call(args[0].j_del),::VertxShell::TermServer) elsif args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellTerm::TermServer.java_method(:createSSHTermServer, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtShellTerm::SSHTermOptions.java_class]).call(args[0].j_del,Java::IoVertxExtShellTerm::SSHTermOptions.new(::Vertx::Util::Utils.to_json_object(args[1]))),::VertxShell::TermServer) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling create_ssh_term_server(#{args[0]},#{args[1]})" end end |
+ (::VertxShell::TermServer) createTelnetTermServer(vertx) + (::VertxShell::TermServer) createTelnetTermServer(vertx, options)
Create a term server for the Telnet protocol.
61 62 63 64 65 66 67 68 69 70 71 72 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 61 def self.create_telnet_term_server(*args) if args[0].class.method_defined?(:j_del) && !block_given? && args[1] == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellTerm::TermServer.java_method(:createTelnetTermServer, [Java::IoVertxCore::Vertx.java_class]).call(args[0].j_del),::VertxShell::TermServer) elsif args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellTerm::TermServer.java_method(:createTelnetTermServer, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtShellTerm::TelnetTermOptions.java_class]).call(args[0].j_del,Java::IoVertxExtShellTerm::TelnetTermOptions.new(::Vertx::Util::Utils.to_json_object(args[1]))),::VertxShell::TermServer) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling create_telnet_term_server(#{args[0]},#{args[1]})" end end |
+ (Object) j_api_type
32 33 34 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 32 def self.j_api_type @@j_api_type end |
+ (Object) j_class
35 36 37 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 35 def self.j_class Java::IoVertxExtShellTerm::TermServer.java_class end |
+ (Object) unwrap(obj)
29 30 31 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 29 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
26 27 28 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 26 def @@j_api_type.wrap(obj) TermServer.new(obj) end |
Instance Method Details
- (Fixnum) actualPort
The actual port the server is listening on. This is useful if you bound the server specifying 0 as port number
signifying an ephemeral port
77 78 79 80 81 82 83 84 85 86 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 77 def actual_port if !block_given? return @j_del.java_method(:actualPort, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling actual_port()" end end |
- (self) authProvider(provider)
Set an auth provider to use, any provider configured in options will override this provider. This should be used
when a custom auth provider should be used.
43 44 45 46 47 48 49 50 51 52 53 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 43 def auth_provider(*args) if args[0].class.method_defined?(:j_del) && !block_given? @j_del.java_method(:authProvider, [Java::IoVertxExtAuth::AuthProvider.java_class]).call(args[0].j_del) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling auth_provider(#{args[0]})" end end |
- (void) close(completionHandler) { ... }
This method returns an undefined value.
Like #close but supplying a handler that will be notified when close is complete.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 138 def close if true if (block_given?) return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling close()" end end |
- (self) listen(listenHandler) { ... }
Bind the term server, the #term_handler must be set before.
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 158 def listen if true if (block_given?) @j_del.java_method(:listen, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:listen, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling listen()" end end |
- (self) termHandler(handler) { ... }
Set the term handler that will receive incoming client connections. When a remote terminal connects
the
handler
will be called with the VertxShell::Term which can be used to interact with the remote
terminal.
93 94 95 96 97 98 99 100 101 102 103 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/term_server.rb', line 93 def term_handler if true @j_del.java_method(:termHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxShell::Term)) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling term_handler()" end end |