public static Map getConnectedClients(boolean onlyClientsNotifiedByThisServer,
      InternalCache cache) {
    ClientHealthMonitor chMon = ClientHealthMonitor.getInstance();
    Set filterProxyIDs = null;
    if (onlyClientsNotifiedByThisServer) {
      // Note it is not necessary to synchronize on the list of Client servers here,
      // since this is only a status (snapshot) of the system.
      for (final CacheServer server : cache.getCacheServers()) {
        InternalCacheServer cacheServer = (InternalCacheServer) server;
        Acceptor acceptor = cacheServer.getAcceptor();
        if (acceptor != null && acceptor.getCacheClientNotifier() != null) {
          if (filterProxyIDs != null) {
            // notifierClients is a copy set from CacheClientNotifier
            filterProxyIDs.addAll(acceptor.getCacheClientNotifier().getActiveClients());
          } else {
            // notifierClients is a copy set from CacheClientNotifier
            filterProxyIDs = acceptor.getCacheClientNotifier().getActiveClients();
          }
        }
      }
    }

    /*
     * if (onlyClientsNotifiedByThisServer) { Map notifyMap = new HashMap();
     *
     * for (Iterator iter = map.keySet().iterator(); iter.hasNext();) { String memberId = (String)
     * iter.next(); if (notifierClients.contains(memberId)) { // found memberId that is notified by
     * this server notifyMap.put(memberId, map.get(memberId)); } } map = notifyMap; }
     */
    return chMon.getConnectedClients(filterProxyIDs);
  }
Returns a map of client memberIds to count of connections to that client. The map entry key is
a String representation of the client memberId, and the map entry value is an Integer count of
connections to that client. Since a single client can have multiple ConnectionProxy objects,
this map will contain all the Connection objects across the ConnectionProxies

@param onlyClientsNotifiedByThisServer true will return only those clients that are actively
       being updated by this server
@return map of client memberIds to count of connections to that client
geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java