Class: Gemfire::LocatorInstance
- Inherits:
-
Shared::Instance
- Object
- Shared::Resource
- Shared::StateResource
- Shared::Instance
- Gemfire::LocatorInstance
- Defined in:
- lib/vas/gemfire/locator_instances.rb
Overview
A locator instance
Instance Attribute Summary collapse
-
#address ⇒ String?
readonly
The property in a node’s metadata used to determine the address of the network card on which the locator will listen.
-
#peer ⇒ Boolean
readonly
true
if the locator will act as a peer,false
if it will not. -
#port ⇒ Integer
readonly
The port that the locator will listen on.
-
#server ⇒ Boolean
readonly
true
if the locator will act as a server,false
if it will not.
Attributes inherited from Shared::Instance
Attributes included from Shared::Deletable
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ LocatorInstance
constructor
A new instance of LocatorInstance.
-
#reload ⇒ void
Reloads the instance’s details from the server.
-
#to_s ⇒ String
A string representation of the instance.
-
#update(options) ⇒ Object
Updates the instance using the supplied
options
.
Methods inherited from Shared::Instance
#group, #installation, #live_configurations, #node_instances, #pending_configurations, #start, #stop
Methods included from Shared::Deletable
Methods inherited from Shared::StateResource
Constructor Details
#initialize(location, client) ⇒ LocatorInstance
Returns a new instance of LocatorInstance.
83 84 85 |
# File 'lib/vas/gemfire/locator_instances.rb', line 83 def initialize(location, client) super(location, client, Group, Installation, LocatorLiveConfigurations, LocatorPendingConfigurations, LocatorNodeInstance, 'locator-node-instance') end |
Instance Attribute Details
#address ⇒ String? (readonly)
Returns the property in a node’s metadata used to determine the address of the network card on which the locator will listen. If nil the locator will listen on the address of the default network card.
71 72 73 |
# File 'lib/vas/gemfire/locator_instances.rb', line 71 def address @address end |
#peer ⇒ Boolean (readonly)
Returns true
if the locator will act as a peer, false
if it will not.
77 78 79 |
# File 'lib/vas/gemfire/locator_instances.rb', line 77 def peer @peer end |
#port ⇒ Integer (readonly)
Returns the port that the locator will listen on.
74 75 76 |
# File 'lib/vas/gemfire/locator_instances.rb', line 74 def port @port end |
#server ⇒ Boolean (readonly)
Returns true
if the locator will act as a server, false
if it will not.
80 81 82 |
# File 'lib/vas/gemfire/locator_instances.rb', line 80 def server @server end |
Instance Method Details
#reload ⇒ void
This method returns an undefined value.
Reloads the instance’s details from the server
133 134 135 136 137 138 139 |
# File 'lib/vas/gemfire/locator_instances.rb', line 133 def reload super @port = details['port'] @peer = details['peer'] @server = details['server'] @address = details['address'] end |
#to_s ⇒ String
Returns a string representation of the instance.
142 143 144 |
# File 'lib/vas/gemfire/locator_instances.rb', line 142 def to_s "#<#{self.class} name=#{name} address='#@address' port='#@port' peer='#@peer' server='#@server'>" end |
#update(options) ⇒ Object
Updates the instance using the supplied options
.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/vas/gemfire/locator_instances.rb', line 104 def update() payload = {} if .has_key?(:installation) payload[:installation] = [:installation].location end if .has_key?(:peer) payload[:peer] = [:peer] end if .has_key?(:port) payload[:port] = [:port] end if .has_key?(:server) payload[:server] = [:server] end if .has_key?(:address) payload[:address] = [:address] end client.post(location, payload) reload end |