public abstract class DocumentPool extends Pool
This class represents an OpenNebula Document pool.
Documents are generic objects. You can dynamically create new Pools in OpenNebula, creating subclasses with different TYPE values.Document
public class GenericObjAPool extends DocumentPool implements Iterable<GenericObjA>
{
private static final int TYPE = 200;
protected int type()
{
return TYPE;
}
public GenericObjAPool(Client client)
{
super(client);
}
public GenericObjAPool(Client client, int filter)
{
super(client, filter);
}
public GenericObjA factory(Node node)
{
return new GenericObjA(node, client);
}
public Iterator<GenericObjA> iterator()
{
AbstractList<GenericObjA> ab = new AbstractList<GenericObjA>()
{
public int size()
{
return getLength();
}
public GenericObjA get(int index)
{
return (GenericObjA) item(index);
}
};
return ab.iterator();
}
}
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
DocumentPool(Client client)
Creates a new Document pool with the default filter flag value
set to
Pool.MINE_GROUP (Document belonging to the connected user,
and the ones in his group) |
DocumentPool(Client client,
int filter)
Creates a new Document pool.
|
Modifier and Type | Method and Description |
---|---|
Document |
getById(int id)
Returns the Document with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of all or part of the
Documents in the pool.
|
OneResponse |
info(int filter,
int startId,
int endId)
Retrieves all or part of the Documents in the pool.
|
OneResponse |
infoAll()
Loads the xml representation of all the Documents in the pool.
|
OneResponse |
infoGroup()
Loads the xml representation of all the connected user's Documents and
the ones in his group.
|
OneResponse |
infoMine()
Loads the xml representation of all the connected user's Documents.
|
protected abstract int |
type() |
public DocumentPool(Client client)
Pool.MINE_GROUP
(Document belonging to the connected user,
and the ones in his group)client
- XML-RPC Client.DocumentPool(Client, int)
public DocumentPool(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use by default in the method
info()
. Possible values:
Pool.ALL
: All DocumentsPool.MINE
: Connected user's DocumentsPool.MINE_GROUP
: Connected user's Documents, and the ones in
his groupprotected abstract int type()
public OneResponse info()
public OneResponse infoAll()
public OneResponse infoMine()
public OneResponse infoGroup()
public OneResponse info(int filter, int startId, int endId)
info
in class Pool
filter
- Filter flag to use. Possible values:
Pool.ALL
: All DocumentsPool.MINE
: Connected user's DocumentsPool.MINE_GROUP
: Connected user's Documents, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrieveVisit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.