Class: PuppetX::EnterpriseModules::Oracle::Sql

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/enterprisemodules/oracle/sql.rb

Overview

docs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Sql

Returns a new instance of Sql.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/puppet_x/enterprisemodules/oracle/sql.rb', line 19

def initialize(options = {})
  @command    = SqlplusCommand.new(options)
  @sid        = @command.sid
  @os_user    = @command.os_user
  @username   = @command.username
  @password   = @command.password
  @timeout    = @command.timeout
  @daemonized = @command.daemonized
  #
  # When a username is specified, we won't use the daemon
  #
  @command = if @daemonized && !@username
               SqlplusDaemon.new(options)
             else
               SqlplusCommand.new(options)
             end
end

Instance Attribute Details

#os_userObject (readonly)

Returns the value of attribute os_user.



17
18
19
# File 'lib/puppet_x/enterprisemodules/oracle/sql.rb', line 17

def os_user
  @os_user
end

#passwordObject (readonly)

Returns the value of attribute password.



17
18
19
# File 'lib/puppet_x/enterprisemodules/oracle/sql.rb', line 17

def password
  @password
end

#sidObject (readonly)

Returns the value of attribute sid.



17
18
19
# File 'lib/puppet_x/enterprisemodules/oracle/sql.rb', line 17

def sid
  @sid
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



17
18
19
# File 'lib/puppet_x/enterprisemodules/oracle/sql.rb', line 17

def timeout
  @timeout
end

#usernameObject (readonly)

Returns the value of attribute username.



17
18
19
# File 'lib/puppet_x/enterprisemodules/oracle/sql.rb', line 17

def username
  @username
end

Instance Method Details

#execute(command) ⇒ Object



37
38
39
40
# File 'lib/puppet_x/enterprisemodules/oracle/sql.rb', line 37

def execute(command)
  create_output_file
  @command.execute_sql_command(command, @output_file.path)
end