Extract Msf::DBManager::Sink

MSP-11124

Extract attributes and methods associated with the deprecated sink.
This commit is contained in:
Luke Imhoff 2014-10-08 15:26:28 -05:00
parent 15f9461279
commit a054259ee5
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
2 changed files with 32 additions and 19 deletions

View File

@ -75,11 +75,15 @@ module Msf
class DBManager
extend Metasploit::Framework::Require
autoload :Sink, 'msf/core/db_manager/sink'
include Msf::DBManager::ImportMsfXml
optionally_include_metasploit_credential_creation
# Provides :framework and other accessors
include Msf::DBManager::Migration
include Msf::DBManager::Sink
# Provides :framework and other accessors
include Msf::Framework::Offspring
#
@ -121,9 +125,6 @@ class DBManager
# Stores the error message for why the db was not loaded
attr_accessor :error
# Stores a TaskManager for serializing database events
attr_accessor :sink
# Flag to indicate that modules are cached
attr_accessor :modules_cached
@ -245,21 +246,6 @@ class DBManager
end
end
#
# Create a new database sink and initialize it
#
def initialize_sink
self.sink = TaskManager.new(framework)
self.sink.start
end
#
# Add a new task to the sink
#
def queue(proc)
self.sink.queue_proc(proc)
end
#
# Connects this instance to a database
#

View File

@ -0,0 +1,27 @@
module Msf::DBManager::Sink
#
# Attributes
#
# Stores a TaskManager for serializing database events
attr_accessor :sink
#
# Instance Methods
#
#
# Create a new database sink and initialize it
#
def initialize_sink
self.sink = Msf::TaskManager.new(framework)
self.sink.start
end
#
# Add a new task to the sink
#
def queue(proc)
self.sink.queue_proc(proc)
end
end