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) ⇒ StatementHandler

Returns a new instance of StatementHandler.



24
25
26
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 24

def initialize(plugin)
  @statement = plugin.statement
end

Instance Attribute Details

#parametersObject (readonly)

Returns the value of attribute parameters.



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

def parameters
  @parameters
end

#statementObject (readonly)

Returns the value of attribute statement.



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

def statement
  @statement
end

Class Method Details

.build_statement_handler(plugin) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 5

def self.build_statement_handler(plugin)
  if plugin.use_prepared_statements
    klass = PreparedStatementHandler
  else
    if plugin.jdbc_paging_enabled
      if plugin.jdbc_paging_mode == "explicit"
        klass = ExplicitPagingModeStatementHandler
      else
        klass = PagedNormalStatementHandler
      end
    else
      klass = NormalStatementHandler
    end
  end
  klass.new(plugin)
end

Instance Method Details

#build_query(db, sql_last_value) ⇒ Object



28
29
30
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 28

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