Tabnine Logo
BackoffLimitedRetryHandler.shouldRetryRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
shouldRetryRequest
method
in
org.jclouds.http.handlers.BackoffLimitedRetryHandler

Best Java code snippets using org.jclouds.http.handlers.BackoffLimitedRetryHandler.shouldRetryRequest (Showing top 20 results out of 360)

origin: org.apache.jclouds.provider/google-cloud-storage

  @Override
  public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) {
   if (response.getStatusCode() == TOO_MANY_REQUESTS) {
     return backoffHandler.shouldRetryRequest(command, response);
   } else {
     return false;
   }
  }
}
origin: jclouds/legacy-jclouds

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableCodes.contains(error.getCode()))
   return backoffLimitedRetryHandler.shouldRetryRequest(command, response);
 return false;
}
origin: com.amysta.jclouds.api/sts

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableCodes.contains(error.getCode()))
   return backoffLimitedRetryHandler.shouldRetryRequest(command, response);
 return false;
}
origin: Nextdoor/bender

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableCodes.contains(error.getCode()))
   return backoffLimitedRetryHandler.shouldRetryRequest(command, response);
 return false;
}
origin: apache/jclouds

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableCodes.contains(error.getCode()))
   return backoffLimitedRetryHandler.shouldRetryRequest(command, response);
 return false;
}
origin: org.apache.jclouds.api/sts

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableCodes.contains(error.getCode()))
   return backoffLimitedRetryHandler.shouldRetryRequest(command, response);
 return false;
}
origin: org.apache.jclouds.api/sts

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableServerCodes.contains(error.getCode()))
   return super.shouldRetryRequest(command, response);
 return false;
}
origin: org.jclouds.api/sts

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableCodes.contains(error.getCode()))
   return backoffLimitedRetryHandler.shouldRetryRequest(command, response);
 return false;
}
origin: io.cloudsoft.jclouds.api/sts

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableServerCodes.contains(error.getCode()))
   return super.shouldRetryRequest(command, response);
 return false;
}
origin: jclouds/legacy-jclouds

@Override
public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) {
 try {
   switch (response.getStatusCode()) {
    case 401:
      authenticationResponseCache.invalidateAll();
      return super.shouldRetryRequest(command, response);
   }
   return false;
 } finally {
   releasePayload(response);
 }
}
origin: apache/jclouds

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableServerCodes.contains(error.getCode()))
   return super.shouldRetryRequest(command, response);
 return false;
}
origin: org.jclouds.common/aws-common

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableCodes.contains(error.getCode()))
   return backoffLimitedRetryHandler.shouldRetryRequest(command, response);
 return false;
}
origin: com.amysta.jclouds.api/sts

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableServerCodes.contains(error.getCode()))
   return super.shouldRetryRequest(command, response);
 return false;
}
origin: io.cloudsoft.jclouds.api/sts

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableCodes.contains(error.getCode()))
   return backoffLimitedRetryHandler.shouldRetryRequest(command, response);
 return false;
}
origin: Nextdoor/bender

protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error) {
 if (retryableServerCodes.contains(error.getCode()))
   return super.shouldRetryRequest(command, response);
 return false;
}
origin: jclouds/legacy-jclouds

@Test
void testDisallowsExcessiveRetries() throws InterruptedException, IOException, SecurityException,
    NoSuchMethodException {
 HttpCommand command = createCommand();
 HttpResponse response = HttpResponse.builder().statusCode(400).build();
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 1
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 2
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 3
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 4
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 5
 assertEquals(handler.shouldRetryRequest(command, response), false); // Failure 6
}
origin: apache/jclouds

@Test
void testDisallowsExcessiveRetries() throws InterruptedException, IOException, SecurityException,
    NoSuchMethodException {
 HttpCommand command = createCommand();
 HttpResponse response = HttpResponse.builder().statusCode(400).build();
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 1
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 2
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 3
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 4
 assertEquals(handler.shouldRetryRequest(command, response), true); // Failure 5
 assertEquals(handler.shouldRetryRequest(command, response), false); // Failure 6
}
origin: apache/jclouds

@Override
public boolean shouldRetryRequest(HttpCommand command, IOException error) {
 HttpRequest request = command.getCurrentRequest();
 if ("POST".equals(request.getMethod())) {
   Payload payload = request.getPayload();
   if (!payload.getRawContent().toString().contains(DESCRIBE_ACTION)){
    logger.error("Command not considered safe to retry because request method is POST and action may not be idempotent: %1$s",
      command);
    return false;
   }
 }
 return super.shouldRetryRequest(command, error);
}
origin: jclouds/legacy-jclouds

@Test
void testIncrementsFailureCount() throws InterruptedException, IOException, SecurityException, NoSuchMethodException {
 HttpCommand command = createCommand();
 HttpResponse response = HttpResponse.builder().statusCode(400).build();
 handler.shouldRetryRequest(command, response);
 assertEquals(command.getFailureCount(), 1);
 handler.shouldRetryRequest(command, response);
 assertEquals(command.getFailureCount(), 2);
 handler.shouldRetryRequest(command, response);
 assertEquals(command.getFailureCount(), 3);
}
origin: apache/jclouds

@Test
void testIncrementsFailureCount() throws InterruptedException, IOException, SecurityException, NoSuchMethodException {
 HttpCommand command = createCommand();
 HttpResponse response = HttpResponse.builder().statusCode(400).build();
 handler.shouldRetryRequest(command, response);
 assertEquals(command.getFailureCount(), 1);
 handler.shouldRetryRequest(command, response);
 assertEquals(command.getFailureCount(), 2);
 handler.shouldRetryRequest(command, response);
 assertEquals(command.getFailureCount(), 3);
}
org.jclouds.http.handlersBackoffLimitedRetryHandlershouldRetryRequest

Popular methods of BackoffLimitedRetryHandler

  • imposeBackoffExponentialDelay
  • ifReplayableBackoffAndReturnTrue

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now