private < T > Observable < PollingState < T > > updateStateFromLocationHeaderOnPutAsync ( final PollingState < T > pollingState ) { return pollAsync ( pollingState . locationHeaderLink ( ) , pollingState . loggingContext ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < PollingState < T > > > ( ) { @ Override public Observable < PollingState < T > > call ( Response < ResponseBody > response ) { int statusCode = response . code ( ) ; if ( statusCode == 202 ) { pollingState . withResponse ( response ) ; pollingState . withStatus ( AzureAsyncOperation . IN_PROGRESS_STATUS , statusCode ) ; } else if ( statusCode == 200 || statusCode == 201 ) { try { pollingState . updateFromResponseOnPutPatch ( response ) ; } catch ( CloudException | IOException e ) { return Observable . error ( e ) ; } } return Observable . just ( pollingState ) ; } } ) ; }
Polls from the location header and updates the polling state with the polling response for a PUT operation .