public static String returnId(Set servers,String server){
  String serverId=null;
  Iterator iter=servers.iterator();
  while (iter.hasNext()) {
    String serverEntry=(String)iter.next();
    if (!serverEntry.startsWith(server)) {
      continue;
    }
    int index=serverEntry.indexOf(delimiter);
    if (index != -1) {
      serverId=serverEntry.substring(index + 1,serverEntry.length());
      return serverId;
    }
  }
  return serverId;
}

public static String returnId ( Set servers , String server ) { String serverId = null ; Iterator iter = servers . iterator ( ) ; while ( iter . hasNext ( ) ) { String serverEntry = ( String ) iter . next ( ) ; if ( ! serverEntry . startsWith ( server ) ) { continue ; } int index = serverEntry . indexOf ( delimiter ) ; if ( index != - 1 ) { serverId = serverEntry . substring ( index + 1 , serverEntry . length ( ) ) ; return serverId ; } } return serverId ; }
this method returns server id for a corresponding server
