Package org.opennebula.client.vrouter
Class VirtualRouterPool
- java.lang.Object
-
- org.opennebula.client.Pool
-
- org.opennebula.client.vrouter.VirtualRouterPool
-
- All Implemented Interfaces:
java.lang.Iterable<VirtualRouter>
public class VirtualRouterPool extends Pool implements java.lang.Iterable<VirtualRouter>
This class represents an OpenNebula VirtualRouter pool. It also offers static XML-RPC call wrappers.
-
-
Field Summary
-
Fields inherited from class org.opennebula.client.Pool
ALL, client, elementName, GROUP, infoMethod, MINE, MINE_GROUP, poolElements, xpath
-
-
Constructor Summary
Constructors Constructor Description VirtualRouterPool(Client client)Creates a new VirtualRouter pool with the default filter flag value set toPool.MINE_GROUP(VirtualRouter belonging to the connected user, and the ones in his group)VirtualRouterPool(Client client, int filter)Creates a new VirtualRouter pool.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PoolElementfactory(org.w3c.dom.Node node)The factory method returns a suitable PoolElement object from an XML node.VirtualRoutergetById(int id)Returns the VirtualRouter with the given Id from the pool.OneResponseinfo()Loads the xml representation of all or part of the VirtualRouters in the pool.OneResponseinfo(int filter, int startId, int endId)Retrieves all or part of the VirtualRouters in the pool.static OneResponseinfo(Client client, int filter)Retrieves all or part of the VirtualRouters in the pool.static OneResponseinfo(Client client, int filter, int startId, int endId)Retrieves all or part of the VirtualRouters in the pool.OneResponseinfoAll()Loads the xml representation of all the VirtualRouters in the pool.static OneResponseinfoAll(Client client)Retrieves all the VirtualRouters in the pool.OneResponseinfoGroup()Loads the xml representation of all the connected user's VirtualRouters and the ones in his group.static OneResponseinfoGroup(Client client)Retrieves all the connected user's VirtualRouters and the ones in his group.OneResponseinfoMine()Loads the xml representation of all the connected user's VirtualRouters.static OneResponseinfoMine(Client client)Retrieves all the connected user's VirtualRouters.java.util.Iterator<VirtualRouter>iterator()-
Methods inherited from class org.opennebula.client.Pool
getLength, info, info, infoAll, infoGroup, infoGroupPrimary, infoMine, item, processInfo, xmlrpcInfo
-
-
-
-
Constructor Detail
-
VirtualRouterPool
public VirtualRouterPool(Client client)
Creates a new VirtualRouter pool with the default filter flag value set toPool.MINE_GROUP(VirtualRouter belonging to the connected user, and the ones in his group)- Parameters:
client- XML-RPC Client.- See Also:
VirtualRouterPool(Client, int)
-
VirtualRouterPool
public VirtualRouterPool(Client client, int filter)
Creates a new VirtualRouter pool.- Parameters:
client- XML-RPC Client.filter- Filter flag to use by default in the methodinfo(). Possible values:Pool.ALL: All VirtualRoutersPool.MINE: Connected user's VirtualRoutersPool.MINE_GROUP: Connected user's VirtualRouters, and the ones in his groupPool.GROUP: User's primary group VirtualRouters- >= 0 UID User's VirtualRouters
-
-
Method Detail
-
factory
public PoolElement factory(org.w3c.dom.Node node)
Description copied from class:PoolThe factory method returns a suitable PoolElement object from an XML node. Each Pool must implement the corresponding factory method.
-
info
public static OneResponse info(Client client, int filter)
Retrieves all or part of the VirtualRouters in the pool.- Parameters:
client- XML-RPC Client.filter- Filter flag to use. Possible values:Pool.ALL: All VirtualRoutersPool.MINE: Connected user's VirtualRoutersPool.MINE_GROUP: Connected user's VirtualRouters, and the ones in his groupPool.GROUP: User's primary group VirtualRouters- >= 0 UID User's VirtualRouters
- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
infoAll
public static OneResponse infoAll(Client client)
Retrieves all the VirtualRouters in the pool.- Parameters:
client- XML-RPC Client.- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
infoMine
public static OneResponse infoMine(Client client)
Retrieves all the connected user's VirtualRouters.- Parameters:
client- XML-RPC Client.- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
infoGroup
public static OneResponse infoGroup(Client client)
Retrieves all the connected user's VirtualRouters and the ones in his group.- Parameters:
client- XML-RPC Client.- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
info
public static OneResponse info(Client client, int filter, int startId, int endId)
Retrieves all or part of the VirtualRouters in the pool. The VirtualRouters to retrieve can be also filtered by Id, specifying the first and last Id to include.- Parameters:
client- XML-RPC Client.filter- Filter flag to use. Possible values:Pool.ALL: All VirtualRoutersPool.MINE: Connected user's VirtualRoutersPool.MINE_GROUP: Connected user's VirtualRouters, and the ones in his groupPool.GROUP: User's primary group VirtualRouters- >= 0 UID User's VirtualRouters
startId- Lowest Id to retrieveendId- Biggest Id to retrieve- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
info
public OneResponse info()
Loads the xml representation of all or part of the VirtualRouters in the pool. The filter used is the one set in the constructor.- Overrides:
infoin classPool- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
- See Also:
info(Client, int)
-
infoAll
public OneResponse infoAll()
Loads the xml representation of all the VirtualRouters in the pool.
-
infoMine
public OneResponse infoMine()
Loads the xml representation of all the connected user's VirtualRouters.
-
infoGroup
public OneResponse infoGroup()
Loads the xml representation of all the connected user's VirtualRouters and the ones in his group.
-
info
public OneResponse info(int filter, int startId, int endId)
Retrieves all or part of the VirtualRouters in the pool. The VirtualRouters to retrieve can be also filtered by Id, specifying the first and last Id to include.- Overrides:
infoin classPool- Parameters:
filter- Filter flag to use. Possible values:Pool.ALL: All VirtualRoutersPool.MINE: Connected user's VirtualRoutersPool.MINE_GROUP: Connected user's VirtualRouters, and the ones in his groupPool.GROUP: User's primary group VirtualRouters- >= 0 UID User's VirtualRouters
startId- Lowest Id to retrieveendId- Biggest Id to retrieve- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
iterator
public java.util.Iterator<VirtualRouter> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<VirtualRouter>
-
getById
public VirtualRouter getById(int id)
Returns the VirtualRouter with the given Id from the pool. If it is not found, then returns null. The methodinfo()must be called before.
-
-