org.glassfish.virtualization.spi
Interface Machine


public interface Machine

Represents a machine

Author:
Jerome Dochez

Nested Class Summary
static class Machine.State
           
 
Method Summary
 StoragePool addStoragePool(String name, long capacity)
           
 VirtualMachine byName(String name)
           
 PhasedFuture<AllocationPhase,VirtualMachine> create(TemplateInstance template, VirtualCluster cluster, EventSource<AllocationPhase> source)
          Allocate a new Virtual Machine on this machine.
<T> T
execute(MachineOperations<T> operations)
           
 MachineConfig getConfig()
           
 String getIpAddress()
           
 String getName()
           
 PhysicalServerPool getServerPool()
           
 Machine.State getState()
           
 Map<String,? extends StoragePool> getStoragePools()
           
 VirtUser getUser()
           
 Collection<? extends VirtualMachine> getVMs()
           
 void install(TemplateInstance template)
           
 boolean isUp()
           
 void sleep()
           
 

Method Detail

getConfig

MachineConfig getConfig()

getName

String getName()

getIpAddress

String getIpAddress()

getServerPool

PhysicalServerPool getServerPool()

getState

Machine.State getState()

getUser

VirtUser getUser()

execute

<T> T execute(MachineOperations<T> operations)
          throws IOException
Throws:
IOException

isUp

boolean isUp()

sleep

void sleep()
           throws IOException,
                  InterruptedException
Throws:
IOException
InterruptedException

getVMs

Collection<? extends VirtualMachine> getVMs()
                                            throws VirtException
Throws:
VirtException

addStoragePool

StoragePool addStoragePool(String name,
                           long capacity)
                           throws VirtException
Throws:
VirtException

getStoragePools

Map<String,? extends StoragePool> getStoragePools()
                                                  throws VirtException
Throws:
VirtException

byName

VirtualMachine byName(String name)
                      throws VirtException
Throws:
VirtException

create

PhasedFuture<AllocationPhase,VirtualMachine> create(TemplateInstance template,
                                                    VirtualCluster cluster,
                                                    EventSource<AllocationPhase> source)
                                                    throws VirtException,
                                                           IOException
Allocate a new Virtual Machine on this machine.

Parameters:
template - the template to use for the virtual machine
cluster - the virtual cluster in which the virtual machine must be added using the VirtualCluster#add(TemplateInstance, VirtualMachine) method
source - the event notification mechanism
Returns:
a PhasedFuture to obtain events and the virtual machine once ready
Throws:
VirtException - if the virtualization layer cannot spawn the virtual machine
IOException - with any file handling.

install

void install(TemplateInstance template)
             throws IOException
Throws:
IOException


Copyright © 2012. All Rights Reserved.