Class: Gemfire::LocatorInstances

Inherits:
Shared::MutableCollection show all
Defined in:
lib/vas/gemfire/locator_instances.rb

Overview

Used to enumerate, create, and delete locator instances.

Instance Attribute Summary

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods inherited from Shared::MutableCollection

#create_image

Methods inherited from Shared::Collection

#each, #reload

Constructor Details

#initialize(location, client) ⇒ LocatorInstances

Returns a new instance of LocatorInstances.



23
24
25
# File 'lib/vas/gemfire/locator_instances.rb', line 23

def initialize(location, client)
  super(location, client, 'locator-group-instances', LocatorInstance)
end

Instance Method Details

#create(installation, name, options = {}) ⇒ LocatorInstance

Creates a new locator instance

Parameters:

  • installation (Installation)

    the installation that the instance will use

  • name (String)

    the name of the instance

  • options (Hash) (defaults to: {})

    optional configuration for the instance

Options Hash (options):

  • :address (String)

    the property in a node’s metadata to use to determine the address of the network card on which the locator should listen. If omitted or nil the locator will listen on the address of the default network card

  • :peer (Object) — default: true

    true if the locator should act as a peer, otherwise false

  • :port (Integer) — default: 10334

    the port that the locator will listen on

  • :server (Object) — default: true

    true if the locator should act as a server, otherwise false

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/vas/gemfire/locator_instances.rb', line 41

def create(installation, name, options = {})
  payload = { :installation => installation.location, :name => name }

  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
  
  if options.has_key?(:address)
    payload[:address] = options[:address]
  end

  super(payload, 'locator-group-instance')
end