Class: LogStash::PluginMixins::Jdbc::StatementHandler
- Inherits:
-
Object
- Object
- LogStash::PluginMixins::Jdbc::StatementHandler
- Defined in:
- lib/logstash/plugin_mixins/jdbc/statement_handler.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#statement ⇒ Object
readonly
Returns the value of attribute statement.
-
#statement_logger ⇒ Object
readonly
Returns the value of attribute statement_logger.
Class Method Summary collapse
Instance Method Summary collapse
- #build_query(db, sql_last_value) ⇒ Object
-
#initialize(plugin, statement_logger) ⇒ StatementHandler
constructor
A new instance of StatementHandler.
- #post_init(plugin) ⇒ Object
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
#parameters ⇒ Object (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 |
#statement ⇒ Object (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_logger ⇒ Object (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 |