public ListenableFuture < EtcdResult > watch ( String key , long index , boolean recursive ) { Map < String , String > params = new HashMap < String , String > ( ) ; params . put ( "wait" , String . valueOf ( true ) ) ; if ( index > 0 ) { params . put ( "waitIndex" , String . valueOf ( index ) ) ; } if ( recursive ) { params . put ( "recursive" , String . valueOf ( recursive ) ) ; } URI uri = buildUriWithKeyAndParams ( key , params ) ; HttpGet httpGet = new HttpGet ( uri ) ; return asyncExecute ( httpGet , new int [ ] { 200 } ) ; }
Watch for a change on a key