Class: Gemfire::LocatorInstance

Inherits:
Shared::Instance show all
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

#location, #security

Instance Method Summary collapse

Methods inherited from Shared::Instance

#installation, #to_s

Methods inherited from Shared::StateResource

#start, #state, #stop

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

#peerObject

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

#portObject

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

#serverObject

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(options)
  payload = {}

  if options.has_key?(:installation)
    payload[:installation] = options[:installation].location
  end

  if options.has_key?(:peer)
    payload[:peer] = options[:peer]
  end

  if options.has_key?(:port)
    payload[:port] = options[:port]
  end

  if options.has_key?(:server)
    payload[:server] = options[:server]
  end

  client.post(location, payload)
end