Class HostPool

  • All Implemented Interfaces:
    java.lang.Iterable<Host>

    public class HostPool
    extends Pool
    implements java.lang.Iterable<Host>
    This class represents an OpenNebula host pool. It also offers static XML-RPC call wrappers.
    • Constructor Detail

      • HostPool

        public HostPool​(Client client)
        Creates a new host pool
        Parameters:
        client - XML-RPC Client.
    • 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)
        Retrieves all the hosts in the pool.
        Parameters:
        client - XML-RPC Client.
        Returns:
        If successful the message contains the string with the information returned by OpenNebula.
      • monitoring

        public static OneResponse monitoring​(Client client)
        Retrieves the monitoring data for all the hosts in the pool.
        Parameters:
        client - XML-RPC Client.
        Returns:
        If successful the message contains the string with the information returned by OpenNebula.
      • monitoring

        public static OneResponse monitoring​(Client client,
                                             int num)
        Retrieves the monitoring data for all the hosts in the pool.
        Parameters:
        client - XML-RPC Client.
        num - : Retrieve monitor records in the last num seconds. 0 just the last record, -1 all records.
        Returns:
        If successful the message contains the string with the information returned by OpenNebula.
      • monitoring

        public OneResponse monitoring()
        Retrieves the monitoring data for all the hosts in the pool.
        Returns:
        If successful the message contains the string with the information returned by OpenNebula.
      • iterator

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

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