Package org.opennebula.client
Class Pool
java.lang.Object
org.opennebula.client.Pool
- Direct Known Subclasses:
AclPool,ClusterPool,DatastorePool,DocumentPool,GroupPool,HookPool,HostPool,ImagePool,MarketPlaceAppPool,MarketPlacePool,SecurityGroupPool,TemplatePool,UserPool,VdcPool,VirtualMachinePool,VirtualNetworkPool,VirtualNetworkTemplatePool,VirtualRouterPool,VMGroupPool,ZonePool
Represents a generic OpenNebula Pool in XML format
and provides the basic functionality to handle the Pool elements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAll resources in the poolprotected Clientprotected Stringstatic final intResources owned by the user's primary groupprotected Stringstatic final intConnected user's resourcesstatic final intConnected user's resources, and the ones in his groupprotected NodeListprotected static XPath -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract PoolElementThe factory method returns a suitable PoolElement object from an XML node.protected PoolElementgetById(int id) Returns the element with the given Id from the pool.intThe number of elements in the pool.protected OneResponseinfo()protected OneResponseinfo(int filter, int startId, int endId) protected static OneResponseInfo methodsprotected static OneResponseprotected OneResponseinfoAll()protected static OneResponseprotected OneResponseprotected static OneResponseprotected static OneResponseinfoGroupPrimary(Client client, String infoMethod) protected OneResponseinfoMine()protected static OneResponseitem(int index) Returns the indexth element in the pool.protected voidprocessInfo(OneResponse info) After a *pool.info call, this method builds the internal xml representation of the pool.protected static OneResponsexmlrpcInfo(Client client, String infoMethod, Object... args)
-
Field Details
-
client
-
elementName
-
infoMethod
-
poolElements
-
xpath
-
ALL
public static final int ALLAll resources in the pool- See Also:
-
MINE
public static final int MINEConnected user's resources- See Also:
-
MINE_GROUP
public static final int MINE_GROUPConnected user's resources, and the ones in his group- See Also:
-
GROUP
public static final int GROUPResources owned by the user's primary group- See Also:
-
-
Constructor Details
-
Pool
Protected constructor, to be called from subclasses.- Parameters:
elementName- Name of the PoolElement's xml elementclient- XML-RPC client which will handle callsinfoMethod- XML-RPC info method for the subclass Pool
-
-
Method Details
-
factory
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
-
info
Info methods -
info
protected static OneResponse info(Client client, String infoMethod, int filter, int startId, int endId) -
infoAll
-
infoMine
-
infoGroup
-
infoGroupPrimary
-
xmlrpcInfo
-
info
-
infoAll
-
infoMine
-
infoGroup
-
info
-
processInfo
After a *pool.info call, this method builds the internal xml representation of the pool.- Parameters:
info- The XML-RPC *pool.info response
-
item
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.
-
getById
Returns the element with the given Id from the pool. If it is not found, then returns null. The methodinfo()must be called before.- Parameters:
id- of the element to retrieve- Returns:
- The element with the given Id, or null if it was not found.
-
getLength
public int getLength()The number of elements in the pool.- Returns:
- The number of elements in the pool.
-