Class: Javonet

Inherits:
Object
  • Object
show all
Defined in:
lib/javonet-ruby-sdk/sdk/javonet.rb

Overview

The Javonet class is a singleton class that serves as the entry point for interacting with Javonet. It provides methods to activate and initialize the Javonet SDK. It supports both in-memory and TCP connections.

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/javonet-static-class article on Javonet Guides}

Class Method Summary collapse

Class Method Details

.activate(license_key, proxy_host = nil, proxy_user_name = nil, proxy_password = nil) ⇒ Integer

Activates Javonet with the provided license key and optionally with proxy data.

Parameters:

  • license_key (String) —

    The license key to activate Javonet.

  • proxy_host (String) (defaults to: nil) —

    The host for the proxy server (optional).

  • proxy_user_name (String) (defaults to: nil) —

    The username for the proxy server (optional).

  • proxy_user_password (String) —

    The password for the proxy server (optional).

Returns:

  • (Integer) —

    The activation status code.

See Also:



46
47
48
49
50
51
# File 'lib/javonet-ruby-sdk/sdk/javonet.rb', line 46

def self.activate(license_key, proxy_host=nil, proxy_user_name=nil, proxy_password=nil)
  proxy_host ||= ""
  proxy_user_name ||= ""
  proxy_password ||= ""
  return Transmitter.activate_with_credentials_and_proxy(license_key, proxy_host, proxy_user_name, proxy_password)
end

.in_memory ⇒ RuntimeFactory

Initializes Javonet using an in-memory channel on the same machine.

Returns:

  • (RuntimeFactory) —

    A RuntimeFactory instance configured for an in-memory connection.

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/in-memory-channel article on Javonet Guides}


18
19
20
# File 'lib/javonet-ruby-sdk/sdk/javonet.rb', line 18

def self.in_memory
  RuntimeFactory.new(ConnectionType::IN_MEMORY, nil)
end

.tcp(tcp_connection_data) ⇒ RuntimeFactory

Initializes Javonet with a TCP connection to a remote machine.

Parameters:

Returns:

  • (RuntimeFactory) —

    A RuntimeFactory instance configured for a TCP connection.

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/tcp-channel article on Javonet Guides}


26
27
28
# File 'lib/javonet-ruby-sdk/sdk/javonet.rb', line 26

def self.tcp(tcp_connection_data)
  RuntimeFactory.new(ConnectionType::TCP, tcp_connection_data)
end

.with_config(path) ⇒ ConfigRuntimeFactory

Initializes Javonet with a custom configuration file.

Parameters:

  • path (String) —

    Path to a configuration file.

Returns:

See Also:

  • to this {https://www.javonet.com/guides/v2/ruby/foundations/configure-channel article on Javonet Guides}


34
35
36
37
# File 'lib/javonet-ruby-sdk/sdk/javonet.rb', line 34

def self.with_config(path)
  Transmitter.set_config_source(path)
  ConfigRuntimeFactory.new(path)
end