Class: LogStash::PluginMixins::Jdbc::StatementHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/plugin_mixins/jdbc/statement_handler.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plugin, statement_logger) ⇒ StatementHandler

Returns a new instance of StatementHandler.



12
13
14
15
16
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 12

def initialize(plugin, statement_logger)
  @statement = plugin.statement
  @statement_logger = statement_logger
  post_init(plugin)
end

Instance Attribute Details

#parametersObject (readonly)

Returns the value of attribute parameters.



10
11
12
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 10

def parameters
  @parameters
end

#statementObject (readonly)

Returns the value of attribute statement.



10
11
12
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 10

def statement
  @statement
end

#statement_loggerObject (readonly)

Returns the value of attribute statement_logger.



10
11
12
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 10

def statement_logger
  @statement_logger
end

Class Method Details

.build_statement_handler(plugin, logger) ⇒ Object



5
6
7
8
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 5

def self.build_statement_handler(plugin, logger)
  klass = plugin.use_prepared_statements ? PreparedStatementHandler : NormalStatementHandler
  klass.new(plugin, logger)
end

Instance Method Details

#build_query(db, sql_last_value) ⇒ Object



18
19
20
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 18

def build_query(db, sql_last_value)
  # override in subclass
end

#post_init(plugin) ⇒ Object



22
23
24
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 22

def post_init(plugin)
  # override in subclass, if needed
end