OpenNebula
Cloud API

org.opennebula.client.vnet
Class VirtualNetworkPool

java.lang.Object
  extended by org.opennebula.client.Pool
      extended by org.opennebula.client.vnet.VirtualNetworkPool
All Implemented Interfaces:
java.lang.Iterable<VirtualNetwork>

public class VirtualNetworkPool
extends Pool
implements java.lang.Iterable<VirtualNetwork>

This class represents an OpenNebula Virtual Network 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
VirtualNetworkPool(Client client)
          Creates a new Virtual Network pool with the default filter flag value set to Pool.MINE_GROUP (Virtual Networks belonging to the connected user, and the ones in his group)
VirtualNetworkPool(Client client, int filter)
          Creates a new Virtual Network pool.
 
Method Summary
 PoolElement factory(org.w3c.dom.Node node)
          The factory method returns a suitable PoolElement object from an XML node.
 VirtualNetwork getById(int id)
          Returns the Virtual Network with the given Id from the pool.
 OneResponse info()
          Loads the xml representation of all or part of the Virtual Networks in the pool.
static OneResponse info(Client client, int filter)
          Retrieves all or part of the Virtual Networks in the pool.
static OneResponse info(Client client, int filter, int startId, int endId)
          Retrieves all or part of the Virtual Networks in the pool.
 OneResponse info(int filter, int startId, int endId)
          Retrieves all or part of the Virtual Networks in the pool.
 OneResponse infoAll()
          Loads the xml representation of all the Virtual Networks in the pool.
static OneResponse infoAll(Client client)
          Retrieves all the Virtual Networks in the pool.
 OneResponse infoGroup()
          Loads the xml representation of all the connected user's Virtual Networks and the ones in his group.
static OneResponse infoGroup(Client client)
          Retrieves all the connected user's Virtual Networks and the ones in his group.
 OneResponse infoMine()
          Loads the xml representation of all the connected user's Virtual Networks.
static OneResponse infoMine(Client client)
          Retrieves all the connected user's Virtual Networks.
 java.util.Iterator<VirtualNetwork> iterator()
           
 
Methods inherited from class org.opennebula.client.Pool
getLength, info, info, infoAll, infoGroup, infoMine, item, processInfo, xmlrpcInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualNetworkPool

public VirtualNetworkPool(Client client)
Creates a new Virtual Network pool with the default filter flag value set to Pool.MINE_GROUP (Virtual Networks belonging to the connected user, and the ones in his group)

Parameters:
client - XML-RPC Client.
See Also:
VirtualNetworkPool(Client, int)

VirtualNetworkPool

public VirtualNetworkPool(Client client,
                          int filter)
Creates a new Virtual Network pool.

Parameters:
client - XML-RPC Client.
filter - Filter flag to use by default in the method info(). Possible values:
  • Pool.ALL: All Virtual Networks
  • Pool.MINE: Connected user's Virtual Networks
  • Pool.MINE_GROUP: Connected user's Virtual Networks, and the ones in his group
  • >= 0: UID User's Virtual Networks
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,
                               int filter)
Retrieves all or part of the Virtual Networks in the pool.

Parameters:
client - XML-RPC Client.
filter - Filter flag to use. Possible values:
  • Pool.ALL: All Virtual Networks
  • Pool.MINE: Connected user's Virtual Networks
  • Pool.MINE_GROUP: Connected user's Virtual Networks, and the ones in his group
  • >= 0: UID User's Virtual Networks
Returns:
If successful the message contains the string with the information returned by OpenNebula.

infoAll

public static OneResponse infoAll(Client client)
Retrieves all the Virtual Networks 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 Virtual Networks.

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 Virtual Networks 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 Virtual Networks in the pool. The Virtual Networks 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 Virtual Networks
  • Pool.MINE: Connected user's Virtual Networks
  • Pool.MINE_GROUP: Connected user's Virtual Networks, and the ones in his group
  • >= 0: UID User's Virtual Networks
startId - Lowest Id to retrieve
endId - 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 Virtual Networks in the pool. The filter used is the one set in the constructor.

Overrides:
info in class Pool
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 Virtual Networks in the pool.

Overrides:
infoAll in class Pool
Returns:
If successful the message contains the string with the information returned by OpenNebula.

infoMine

public OneResponse infoMine()
Loads the xml representation of all the connected user's Virtual Networks.

Overrides:
infoMine in class Pool
Returns:
If successful the message contains the string with the information returned by OpenNebula.

infoGroup

public OneResponse infoGroup()
Loads the xml representation of all the connected user's Virtual Networks and the ones in his group.

Overrides:
infoGroup in class Pool
Returns:
If successful the message contains the string with the information returned by OpenNebula.

info

public OneResponse info(int filter,
                        int startId,
                        int endId)
Retrieves all or part of the Virtual Networks in the pool. The Virtual Networks to retrieve can be also filtered by Id, specifying the first and last Id to include.

Overrides:
info in class Pool
Parameters:
filter - Filter flag to use. Possible values:
  • Pool.ALL: All Virtual Networks
  • Pool.MINE: Connected user's Virtual Networks
  • Pool.MINE_GROUP: Connected user's Virtual Networks, and the ones in his group
  • >= 0: UID User's Virtual Networks
startId - Lowest Id to retrieve
endId - Biggest Id to retrieve
Returns:
If successful the message contains the string with the information returned by OpenNebula.

iterator

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

getById

public VirtualNetwork getById(int id)
Returns the Virtual Network 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 Virtual Network 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).