Class: MintPress::OracleDatabase::Listener

Inherits:
Object
  • Object
show all
Includes:
MintLogger, Mixins::Properties, Utils
Defined in:
src/oracle-database/lib/oracle-database/model/database/listener.rb

Overview

An Oracle listener object that represents an Oracle Listener This class provides a set of methods to manage an Oracle Listener

Properties (Read/Write)

  • #name ⇒ String (Default Value: "LISTENER")
    The name of LISTENER Default value is LISTENER

    Property Attributes
    • requiredtrue
    • default"LISTENER"
    
    
    25
    # File 'src/oracle-database/lib/oracle-database/model/database/listener.rb', line 25
    
    property :name, required: true, type: String, default: "LISTENER"
  • #listen_address ⇒ String (Default Value: "0.0.0.0")
    The listen address for the listener Default listen on all interfaces (0.0.0.0)

    Property Attributes
    • requiredtrue
    • default"0.0.0.0"
    
    
    28
    # File 'src/oracle-database/lib/oracle-database/model/database/listener.rb', line 28
    
    property :listen_address, required: true, type: String, default: "0.0.0.0"
  • #listen_port ⇒ Integer (Default Value: 1521)
    The listen port for the listener Listen port - default is 1521

    Property Attributes
    • requiredtrue
    • default1521
    
    
    31
    # File 'src/oracle-database/lib/oracle-database/model/database/listener.rb', line 31
    
    property :listen_port, required: true, type: Integer, default: 1521
  • #wait_for_services ⇒ [ TrueClass, FalseClass ] (Default Value: true)
    Should we wait for services before we return on actions? Default: true

    Property Attributes
    • defaulttrue
    
    
    35
    # File 'src/oracle-database/lib/oracle-database/model/database/listener.rb', line 35
    
    property :wait_for_services, type: [ TrueClass, FalseClass ], default: true
  • #installation ⇒ [ MintPress::OracleDatabase::Installation, MintPress::OracleGridInfrastructure::Installation ] (Default Value: Proc.new { r = nil ; databases.each { |k,v| r = v.installation if v.installation } ; r })
    This would generally not be used unless defining a standalone listener - usually, this would be inherited from the parent, that being either a Database, a Node, or an Instance. If it is defined, it's used to work out host and oracle_home

    Property Attributes
    • defaultProc.new { r = nil ; databases.each { |k,v| r = v.installation if v.installation } ; r }
    
    
    39
    # File 'src/oracle-database/lib/oracle-database/model/database/listener.rb', line 39
    
    property :installation, type: [ MintPress::OracleDatabase::Installation, MintPress::OracleGridInfrastructure::Installation ], default: Proc.new { r = nil ; databases.each { |k,v| r = v.installation if v.installation } ; r }
  • #oracle_home ⇒ String (Default Value: Proc.new { r=nil if self.get_property(:installation) r=installation.oracle_home elsif self.get_property(:database) database.each { |k,v| puts k ; r = v.oracle_home if v.oracle_home } end r })
    Location of ORACLE_HOME. If this listener is linked to an installation or a database object, this will be derived from those and need not be specified again.

    Property Attributes
    • defaultProc.new { r=nil if self.get_property(:installation) r=installation.oracle_home elsif self.get_property(:database) database.each { |k,v| puts k ; r = v.oracle_home if v.oracle_home } end r }
    
    
    41
    42
    43
    44
    45
    46
    47
    # File 'src/oracle-database/lib/oracle-database/model/database/listener.rb', line 41
    
    property :oracle_home, type: String, default: Proc.new { r=nil
                                                                     if self.get_property(:installation)
     r=installation.oracle_home
                                                                     elsif self.get_property(:database)
     database.each { |k,v| puts k ; r = v.oracle_home if v.oracle_home }
    end
    r }
  • #host ⇒ MintPress::Infrastructure::Host (Default Value: Proc.new { r=nil if self.get_property(:installation) and self.get_property(:installation).get_property(:host) r = installation.host elsif self.get_property(:database) database.each { |k,v| r = v.host if v.host } elsif self.default_localhost r = MintPress::Infrastructure::Localhost.new(final_user: self.default_localhost_user) end r })
    The host on which to install the listener. This will be derived from any linked installation or database object, otherwise will default to localhost on systems where that makes sense

    Property Attributes
    • defaultProc.new { r=nil if self.get_property(:installation) and self.get_property(:installation).get_property(:host) r = installation.host elsif self.get_property(:database) database.each { |k,v| r = v.host if v.host } elsif self.default_localhost r = MintPress::Infrastructure::Localhost.new(final_user: self.default_localhost_user) end r }
    
    
    50
    51
    52
    53
    54
    55
    56
    57
    58
    # File 'src/oracle-database/lib/oracle-database/model/database/listener.rb', line 50
    
    property :host, type: MintPress::Infrastructure::Host, default: Proc.new { r=nil
                                                                                       if self.get_property(:installation) and self.get_property(:installation).get_property(:host)
     r = installation.host
    elsif self.get_property(:database)
      database.each { |k,v| r = v.host if v.host }
    elsif self.default_localhost
      r = MintPress::Infrastructure::Localhost.new(final_user: self.default_localhost_user)
    end
    r }
  • #database ⇒ Hash of ⇒ MintPress::OracleDatabase::Database
    The set of databases who are using us as a listener

    Property Attributes
    • alias:databases
    
    
    66
    # File 'src/oracle-database/lib/oracle-database/model/database/listener.rb', line 66
    
    property :database, type: MintPress::OracleDatabase::Database, hash: true, alias: :databases

