Collection collection = broker.getCollection(collectionName);
collection = broker.openCollection(collectionName, Lock.READ_LOCK);
	public Vector getIndexedElements(User user, String collectionName,			boolean inclusive) throws EXistException, PermissionDeniedException {		DBBroker broker = null;		try {			broker = brokerPool.get(user);			Collection collection = broker.getCollection(collectionName);			if (collection == null)				throw new EXistException("collection " + collectionName						+ " not found");			Occurrences occurrences[] = broker.getElementIndex().scanIndexedElements(collection,					inclusive);			Vector result = new Vector(occurrences.length);			for (int i = 0; i < occurrences.length; i++) {				QName qname = (QName)occurrences[i].getTerm();				Vector temp = new Vector(4);				temp.addElement(qname.getLocalName());				temp.addElement(qname.getNamespaceURI());				temp.addElement(qname.getPrefix() == null ? "" : qname.getPrefix());				temp.addElement(new Integer(occurrences[i].getOccurrences()));				result.addElement(temp);			}			return result;		} finally {			brokerPool.release(broker);		}	}