OpenNebula
Cloud API

org.opennebula.client.vm
Class VirtualMachinePool

java.lang.Object
  extended by org.opennebula.client.Pool
      extended by org.opennebula.client.vm.VirtualMachinePool
All Implemented Interfaces:
java.lang.Iterable<VirtualMachine>

public class VirtualMachinePool
extends Pool
implements java.lang.Iterable<VirtualMachine>

This class represents an OpenNebula VM pool. It also offers static XML-RPC call wrappers.


Field Summary
 
Fields inherited from class org.opennebula.client.Pool
client, elementName, poolElements
 
Constructor Summary
VirtualMachinePool(Client client)
          Creates a new VM pool with the default filter flag value set to 0 (VMs belonging to user with UID 0)
VirtualMachinePool(Client client, int filter)
          Creates a new VM pool.
 
Method Summary
 PoolElement factory(org.w3c.dom.Node node)
          The factory method returns a suitable PoolElement object from an XML node.
 OneResponse info()
          Loads the xml representation of all or part of the VMs in the pool.
static OneResponse info(Client client, int filter)
          Retrieves all or part of the VMs in the pool.
 java.util.Iterator<VirtualMachine> iterator()
           
 
Methods inherited from class org.opennebula.client.Pool
getLength, item, processInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualMachinePool

public VirtualMachinePool(Client client)
Creates a new VM pool with the default filter flag value set to 0 (VMs belonging to user with UID 0)

Parameters:
client - XML-RPC Client.
See Also:
VirtualMachinePool(Client, int)

VirtualMachinePool

public VirtualMachinePool(Client client,
                          int filter)
Creates a new VM pool.

Parameters:
client - XML-RPC Client.
filter - Filter flag used by default in the method info(). Possible values:
  • <= -2: All VMs
  • -1: Connected user's VMs
  • >= 0: UID User's VMs
Method Detail

factory

public PoolElement factory(org.w3c.dom.Node node)
Description copied from class: Pool
The factory method returns a suitable PoolElement object from an XML node. Each Pool must implement the corresponding factory method.

Specified by:
factory in class Pool
Parameters:
node - XML Dom node to build the PoolElement from
Returns:
The corresponding PoolElement

info

public static OneResponse info(Client client,
                               int filter)
Retrieves all or part of the VMs in the pool.

Parameters:
client - XML-RPC Client.
filter - Filter flag. Possible values:
  • <= -2: All VMs
  • -1: Connected user's VMs
  • >= 0: UID User's VMs
Returns:
If successful the message contains the string with the information returned by OpenNebula.

info

public OneResponse info()
Loads the xml representation of all or part of the VMs in the pool. The filter used is the one set in the constructor.

Returns:
If successful the message contains the string with the information returned by OpenNebula.
See Also:
info(Client, int)

iterator

public java.util.Iterator<VirtualMachine> iterator()
Specified by:
iterator in interface java.lang.Iterable<VirtualMachine>

OpenNebula
Cloud API

Visit OpenNebula.org
Copyright 2002-2010 © OpenNebula Project Leads (OpenNebula.org).