OpenNebula
Cloud API

org.opennebula.client.datastore
Class DatastorePool

java.lang.Object
  extended by org.opennebula.client.Pool
      extended by org.opennebula.client.datastore.DatastorePool
All Implemented Interfaces:
java.lang.Iterable<Datastore>

public class DatastorePool
extends Pool
implements java.lang.Iterable<Datastore>

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


Field Summary
 
Fields inherited from class org.opennebula.client.Pool
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
 
Constructor Summary
DatastorePool(Client client)
          Creates a new datastore pool
 
Method Summary
 PoolElement factory(org.w3c.dom.Node node)
          The factory method returns a suitable PoolElement object from an XML node.
 Datastore getById(int id)
          Returns the Datastore with the given Id from the pool.
 OneResponse info()
          Loads the xml representation of the datastore pool.
static OneResponse info(Client client)
          Retrieves all the datastores in the pool.
 java.util.Iterator<Datastore> iterator()
           
 
Methods inherited from class org.opennebula.client.Pool
getLength, info, info, info, infoAll, infoAll, infoGroup, infoGroup, infoMine, infoMine, item, processInfo, xmlrpcInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatastorePool

public DatastorePool(Client client)
Creates a new datastore pool

Parameters:
client - XML-RPC Client.
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)
Retrieves all the datastores in the pool.

Parameters:
client - XML-RPC Client.
Returns:
If successful the message contains the string with the information returned by OpenNebula.

info

public OneResponse info()
Loads the xml representation of the datastore pool.

Overrides:
info in class Pool
See Also:
info(Client)

iterator

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

getById

public Datastore getById(int id)
Returns the Datastore with the given Id from the pool. If it is not found, then returns null. The method info() must be called before.

Overrides:
getById in class Pool
Parameters:
id - of the Datastore to retrieve
Returns:
The Image with the given Id, or null if it was not found.

OpenNebula
Cloud API

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