Class: Hypertube::Sdk::RuntimeBridge
- Inherits:
-
Object
- Object
- Hypertube::Sdk::RuntimeBridge
- Defined in:
- lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb
Class Method Summary collapse
-
.activate(license_key) ⇒ Integer
Activates Hypertube::Sdk::RuntimeBridge with the provided license key and optionally with proxy data.
-
.add_config(priority, config_source) ⇒ Object
Adds configuration from the given source with specified priority.
-
.get_runtime_info(get_loaded_modules) ⇒ String
Gets information about the current runtime.
-
.http2(http2_connection_data) ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with an HTTP/2 connection to a remote machine.
-
.in_memory ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge using an in-memory channel on the same machine.
-
.initialize_rc(config_name) ⇒ Hypertube::Sdk::RuntimeContext
Initializes Hypertube::Sdk::RuntimeContext for the given configuration name.
-
.plugin(plugin_connection_data) ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with a Plugin connection to a remote machine.
-
.set_config_source(config_source) ⇒ Object
Sets the configuration source for the Hypertube::Sdk::RuntimeBridge SDK.
-
.set_working_directory(path) ⇒ Object
Sets the working directory for the Hypertube::Sdk::RuntimeBridge SDK.
-
.tcp(tcp_connection_data) ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with a TCP connection to a remote machine.
-
.web_socket(ws_connection_data) ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with a WebSocket connection to a remote machine.
-
.with_config(path) ⇒ Hypertube::Sdk::ConfigRuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with a custom configuration file.
Class Method Details
.activate(license_key) ⇒ Integer
Activates Hypertube::Sdk::RuntimeBridge with the provided license key and optionally with proxy data.
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 75 def self.activate(license_key) if license_key != Hypertube::Sdk::Tools::ActivationHelper.temporary_license_key Hypertube::Sdk::Tools::ActivationHelper.temporary_license_key = license_key Hypertube::Sdk::Tools::SdkMessageHelper.('SdkMessage', 'Activation') end Hypertube::Sdk::Tools::ActivationHelper.temporary_license_key = license_key Hypertube::Core::Transmitter::Transmitter.activate(license_key) rescue Exception => e Hypertube::Sdk::Tools::SdkMessageHelper.('SdkException', e.) raise e end |
.add_config(priority, config_source) ⇒ Object
Adds configuration from the given source with specified priority.
120 121 122 123 124 125 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 120 def self.add_config(priority, config_source) Hypertube::Sdk::Configuration::ConfigSourceResolver.add_configs(priority, config_source) rescue Exception => e Hypertube::Sdk::Tools::SdkMessageHelper.('SdkException', e.) raise e end |
.get_runtime_info(get_loaded_modules) ⇒ String
Gets information about the current runtime.
113 114 115 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 113 def self.get_runtime_info(get_loaded_modules) Hypertube::Utils::RuntimeLogger.get_runtime_info(get_loaded_modules) end |
.http2(http2_connection_data) ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with an HTTP/2 connection to a remote machine.
56 57 58 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 56 def self.http2(http2_connection_data) Hypertube::Sdk::RuntimeFactory.new(http2_connection_data) end |
.in_memory ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge using an in-memory channel on the same machine.
26 27 28 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 26 def self.in_memory Hypertube::Sdk::RuntimeFactory.new(Hypertube::Utils::InMemoryConnectionData.new) end |
.initialize_rc(config_name) ⇒ Hypertube::Sdk::RuntimeContext
Initializes Hypertube::Sdk::RuntimeContext for the given configuration name.
130 131 132 133 134 135 136 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 130 def self.initialize_rc(config_name) config = Hypertube::Sdk::Configuration::ConfigSourceResolver.get_config(config_name) Hypertube::Sdk::RuntimeContext.initialize_runtime_context(config) rescue Exception => e Hypertube::Sdk::Tools::SdkMessageHelper.('SdkException', e.) raise e end |
.plugin(plugin_connection_data) ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with a Plugin connection to a remote machine.
41 42 43 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 41 def self.plugin(plugin_connection_data) Hypertube::Sdk::RuntimeFactory.new(plugin_connection_data) end |
.set_config_source(config_source) ⇒ Object
Sets the configuration source for the Hypertube::Sdk::RuntimeBridge SDK.
90 91 92 93 94 95 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 90 def self.set_config_source(config_source) Hypertube::Core::Transmitter::Transmitter.set_config_source(config_source) rescue Exception => e Hypertube::Sdk::Tools::SdkMessageHelper.('SdkException', e.) raise e end |
.set_working_directory(path) ⇒ Object
Sets the working directory for the Hypertube::Sdk::RuntimeBridge SDK.
99 100 101 102 103 104 105 106 107 108 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 99 def self.set_working_directory(path) path.gsub!('\\', '/') path += '/' unless path.end_with?('/') FileUtils.mkdir_p(path, mode: 0o700) Hypertube::Sdk::Tools::ActivationHelper.working_directory = path Hypertube::Core::Transmitter::Transmitter.set_working_directory(path) rescue Exception => e Hypertube::Sdk::Tools::SdkMessageHelper.('SdkException', e.) raise e end |
.tcp(tcp_connection_data) ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with a TCP connection to a remote machine.
34 35 36 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 34 def self.tcp(tcp_connection_data) Hypertube::Sdk::RuntimeFactory.new(tcp_connection_data) end |
.web_socket(ws_connection_data) ⇒ Hypertube::Sdk::RuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with a WebSocket connection to a remote machine.
49 50 51 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 49 def self.web_socket(ws_connection_data) Hypertube::Sdk::RuntimeFactory.new(ws_connection_data) end |
.with_config(path) ⇒ Hypertube::Sdk::ConfigRuntimeFactory
Initializes Hypertube::Sdk::RuntimeBridge with a custom configuration file.
64 65 66 67 68 69 |
# File 'lib/hypertube-ruby-sdk/sdk/runtime_bridge.rb', line 64 def self.with_config(path) Hypertube::Sdk::ConfigRuntimeFactory.new(path) rescue Exception => e Hypertube::Sdk::Tools::SdkMessageHelper.('SdkException', e.) raise e end |