Class: Shared::NodeConfiguration Abstract
- Defined in:
- lib/vas/shared/node_configuration.rb
Overview
A configuration file in a node instance
Direct Known Subclasses
Gemfire::AgentNodeLiveConfiguration, Gemfire::CacheServerNodeLiveConfiguration, Gemfire::LocatorNodeLiveConfiguration, RabbitMq::NodeLiveConfiguration, Sqlfire::AgentNodeLiveConfiguration, Sqlfire::LocatorNodeLiveConfiguration, Sqlfire::ServerNodeLiveConfiguration, TcServer::NodeLiveConfiguration, WebServer::NodeLiveConfiguration
Instance Attribute Summary collapse
-
#path ⇒ String
readonly
The configuration’s path.
-
#size ⇒ Integer
readonly
The configuration’s size.
Attributes inherited from Resource
Instance Method Summary collapse
-
#content {|chunk| ... } ⇒ void
Retrieves the configuration’s content and passes it to the block.
-
#group_configuration ⇒ LiveConfiguration
The node configuration’s group configuration.
-
#initialize(location, client, instance_type, instance_class, group_configuration_class) ⇒ NodeConfiguration
constructor
A new instance of NodeConfiguration.
-
#instance ⇒ NodeInstance
The node instance that owns the configuration.
-
#reload ⇒ void
Reloads the configuration’s details from the server.
-
#to_s ⇒ String
A string representation of the configuration.
Constructor Details
#initialize(location, client, instance_type, instance_class, group_configuration_class) ⇒ NodeConfiguration
Returns a new instance of NodeConfiguration.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vas/shared/node_configuration.rb', line 29 def initialize(location, client, instance_type, instance_class, group_configuration_class) super(location, client) @instance_class = instance_class @group_configuration_class = group_configuration_class @instance_location = Util::LinkUtils.get_link_href(details, instance_type) @group_configuration_location = Util::LinkUtils.get_link_href(details, 'group-live-configuration') @content_location = Util::LinkUtils.get_link_href(details, 'content') @path = details['path'] end |
Instance Attribute Details
#path ⇒ String (readonly)
Returns the configuration’s path.
23 24 25 |
# File 'lib/vas/shared/node_configuration.rb', line 23 def path @path end |
#size ⇒ Integer (readonly)
Returns the configuration’s size.
26 27 28 |
# File 'lib/vas/shared/node_configuration.rb', line 26 def size @size end |
Instance Method Details
#content {|chunk| ... } ⇒ void
This method returns an undefined value.
Retrieves the configuration’s content and passes it to the block
54 55 56 |
# File 'lib/vas/shared/node_configuration.rb', line 54 def content(&block) client.get_stream(@content_location, &block) end |
#group_configuration ⇒ LiveConfiguration
Returns the node configuration’s group configuration.
59 60 61 |
# File 'lib/vas/shared/node_configuration.rb', line 59 def group_configuration @group_configuration ||= @group_configuration_class.new(@group_configuration_location, client) end |
#instance ⇒ NodeInstance
Returns the node instance that owns the configuration.
64 65 66 |
# File 'lib/vas/shared/node_configuration.rb', line 64 def instance @instance ||= @instance_class.new(@instance_location, client) end |
#reload ⇒ void
This method returns an undefined value.
Reloads the configuration’s details from the server
44 45 46 47 |
# File 'lib/vas/shared/node_configuration.rb', line 44 def reload super @size = details['size'] end |
#to_s ⇒ String
Returns a string representation of the configuration.
69 70 71 |
# File 'lib/vas/shared/node_configuration.rb', line 69 def to_s "#<#{self.class} name='#@path' size=#@size>" end |