Class: Flydata::Output::ForwarderFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/flydata/command/sync.rb

Class Method Summary collapse

Class Method Details

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



507
508
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/flydata/command/sync.rb', line 507

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