Properties (Read Only)

Constant Summary

Constants included from MintLogger

MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN

Instance Attribute Summary

Attributes included from Mixins::Properties

#autopush_set_cache, #dynamic_create, #harvest_on_access, #harvest_undefined_only, #harvested, #tree_root

Instance Method Summary collapse

Methods included from Utils

#session, #sql_ruby_session, #to_hash

Methods included from Mixins::Properties

#[], #[]=, #add_validate_report_result, #armour_set_property, #array_contains?, #array_is_a?, #check_autopush, #check_stack_overflow, #clone_property_object, #cloner_handle_single_property, #coerce_single, #contains_as_string?, #display_validate_report_result, #double_initialize?, #dump_to_hash, #find_parent, #find_parent_by_identity, #generate_accessor_functions, #get_canonical_renamed, #get_from_opts, #get_my_name, #get_property, #get_property_item, #has?, included, #initialize_validate_report, #inspect, #is_cloned_object?, #is_mintpress_object?, #is_probably_canonical?, #is_set?, #local_debug, #local_info, #local_verbose, #mintpress_property_definitions, #place_object_by_identity, #process_properties, #prop_set?, #property, #property_definitions, #property_details, #property_is_simple_object?, #push_root!, #require_property, #require_update, #retrieve_docstring, #sanitize, #set_map_dirty, #set_property, #set_property_item, #show_short_array, #strip_defaults!, #synchronize, #uncloned_property_definitions, #update_map, #validate, #validate_generic, #validate_properties, #validate_property, #validate_required, #version_allowed?, #weakref

Methods included from MintLogger::Utils::Common

#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send

Constructor Details

#initialize(opts = {}) ⇒ Listener

Returns a new instance of Listener.

Instance Method Details

#createvoid

This method returns an undefined value.

Create the listener This method creates a new listener definition in listener.ora file

#deletevoid

This method returns an undefined value.

Delete the listener This method removes a listener definition in listener.ora file

#exists?TrueClass | FalseClass

Does the listener exist in listener.ora?

Returns:

  • (TrueClass | FalseClass)

#reloadvoid

This method returns an undefined value.

Reload the listener Equivalent to the `lsnrctl reload` command

#restartvoid

This method returns an undefined value.

Restart the listener Equivalent to the `lsnrctl stop; lsnrctl start` command

#running?TrueClass | FalseClass

Is the listener running?

Returns:

  • (TrueClass | FalseClass)

#servicesString

What services are registered with the listener Equivalent to the `lsnrctl services` command

Returns:

#startvoid

This method returns an undefined value.

Start the listener and wait for services to be registered with it before returning Equivalent to the `lsnrctl start` command

#stateString

What is the state of the listener Equivalent to the `lsnrctl status` command

Returns:

#stopvoid

This method returns an undefined value.

Stop the listener Equivalent to the `lsnrctl stop` command

#usageString

Example usage of the class

Returns:

#wait_until_services_available(idatabase = nil) ⇒ void

This method returns an undefined value.

Wait for the listener to have database services registered with it