public RetryRule(int maxRetryAttempts, long delay, TimeUnit timeUnit) { this.maxRetryAttempts = maxRetryAttempts; this.delay = delay; this.timeUnit = ValidationUtils.assertNotNull(timeUnit, "timeUnit"); }
public ApiGatewayErrorResponseHandler(List<ApiGatewayErrorUnmarshaller> errorUnmarshallers, JsonFactory jsonFactory) { this.unmarshallers = ValidationUtils .assertNotNull(errorUnmarshallers, "errorUnmarshallers"); this.jsonFactory = ValidationUtils.assertNotNull(jsonFactory, "jsonFactory"); }
public SimpleRetryPolicy(RetryCondition retryCondition, BackoffStrategy backoffStrategy) { this.retryCondition = assertNotNull(retryCondition, "retryCondition"); this.backoffStrategy = assertNotNull(backoffStrategy, "backoffStrategy"); }
HttpClientSettings(final ClientConfiguration config, final boolean useBrowserCompatibleHostNameVerifier, final boolean calculateCRC32FromCompressedData) { this.config = ValidationUtils.assertNotNull(config, "client configuration"); this.useBrowserCompatibleHostNameVerifier = useBrowserCompatibleHostNameVerifier; this.calculateCRC32FromCompressedData = calculateCRC32FromCompressedData; }
public InMemoryRegionImpl(String name, String domain) { ValidationUtils.assertNotNull(name, "region name"); this.name = name; this.domain = domain == null ? DEFAULT_DOMAIN : domain; }
private RefreshableTask(Callable<T> refreshCallable, SdkPredicate<T> shouldDoBlockingRefresh, SdkPredicate<T> shouldDoAsyncRefresh) { this.refreshCallable = ValidationUtils.assertNotNull(refreshCallable, "refreshCallable"); this.shouldDoBlockingRefresh = ValidationUtils .assertNotNull(shouldDoBlockingRefresh, "shouldDoBlockingRefresh"); this.shouldDoAsyncRefresh = ValidationUtils .assertNotNull(shouldDoAsyncRefresh, "shouldDoAsyncRefresh"); }
/** * Instantiates a new BatchLoadContext. * @param batchGetItemRequest see {@link BatchGetItemRequest}. * */ public BatchLoadContext(BatchGetItemRequest batchGetItemRequest) { this.batchGetItemRequest = ValidationUtils.assertNotNull(batchGetItemRequest, "batchGetItemRequest"); this.batchGetItemResult = null; this.retriesAttempted = 0; }
public InMemoryRegionImpl addEndpoint(String serviceName, String endpoint) { ValidationUtils.assertNotNull(serviceName, "service name"); ValidationUtils.assertNotNull(endpoint, "endpoint"); endpoints.put(serviceName, endpoint); return this; }
/** * @param exceptionsToRetryOn Exception classes to retry on. */ public RetryOnExceptionsCondition(List<Class<? extends Exception>> exceptionsToRetryOn) { this.exceptionsToRetryOn = new ArrayList<Class<? extends Exception>>( assertNotNull(exceptionsToRetryOn, "exceptionsToRetryOn")); }
public static <T> T[] assertNotEmpty(T[] array, String fieldName) throws IllegalArgumentException { assertNotNull(array, fieldName); if (array.length == 0) { throw new IllegalArgumentException(String.format("%s cannot be empty", fieldName)); } return array; }
public InMemoryRegionsProvider(List<Region> regions) { ValidationUtils.assertNotNull(regions, "regions"); this.regions = Collections.unmodifiableList(new ArrayList<Region> (regions)); }
public StackedRequestHandler(List<RequestHandler2> requestHandlers) { this.inOrderRequestHandlers = ValidationUtils.assertNotNull(requestHandlers, "requestHandlers"); this.reverseOrderRequestHandlers = new ArrayList<RequestHandler2>(requestHandlers); Collections.reverse(reverseOrderRequestHandlers); }
public static String assertStringNotEmpty(String string, String fieldName) throws IllegalArgumentException { assertNotNull(string, fieldName); if (string.isEmpty()) { throw new IllegalArgumentException(String.format("%s cannot be empty", fieldName)); } return string; } }
public static <T extends Collection<?>> T assertNotEmpty(T collection, String fieldName) throws IllegalArgumentException{ assertNotNull(collection, fieldName); if (collection.isEmpty()) { throw new IllegalArgumentException(String.format("%s cannot be empty", fieldName)); } return collection; }
/** * Loads the AWS credential profiles from the file. The reference to the file is specified as a * parameter to the constructor. */ public ProfilesConfigFile(File file, ProfileCredentialsService credentialsService) throws SdkClientException { profileFile = ValidationUtils.assertNotNull(file, "profile file"); profileCredentialsService = credentialsService; profileFileLastModified = file.lastModified(); allProfiles = loadProfiles(profileFile); }
public static void checkInvalidAttribute(String attrName, Object val) { checkInvalidAttrName(attrName); ValidationUtils.assertNotNull(val, attrName); } }
/** * For testing purposes. */ @SdkTestInternalApi CompleteMultipartUploadRetryCondition(SdkPredicate<AmazonS3Exception> predicate, int maxRetryAttempts) { ValidationUtils.assertNotNull(predicate, "sdk predicate"); this.completeMultipartRetryablePredicate = predicate; this.maxCompleteMultipartUploadRetries = maxRetryAttempts; }
@Override public String marshall(String resourcePath, String paramName, Integer pathValue) { assertNotNull(pathValue, paramName); return marshall(resourcePath, paramName, StringUtils.fromInteger(pathValue)); }
@Override public String marshall(String resourcePath, String paramName, Long pathValue) { assertNotNull(pathValue, paramName); return marshall(resourcePath, paramName, StringUtils.fromLong(pathValue)); } }
@Override public String marshall(String resourcePath, String paramName, Long pathValue) { assertNotNull(pathValue, paramName); return marshall(resourcePath, paramName, StringUtils.fromLong(pathValue)); } }