public abstract class Pool
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ALL
All resources in the pool
|
protected Client |
client |
protected java.lang.String |
elementName |
protected java.lang.String |
infoMethod |
static int |
MINE
Connected user's resources
|
static int |
MINE_GROUP
Connected user's resources, and the ones in his group
|
protected org.w3c.dom.NodeList |
poolElements |
Modifier | Constructor and Description |
---|---|
protected |
Pool(java.lang.String elementName,
Client client,
java.lang.String infoMethod)
Protected constructor, to be called from subclasses.
|
Modifier and Type | Method and Description |
---|---|
abstract PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
protected PoolElement |
getById(int id)
Returns the element with the given Id from the pool.
|
int |
getLength()
The number of elements in the pool.
|
protected OneResponse |
info() |
protected static OneResponse |
info(Client client,
java.lang.String infoMethod)
Info methods
|
protected static OneResponse |
info(Client client,
java.lang.String infoMethod,
int filter,
int startId,
int endId) |
protected OneResponse |
info(int filter,
int startId,
int endId) |
protected OneResponse |
infoAll() |
protected static OneResponse |
infoAll(Client client,
java.lang.String infoMethod) |
protected OneResponse |
infoGroup() |
protected static OneResponse |
infoGroup(Client client,
java.lang.String infoMethod) |
protected OneResponse |
infoMine() |
protected static OneResponse |
infoMine(Client client,
java.lang.String infoMethod) |
PoolElement |
item(int index)
Returns the indexth element in the pool.
|
protected void |
processInfo(OneResponse info)
After a *pool.info call, this method builds the internal xml
representation of the pool.
|
protected static OneResponse |
xmlrpcInfo(Client client,
java.lang.String infoMethod,
java.lang.Object... args) |
protected Client client
protected java.lang.String elementName
protected java.lang.String infoMethod
protected org.w3c.dom.NodeList poolElements
public static final int ALL
public static final int MINE
public static final int MINE_GROUP
protected Pool(java.lang.String elementName, Client client, java.lang.String infoMethod)
elementName
- Name of the PoolElement's xml elementclient
- XML-RPC client which will handle callsinfoMethod
- XML-RPC info method for the subclass Poolpublic abstract PoolElement factory(org.w3c.dom.Node node)
node
- XML Dom node to build the PoolElement fromprotected static OneResponse info(Client client, java.lang.String infoMethod)
protected static OneResponse info(Client client, java.lang.String infoMethod, int filter, int startId, int endId)
protected static OneResponse infoAll(Client client, java.lang.String infoMethod)
protected static OneResponse infoMine(Client client, java.lang.String infoMethod)
protected static OneResponse infoGroup(Client client, java.lang.String infoMethod)
protected static OneResponse xmlrpcInfo(Client client, java.lang.String infoMethod, java.lang.Object... args)
protected OneResponse info()
protected OneResponse infoAll()
protected OneResponse infoMine()
protected OneResponse infoGroup()
protected OneResponse info(int filter, int startId, int endId)
protected void processInfo(OneResponse info)
info
- The XML-RPC *pool.info responsepublic PoolElement item(int index)
index
- Index of the element.protected PoolElement getById(int id)
info()
must be called before.id
- of the element to retrievepublic int getLength()
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.