Class: OsCtld::Migration::Server::ClientHandler

Inherits:
Generic::ClientHandler show all
Defined in:
lib/osctld/migration/server.rb

Instance Attribute Summary

Attributes inherited from Generic::ClientHandler

#opts

Instance Method Summary collapse

Methods inherited from Generic::ClientHandler

#communicate, #error, #error!, #initialize, #ok, #parse, #reply_error, #reply_ok, #request_stop, #send_data, #send_update, #server_version, #socket

Constructor Details

This class inherits a constructor from OsCtld::Generic::ClientHandler

Instance Method Details

#handle_cmd(req) ⇒ Object



8
9
10
11
12
13
# File 'lib/osctld/migration/server.rb', line 8

def handle_cmd(req)
  cmd = Migration::Command.find(req[:cmd].to_sym)
  error!("Unsupported command '#{req[:cmd]}'") unless cmd

  cmd.run(req[:opts], handler: self)
end

#log_typeObject



15
16
17
# File 'lib/osctld/migration/server.rb', line 15

def log_type
  self.class.name
end