Several HCL Compass CM API methods return collections of resources.

The resource collections can be returned as a ResourceList or as a ResourceList.ResponseIterator.

The value of many properties is a list of references to resources. The value of such properties is represented by a ResourceList object, which is a collection of proxy objects with a number of additional methods for performing specific operations on the members of the list. If the value of a property is a ResourceList, a NestedPropertyNames object can be used to request properties from each of the resources in the list. The same set of properties will be requested from each resource.

The ResourceList provides a number of methods for performing specific operations on the members of the list. A ResourceList can contain proxies of any Resource subclass. All proxies in a collection can be the same proxy class or different classes depending on the generator of the list. A new ResourceList is created by the Provider.resourceList() method. ResourceList can be parameterized with the type of resource proxy it is meant to contain.

The ResponseIterator represents a stream of proxy information coming from the server, one proxy at a time, as the client moves through the items of the ResponseIterator. Until it is explicitly released (using ResourceList.ResponseIterator().release()) or its end is reached, the ResponseIterator holds open a communication channel with the server. For optimal performance, clients should examine the items in the iterator as quickly as possible and release the iterator as soon as it is no longer needed.

For example, to find available database sets by using the CqProvider.doGetDbSetList() method:
        try {
            StpProvider provider = getProvider();
            // Request a list of the CQ databases known to the provider
            ResourceList<CqDbSet> databases = 
            // List the returned information
            for (CqDbSet dbSet : databases) {
                System.out.println (dbSet.getDisplayName() 
                                    + ": " + dbSet.getLocalReplica());
        } catch(Throwable ex) {
        } finally {

For details, see the Javadoc information for the HCL Compass CM API.