public Collection getIndexes() {
   ArrayList allIndexes = new ArrayList();
   Iterator rootRegions = cache.rootRegions().iterator();
   while (rootRegions.hasNext()) {
     Region region = (Region) rootRegions.next();
     Collection indexes = getIndexes(region);
     if (indexes != null) allIndexes.addAll(indexes);
     Iterator subRegions = region.subregions(true).iterator();
     while (subRegions.hasNext()) {
       indexes = getIndexes((Region) subRegions.next());
       if (indexes != null) allIndexes.addAll(indexes);
     }
   }
   return allIndexes;
 }
  public void removeIndexes() {
    if (pool != null) {
      throw new UnsupportedOperationException(
          "Index Operation is not supported on the Server Region.");
    }

    Iterator rootRegions = cache.rootRegions().iterator();
    while (rootRegions.hasNext()) {
      Region region = (Region) rootRegions.next();
      Iterator subRegions = region.subregions(true).iterator();
      while (subRegions.hasNext()) {
        removeIndexes((Region) subRegions.next());
      }
      removeIndexes(region);
    }
  }