GroupPool (OpenNebula Cloud API)
Description: declaration: package: org.opennebula.client.group, class: GroupPool

Package org.opennebula.client.group

# Class GroupPool

java.lang.Object
org.opennebula.client.Pool
org.opennebula.client.group.GroupPool

All Implemented Interfaces:
  `Iterable<Group>`

public class GroupPool extends Pool implements Iterable<Group>
This class represents an OpenNebula group 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
  `GroupPool(Client client)`
  Creates a new group pool

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PoolElement`
  `factory(Node node)`
  The factory method returns a suitable PoolElement object from an XML node.
  `Group`
  `getById(int id)`
  Returns the Group with the given Id from the pool.
  `OneResponse`
  `info()`
  Loads the xml representation of the group pool.
  `static OneResponse`
  `info(Client client)`
  Retrieves all the groups in the pool.
  `Iterator<Group>`
  `iterator()`

  ### Methods inherited from class org.opennebula.client.Pool

  `getLength, info, info, info, infoAll, infoAll, infoGroup, infoGroup, infoGroupPrimary, infoMine, infoMine, item, processInfo, xmlrpcInfo`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## Constructor Details

  - ### GroupPool

    public GroupPool(Client client)
    Creates a new group pool
    Parameters:
      `client` - XML-RPC Client.

- ## Method Details

  - ### factory

    public PoolElement factory(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)
    Retrieves all the groups in the pool.
    Parameters:
      `client` - XML-RPC Client.
    Returns:
      If successful the message contains the string with the information returned by OpenNebula.

  - ### info

    public OneResponse info()
    Loads the xml representation of the group pool.
    Overrides:
      `info` in class `Pool`
    See Also:
      - `info(Client)`

  - ### iterator

    public Iterator<Group> iterator()
    Specified by:
      `iterator` in interface `Iterable<Group>`

  - ### getById

    public Group getById(int id)
    Returns the Group 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 Group to retrieve
    Returns:
      The Image with the given Id, or null if it was not found.