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
Attributes inherited from Shared::Instance
#group, #live_configurations, #name, #pending_configurations
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ LocatorInstance
constructor
A new instance of LocatorInstance.
-
#peer ⇒ Boolean
true
if the locator will act as a peer,false
if it will not. -
#port ⇒ Integer
The port that the locator will listen on.
-
#server ⇒ Boolean
true
if the locator will act as a server,false
if it will not. -
#update(options) ⇒ Object
Updates the instance using the supplied
options
.
Methods inherited from Shared::Instance
#installation, #node_instances, #to_s
Methods inherited from Shared::StateResource
Constructor Details
#initialize(location, client) ⇒ LocatorInstance
Returns a new instance of LocatorInstance.
59 60 61 |
# File 'lib/vas/gemfire/locator_instances.rb', line 59 def initialize(location, client) super(location, client, Group, Installation, LocatorLiveConfigurations, LocatorPendingConfigurations, LocatorNodeInstance, 'locator-node-instance') end |
Instance Method Details
#peer ⇒ Boolean
Returns true
if the locator will act as a peer, false
if it will not.
103 104 105 |
# File 'lib/vas/gemfire/locator_instances.rb', line 103 def peer client.get(location)['peer'] end |
#port ⇒ Integer
Returns the port that the locator will listen on.
98 99 100 |
# File 'lib/vas/gemfire/locator_instances.rb', line 98 def port client.get(location)['port'] end |
#server ⇒ Boolean
Returns true
if the locator will act as a server, false
if it will not.
108 109 110 |
# File 'lib/vas/gemfire/locator_instances.rb', line 108 def server client.get(location)['server'] end |
#update(options) ⇒ Object
Updates the instance using the supplied options
.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/vas/gemfire/locator_instances.rb', line 75 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 client.post(location, payload) end |