OpenNebula
Cloud API

org.opennebula.client
Class Pool

java.lang.Object
  extended by org.opennebula.client.Pool
Direct Known Subclasses:
HostPool, UserPool, VirtualMachinePool, VirtualNetworkPool

public abstract class Pool
extends java.lang.Object

Represents a generic OpenNebula Pool in XML format and provides the basic functionality to handle the Pool elements.


Field Summary
protected  Client client
           
protected  java.lang.String elementName
           
protected  org.w3c.dom.NodeList poolElements
           
 
Constructor Summary
protected Pool(java.lang.String elementName, Client client)
          Sets the Pool attributes.
 
Method Summary
abstract  PoolElement factory(org.w3c.dom.Node node)
          The factory method returns a suitable PoolElement object from an XML node.
 int getLength()
          The number of elements in the pool.
 PoolElement item(int index)
          Returns the indexth element in the pool.
 void processInfo(OneResponse info)
          After a *pool.info call, this method builds the internal xml representation of the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

protected Client client

elementName

protected java.lang.String elementName

poolElements

protected org.w3c.dom.NodeList poolElements
Constructor Detail

Pool

protected Pool(java.lang.String elementName,
               Client client)
Sets the Pool attributes.

Parameters:
elementName - Name of the PoolElement's xml element
client - XML-RPC client which will handle calls
Method Detail

factory

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

Parameters:
node - XML Dom node to build the PoolElement from
Returns:
The corresponding PoolElement

processInfo

public void processInfo(OneResponse info)
After a *pool.info call, this method builds the internal xml representation of the pool.

Parameters:
info - The XML-RPC *pool.info response

item

public PoolElement item(int index)
Returns the indexth element in the pool. If index is greater than or equal to the number of elements in the pool, this returns null.

Parameters:
index - Index of the element.
Returns:
The element at the indexth position in the pool, or null if that is not a valid index.

getLength

public int getLength()
The number of elements in the pool.

Returns:
The number of elements in the pool.

OpenNebula
Cloud API

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