Class Pool

    • Field Detail

      • client

        protected Client client
      • elementName

        protected java.lang.String elementName
      • infoMethod

        protected java.lang.String infoMethod
      • poolElements

        protected org.w3c.dom.NodeList poolElements
      • xpath

        protected static javax.xml.xpath.XPath xpath
      • MINE_GROUP

        public static final int MINE_GROUP
        Connected user's resources, and the ones in his group
        See Also:
        Constant Field Values
      • GROUP

        public static final int GROUP
        Resources owned by the user's primary group
        See Also:
        Constant Field Values
    • Constructor Detail

      • Pool

        protected Pool​(java.lang.String elementName,
                       Client client,
                       java.lang.String infoMethod)
        Protected constructor, to be called from subclasses.
        Parameters:
        elementName - Name of the PoolElement's xml element
        client - XML-RPC client which will handle calls
        infoMethod - XML-RPC info method for the subclass Pool
    • Method Detail

      • factory

        public abstract PoolElement factory​(org.w3c.dom.Node node)
        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

        protected static OneResponse info​(Client client,
                                          java.lang.String infoMethod)
        Info methods
      • info

        protected static OneResponse info​(Client client,
                                          java.lang.String infoMethod,
                                          int filter,
                                          int startId,
                                          int endId)
      • infoAll

        protected static OneResponse infoAll​(Client client,
                                             java.lang.String infoMethod)
      • infoMine

        protected static OneResponse infoMine​(Client client,
                                              java.lang.String infoMethod)
      • infoGroup

        protected static OneResponse infoGroup​(Client client,
                                               java.lang.String infoMethod)
      • infoGroupPrimary

        protected static OneResponse infoGroupPrimary​(Client client,
                                                      java.lang.String infoMethod)
      • xmlrpcInfo

        protected static OneResponse xmlrpcInfo​(Client client,
                                                java.lang.String infoMethod,
                                                java.lang.Object... args)
      • info

        protected OneResponse info​(int filter,
                                   int startId,
                                   int endId)
      • processInfo

        protected void processInfo​(OneResponse info)
        After a *pool.info call, this method builds the internal xml representation of the pool.
        Parameters:
        info - The XML-RPC *pool.info response
      • item

        public PoolElement item​(int index)
        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

        protected PoolElement getById​(int id)
        Returns the element with the given Id from the pool. If it is not found, then returns null. The method info() 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.