Class: Redfish::Context
- Inherits:
-
Object
- Object
- Redfish::Context
- Defined in:
- lib/redfish/context.rb
Instance Attribute Summary collapse
-
#domain_admin_port ⇒ Object
readonly
The port on which the management application is bound.
-
#domain_name ⇒ Object
readonly
The name of the domain.
-
#domain_password_file ⇒ Object
readonly
The password file used when connecting to glassfish.
-
#domain_secure ⇒ Object
readonly
If true use SSL when communicating with the domain for administration.
-
#domain_username ⇒ Object
readonly
The username to use when communicating with the domain.
-
#install_dir ⇒ Object
readonly
The directory in which glassfish has been installed.
-
#system_group ⇒ Object
readonly
The group that the asadmin command executes as.
-
#system_user ⇒ Object
readonly
The user that the asadmin command executes as.
Instance Method Summary collapse
- #cache_properties(properties) ⇒ Object
-
#echo? ⇒ Boolean
If true, echo commands supplied to asadmin.
- #exec(asadmin_command, args, options = {}) ⇒ Object
-
#initialize(executor, install_dir, domain_name, domain_admin_port, domain_secure, domain_username, domain_password_file, options = {}) ⇒ Context
constructor
A new instance of Context.
- #property_cache ⇒ Object
- #property_cache? ⇒ Boolean
- #remove_property_cache ⇒ Object
-
#terse? ⇒ Boolean
Use terse output from the underlying asadmin.
Constructor Details
#initialize(executor, install_dir, domain_name, domain_admin_port, domain_secure, domain_username, domain_password_file, options = {}) ⇒ Context
Returns a new instance of Context.
32 33 34 35 36 37 38 39 40 |
# File 'lib/redfish/context.rb', line 32 def initialize(executor, install_dir, domain_name, domain_admin_port, domain_secure, domain_username, domain_password_file, = {}) @executor, @install_dir, @domain_name, @domain_admin_port, @domain_secure, @domain_username, @domain_password_file = executor, install_dir, domain_name, domain_admin_port, domain_secure, domain_username, domain_password_file @echo = [:echo].nil? ? false : !![:echo] @terse = [:terse].nil? ? false : !![:terse] @system_user = [:system_user] @system_group = [:system_group] @property_cache = nil end |
Instance Attribute Details
#domain_admin_port ⇒ Object (readonly)
The port on which the management application is bound.
9 10 11 |
# File 'lib/redfish/context.rb', line 9 def domain_admin_port @domain_admin_port end |
#domain_name ⇒ Object (readonly)
The name of the domain.
7 8 9 |
# File 'lib/redfish/context.rb', line 7 def domain_name @domain_name end |
#domain_password_file ⇒ Object (readonly)
The password file used when connecting to glassfish.
15 16 17 |
# File 'lib/redfish/context.rb', line 15 def domain_password_file @domain_password_file end |
#domain_secure ⇒ Object (readonly)
If true use SSL when communicating with the domain for administration. Assumes the domain is in secure mode.
11 12 13 |
# File 'lib/redfish/context.rb', line 11 def domain_secure @domain_secure end |
#domain_username ⇒ Object (readonly)
The username to use when communicating with the domain.
13 14 15 |
# File 'lib/redfish/context.rb', line 13 def domain_username @domain_username end |
#install_dir ⇒ Object (readonly)
The directory in which glassfish has been installed.
4 5 6 |
# File 'lib/redfish/context.rb', line 4 def install_dir @install_dir end |
#system_group ⇒ Object (readonly)
The group that the asadmin command executes as.
30 31 32 |
# File 'lib/redfish/context.rb', line 30 def system_group @system_group end |
#system_user ⇒ Object (readonly)
The user that the asadmin command executes as.
28 29 30 |
# File 'lib/redfish/context.rb', line 28 def system_user @system_user end |
Instance Method Details
#cache_properties(properties) ⇒ Object
51 52 53 54 |
# File 'lib/redfish/context.rb', line 51 def cache_properties(properties) raise 'Property cache already defined' if property_cache? @property_cache = PropertyCache.new(properties) end |
#echo? ⇒ Boolean
If true, echo commands supplied to asadmin.
23 24 25 |
# File 'lib/redfish/context.rb', line 23 def echo? !!@echo end |
#exec(asadmin_command, args, options = {}) ⇒ Object
61 62 63 |
# File 'lib/redfish/context.rb', line 61 def exec(asadmin_command, args, = {}) @executor.exec(self, asadmin_command, args, ) end |
#property_cache ⇒ Object
46 47 48 49 |
# File 'lib/redfish/context.rb', line 46 def property_cache raise 'Property cache not defined' unless property_cache? @property_cache end |
#property_cache? ⇒ Boolean
42 43 44 |
# File 'lib/redfish/context.rb', line 42 def property_cache? !@property_cache.nil? end |
#remove_property_cache ⇒ Object
56 57 58 59 |
# File 'lib/redfish/context.rb', line 56 def remove_property_cache raise 'No property cache to remove' unless property_cache? @property_cache = nil end |
#terse? ⇒ Boolean
Use terse output from the underlying asadmin.
18 19 20 |
# File 'lib/redfish/context.rb', line 18 def terse? !!@terse end |