Class ServiceTimeoutPolicy

java.lang.Object
com.azure.storage.common.policy.ServiceTimeoutPolicy
All Implemented Interfaces:
com.azure.core.http.policy.HttpPipelinePolicy

public final class ServiceTimeoutPolicy extends Object implements com.azure.core.http.policy.HttpPipelinePolicy
Pipeline policy that sets the timeout URI query parameter to cancel requests on the service side if the server timeout interval elapses before the service has finished processing the request. For more information on timeouts for different services, see here: Setting timeouts for blob service operations Setting timeouts for file service operations Setting timeouts for queue service operations
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a service timeout policy.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.azure.core.http.HttpPipelinePosition
    Gets the position to place the policy.
    Mono<com.azure.core.http.HttpResponse>
    process(com.azure.core.http.HttpPipelineCallContext context, com.azure.core.http.HttpPipelineNextPolicy next)
     
    com.azure.core.http.HttpResponse
    processSync(com.azure.core.http.HttpPipelineCallContext context, com.azure.core.http.HttpPipelineNextSyncPolicy next)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ServiceTimeoutPolicy

      public ServiceTimeoutPolicy(Duration timeout)
      Creates a service timeout policy.

      The maximum timeout interval for Blob service operations is 30 seconds, with exceptions for certain operations. The default value is also 30 seconds, although some read and write operations may use a larger default. Apart from these exceptions, the service automatically reduces any timeouts larger than 30 seconds to the 30-second maximum. For more information, see here: Setting timeouts for blob service operations For more information on setting timeouts for file shares, see here: Setting timeouts for file service operations For more information on setting timeouts on queues, see here: Setting timeouts for queue service operations

      Parameters:
      timeout - The timeout duration.
  • Method Details

    • process

      public Mono<com.azure.core.http.HttpResponse> process(com.azure.core.http.HttpPipelineCallContext context, com.azure.core.http.HttpPipelineNextPolicy next)
      Specified by:
      process in interface com.azure.core.http.policy.HttpPipelinePolicy
    • processSync

      public com.azure.core.http.HttpResponse processSync(com.azure.core.http.HttpPipelineCallContext context, com.azure.core.http.HttpPipelineNextSyncPolicy next)
      Specified by:
      processSync in interface com.azure.core.http.policy.HttpPipelinePolicy
    • getPipelinePosition

      public com.azure.core.http.HttpPipelinePosition getPipelinePosition()
      Gets the position to place the policy.
      Specified by:
      getPipelinePosition in interface com.azure.core.http.policy.HttpPipelinePolicy
      Returns:
      The position to place the policy.