public void operateOnLocalCache(InternalCache cache) {
    final InitializationLevel oldLevel =
        LocalRegion.setThreadInitLevelRequirement(BEFORE_INITIAL_IMAGE);
    if (cache.getCacheServers().size() == 0) {
      try {
        for (InternalRegion r : getAllRegions(cache)) {
          FilterProfile fp = r.getFilterProfile();
          if (fp != null) {
            fp.getLocalProfile().hasCacheServer = false;
          }
        }
        for (PartitionedRegion r : getPartitionedRegions(cache)) {
          FilterProfile fp = r.getFilterProfile();
          if (fp != null) {
            fp.getLocalProfile().hasCacheServer = false;
          }
        }
      } finally {
        LocalRegion.setThreadInitLevelRequirement(oldLevel);
      }
    }
  }
set the hasCacheServer flags for all regions in this cache
geode-core/src/main/java/org/apache/geode/internal/cache/RemoveCacheServerProfileMessage.java