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, #node_instances, #pending_configurations
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ LocatorInstance
constructor
:nodoc:.
-
#peer ⇒ Object
true
if the locator will act as a peer,false
if it will not. -
#port ⇒ Object
The port that the locator will listen on.
-
#server ⇒ Object
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
Methods inherited from Shared::StateResource
Constructor Details
#initialize(location, client) ⇒ LocatorInstance
:nodoc:
58 59 60 |
# File 'lib/vas/gemfire/locator_instances.rb', line 58 def initialize(location, client) #:nodoc: super(location, client, Group, Installation, LocatorLiveConfigurations, LocatorPendingConfigurations, LocatorNodeInstance, 'locator-node-instance') end |
Instance Method Details
#peer ⇒ Object
true
if the locator will act as a peer, false
if it will not
98 99 100 |
# File 'lib/vas/gemfire/locator_instances.rb', line 98 def peer client.get(location)['peer'] end |
#port ⇒ Object
The port that the locator will listen on
93 94 95 |
# File 'lib/vas/gemfire/locator_instances.rb', line 93 def port client.get(location)['port'] end |
#server ⇒ Object
true
if the locator will act as a server, false
if it will not
103 104 105 |
# File 'lib/vas/gemfire/locator_instances.rb', line 103 def server client.get(location)['server'] end |
#update(options) ⇒ Object
Updates the instance using the supplied options
.
Recognized options are:
- installation
-
The installation to use when running the locator instance. If omitted or nil, the installation configuration will not be changed
- peer
-
Whether or not the locator will act as a peer. If omitted, the configuration will not be changed
- port
-
The port on which the locator will listen. If omitted, the port configuration will not be changed
- server
-
Whether or not the locator will act as a server. If omitted, the configuration will not be changed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/vas/gemfire/locator_instances.rb', line 70 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 |