static PollStrategy tryToCreate ( RestProxy restProxy , SwaggerMethodParser methodParser , HttpRequest originalHttpRequest , HttpResponse httpResponse , long delayInMilliseconds ) { String urlHeader = getHeader ( httpResponse ) ; URL azureAsyncOperationUrl = null ; if ( urlHeader != null ) { try { azureAsyncOperationUrl = new URL ( urlHeader ) ; } catch ( MalformedURLException ignored ) { } } urlHeader = httpResponse . headerValue ( "Location" ) ; URL locationUrl = null ; if ( urlHeader != null ) { try { locationUrl = new URL ( urlHeader ) ; } catch ( MalformedURLException ignored ) { } } return azureAsyncOperationUrl != null ? new AzureAsyncOperationPollStrategy ( new AzureAsyncOperationPollStrategyData ( restProxy , methodParser , azureAsyncOperationUrl , originalHttpRequest . url ( ) , locationUrl , originalHttpRequest . httpMethod ( ) , delayInMilliseconds ) ) : null ; }
Try to create a new AzureAsyncOperationPollStrategy object that will poll the provided operation resource URL . If the provided HttpResponse doesn t have an Azure - AsyncOperation header or if the header is empty then null will be returned .