Class: JrubyWhirr::ClusterController

Inherits:
Object
  • Object
show all
Defined in:
lib/jruby_whirr/cluster_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster_spec) ⇒ ClusterController

Returns a new instance of ClusterController.



12
13
14
15
16
# File 'lib/jruby_whirr/cluster_controller.rb', line 12

def initialize (cluster_spec)
	@spec = cluster_spec
	factory = ClusterControllerFactory.new;
	@controller = factory.create(cluster_spec.get_service_name)
end

Instance Attribute Details

#clusterObject

Returns the value of attribute cluster.



10
11
12
# File 'lib/jruby_whirr/cluster_controller.rb', line 10

def cluster
  @cluster
end

#controllerObject

Returns the value of attribute controller.



10
11
12
# File 'lib/jruby_whirr/cluster_controller.rb', line 10

def controller
  @controller
end

#specObject

Returns the value of attribute spec.



10
11
12
# File 'lib/jruby_whirr/cluster_controller.rb', line 10

def spec
  @spec
end

Instance Method Details

#destroy_cluster(spec) ⇒ Object



22
23
24
# File 'lib/jruby_whirr/cluster_controller.rb', line 22

def destroy_cluster(spec)
	@controller.destroyCluster(spec)
end

#launch_clusterObject



18
19
20
# File 'lib/jruby_whirr/cluster_controller.rb', line 18

def launch_cluster()
	@cluster = @controller.launchCluster(@spec.cluster_spec)
end