Extract Msf::DBManager::Sink
MSP-11124 Extract attributes and methods associated with the deprecated sink.
This commit is contained in:
parent
15f9461279
commit
a054259ee5
|
@ -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
|
||||
#
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue