private void addStorageFilesWithRetry(BusinessObjectDataKey businessObjectDataKey,UploaderInputManifestDto manifest,S3FileTransferRequestParamsDto params,String storageName,Integer maxRetryAttempts,Integer retryDelaySecs) throws IOException, JAXBException, URISyntaxException {
  int retryCount=0;
  while (true) {
    try {
      uploaderWebClient.addStorageFiles(businessObjectDataKey,manifest,params,storageName);
      break;
    }
 catch (    IOException|JAXBException|URISyntaxException e) {
      if (retryCount >= maxRetryAttempts) {
        LOGGER.warn("An exception occurred when adding storage files to the business object data. The maximum number of retries of " + maxRetryAttempts + " has been exceeded so the exception will now be thrown.");
        throw e;
      }
 else {
        LOGGER.warn("An exception occurred when adding storage files to the business object data. {}",e.toString(),e);
        LOGGER.warn("Will retry in " + retryDelaySecs + " second(s) and no more than "+ (maxRetryAttempts - retryCount)+ " more time(s).");
        retryCount++;
        herdThreadHelper.sleep(retryDelaySecs * 1000L);
      }
    }
  }
}

private void addStorageFilesWithRetry ( BusinessObjectDataKey businessObjectDataKey , UploaderInputManifestDto manifest , S3FileTransferRequestParamsDto params , String storageName , Integer maxRetryAttempts , Integer retryDelaySecs ) throws IOException , JAXBException , URISyntaxException { int retryCount = 0 ; while ( true ) { try { uploaderWebClient . addStorageFiles ( businessObjectDataKey , manifest , params , storageName ) ; break ; } catch ( IOException | JAXBException | URISyntaxException e ) { if ( retryCount >= maxRetryAttempts ) { LOGGER . warn ( "An exception occurred when adding storage files to the business object data. The maximum number of retries of " + maxRetryAttempts + " has been exceeded so the exception will now be thrown." ) ; throw e ; } else { LOGGER . warn ( "An exception occurred when adding storage files to the business object data. {}" , e . toString ( ) , e ) ; LOGGER . warn ( "Will retry in " + retryDelaySecs + " second(s) and no more than " + ( maxRetryAttempts - retryCount ) + " more time(s)." ) ; retryCount ++ ; herdThreadHelper . sleep ( retryDelaySecs * 1000L ) ; } } } }
add storage files to a business object data with a retry on error .
