org.glassfish.virtualization.spi
Interface ServerPool

All Known Subinterfaces:
PhysicalServerPool

public interface ServerPool

Abstract a set of servers than can be used to provide VirtualMachine

Author:
Jerome Dochez

Method Summary
 PhasedFuture<AllocationPhase,VirtualMachine> allocate(TemplateInstance template, VirtualCluster cluster, EventSource<AllocationPhase> source)
          Allocates number of virtual machines on any machine belonging to this server pool, each virtual machine should be based on the provided template.
 ServerPoolConfig getConfig()
          Returns the configuration for this server pool.
 String getName()
          Returns this pool's name.
 Collection<VirtualMachine> getVMs()
          Returns all allocated virtual machine in this server pool
 void install(TemplateInstance template)
           
 VirtualMachine vmByName(String name)
          Returns an allocated virtual machine in this server pool using its name.
 

Method Detail

getConfig

ServerPoolConfig getConfig()
Returns the configuration for this server pool.

Returns:
the server pool's configuration.

getName

String getName()
Returns this pool's name.

Returns:
this pool's name

getVMs

Collection<VirtualMachine> getVMs()
                                  throws VirtException
Returns all allocated virtual machine in this server pool

Returns:
the list of allocated virtual machines
Throws:
VirtException

vmByName

VirtualMachine vmByName(String name)
                        throws VirtException
Returns an allocated virtual machine in this server pool using its name.

Parameters:
name - virtual machine name
Returns:
virtual machine instance if found or null otherwise.
Throws:
VirtException - if the vm cannot be obtained

allocate

PhasedFuture<AllocationPhase,VirtualMachine> allocate(TemplateInstance template,
                                                      VirtualCluster cluster,
                                                      EventSource<AllocationPhase> source)
                                                      throws VirtException
Allocates number of virtual machines on any machine belonging to this server pool, each virtual machine should be based on the provided template.

Parameters:
template - template for the virtual machines
cluster - the virtual cluster in which the virtual machine must be added using the VirtualCluster#add(TemplateInstance, VirtualMachine) method
Returns:
Listenable future for the VirtualMachine instance
Throws:
VirtException - when the virtual machine creation failed.

install

void install(TemplateInstance template)
             throws IOException
Throws:
IOException


Copyright © 2012. All Rights Reserved.