public Collection < String > queryForNames ( ) throws Exception { Set < String > names = new HashSet < String > ( ) ; // todo: it would be better to do: // services = client.getServicesClient().list(options, typeTag); // but there are some validation problems (the tag is allowed to be written, but not queried on). Iterator < Service > services = client . getServicesClient ( ) . list ( new MethodOptions ( 100 , null ) ) ; while ( services . hasNext ( ) ) { Service service = services . next ( ) ; // this conditional can be removed when the above operation works. if ( ! service . getTags ( ) . contains ( typeTag ) ) { continue ; } String name = service . getMetadata ( ) . get ( ServiceTracker . NAME ) ; if ( ! names . contains ( name ) ) { names . add ( name ) ; } } return names ; }
return all distinct names registered by this discovery type .