public Map<String,Map<String,String>> list(String serviceName){
  Map<String,Map<String,String>> results=new HashMap<String,Map<String,String>>();
  ServiceInfo[] infos=jmdns.list("_" + serviceName + "._tcp.local.");
  for (  ServiceInfo info : infos) {
    _log.info("ServiceInfo:{}",info);
    final String[] hostAddrs=info.getHostAddresses();
    final StringBuffer buf=new StringBuffer();
    for (    String hostAddr : hostAddrs) {
      buf.append(hostAddr);
      buf.append(';');
    }
    final String key=buf.toString();
    _log.info("\tkey:{}",key);
    final Map<String,String> values=new HashMap<String,String>();
    for (Enumeration<String> e=info.getPropertyNames(); e.hasMoreElements(); ) {
      final String prop=e.nextElement();
      final String value=new String(info.getPropertyBytes(prop));
      _log.info("\tprop:{}, value:{}",prop,value);
      values.put(prop,value);
    }
    if (values.isEmpty()) {
      _log.warn("values are empty for key: {}",key);
    }
    results.put(key,values.isEmpty() ? null : values);
  }
  return results;
}

public Map < String , Map < String , String > > list ( String serviceName ) { Map < String , Map < String , String > > results = new HashMap < String , Map < String , String > > ( ) ; ServiceInfo [ ] infos = jmdns . list ( "_" + serviceName + "._tcp.local." ) ; for ( ServiceInfo info : infos ) { _log . info ( "ServiceInfo:{}" , info ) ; final String [ ] hostAddrs = info . getHostAddresses ( ) ; final StringBuffer buf = new StringBuffer ( ) ; for ( String hostAddr : hostAddrs ) { buf . append ( hostAddr ) ; buf . append ( ';' ) ; } final String key = buf . toString ( ) ; _log . info ( "\tkey:{}" , key ) ; final Map < String , String > values = new HashMap < String , String > ( ) ; for ( Enumeration < String > e = info . getPropertyNames ( ) ; e . hasMoreElements ( ) ; ) { final String prop = e . nextElement ( ) ; final String value = new String ( info . getPropertyBytes ( prop ) ) ; _log . info ( "\tprop:{}, value:{}" , prop , value ) ; values . put ( prop , value ) ; } if ( values . isEmpty ( ) ) { _log . warn ( "values are empty for key: {}" , key ) ; } results . put ( key , values . isEmpty ( ) ? null : values ) ; } return results ; }
list published node ( s ) configuration in the network via multicast
