Class: Flydata::Output::ForwarderFactory

Inherits:
Object
  • Object
show all
Includes:
CommandLoggable
Defined in:
lib/flydata/output/forwarder.rb

Class Method Summary collapse

Methods included from CommandLoggable

#before_logging, #log_error_stderr, #log_info_stdout, #log_warn_stderr

Class Method Details

.create(forwarder_key, tag, servers, options = {}) ⇒ Object


10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/flydata/output/forwarder.rb', line 10

def self.create(forwarder_key, tag, servers, options = {})
  case forwarder_key
  when nil, "tcpforwarder"
    puts("Creating TCP connection") if FLYDATA_DEBUG
    forward = TcpForwarder.new(tag, servers, options)
  when "sslforwarder"
    puts("Creating SSL connection") if FLYDATA_DEBUG
    forward = SslForwarder.new(tag, servers, options)
  else
    raise "Unsupported Forwarding type #{forwarder_key}"
  end
  forward
end