id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
20,500
aws/aws-sdk-java
aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/internal/netty/handler/ErrorUnmarshallingHandler.java
ErrorUnmarshallingHandler.unmarshallError
private AmazonServiceException unmarshallError() throws Exception { errorResponse.setContent(new ByteArrayInputStream(BinaryUtils.copyBytesFrom(cumulation.nioBuffer()))); return errorResponseHandler.handle(errorResponse); }
java
private AmazonServiceException unmarshallError() throws Exception { errorResponse.setContent(new ByteArrayInputStream(BinaryUtils.copyBytesFrom(cumulation.nioBuffer()))); return errorResponseHandler.handle(errorResponse); }
[ "private", "AmazonServiceException", "unmarshallError", "(", ")", "throws", "Exception", "{", "errorResponse", ".", "setContent", "(", "new", "ByteArrayInputStream", "(", "BinaryUtils", ".", "copyBytesFrom", "(", "cumulation", ".", "nioBuffer", "(", ")", ")", ")", ")", ";", "return", "errorResponseHandler", ".", "handle", "(", "errorResponse", ")", ";", "}" ]
We've received all the error content so send it off to the error response handler to produce the service exception.
[ "We", "ve", "received", "all", "the", "error", "content", "so", "send", "it", "off", "to", "the", "error", "response", "handler", "to", "produce", "the", "service", "exception", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/internal/netty/handler/ErrorUnmarshallingHandler.java#L133-L136
20,501
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/ItemUtils.java
ItemUtils.fromSimpleMap
public static Map<String, AttributeValue> fromSimpleMap( Map<String, Object> map) { if (map == null) return null; // row with multiple attributes Map<String, AttributeValue> result = new LinkedHashMap<String, AttributeValue>(); for (Map.Entry<String, Object> entry : map.entrySet()) result.put(entry.getKey(), toAttributeValue(entry.getValue())); return result; }
java
public static Map<String, AttributeValue> fromSimpleMap( Map<String, Object> map) { if (map == null) return null; // row with multiple attributes Map<String, AttributeValue> result = new LinkedHashMap<String, AttributeValue>(); for (Map.Entry<String, Object> entry : map.entrySet()) result.put(entry.getKey(), toAttributeValue(entry.getValue())); return result; }
[ "public", "static", "Map", "<", "String", ",", "AttributeValue", ">", "fromSimpleMap", "(", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "if", "(", "map", "==", "null", ")", "return", "null", ";", "// row with multiple attributes", "Map", "<", "String", ",", "AttributeValue", ">", "result", "=", "new", "LinkedHashMap", "<", "String", ",", "AttributeValue", ">", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Object", ">", "entry", ":", "map", ".", "entrySet", "(", ")", ")", "result", ".", "put", "(", "entry", ".", "getKey", "(", ")", ",", "toAttributeValue", "(", "entry", ".", "getValue", "(", ")", ")", ")", ";", "return", "result", ";", "}" ]
Converts a map of string to simple objects into the low-level representation; or null if the input is null.
[ "Converts", "a", "map", "of", "string", "to", "simple", "objects", "into", "the", "low", "-", "level", "representation", ";", "or", "null", "if", "the", "input", "is", "null", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/ItemUtils.java#L89-L98
20,502
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/event/ProgressEvent.java
ProgressEvent.getEventCode
@Deprecated public int getEventCode() { Integer legacyCode = legacyEventCodes.get(eventType); // Returns -1 if the event type does not have a legacy event code return legacyCode == null ? -1 : legacyCode; }
java
@Deprecated public int getEventCode() { Integer legacyCode = legacyEventCodes.get(eventType); // Returns -1 if the event type does not have a legacy event code return legacyCode == null ? -1 : legacyCode; }
[ "@", "Deprecated", "public", "int", "getEventCode", "(", ")", "{", "Integer", "legacyCode", "=", "legacyEventCodes", ".", "get", "(", "eventType", ")", ";", "// Returns -1 if the event type does not have a legacy event code", "return", "legacyCode", "==", "null", "?", "-", "1", ":", "legacyCode", ";", "}" ]
Returns the unique event code identifying the type of event this object represents. @return The unique event code that identifies what type of specific type of event this object represents. @deprecated Use {@link #getEventType()} instead.
[ "Returns", "the", "unique", "event", "code", "identifying", "the", "type", "of", "event", "this", "object", "represents", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/event/ProgressEvent.java#L113-L118
20,503
aws/aws-sdk-java
aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/CreateSampleFindingsRequest.java
CreateSampleFindingsRequest.setFindingTypes
public void setFindingTypes(java.util.Collection<String> findingTypes) { if (findingTypes == null) { this.findingTypes = null; return; } this.findingTypes = new java.util.ArrayList<String>(findingTypes); }
java
public void setFindingTypes(java.util.Collection<String> findingTypes) { if (findingTypes == null) { this.findingTypes = null; return; } this.findingTypes = new java.util.ArrayList<String>(findingTypes); }
[ "public", "void", "setFindingTypes", "(", "java", ".", "util", ".", "Collection", "<", "String", ">", "findingTypes", ")", "{", "if", "(", "findingTypes", "==", "null", ")", "{", "this", ".", "findingTypes", "=", "null", ";", "return", ";", "}", "this", ".", "findingTypes", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "String", ">", "(", "findingTypes", ")", ";", "}" ]
Types of sample findings that you want to generate. @param findingTypes Types of sample findings that you want to generate.
[ "Types", "of", "sample", "findings", "that", "you", "want", "to", "generate", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/CreateSampleFindingsRequest.java#L85-L92
20,504
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/protocol/json/JsonContent.java
JsonContent.createJsonContent
public static JsonContent createJsonContent(HttpResponse httpResponse, JsonFactory jsonFactory) { byte[] rawJsonContent = null; try { if (httpResponse.getContent() != null) { rawJsonContent = IOUtils.toByteArray(httpResponse.getContent()); } } catch (Exception e) { LOG.debug("Unable to read HTTP response content", e); } return new JsonContent(rawJsonContent, new ObjectMapper(jsonFactory) .configure(JsonParser.Feature.ALLOW_COMMENTS, true)); }
java
public static JsonContent createJsonContent(HttpResponse httpResponse, JsonFactory jsonFactory) { byte[] rawJsonContent = null; try { if (httpResponse.getContent() != null) { rawJsonContent = IOUtils.toByteArray(httpResponse.getContent()); } } catch (Exception e) { LOG.debug("Unable to read HTTP response content", e); } return new JsonContent(rawJsonContent, new ObjectMapper(jsonFactory) .configure(JsonParser.Feature.ALLOW_COMMENTS, true)); }
[ "public", "static", "JsonContent", "createJsonContent", "(", "HttpResponse", "httpResponse", ",", "JsonFactory", "jsonFactory", ")", "{", "byte", "[", "]", "rawJsonContent", "=", "null", ";", "try", "{", "if", "(", "httpResponse", ".", "getContent", "(", ")", "!=", "null", ")", "{", "rawJsonContent", "=", "IOUtils", ".", "toByteArray", "(", "httpResponse", ".", "getContent", "(", ")", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "LOG", ".", "debug", "(", "\"Unable to read HTTP response content\"", ",", "e", ")", ";", "}", "return", "new", "JsonContent", "(", "rawJsonContent", ",", "new", "ObjectMapper", "(", "jsonFactory", ")", ".", "configure", "(", "JsonParser", ".", "Feature", ".", "ALLOW_COMMENTS", ",", "true", ")", ")", ";", "}" ]
Static factory method to create a JsonContent object from the contents of the HttpResponse provided
[ "Static", "factory", "method", "to", "create", "a", "JsonContent", "object", "from", "the", "contents", "of", "the", "HttpResponse", "provided" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/protocol/json/JsonContent.java#L43-L55
20,505
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBScanExpression.java
DynamoDBScanExpression.addFilterCondition
public void addFilterCondition(String attributeName, Condition condition) { if ( scanFilter == null ) scanFilter = new HashMap<String, Condition>(); scanFilter.put(attributeName, condition); }
java
public void addFilterCondition(String attributeName, Condition condition) { if ( scanFilter == null ) scanFilter = new HashMap<String, Condition>(); scanFilter.put(attributeName, condition); }
[ "public", "void", "addFilterCondition", "(", "String", "attributeName", ",", "Condition", "condition", ")", "{", "if", "(", "scanFilter", "==", "null", ")", "scanFilter", "=", "new", "HashMap", "<", "String", ",", "Condition", ">", "(", ")", ";", "scanFilter", ".", "put", "(", "attributeName", ",", "condition", ")", ";", "}" ]
Adds a new filter condition to the current scan filter. @param attributeName The name of the attribute on which the specified condition operates. @param condition The condition which describes how the specified attribute is compared and if a row of data is included in the results returned by the scan operation.
[ "Adds", "a", "new", "filter", "condition", "to", "the", "current", "scan", "filter", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBScanExpression.java#L253-L258
20,506
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBScanExpression.java
DynamoDBScanExpression.withFilterConditionEntry
public DynamoDBScanExpression withFilterConditionEntry(String attributeName, Condition condition) { if ( scanFilter == null ) scanFilter = new HashMap<String, Condition>(); scanFilter.put(attributeName, condition); return this; }
java
public DynamoDBScanExpression withFilterConditionEntry(String attributeName, Condition condition) { if ( scanFilter == null ) scanFilter = new HashMap<String, Condition>(); scanFilter.put(attributeName, condition); return this; }
[ "public", "DynamoDBScanExpression", "withFilterConditionEntry", "(", "String", "attributeName", ",", "Condition", "condition", ")", "{", "if", "(", "scanFilter", "==", "null", ")", "scanFilter", "=", "new", "HashMap", "<", "String", ",", "Condition", ">", "(", ")", ";", "scanFilter", ".", "put", "(", "attributeName", ",", "condition", ")", ";", "return", "this", ";", "}" ]
Adds a new filter condition to the current scan filter and returns a pointer to this object for method-chaining. @param attributeName The name of the attribute on which the specified condition operates. @param condition The condition which describes how the specified attribute is compared and if a row of data is included in the results returned by the scan operation.
[ "Adds", "a", "new", "filter", "condition", "to", "the", "current", "scan", "filter", "and", "returns", "a", "pointer", "to", "this", "object", "for", "method", "-", "chaining", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBScanExpression.java#L272-L278
20,507
aws/aws-sdk-java
aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/ListDeploymentsResult.java
ListDeploymentsResult.setDeployments
public void setDeployments(java.util.Collection<Deployment> deployments) { if (deployments == null) { this.deployments = null; return; } this.deployments = new java.util.ArrayList<Deployment>(deployments); }
java
public void setDeployments(java.util.Collection<Deployment> deployments) { if (deployments == null) { this.deployments = null; return; } this.deployments = new java.util.ArrayList<Deployment>(deployments); }
[ "public", "void", "setDeployments", "(", "java", ".", "util", ".", "Collection", "<", "Deployment", ">", "deployments", ")", "{", "if", "(", "deployments", "==", "null", ")", "{", "this", ".", "deployments", "=", "null", ";", "return", ";", "}", "this", ".", "deployments", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "Deployment", ">", "(", "deployments", ")", ";", "}" ]
A list of deployments for the requested groups. @param deployments A list of deployments for the requested groups.
[ "A", "list", "of", "deployments", "for", "the", "requested", "groups", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/ListDeploymentsResult.java#L48-L55
20,508
aws/aws-sdk-java
aws-java-sdk-mediapackage/src/main/java/com/amazonaws/services/mediapackage/model/HlsIngest.java
HlsIngest.setIngestEndpoints
public void setIngestEndpoints(java.util.Collection<IngestEndpoint> ingestEndpoints) { if (ingestEndpoints == null) { this.ingestEndpoints = null; return; } this.ingestEndpoints = new java.util.ArrayList<IngestEndpoint>(ingestEndpoints); }
java
public void setIngestEndpoints(java.util.Collection<IngestEndpoint> ingestEndpoints) { if (ingestEndpoints == null) { this.ingestEndpoints = null; return; } this.ingestEndpoints = new java.util.ArrayList<IngestEndpoint>(ingestEndpoints); }
[ "public", "void", "setIngestEndpoints", "(", "java", ".", "util", ".", "Collection", "<", "IngestEndpoint", ">", "ingestEndpoints", ")", "{", "if", "(", "ingestEndpoints", "==", "null", ")", "{", "this", ".", "ingestEndpoints", "=", "null", ";", "return", ";", "}", "this", ".", "ingestEndpoints", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "IngestEndpoint", ">", "(", "ingestEndpoints", ")", ";", "}" ]
A list of endpoints to which the source stream should be sent. @param ingestEndpoints A list of endpoints to which the source stream should be sent.
[ "A", "list", "of", "endpoints", "to", "which", "the", "source", "stream", "should", "be", "sent", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediapackage/src/main/java/com/amazonaws/services/mediapackage/model/HlsIngest.java#L49-L56
20,509
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java
DynamoDBMapper.privateMarshallIntoObject
private <T> T privateMarshallIntoObject( AttributeTransformer.Parameters<T> parameters) { Class<T> clazz = parameters.getModelClass(); Map<String, AttributeValue> values = untransformAttributes(parameters); final DynamoDBMapperTableModel<T> model = getTableModel(clazz, parameters.getMapperConfig()); return model.unconvert(values); }
java
private <T> T privateMarshallIntoObject( AttributeTransformer.Parameters<T> parameters) { Class<T> clazz = parameters.getModelClass(); Map<String, AttributeValue> values = untransformAttributes(parameters); final DynamoDBMapperTableModel<T> model = getTableModel(clazz, parameters.getMapperConfig()); return model.unconvert(values); }
[ "private", "<", "T", ">", "T", "privateMarshallIntoObject", "(", "AttributeTransformer", ".", "Parameters", "<", "T", ">", "parameters", ")", "{", "Class", "<", "T", ">", "clazz", "=", "parameters", ".", "getModelClass", "(", ")", ";", "Map", "<", "String", ",", "AttributeValue", ">", "values", "=", "untransformAttributes", "(", "parameters", ")", ";", "final", "DynamoDBMapperTableModel", "<", "T", ">", "model", "=", "getTableModel", "(", "clazz", ",", "parameters", ".", "getMapperConfig", "(", ")", ")", ";", "return", "model", ".", "unconvert", "(", "values", ")", ";", "}" ]
The one true implementation of marshallIntoObject.
[ "The", "one", "true", "implementation", "of", "marshallIntoObject", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java#L466-L474
20,510
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java
DynamoDBMapper.containsThrottlingException
private boolean containsThrottlingException (List<FailedBatch> failedBatches) { for (FailedBatch failedBatch : failedBatches) { if (failedBatch.isThrottling()) { return true; } } return false; }
java
private boolean containsThrottlingException (List<FailedBatch> failedBatches) { for (FailedBatch failedBatch : failedBatches) { if (failedBatch.isThrottling()) { return true; } } return false; }
[ "private", "boolean", "containsThrottlingException", "(", "List", "<", "FailedBatch", ">", "failedBatches", ")", "{", "for", "(", "FailedBatch", "failedBatch", ":", "failedBatches", ")", "{", "if", "(", "failedBatch", ".", "isThrottling", "(", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Check whether there are throttling exception in the failed batches.
[ "Check", "whether", "there", "are", "throttling", "exception", "in", "the", "failed", "batches", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java#L1306-L1313
20,511
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java
DynamoDBMapper.doBatchWriteItemWithRetry
private FailedBatch doBatchWriteItemWithRetry( Map<String, List<WriteRequest>> batch, BatchWriteRetryStrategy batchWriteRetryStrategy) { BatchWriteItemResult result = null; int retries = 0; int maxRetries = batchWriteRetryStrategy .getMaxRetryOnUnprocessedItems(Collections .unmodifiableMap(batch)); FailedBatch failedBatch = null; Map<String, List<WriteRequest>> pendingItems = batch; while (true) { try { result = db.batchWriteItem(applyBatchOperationUserAgent( new BatchWriteItemRequest().withRequestItems(pendingItems))); } catch (Exception e) { failedBatch = new FailedBatch(); failedBatch.setUnprocessedItems(pendingItems); failedBatch.setException(e); return failedBatch; } pendingItems = result.getUnprocessedItems(); if (pendingItems.size() > 0) { // return pendingItems as a FailedBatch if we have exceeded max retry if (maxRetries >= 0 && retries >= maxRetries) { failedBatch = new FailedBatch(); failedBatch.setUnprocessedItems(pendingItems); failedBatch.setException(null); return failedBatch; } pause(batchWriteRetryStrategy.getDelayBeforeRetryUnprocessedItems( Collections.unmodifiableMap(pendingItems), retries)); retries++; } else { break; } } return failedBatch; }
java
private FailedBatch doBatchWriteItemWithRetry( Map<String, List<WriteRequest>> batch, BatchWriteRetryStrategy batchWriteRetryStrategy) { BatchWriteItemResult result = null; int retries = 0; int maxRetries = batchWriteRetryStrategy .getMaxRetryOnUnprocessedItems(Collections .unmodifiableMap(batch)); FailedBatch failedBatch = null; Map<String, List<WriteRequest>> pendingItems = batch; while (true) { try { result = db.batchWriteItem(applyBatchOperationUserAgent( new BatchWriteItemRequest().withRequestItems(pendingItems))); } catch (Exception e) { failedBatch = new FailedBatch(); failedBatch.setUnprocessedItems(pendingItems); failedBatch.setException(e); return failedBatch; } pendingItems = result.getUnprocessedItems(); if (pendingItems.size() > 0) { // return pendingItems as a FailedBatch if we have exceeded max retry if (maxRetries >= 0 && retries >= maxRetries) { failedBatch = new FailedBatch(); failedBatch.setUnprocessedItems(pendingItems); failedBatch.setException(null); return failedBatch; } pause(batchWriteRetryStrategy.getDelayBeforeRetryUnprocessedItems( Collections.unmodifiableMap(pendingItems), retries)); retries++; } else { break; } } return failedBatch; }
[ "private", "FailedBatch", "doBatchWriteItemWithRetry", "(", "Map", "<", "String", ",", "List", "<", "WriteRequest", ">", ">", "batch", ",", "BatchWriteRetryStrategy", "batchWriteRetryStrategy", ")", "{", "BatchWriteItemResult", "result", "=", "null", ";", "int", "retries", "=", "0", ";", "int", "maxRetries", "=", "batchWriteRetryStrategy", ".", "getMaxRetryOnUnprocessedItems", "(", "Collections", ".", "unmodifiableMap", "(", "batch", ")", ")", ";", "FailedBatch", "failedBatch", "=", "null", ";", "Map", "<", "String", ",", "List", "<", "WriteRequest", ">", ">", "pendingItems", "=", "batch", ";", "while", "(", "true", ")", "{", "try", "{", "result", "=", "db", ".", "batchWriteItem", "(", "applyBatchOperationUserAgent", "(", "new", "BatchWriteItemRequest", "(", ")", ".", "withRequestItems", "(", "pendingItems", ")", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "failedBatch", "=", "new", "FailedBatch", "(", ")", ";", "failedBatch", ".", "setUnprocessedItems", "(", "pendingItems", ")", ";", "failedBatch", ".", "setException", "(", "e", ")", ";", "return", "failedBatch", ";", "}", "pendingItems", "=", "result", ".", "getUnprocessedItems", "(", ")", ";", "if", "(", "pendingItems", ".", "size", "(", ")", ">", "0", ")", "{", "// return pendingItems as a FailedBatch if we have exceeded max retry", "if", "(", "maxRetries", ">=", "0", "&&", "retries", ">=", "maxRetries", ")", "{", "failedBatch", "=", "new", "FailedBatch", "(", ")", ";", "failedBatch", ".", "setUnprocessedItems", "(", "pendingItems", ")", ";", "failedBatch", ".", "setException", "(", "null", ")", ";", "return", "failedBatch", ";", "}", "pause", "(", "batchWriteRetryStrategy", ".", "getDelayBeforeRetryUnprocessedItems", "(", "Collections", ".", "unmodifiableMap", "(", "pendingItems", ")", ",", "retries", ")", ")", ";", "retries", "++", ";", "}", "else", "{", "break", ";", "}", "}", "return", "failedBatch", ";", "}" ]
Continue trying to process the batch and retry on UnproccessedItems as according to the specified BatchWriteRetryStrategy
[ "Continue", "trying", "to", "process", "the", "batch", "and", "retry", "on", "UnproccessedItems", "as", "according", "to", "the", "specified", "BatchWriteRetryStrategy" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java#L1319-L1362
20,512
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java
DynamoDBMapper.anyKeyGeneratable
private static <T> boolean anyKeyGeneratable( final DynamoDBMapperTableModel<T> model, final T object, final SaveBehavior saveBehavior ) { for (final DynamoDBMapperFieldModel<T, Object> field : model.keys()) { if (canGenerate(model, object, saveBehavior, field)) { return true; } } return false; }
java
private static <T> boolean anyKeyGeneratable( final DynamoDBMapperTableModel<T> model, final T object, final SaveBehavior saveBehavior ) { for (final DynamoDBMapperFieldModel<T, Object> field : model.keys()) { if (canGenerate(model, object, saveBehavior, field)) { return true; } } return false; }
[ "private", "static", "<", "T", ">", "boolean", "anyKeyGeneratable", "(", "final", "DynamoDBMapperTableModel", "<", "T", ">", "model", ",", "final", "T", "object", ",", "final", "SaveBehavior", "saveBehavior", ")", "{", "for", "(", "final", "DynamoDBMapperFieldModel", "<", "T", ",", "Object", ">", "field", ":", "model", ".", "keys", "(", ")", ")", "{", "if", "(", "canGenerate", "(", "model", ",", "object", ",", "saveBehavior", ",", "field", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Determnes if any of the primary keys require auto-generation.
[ "Determnes", "if", "any", "of", "the", "primary", "keys", "require", "auto", "-", "generation", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java#L1503-L1514
20,513
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java
DynamoDBMapper.canGenerate
private static <T> boolean canGenerate( final DynamoDBMapperTableModel<T> model, final T object, final SaveBehavior saveBehavior, final DynamoDBMapperFieldModel<T,Object> field ) { if (field.getGenerateStrategy() == null) { return false; } else if (field.getGenerateStrategy() == DynamoDBAutoGenerateStrategy.ALWAYS) { return true; } else if (field.get(object) != null) { return false; } else if (field.keyType() != null || field.indexed()) { return true; } else if (saveBehavior == SaveBehavior.CLOBBER || saveBehavior == SaveBehavior.UPDATE || saveBehavior == SaveBehavior.PUT) { return true; } else if (anyKeyGeneratable(model, object, saveBehavior)) { return true; } return false; }
java
private static <T> boolean canGenerate( final DynamoDBMapperTableModel<T> model, final T object, final SaveBehavior saveBehavior, final DynamoDBMapperFieldModel<T,Object> field ) { if (field.getGenerateStrategy() == null) { return false; } else if (field.getGenerateStrategy() == DynamoDBAutoGenerateStrategy.ALWAYS) { return true; } else if (field.get(object) != null) { return false; } else if (field.keyType() != null || field.indexed()) { return true; } else if (saveBehavior == SaveBehavior.CLOBBER || saveBehavior == SaveBehavior.UPDATE || saveBehavior == SaveBehavior.PUT) { return true; } else if (anyKeyGeneratable(model, object, saveBehavior)) { return true; } return false; }
[ "private", "static", "<", "T", ">", "boolean", "canGenerate", "(", "final", "DynamoDBMapperTableModel", "<", "T", ">", "model", ",", "final", "T", "object", ",", "final", "SaveBehavior", "saveBehavior", ",", "final", "DynamoDBMapperFieldModel", "<", "T", ",", "Object", ">", "field", ")", "{", "if", "(", "field", ".", "getGenerateStrategy", "(", ")", "==", "null", ")", "{", "return", "false", ";", "}", "else", "if", "(", "field", ".", "getGenerateStrategy", "(", ")", "==", "DynamoDBAutoGenerateStrategy", ".", "ALWAYS", ")", "{", "return", "true", ";", "}", "else", "if", "(", "field", ".", "get", "(", "object", ")", "!=", "null", ")", "{", "return", "false", ";", "}", "else", "if", "(", "field", ".", "keyType", "(", ")", "!=", "null", "||", "field", ".", "indexed", "(", ")", ")", "{", "return", "true", ";", "}", "else", "if", "(", "saveBehavior", "==", "SaveBehavior", ".", "CLOBBER", "||", "saveBehavior", "==", "SaveBehavior", ".", "UPDATE", "||", "saveBehavior", "==", "SaveBehavior", ".", "PUT", ")", "{", "return", "true", ";", "}", "else", "if", "(", "anyKeyGeneratable", "(", "model", ",", "object", ",", "saveBehavior", ")", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}" ]
Determines if the mapping value can be auto-generated.
[ "Determines", "if", "the", "mapping", "value", "can", "be", "auto", "-", "generated", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java#L1519-L1541
20,514
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java
DynamoDBMapper.newTableMapper
public <T,H,R> DynamoDBTableMapper<T,H,R> newTableMapper(Class<T> clazz) { DynamoDBMapperConfig config = mergeConfig(null); return new DynamoDBTableMapper<T,H,R>(this.db, this, config, getTableModel(clazz, config)); }
java
public <T,H,R> DynamoDBTableMapper<T,H,R> newTableMapper(Class<T> clazz) { DynamoDBMapperConfig config = mergeConfig(null); return new DynamoDBTableMapper<T,H,R>(this.db, this, config, getTableModel(clazz, config)); }
[ "public", "<", "T", ",", "H", ",", "R", ">", "DynamoDBTableMapper", "<", "T", ",", "H", ",", "R", ">", "newTableMapper", "(", "Class", "<", "T", ">", "clazz", ")", "{", "DynamoDBMapperConfig", "config", "=", "mergeConfig", "(", "null", ")", ";", "return", "new", "DynamoDBTableMapper", "<", "T", ",", "H", ",", "R", ">", "(", "this", ".", "db", ",", "this", ",", "config", ",", "getTableModel", "(", "clazz", ",", "config", ")", ")", ";", "}" ]
Creates a new table mapper using this mapper to perform operations. @param <T> The object type which this mapper operates. @param <H> The hash key value type. @param <R> The range key value type; use <code>?</code> if no range key. @param clazz The object class. @return The table mapper.
[ "Creates", "a", "new", "table", "mapper", "using", "this", "mapper", "to", "perform", "operations", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java#L2307-L2310
20,515
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java
DynamoDBMapper.pause
private static void pause(long delay) { if (delay <= 0) { return; } try { Thread.sleep(delay); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new SdkClientException(e.getMessage(), e); } }
java
private static void pause(long delay) { if (delay <= 0) { return; } try { Thread.sleep(delay); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new SdkClientException(e.getMessage(), e); } }
[ "private", "static", "void", "pause", "(", "long", "delay", ")", "{", "if", "(", "delay", "<=", "0", ")", "{", "return", ";", "}", "try", "{", "Thread", ".", "sleep", "(", "delay", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "Thread", ".", "currentThread", "(", ")", ".", "interrupt", "(", ")", ";", "throw", "new", "SdkClientException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "}" ]
Batch pause.
[ "Batch", "pause", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapper.java#L2394-L2404
20,516
aws/aws-sdk-java
aws-java-sdk-rdsdata/src/main/java/com/amazonaws/services/rdsdata/model/Value.java
Value.setArrayValues
public void setArrayValues(java.util.Collection<Value> arrayValues) { if (arrayValues == null) { this.arrayValues = null; return; } this.arrayValues = new java.util.ArrayList<Value>(arrayValues); }
java
public void setArrayValues(java.util.Collection<Value> arrayValues) { if (arrayValues == null) { this.arrayValues = null; return; } this.arrayValues = new java.util.ArrayList<Value>(arrayValues); }
[ "public", "void", "setArrayValues", "(", "java", ".", "util", ".", "Collection", "<", "Value", ">", "arrayValues", ")", "{", "if", "(", "arrayValues", "==", "null", ")", "{", "this", ".", "arrayValues", "=", "null", ";", "return", ";", "}", "this", ".", "arrayValues", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "Value", ">", "(", "arrayValues", ")", ";", "}" ]
Arbitrarily nested arrays @param arrayValues Arbitrarily nested arrays
[ "Arbitrarily", "nested", "arrays" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rdsdata/src/main/java/com/amazonaws/services/rdsdata/model/Value.java#L67-L74
20,517
aws/aws-sdk-java
aws-java-sdk-pinpointsmsvoice/src/main/java/com/amazonaws/services/pinpointsmsvoice/model/ListConfigurationSetsResult.java
ListConfigurationSetsResult.setConfigurationSets
public void setConfigurationSets(java.util.Collection<String> configurationSets) { if (configurationSets == null) { this.configurationSets = null; return; } this.configurationSets = new java.util.ArrayList<String>(configurationSets); }
java
public void setConfigurationSets(java.util.Collection<String> configurationSets) { if (configurationSets == null) { this.configurationSets = null; return; } this.configurationSets = new java.util.ArrayList<String>(configurationSets); }
[ "public", "void", "setConfigurationSets", "(", "java", ".", "util", ".", "Collection", "<", "String", ">", "configurationSets", ")", "{", "if", "(", "configurationSets", "==", "null", ")", "{", "this", ".", "configurationSets", "=", "null", ";", "return", ";", "}", "this", ".", "configurationSets", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "String", ">", "(", "configurationSets", ")", ";", "}" ]
An object that contains a list of configuration sets for your account in the current region. @param configurationSets An object that contains a list of configuration sets for your account in the current region.
[ "An", "object", "that", "contains", "a", "list", "of", "configuration", "sets", "for", "your", "account", "in", "the", "current", "region", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpointsmsvoice/src/main/java/com/amazonaws/services/pinpointsmsvoice/model/ListConfigurationSetsResult.java#L52-L59
20,518
aws/aws-sdk-java
aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java
ValidationContext.assertIsValidReferencePath
public void assertIsValidReferencePath(String path, String propertyName) { if (path == null) { return; } if (path.isEmpty()) { problemReporter.report(new Problem(this, String.format("%s cannot be empty", propertyName))); return; } }
java
public void assertIsValidReferencePath(String path, String propertyName) { if (path == null) { return; } if (path.isEmpty()) { problemReporter.report(new Problem(this, String.format("%s cannot be empty", propertyName))); return; } }
[ "public", "void", "assertIsValidReferencePath", "(", "String", "path", ",", "String", "propertyName", ")", "{", "if", "(", "path", "==", "null", ")", "{", "return", ";", "}", "if", "(", "path", ".", "isEmpty", "(", ")", ")", "{", "problemReporter", ".", "report", "(", "new", "Problem", "(", "this", ",", "String", ".", "format", "(", "\"%s cannot be empty\"", ",", "propertyName", ")", ")", ")", ";", "return", ";", "}", "}" ]
Asserts that the string represents a valid reference path expression. @param path Path expression to validate. @param propertyName Name of property.
[ "Asserts", "that", "the", "string", "represents", "a", "valid", "reference", "path", "expression", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/internal/validation/ValidationContext.java#L181-L189
20,519
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/Constants.java
Constants.getStreamBufferSize
@Deprecated public static int getStreamBufferSize() { int streamBufferSize = DEFAULT_STREAM_BUFFER_SIZE; String bufferSizeOverride = System.getProperty(SDKGlobalConfiguration.DEFAULT_S3_STREAM_BUFFER_SIZE); if (bufferSizeOverride != null) { try { streamBufferSize = Integer.parseInt(bufferSizeOverride); } catch (Exception e) { log.warn("Unable to parse buffer size override from value: " + bufferSizeOverride); } } return streamBufferSize; }
java
@Deprecated public static int getStreamBufferSize() { int streamBufferSize = DEFAULT_STREAM_BUFFER_SIZE; String bufferSizeOverride = System.getProperty(SDKGlobalConfiguration.DEFAULT_S3_STREAM_BUFFER_SIZE); if (bufferSizeOverride != null) { try { streamBufferSize = Integer.parseInt(bufferSizeOverride); } catch (Exception e) { log.warn("Unable to parse buffer size override from value: " + bufferSizeOverride); } } return streamBufferSize; }
[ "@", "Deprecated", "public", "static", "int", "getStreamBufferSize", "(", ")", "{", "int", "streamBufferSize", "=", "DEFAULT_STREAM_BUFFER_SIZE", ";", "String", "bufferSizeOverride", "=", "System", ".", "getProperty", "(", "SDKGlobalConfiguration", ".", "DEFAULT_S3_STREAM_BUFFER_SIZE", ")", ";", "if", "(", "bufferSizeOverride", "!=", "null", ")", "{", "try", "{", "streamBufferSize", "=", "Integer", ".", "parseInt", "(", "bufferSizeOverride", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "log", ".", "warn", "(", "\"Unable to parse buffer size override from value: \"", "+", "bufferSizeOverride", ")", ";", "}", "}", "return", "streamBufferSize", ";", "}" ]
Returns the buffer size override if it is specified in the system property, otherwise returns the default value.
[ "Returns", "the", "buffer", "size", "override", "if", "it", "is", "specified", "in", "the", "system", "property", "otherwise", "returns", "the", "default", "value", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/Constants.java#L92-L106
20,520
aws/aws-sdk-java
aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/CreateInputSecurityGroupRequest.java
CreateInputSecurityGroupRequest.setWhitelistRules
public void setWhitelistRules(java.util.Collection<InputWhitelistRuleCidr> whitelistRules) { if (whitelistRules == null) { this.whitelistRules = null; return; } this.whitelistRules = new java.util.ArrayList<InputWhitelistRuleCidr>(whitelistRules); }
java
public void setWhitelistRules(java.util.Collection<InputWhitelistRuleCidr> whitelistRules) { if (whitelistRules == null) { this.whitelistRules = null; return; } this.whitelistRules = new java.util.ArrayList<InputWhitelistRuleCidr>(whitelistRules); }
[ "public", "void", "setWhitelistRules", "(", "java", ".", "util", ".", "Collection", "<", "InputWhitelistRuleCidr", ">", "whitelistRules", ")", "{", "if", "(", "whitelistRules", "==", "null", ")", "{", "this", ".", "whitelistRules", "=", "null", ";", "return", ";", "}", "this", ".", "whitelistRules", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "InputWhitelistRuleCidr", ">", "(", "whitelistRules", ")", ";", "}" ]
List of IPv4 CIDR addresses to whitelist @param whitelistRules List of IPv4 CIDR addresses to whitelist
[ "List", "of", "IPv4", "CIDR", "addresses", "to", "whitelist" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/CreateInputSecurityGroupRequest.java#L106-L113
20,521
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseXmlInputStream
protected void parseXmlInputStream(DefaultHandler handler, InputStream inputStream) throws IOException { try { if (log.isDebugEnabled()) { log.debug("Parsing XML response document with handler: " + handler.getClass()); } BufferedReader breader = new BufferedReader(new InputStreamReader(inputStream, Constants.DEFAULT_ENCODING)); xr.setContentHandler(handler); xr.setErrorHandler(handler); xr.parse(new InputSource(breader)); } catch (IOException e) { throw e; } catch (Throwable t) { try { inputStream.close(); } catch (IOException e) { if (log.isErrorEnabled()) { log.error("Unable to close response InputStream up after XML parse failure", e); } } throw new SdkClientException("Failed to parse XML document with handler " + handler.getClass(), t); } }
java
protected void parseXmlInputStream(DefaultHandler handler, InputStream inputStream) throws IOException { try { if (log.isDebugEnabled()) { log.debug("Parsing XML response document with handler: " + handler.getClass()); } BufferedReader breader = new BufferedReader(new InputStreamReader(inputStream, Constants.DEFAULT_ENCODING)); xr.setContentHandler(handler); xr.setErrorHandler(handler); xr.parse(new InputSource(breader)); } catch (IOException e) { throw e; } catch (Throwable t) { try { inputStream.close(); } catch (IOException e) { if (log.isErrorEnabled()) { log.error("Unable to close response InputStream up after XML parse failure", e); } } throw new SdkClientException("Failed to parse XML document with handler " + handler.getClass(), t); } }
[ "protected", "void", "parseXmlInputStream", "(", "DefaultHandler", "handler", ",", "InputStream", "inputStream", ")", "throws", "IOException", "{", "try", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"Parsing XML response document with handler: \"", "+", "handler", ".", "getClass", "(", ")", ")", ";", "}", "BufferedReader", "breader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "inputStream", ",", "Constants", ".", "DEFAULT_ENCODING", ")", ")", ";", "xr", ".", "setContentHandler", "(", "handler", ")", ";", "xr", ".", "setErrorHandler", "(", "handler", ")", ";", "xr", ".", "parse", "(", "new", "InputSource", "(", "breader", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "e", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "try", "{", "inputStream", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "if", "(", "log", ".", "isErrorEnabled", "(", ")", ")", "{", "log", ".", "error", "(", "\"Unable to close response InputStream up after XML parse failure\"", ",", "e", ")", ";", "}", "}", "throw", "new", "SdkClientException", "(", "\"Failed to parse XML document with handler \"", "+", "handler", ".", "getClass", "(", ")", ",", "t", ")", ";", "}", "}" ]
Parses an XML document from an input stream using a document handler. @param handler the handler for the XML document @param inputStream an input stream containing the XML document to parse @throws IOException on error reading from the input stream (ie connection reset) @throws SdkClientException on error with malformed XML, etc
[ "Parses", "an", "XML", "document", "from", "an", "input", "stream", "using", "a", "document", "handler", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L140-L168
20,522
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.disableExternalResourceFetching
private void disableExternalResourceFetching(XMLReader reader) throws SAXNotRecognizedException, SAXNotSupportedException { reader.setFeature("http://xml.org/sax/features/external-general-entities", false); reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",false); }
java
private void disableExternalResourceFetching(XMLReader reader) throws SAXNotRecognizedException, SAXNotSupportedException { reader.setFeature("http://xml.org/sax/features/external-general-entities", false); reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",false); }
[ "private", "void", "disableExternalResourceFetching", "(", "XMLReader", "reader", ")", "throws", "SAXNotRecognizedException", ",", "SAXNotSupportedException", "{", "reader", ".", "setFeature", "(", "\"http://xml.org/sax/features/external-general-entities\"", ",", "false", ")", ";", "reader", ".", "setFeature", "(", "\"http://xml.org/sax/features/external-parameter-entities\"", ",", "false", ")", ";", "reader", ".", "setFeature", "(", "\"http://apache.org/xml/features/nonvalidating/load-external-dtd\"", ",", "false", ")", ";", "}" ]
Disables certain dangerous features that attempt to automatically fetch DTDs See <a href="https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet#XMLReader">OWASP XXE Cheat Sheet</a> @param reader the reader to disable the features on @throws SAXNotRecognizedException @throws SAXNotSupportedException
[ "Disables", "certain", "dangerous", "features", "that", "attempt", "to", "automatically", "fetch", "DTDs" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L238-L242
20,523
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.checkForEmptyString
private static String checkForEmptyString(String s) { if (s == null) return null; if (s.length() == 0) return null; return s; }
java
private static String checkForEmptyString(String s) { if (s == null) return null; if (s.length() == 0) return null; return s; }
[ "private", "static", "String", "checkForEmptyString", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "return", "null", ";", "if", "(", "s", ".", "length", "(", ")", "==", "0", ")", "return", "null", ";", "return", "s", ";", "}" ]
Checks if the specified string is empty or null and if so, returns null. Otherwise simply returns the string. @param s The string to check. @return Null if the specified string was null, or empty, otherwise returns the string the caller passed in.
[ "Checks", "if", "the", "specified", "string", "is", "empty", "or", "null", "and", "if", "so", "returns", "null", ".", "Otherwise", "simply", "returns", "the", "string", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L253-L258
20,524
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseInt
private static int parseInt(String s) { try { return Integer.parseInt(s); } catch (NumberFormatException nfe) { log.error("Unable to parse integer value '" + s + "'", nfe); } return -1; }
java
private static int parseInt(String s) { try { return Integer.parseInt(s); } catch (NumberFormatException nfe) { log.error("Unable to parse integer value '" + s + "'", nfe); } return -1; }
[ "private", "static", "int", "parseInt", "(", "String", "s", ")", "{", "try", "{", "return", "Integer", ".", "parseInt", "(", "s", ")", ";", "}", "catch", "(", "NumberFormatException", "nfe", ")", "{", "log", ".", "error", "(", "\"Unable to parse integer value '\"", "+", "s", "+", "\"'\"", ",", "nfe", ")", ";", "}", "return", "-", "1", ";", "}" ]
Safely parses the specified string as an integer and returns the value. If a NumberFormatException occurs while parsing the integer, an error is logged and -1 is returned. @param s The string to parse and return as an integer. @return The integer value of the specified string, otherwise -1 if there were any problems parsing the string as an integer.
[ "Safely", "parses", "the", "specified", "string", "as", "an", "integer", "and", "returns", "the", "value", ".", "If", "a", "NumberFormatException", "occurs", "while", "parsing", "the", "integer", "an", "error", "is", "logged", "and", "-", "1", "is", "returned", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L271-L279
20,525
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseLong
private static long parseLong(String s) { try { return Long.parseLong(s); } catch (NumberFormatException nfe) { log.error("Unable to parse long value '" + s + "'", nfe); } return -1; }
java
private static long parseLong(String s) { try { return Long.parseLong(s); } catch (NumberFormatException nfe) { log.error("Unable to parse long value '" + s + "'", nfe); } return -1; }
[ "private", "static", "long", "parseLong", "(", "String", "s", ")", "{", "try", "{", "return", "Long", ".", "parseLong", "(", "s", ")", ";", "}", "catch", "(", "NumberFormatException", "nfe", ")", "{", "log", ".", "error", "(", "\"Unable to parse long value '\"", "+", "s", "+", "\"'\"", ",", "nfe", ")", ";", "}", "return", "-", "1", ";", "}" ]
Safely parses the specified string as a long and returns the value. If a NumberFormatException occurs while parsing the long, an error is logged and -1 is returned. @param s The string to parse and return as a long. @return The long value of the specified string, otherwise -1 if there were any problems parsing the string as a long.
[ "Safely", "parses", "the", "specified", "string", "as", "a", "long", "and", "returns", "the", "value", ".", "If", "a", "NumberFormatException", "occurs", "while", "parsing", "the", "long", "an", "error", "is", "logged", "and", "-", "1", "is", "returned", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L292-L300
20,526
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.decodeIfSpecified
private static String decodeIfSpecified(String value, boolean decode) { return decode ? SdkHttpUtils.urlDecode(value) : value; }
java
private static String decodeIfSpecified(String value, boolean decode) { return decode ? SdkHttpUtils.urlDecode(value) : value; }
[ "private", "static", "String", "decodeIfSpecified", "(", "String", "value", ",", "boolean", "decode", ")", "{", "return", "decode", "?", "SdkHttpUtils", ".", "urlDecode", "(", "value", ")", ":", "value", ";", "}" ]
Perform a url decode on the given value if specified. Return value by default;
[ "Perform", "a", "url", "decode", "on", "the", "given", "value", "if", "specified", ".", "Return", "value", "by", "default", ";" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L306-L308
20,527
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseListBucketObjectsResponse
public ListBucketHandler parseListBucketObjectsResponse(InputStream inputStream, final boolean shouldSDKDecodeResponse) throws IOException { ListBucketHandler handler = new ListBucketHandler(shouldSDKDecodeResponse); parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)); return handler; }
java
public ListBucketHandler parseListBucketObjectsResponse(InputStream inputStream, final boolean shouldSDKDecodeResponse) throws IOException { ListBucketHandler handler = new ListBucketHandler(shouldSDKDecodeResponse); parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)); return handler; }
[ "public", "ListBucketHandler", "parseListBucketObjectsResponse", "(", "InputStream", "inputStream", ",", "final", "boolean", "shouldSDKDecodeResponse", ")", "throws", "IOException", "{", "ListBucketHandler", "handler", "=", "new", "ListBucketHandler", "(", "shouldSDKDecodeResponse", ")", ";", "parseXmlInputStream", "(", "handler", ",", "sanitizeXmlDocument", "(", "handler", ",", "inputStream", ")", ")", ";", "return", "handler", ";", "}" ]
Parses a ListBucket response XML document from an input stream. @param inputStream XML data input stream. @return the XML handler object populated with data parsed from the XML stream. @throws SdkClientException
[ "Parses", "a", "ListBucket", "response", "XML", "document", "from", "an", "input", "stream", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L319-L325
20,528
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseListObjectsV2Response
public ListObjectsV2Handler parseListObjectsV2Response(InputStream inputStream, final boolean shouldSDKDecodeResponse) throws IOException { ListObjectsV2Handler handler = new ListObjectsV2Handler(shouldSDKDecodeResponse); parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)); return handler; }
java
public ListObjectsV2Handler parseListObjectsV2Response(InputStream inputStream, final boolean shouldSDKDecodeResponse) throws IOException { ListObjectsV2Handler handler = new ListObjectsV2Handler(shouldSDKDecodeResponse); parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)); return handler; }
[ "public", "ListObjectsV2Handler", "parseListObjectsV2Response", "(", "InputStream", "inputStream", ",", "final", "boolean", "shouldSDKDecodeResponse", ")", "throws", "IOException", "{", "ListObjectsV2Handler", "handler", "=", "new", "ListObjectsV2Handler", "(", "shouldSDKDecodeResponse", ")", ";", "parseXmlInputStream", "(", "handler", ",", "sanitizeXmlDocument", "(", "handler", ",", "inputStream", ")", ")", ";", "return", "handler", ";", "}" ]
Parses a ListBucketV2 response XML document from an input stream. @param inputStream XML data input stream. @return the XML handler object populated with data parsed from the XML stream. @throws SdkClientException
[ "Parses", "a", "ListBucketV2", "response", "XML", "document", "from", "an", "input", "stream", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L336-L342
20,529
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseListVersionsResponse
public ListVersionsHandler parseListVersionsResponse(InputStream inputStream, final boolean shouldSDKDecodeResponse) throws IOException { ListVersionsHandler handler = new ListVersionsHandler(shouldSDKDecodeResponse); parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)); return handler; }
java
public ListVersionsHandler parseListVersionsResponse(InputStream inputStream, final boolean shouldSDKDecodeResponse) throws IOException { ListVersionsHandler handler = new ListVersionsHandler(shouldSDKDecodeResponse); parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)); return handler; }
[ "public", "ListVersionsHandler", "parseListVersionsResponse", "(", "InputStream", "inputStream", ",", "final", "boolean", "shouldSDKDecodeResponse", ")", "throws", "IOException", "{", "ListVersionsHandler", "handler", "=", "new", "ListVersionsHandler", "(", "shouldSDKDecodeResponse", ")", ";", "parseXmlInputStream", "(", "handler", ",", "sanitizeXmlDocument", "(", "handler", ",", "inputStream", ")", ")", ";", "return", "handler", ";", "}" ]
Parses a ListVersions response XML document from an input stream. @param inputStream XML data input stream. @return the XML handler object populated with data parsed from the XML stream. @throws SdkClientException
[ "Parses", "a", "ListVersions", "response", "XML", "document", "from", "an", "input", "stream", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L353-L358
20,530
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseListMyBucketsResponse
public ListAllMyBucketsHandler parseListMyBucketsResponse(InputStream inputStream) throws IOException { ListAllMyBucketsHandler handler = new ListAllMyBucketsHandler(); parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)); return handler; }
java
public ListAllMyBucketsHandler parseListMyBucketsResponse(InputStream inputStream) throws IOException { ListAllMyBucketsHandler handler = new ListAllMyBucketsHandler(); parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)); return handler; }
[ "public", "ListAllMyBucketsHandler", "parseListMyBucketsResponse", "(", "InputStream", "inputStream", ")", "throws", "IOException", "{", "ListAllMyBucketsHandler", "handler", "=", "new", "ListAllMyBucketsHandler", "(", ")", ";", "parseXmlInputStream", "(", "handler", ",", "sanitizeXmlDocument", "(", "handler", ",", "inputStream", ")", ")", ";", "return", "handler", ";", "}" ]
Parses a ListAllMyBuckets response XML document from an input stream. @param inputStream XML data input stream. @return the XML handler object populated with data parsed from the XML stream. @throws SdkClientException
[ "Parses", "a", "ListAllMyBuckets", "response", "XML", "document", "from", "an", "input", "stream", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L369-L374
20,531
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseAccessControlListResponse
public AccessControlListHandler parseAccessControlListResponse(InputStream inputStream) throws IOException { AccessControlListHandler handler = new AccessControlListHandler(); parseXmlInputStream(handler, inputStream); return handler; }
java
public AccessControlListHandler parseAccessControlListResponse(InputStream inputStream) throws IOException { AccessControlListHandler handler = new AccessControlListHandler(); parseXmlInputStream(handler, inputStream); return handler; }
[ "public", "AccessControlListHandler", "parseAccessControlListResponse", "(", "InputStream", "inputStream", ")", "throws", "IOException", "{", "AccessControlListHandler", "handler", "=", "new", "AccessControlListHandler", "(", ")", ";", "parseXmlInputStream", "(", "handler", ",", "inputStream", ")", ";", "return", "handler", ";", "}" ]
Parses an AccessControlListHandler response XML document from an input stream. @param inputStream XML data input stream. @return the XML handler object populated with data parsed from the XML stream. @throws SdkClientException
[ "Parses", "an", "AccessControlListHandler", "response", "XML", "document", "from", "an", "input", "stream", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L387-L392
20,532
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseLoggingStatusResponse
public BucketLoggingConfigurationHandler parseLoggingStatusResponse(InputStream inputStream) throws IOException { BucketLoggingConfigurationHandler handler = new BucketLoggingConfigurationHandler(); parseXmlInputStream(handler, inputStream); return handler; }
java
public BucketLoggingConfigurationHandler parseLoggingStatusResponse(InputStream inputStream) throws IOException { BucketLoggingConfigurationHandler handler = new BucketLoggingConfigurationHandler(); parseXmlInputStream(handler, inputStream); return handler; }
[ "public", "BucketLoggingConfigurationHandler", "parseLoggingStatusResponse", "(", "InputStream", "inputStream", ")", "throws", "IOException", "{", "BucketLoggingConfigurationHandler", "handler", "=", "new", "BucketLoggingConfigurationHandler", "(", ")", ";", "parseXmlInputStream", "(", "handler", ",", "inputStream", ")", ";", "return", "handler", ";", "}" ]
Parses a LoggingStatus response XML document for a bucket from an input stream. @param inputStream XML data input stream. @return the XML handler object populated with data parsed from the XML stream. @throws SdkClientException
[ "Parses", "a", "LoggingStatus", "response", "XML", "document", "for", "a", "bucket", "from", "an", "input", "stream", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L405-L410
20,533
aws/aws-sdk-java
aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/DescribeBrokerResult.java
DescribeBrokerResult.setBrokerInstances
public void setBrokerInstances(java.util.Collection<BrokerInstance> brokerInstances) { if (brokerInstances == null) { this.brokerInstances = null; return; } this.brokerInstances = new java.util.ArrayList<BrokerInstance>(brokerInstances); }
java
public void setBrokerInstances(java.util.Collection<BrokerInstance> brokerInstances) { if (brokerInstances == null) { this.brokerInstances = null; return; } this.brokerInstances = new java.util.ArrayList<BrokerInstance>(brokerInstances); }
[ "public", "void", "setBrokerInstances", "(", "java", ".", "util", ".", "Collection", "<", "BrokerInstance", ">", "brokerInstances", ")", "{", "if", "(", "brokerInstances", "==", "null", ")", "{", "this", ".", "brokerInstances", "=", "null", ";", "return", ";", "}", "this", ".", "brokerInstances", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "BrokerInstance", ">", "(", "brokerInstances", ")", ";", "}" ]
A list of information about allocated brokers. @param brokerInstances A list of information about allocated brokers.
[ "A", "list", "of", "information", "about", "allocated", "brokers", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/DescribeBrokerResult.java#L221-L228
20,534
aws/aws-sdk-java
aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/DescribeBrokerResult.java
DescribeBrokerResult.withTags
public DescribeBrokerResult withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
java
public DescribeBrokerResult withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "DescribeBrokerResult", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
The list of all tags associated with this broker. @param tags The list of all tags associated with this broker. @return Returns a reference to this object so that method calls can be chained together.
[ "The", "list", "of", "all", "tags", "associated", "with", "this", "broker", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/DescribeBrokerResult.java#L928-L931
20,535
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/CopyMonitor.java
CopyMonitor.create
public static CopyMonitor create( TransferManager manager, CopyImpl transfer, ExecutorService threadPool, CopyCallable multipartCopyCallable, CopyObjectRequest copyObjectRequest, ProgressListenerChain progressListenerChain) { CopyMonitor copyMonitor = new CopyMonitor(manager, transfer, threadPool, multipartCopyCallable, copyObjectRequest, progressListenerChain); Future<CopyResult> thisFuture = threadPool.submit(copyMonitor); // Use an atomic compareAndSet to prevent a possible race between the // setting of the CopyMonitor's futureReference, and setting the // CompleteMultipartCopy's futureReference within the call() method. // We only want to set the futureReference to CopyMonitor's futureReference if the // current value is null, otherwise the futureReference that's set is // CompleteMultipartCopy's which is ultimately what we want. copyMonitor.futureReference.compareAndSet(null, thisFuture); return copyMonitor; }
java
public static CopyMonitor create( TransferManager manager, CopyImpl transfer, ExecutorService threadPool, CopyCallable multipartCopyCallable, CopyObjectRequest copyObjectRequest, ProgressListenerChain progressListenerChain) { CopyMonitor copyMonitor = new CopyMonitor(manager, transfer, threadPool, multipartCopyCallable, copyObjectRequest, progressListenerChain); Future<CopyResult> thisFuture = threadPool.submit(copyMonitor); // Use an atomic compareAndSet to prevent a possible race between the // setting of the CopyMonitor's futureReference, and setting the // CompleteMultipartCopy's futureReference within the call() method. // We only want to set the futureReference to CopyMonitor's futureReference if the // current value is null, otherwise the futureReference that's set is // CompleteMultipartCopy's which is ultimately what we want. copyMonitor.futureReference.compareAndSet(null, thisFuture); return copyMonitor; }
[ "public", "static", "CopyMonitor", "create", "(", "TransferManager", "manager", ",", "CopyImpl", "transfer", ",", "ExecutorService", "threadPool", ",", "CopyCallable", "multipartCopyCallable", ",", "CopyObjectRequest", "copyObjectRequest", ",", "ProgressListenerChain", "progressListenerChain", ")", "{", "CopyMonitor", "copyMonitor", "=", "new", "CopyMonitor", "(", "manager", ",", "transfer", ",", "threadPool", ",", "multipartCopyCallable", ",", "copyObjectRequest", ",", "progressListenerChain", ")", ";", "Future", "<", "CopyResult", ">", "thisFuture", "=", "threadPool", ".", "submit", "(", "copyMonitor", ")", ";", "// Use an atomic compareAndSet to prevent a possible race between the\r", "// setting of the CopyMonitor's futureReference, and setting the\r", "// CompleteMultipartCopy's futureReference within the call() method.\r", "// We only want to set the futureReference to CopyMonitor's futureReference if the\r", "// current value is null, otherwise the futureReference that's set is\r", "// CompleteMultipartCopy's which is ultimately what we want.\r", "copyMonitor", ".", "futureReference", ".", "compareAndSet", "(", "null", ",", "thisFuture", ")", ";", "return", "copyMonitor", ";", "}" ]
Constructs a new watcher for copy operation, and then immediately submits it to the thread pool. @param manager The {@link TransferManager} that owns this copy request. @param threadPool The {@link ExecutorService} to which we should submit new tasks. @param multipartCopyCallable The callable responsible for processing the copy asynchronously @param copyObjectRequest The original CopyObject request
[ "Constructs", "a", "new", "watcher", "for", "copy", "operation", "and", "then", "immediately", "submits", "it", "to", "the", "thread", "pool", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/CopyMonitor.java#L94-L114
20,536
aws/aws-sdk-java
aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/PredefinedMetricTransformer.java
PredefinedMetricTransformer.metricOfRequestOrRetryCount
protected List<MetricDatum> metricOfRequestOrRetryCount( Field metricType, Request<?> req, Object resp) { AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo ti = m.getTimingInfo(); // Always retrieve the request count even for retry which is equivalent // to the number of requests minus one. Number counter = ti.getCounter(Field.RequestCount.name()); if (counter == null) { // this is possible if one of the request handlers screwed up return Collections.emptyList(); } int requestCount = counter.intValue(); if (requestCount < 1) { LogFactory.getLog(getClass()).debug( "request count must be at least one"); return Collections.emptyList(); } final double count = metricType == Field.RequestCount ? requestCount : requestCount-1 // retryCount = requestCount - 1 ; if (count < 1) { return Collections.emptyList(); } else { return Collections.singletonList(new MetricDatum() .withMetricName(req.getServiceName()) .withDimensions(new Dimension() .withName(Dimensions.MetricType.name()) .withValue(metricType.name())) .withUnit(StandardUnit.Count) .withValue(Double.valueOf(count)) .withTimestamp(endTimestamp(ti))) ; } }
java
protected List<MetricDatum> metricOfRequestOrRetryCount( Field metricType, Request<?> req, Object resp) { AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo ti = m.getTimingInfo(); // Always retrieve the request count even for retry which is equivalent // to the number of requests minus one. Number counter = ti.getCounter(Field.RequestCount.name()); if (counter == null) { // this is possible if one of the request handlers screwed up return Collections.emptyList(); } int requestCount = counter.intValue(); if (requestCount < 1) { LogFactory.getLog(getClass()).debug( "request count must be at least one"); return Collections.emptyList(); } final double count = metricType == Field.RequestCount ? requestCount : requestCount-1 // retryCount = requestCount - 1 ; if (count < 1) { return Collections.emptyList(); } else { return Collections.singletonList(new MetricDatum() .withMetricName(req.getServiceName()) .withDimensions(new Dimension() .withName(Dimensions.MetricType.name()) .withValue(metricType.name())) .withUnit(StandardUnit.Count) .withValue(Double.valueOf(count)) .withTimestamp(endTimestamp(ti))) ; } }
[ "protected", "List", "<", "MetricDatum", ">", "metricOfRequestOrRetryCount", "(", "Field", "metricType", ",", "Request", "<", "?", ">", "req", ",", "Object", "resp", ")", "{", "AWSRequestMetrics", "m", "=", "req", ".", "getAWSRequestMetrics", "(", ")", ";", "TimingInfo", "ti", "=", "m", ".", "getTimingInfo", "(", ")", ";", "// Always retrieve the request count even for retry which is equivalent", "// to the number of requests minus one.", "Number", "counter", "=", "ti", ".", "getCounter", "(", "Field", ".", "RequestCount", ".", "name", "(", ")", ")", ";", "if", "(", "counter", "==", "null", ")", "{", "// this is possible if one of the request handlers screwed up", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "int", "requestCount", "=", "counter", ".", "intValue", "(", ")", ";", "if", "(", "requestCount", "<", "1", ")", "{", "LogFactory", ".", "getLog", "(", "getClass", "(", ")", ")", ".", "debug", "(", "\"request count must be at least one\"", ")", ";", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "final", "double", "count", "=", "metricType", "==", "Field", ".", "RequestCount", "?", "requestCount", ":", "requestCount", "-", "1", "// retryCount = requestCount - 1", ";", "if", "(", "count", "<", "1", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "else", "{", "return", "Collections", ".", "singletonList", "(", "new", "MetricDatum", "(", ")", ".", "withMetricName", "(", "req", ".", "getServiceName", "(", ")", ")", ".", "withDimensions", "(", "new", "Dimension", "(", ")", ".", "withName", "(", "Dimensions", ".", "MetricType", ".", "name", "(", ")", ")", ".", "withValue", "(", "metricType", ".", "name", "(", ")", ")", ")", ".", "withUnit", "(", "StandardUnit", ".", "Count", ")", ".", "withValue", "(", "Double", ".", "valueOf", "(", "count", ")", ")", ".", "withTimestamp", "(", "endTimestamp", "(", "ti", ")", ")", ")", ";", "}", "}" ]
Returns a list with a single metric datum for the specified retry or request count predefined metric; or an empty list if there is none. @param metricType must be either {@link Field#RequestCount} or {@link Field#RetryCount}; or else GIGO.
[ "Returns", "a", "list", "with", "a", "single", "metric", "datum", "for", "the", "specified", "retry", "or", "request", "count", "predefined", "metric", ";", "or", "an", "empty", "list", "if", "there", "is", "none", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/PredefinedMetricTransformer.java#L126-L160
20,537
aws/aws-sdk-java
aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/PredefinedMetricTransformer.java
PredefinedMetricTransformer.latencyMetricOf
protected List<MetricDatum> latencyMetricOf(MetricType metricType, Request<?> req, Object response, boolean includesRequestType) { AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo root = m.getTimingInfo(); final String metricName = metricType.name(); List<TimingInfo> subMeasures = root.getAllSubMeasurements(metricName); if (subMeasures != null) { List<MetricDatum> result = new ArrayList<MetricDatum>(subMeasures.size()); for (TimingInfo sub : subMeasures) { if (sub.isEndTimeKnown()) { // being defensive List<Dimension> dims = new ArrayList<Dimension>(); dims.add(new Dimension() .withName(Dimensions.MetricType.name()) .withValue(metricName)); // Either a non request type specific datum is created per // sub-measurement, or a request type specific one is // created but not both if (includesRequestType) { dims.add(new Dimension() .withName(Dimensions.RequestType.name()) .withValue(requestType(req))); } MetricDatum datum = new MetricDatum() .withMetricName(req.getServiceName()) .withDimensions(dims) .withUnit(StandardUnit.Milliseconds) .withValue(sub.getTimeTakenMillisIfKnown()); result.add(datum); } } return result; } return Collections.emptyList(); }
java
protected List<MetricDatum> latencyMetricOf(MetricType metricType, Request<?> req, Object response, boolean includesRequestType) { AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo root = m.getTimingInfo(); final String metricName = metricType.name(); List<TimingInfo> subMeasures = root.getAllSubMeasurements(metricName); if (subMeasures != null) { List<MetricDatum> result = new ArrayList<MetricDatum>(subMeasures.size()); for (TimingInfo sub : subMeasures) { if (sub.isEndTimeKnown()) { // being defensive List<Dimension> dims = new ArrayList<Dimension>(); dims.add(new Dimension() .withName(Dimensions.MetricType.name()) .withValue(metricName)); // Either a non request type specific datum is created per // sub-measurement, or a request type specific one is // created but not both if (includesRequestType) { dims.add(new Dimension() .withName(Dimensions.RequestType.name()) .withValue(requestType(req))); } MetricDatum datum = new MetricDatum() .withMetricName(req.getServiceName()) .withDimensions(dims) .withUnit(StandardUnit.Milliseconds) .withValue(sub.getTimeTakenMillisIfKnown()); result.add(datum); } } return result; } return Collections.emptyList(); }
[ "protected", "List", "<", "MetricDatum", ">", "latencyMetricOf", "(", "MetricType", "metricType", ",", "Request", "<", "?", ">", "req", ",", "Object", "response", ",", "boolean", "includesRequestType", ")", "{", "AWSRequestMetrics", "m", "=", "req", ".", "getAWSRequestMetrics", "(", ")", ";", "TimingInfo", "root", "=", "m", ".", "getTimingInfo", "(", ")", ";", "final", "String", "metricName", "=", "metricType", ".", "name", "(", ")", ";", "List", "<", "TimingInfo", ">", "subMeasures", "=", "root", ".", "getAllSubMeasurements", "(", "metricName", ")", ";", "if", "(", "subMeasures", "!=", "null", ")", "{", "List", "<", "MetricDatum", ">", "result", "=", "new", "ArrayList", "<", "MetricDatum", ">", "(", "subMeasures", ".", "size", "(", ")", ")", ";", "for", "(", "TimingInfo", "sub", ":", "subMeasures", ")", "{", "if", "(", "sub", ".", "isEndTimeKnown", "(", ")", ")", "{", "// being defensive", "List", "<", "Dimension", ">", "dims", "=", "new", "ArrayList", "<", "Dimension", ">", "(", ")", ";", "dims", ".", "add", "(", "new", "Dimension", "(", ")", ".", "withName", "(", "Dimensions", ".", "MetricType", ".", "name", "(", ")", ")", ".", "withValue", "(", "metricName", ")", ")", ";", "// Either a non request type specific datum is created per", "// sub-measurement, or a request type specific one is", "// created but not both", "if", "(", "includesRequestType", ")", "{", "dims", ".", "add", "(", "new", "Dimension", "(", ")", ".", "withName", "(", "Dimensions", ".", "RequestType", ".", "name", "(", ")", ")", ".", "withValue", "(", "requestType", "(", "req", ")", ")", ")", ";", "}", "MetricDatum", "datum", "=", "new", "MetricDatum", "(", ")", ".", "withMetricName", "(", "req", ".", "getServiceName", "(", ")", ")", ".", "withDimensions", "(", "dims", ")", ".", "withUnit", "(", "StandardUnit", ".", "Milliseconds", ")", ".", "withValue", "(", "sub", ".", "getTimeTakenMillisIfKnown", "(", ")", ")", ";", "result", ".", "add", "(", "datum", ")", ";", "}", "}", "return", "result", ";", "}", "return", "Collections", ".", "emptyList", "(", ")", ";", "}" ]
Returns all the latency metric data recorded for the specified metric event type; or an empty list if there is none. The number of metric datum in the returned list should be exactly one when there is no retries, or more than one when there are retries. @param includesRequestType true iff the "request" dimension is to be included;
[ "Returns", "all", "the", "latency", "metric", "data", "recorded", "for", "the", "specified", "metric", "event", "type", ";", "or", "an", "empty", "list", "if", "there", "is", "none", ".", "The", "number", "of", "metric", "datum", "in", "the", "returned", "list", "should", "be", "exactly", "one", "when", "there", "is", "no", "retries", "or", "more", "than", "one", "when", "there", "are", "retries", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/PredefinedMetricTransformer.java#L195-L230
20,538
aws/aws-sdk-java
aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/PredefinedMetricTransformer.java
PredefinedMetricTransformer.counterMetricOf
protected List<MetricDatum> counterMetricOf(MetricType type, Request<?> req, Object resp, boolean includesRequestType) { AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo ti = m.getTimingInfo(); final String metricName = type.name(); Number counter = ti.getCounter(metricName); if (counter == null) { return Collections.emptyList(); } int count = counter.intValue(); if (count < 1) { LogFactory.getLog(getClass()).debug("Count must be at least one"); return Collections.emptyList(); } final List<MetricDatum> result = new ArrayList<MetricDatum>(); final Dimension metricDimension = new Dimension() .withName(Dimensions.MetricType.name()) .withValue(metricName); // non-request type specific metric datum final MetricDatum first = new MetricDatum() .withMetricName(req.getServiceName()) .withDimensions(metricDimension) .withUnit(StandardUnit.Count) .withValue(Double.valueOf(count)) .withTimestamp(endTimestamp(ti)); result.add(first); if (includesRequestType) { // additional request type specific metric datum Dimension requestDimension = new Dimension() .withName(Dimensions.RequestType.name()) .withValue(requestType(req)); final MetricDatum second = newMetricDatum(first, metricDimension, requestDimension); result.add(second); } return result; }
java
protected List<MetricDatum> counterMetricOf(MetricType type, Request<?> req, Object resp, boolean includesRequestType) { AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo ti = m.getTimingInfo(); final String metricName = type.name(); Number counter = ti.getCounter(metricName); if (counter == null) { return Collections.emptyList(); } int count = counter.intValue(); if (count < 1) { LogFactory.getLog(getClass()).debug("Count must be at least one"); return Collections.emptyList(); } final List<MetricDatum> result = new ArrayList<MetricDatum>(); final Dimension metricDimension = new Dimension() .withName(Dimensions.MetricType.name()) .withValue(metricName); // non-request type specific metric datum final MetricDatum first = new MetricDatum() .withMetricName(req.getServiceName()) .withDimensions(metricDimension) .withUnit(StandardUnit.Count) .withValue(Double.valueOf(count)) .withTimestamp(endTimestamp(ti)); result.add(first); if (includesRequestType) { // additional request type specific metric datum Dimension requestDimension = new Dimension() .withName(Dimensions.RequestType.name()) .withValue(requestType(req)); final MetricDatum second = newMetricDatum(first, metricDimension, requestDimension); result.add(second); } return result; }
[ "protected", "List", "<", "MetricDatum", ">", "counterMetricOf", "(", "MetricType", "type", ",", "Request", "<", "?", ">", "req", ",", "Object", "resp", ",", "boolean", "includesRequestType", ")", "{", "AWSRequestMetrics", "m", "=", "req", ".", "getAWSRequestMetrics", "(", ")", ";", "TimingInfo", "ti", "=", "m", ".", "getTimingInfo", "(", ")", ";", "final", "String", "metricName", "=", "type", ".", "name", "(", ")", ";", "Number", "counter", "=", "ti", ".", "getCounter", "(", "metricName", ")", ";", "if", "(", "counter", "==", "null", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "int", "count", "=", "counter", ".", "intValue", "(", ")", ";", "if", "(", "count", "<", "1", ")", "{", "LogFactory", ".", "getLog", "(", "getClass", "(", ")", ")", ".", "debug", "(", "\"Count must be at least one\"", ")", ";", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "final", "List", "<", "MetricDatum", ">", "result", "=", "new", "ArrayList", "<", "MetricDatum", ">", "(", ")", ";", "final", "Dimension", "metricDimension", "=", "new", "Dimension", "(", ")", ".", "withName", "(", "Dimensions", ".", "MetricType", ".", "name", "(", ")", ")", ".", "withValue", "(", "metricName", ")", ";", "// non-request type specific metric datum", "final", "MetricDatum", "first", "=", "new", "MetricDatum", "(", ")", ".", "withMetricName", "(", "req", ".", "getServiceName", "(", ")", ")", ".", "withDimensions", "(", "metricDimension", ")", ".", "withUnit", "(", "StandardUnit", ".", "Count", ")", ".", "withValue", "(", "Double", ".", "valueOf", "(", "count", ")", ")", ".", "withTimestamp", "(", "endTimestamp", "(", "ti", ")", ")", ";", "result", ".", "add", "(", "first", ")", ";", "if", "(", "includesRequestType", ")", "{", "// additional request type specific metric datum", "Dimension", "requestDimension", "=", "new", "Dimension", "(", ")", ".", "withName", "(", "Dimensions", ".", "RequestType", ".", "name", "(", ")", ")", ".", "withValue", "(", "requestType", "(", "req", ")", ")", ";", "final", "MetricDatum", "second", "=", "newMetricDatum", "(", "first", ",", "metricDimension", ",", "requestDimension", ")", ";", "result", ".", "add", "(", "second", ")", ";", "}", "return", "result", ";", "}" ]
Returns a list of metric datum recorded for the specified counter metric type; or an empty list if there is none. @param includesRequestType true iff an additional metric datum is to be created that includes the "request" dimension
[ "Returns", "a", "list", "of", "metric", "datum", "recorded", "for", "the", "specified", "counter", "metric", "type", ";", "or", "an", "empty", "list", "if", "there", "is", "none", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/PredefinedMetricTransformer.java#L276-L312
20,539
aws/aws-sdk-java
aws-java-sdk-importexport/src/main/java/com/amazonaws/services/importexport/AmazonImportExportAsyncClient.java
AmazonImportExportAsyncClient.listJobsAsync
@Override public java.util.concurrent.Future<ListJobsResult> listJobsAsync(com.amazonaws.handlers.AsyncHandler<ListJobsRequest, ListJobsResult> asyncHandler) { return listJobsAsync(new ListJobsRequest(), asyncHandler); }
java
@Override public java.util.concurrent.Future<ListJobsResult> listJobsAsync(com.amazonaws.handlers.AsyncHandler<ListJobsRequest, ListJobsResult> asyncHandler) { return listJobsAsync(new ListJobsRequest(), asyncHandler); }
[ "@", "Override", "public", "java", ".", "util", ".", "concurrent", ".", "Future", "<", "ListJobsResult", ">", "listJobsAsync", "(", "com", ".", "amazonaws", ".", "handlers", ".", "AsyncHandler", "<", "ListJobsRequest", ",", "ListJobsResult", ">", "asyncHandler", ")", "{", "return", "listJobsAsync", "(", "new", "ListJobsRequest", "(", ")", ",", "asyncHandler", ")", ";", "}" ]
Simplified method form for invoking the ListJobs operation with an AsyncHandler. @see #listJobsAsync(ListJobsRequest, com.amazonaws.handlers.AsyncHandler)
[ "Simplified", "method", "form", "for", "invoking", "the", "ListJobs", "operation", "with", "an", "AsyncHandler", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-importexport/src/main/java/com/amazonaws/services/importexport/AmazonImportExportAsyncClient.java#L430-L434
20,540
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/internal/config/InternalConfig.java
InternalConfig.mergeSignerMap
private Map<String, SignerConfig> mergeSignerMap(JsonIndex<SignerConfigJsonHelper, SignerConfig>[] defaults, JsonIndex<SignerConfigJsonHelper, SignerConfig>[] overrides, String theme) { Map<String, SignerConfig> map = buildSignerMap(defaults, theme); Map<String, SignerConfig> mapOverride = buildSignerMap(overrides, theme); map.putAll(mapOverride); return Collections.unmodifiableMap(map); }
java
private Map<String, SignerConfig> mergeSignerMap(JsonIndex<SignerConfigJsonHelper, SignerConfig>[] defaults, JsonIndex<SignerConfigJsonHelper, SignerConfig>[] overrides, String theme) { Map<String, SignerConfig> map = buildSignerMap(defaults, theme); Map<String, SignerConfig> mapOverride = buildSignerMap(overrides, theme); map.putAll(mapOverride); return Collections.unmodifiableMap(map); }
[ "private", "Map", "<", "String", ",", "SignerConfig", ">", "mergeSignerMap", "(", "JsonIndex", "<", "SignerConfigJsonHelper", ",", "SignerConfig", ">", "[", "]", "defaults", ",", "JsonIndex", "<", "SignerConfigJsonHelper", ",", "SignerConfig", ">", "[", "]", "overrides", ",", "String", "theme", ")", "{", "Map", "<", "String", ",", "SignerConfig", ">", "map", "=", "buildSignerMap", "(", "defaults", ",", "theme", ")", ";", "Map", "<", "String", ",", "SignerConfig", ">", "mapOverride", "=", "buildSignerMap", "(", "overrides", ",", "theme", ")", ";", "map", ".", "putAll", "(", "mapOverride", ")", ";", "return", "Collections", ".", "unmodifiableMap", "(", "map", ")", ";", "}" ]
Returns an immutable map by merging the override signer configuration into the default signer configuration for the given theme. @param defaults default signer configuration @param override signer configurations overrides @param theme used for message logging. eg region, service, region+service
[ "Returns", "an", "immutable", "map", "by", "merging", "the", "override", "signer", "configuration", "into", "the", "default", "signer", "configuration", "for", "the", "given", "theme", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/internal/config/InternalConfig.java#L115-L122
20,541
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/internal/config/InternalConfig.java
InternalConfig.buildSignerMap
private Map<String, SignerConfig> buildSignerMap(JsonIndex<SignerConfigJsonHelper, SignerConfig>[] signerIndexes, String theme) { Map<String, SignerConfig> map = new HashMap<String, SignerConfig>(); if (signerIndexes != null) { for (JsonIndex<SignerConfigJsonHelper, SignerConfig> index : signerIndexes) { String region = index.getKey(); SignerConfig prev = map.put(region, index.newReadOnlyConfig()); if (prev != null) { log.warn("Duplicate definition of signer for " + theme + " " + index.getKey()); } } } return map; }
java
private Map<String, SignerConfig> buildSignerMap(JsonIndex<SignerConfigJsonHelper, SignerConfig>[] signerIndexes, String theme) { Map<String, SignerConfig> map = new HashMap<String, SignerConfig>(); if (signerIndexes != null) { for (JsonIndex<SignerConfigJsonHelper, SignerConfig> index : signerIndexes) { String region = index.getKey(); SignerConfig prev = map.put(region, index.newReadOnlyConfig()); if (prev != null) { log.warn("Duplicate definition of signer for " + theme + " " + index.getKey()); } } } return map; }
[ "private", "Map", "<", "String", ",", "SignerConfig", ">", "buildSignerMap", "(", "JsonIndex", "<", "SignerConfigJsonHelper", ",", "SignerConfig", ">", "[", "]", "signerIndexes", ",", "String", "theme", ")", "{", "Map", "<", "String", ",", "SignerConfig", ">", "map", "=", "new", "HashMap", "<", "String", ",", "SignerConfig", ">", "(", ")", ";", "if", "(", "signerIndexes", "!=", "null", ")", "{", "for", "(", "JsonIndex", "<", "SignerConfigJsonHelper", ",", "SignerConfig", ">", "index", ":", "signerIndexes", ")", "{", "String", "region", "=", "index", ".", "getKey", "(", ")", ";", "SignerConfig", "prev", "=", "map", ".", "put", "(", "region", ",", "index", ".", "newReadOnlyConfig", "(", ")", ")", ";", "if", "(", "prev", "!=", "null", ")", "{", "log", ".", "warn", "(", "\"Duplicate definition of signer for \"", "+", "theme", "+", "\" \"", "+", "index", ".", "getKey", "(", ")", ")", ";", "}", "}", "}", "return", "map", ";", "}" ]
Builds and returns a signer configuration map. @param signerIndexes signer configuration entries loaded from JSON @param theme used for message logging. eg region, service, region+service
[ "Builds", "and", "returns", "a", "signer", "configuration", "map", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/internal/config/InternalConfig.java#L168-L181
20,542
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/internal/config/InternalConfig.java
InternalConfig.getSignerConfig
public SignerConfig getSignerConfig(String serviceName, String regionName) { if (serviceName == null) throw new IllegalArgumentException(); SignerConfig signerConfig = null; if (regionName != null) { // Service+Region signer config has the highest precedence String key = serviceName + SERVICE_REGION_DELIMITOR + regionName; signerConfig = serviceRegionSigners.get(key); if (signerConfig != null) { return signerConfig; } // Region signer config has the 2nd highest precedence signerConfig = regionSigners.get(regionName); if (signerConfig != null) { return signerConfig; } } // Service signer config has the 3rd highest precedence signerConfig = serviceSigners.get(serviceName); // Fall back to the default return signerConfig == null ? defaultSignerConfig : signerConfig; }
java
public SignerConfig getSignerConfig(String serviceName, String regionName) { if (serviceName == null) throw new IllegalArgumentException(); SignerConfig signerConfig = null; if (regionName != null) { // Service+Region signer config has the highest precedence String key = serviceName + SERVICE_REGION_DELIMITOR + regionName; signerConfig = serviceRegionSigners.get(key); if (signerConfig != null) { return signerConfig; } // Region signer config has the 2nd highest precedence signerConfig = regionSigners.get(regionName); if (signerConfig != null) { return signerConfig; } } // Service signer config has the 3rd highest precedence signerConfig = serviceSigners.get(serviceName); // Fall back to the default return signerConfig == null ? defaultSignerConfig : signerConfig; }
[ "public", "SignerConfig", "getSignerConfig", "(", "String", "serviceName", ",", "String", "regionName", ")", "{", "if", "(", "serviceName", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", ")", ";", "SignerConfig", "signerConfig", "=", "null", ";", "if", "(", "regionName", "!=", "null", ")", "{", "// Service+Region signer config has the highest precedence", "String", "key", "=", "serviceName", "+", "SERVICE_REGION_DELIMITOR", "+", "regionName", ";", "signerConfig", "=", "serviceRegionSigners", ".", "get", "(", "key", ")", ";", "if", "(", "signerConfig", "!=", "null", ")", "{", "return", "signerConfig", ";", "}", "// Region signer config has the 2nd highest precedence", "signerConfig", "=", "regionSigners", ".", "get", "(", "regionName", ")", ";", "if", "(", "signerConfig", "!=", "null", ")", "{", "return", "signerConfig", ";", "}", "}", "// Service signer config has the 3rd highest precedence", "signerConfig", "=", "serviceSigners", ".", "get", "(", "serviceName", ")", ";", "// Fall back to the default", "return", "signerConfig", "==", "null", "?", "defaultSignerConfig", ":", "signerConfig", ";", "}" ]
Returns the signer configuration for the specified service name and an optional region name. @param serviceName must not be null @param regionName similar to the region name in <code>Regions</code>; can be null. @return the signer
[ "Returns", "the", "signer", "configuration", "for", "the", "specified", "service", "name", "and", "an", "optional", "region", "name", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/internal/config/InternalConfig.java#L206-L227
20,543
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/util/XMLWriter.java
XMLWriter.startElement
public XMLWriter startElement(String element) { append("<" + element); if (rootElement && xmlns != null) { append(" xmlns=\"" + xmlns + "\""); rootElement = false; } append(">"); elementStack.push(element); return this; }
java
public XMLWriter startElement(String element) { append("<" + element); if (rootElement && xmlns != null) { append(" xmlns=\"" + xmlns + "\""); rootElement = false; } append(">"); elementStack.push(element); return this; }
[ "public", "XMLWriter", "startElement", "(", "String", "element", ")", "{", "append", "(", "\"<\"", "+", "element", ")", ";", "if", "(", "rootElement", "&&", "xmlns", "!=", "null", ")", "{", "append", "(", "\" xmlns=\\\"\"", "+", "xmlns", "+", "\"\\\"\"", ")", ";", "rootElement", "=", "false", ";", "}", "append", "(", "\">\"", ")", ";", "elementStack", ".", "push", "(", "element", ")", ";", "return", "this", ";", "}" ]
Starts a new element with the specified name at the current position in the in-progress XML document. @param element The name of the new element. @return This XMLWriter so that additional method calls can be chained together.
[ "Starts", "a", "new", "element", "with", "the", "specified", "name", "at", "the", "current", "position", "in", "the", "in", "-", "progress", "XML", "document", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XMLWriter.java#L81-L90
20,544
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/util/XMLWriter.java
XMLWriter.value
public XMLWriter value(ByteBuffer b) { append(escapeXMLEntities(Base64.encodeAsString(BinaryUtils.copyBytesFrom(b)))); return this; }
java
public XMLWriter value(ByteBuffer b) { append(escapeXMLEntities(Base64.encodeAsString(BinaryUtils.copyBytesFrom(b)))); return this; }
[ "public", "XMLWriter", "value", "(", "ByteBuffer", "b", ")", "{", "append", "(", "escapeXMLEntities", "(", "Base64", ".", "encodeAsString", "(", "BinaryUtils", ".", "copyBytesFrom", "(", "b", ")", ")", ")", ")", ";", "return", "this", ";", "}" ]
Adds the specified value as Base64 encoded text to the current position of the in progress XML document. @param b The binary data to add to the XML document. @return This XMLWriter so that additional method calls can be chained together.
[ "Adds", "the", "specified", "value", "as", "Base64", "encoded", "text", "to", "the", "current", "position", "of", "the", "in", "progress", "XML", "document", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/XMLWriter.java#L130-L133
20,545
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/event/SDKProgressPublisher.java
SDKProgressPublisher.publishProgress
public static Future<?> publishProgress( final ProgressListener listener, final ProgressEventType type) { if (listener == ProgressListener.NOOP || listener == null || type == null) { return null; } return deliverEvent(listener, new ProgressEvent(type)); }
java
public static Future<?> publishProgress( final ProgressListener listener, final ProgressEventType type) { if (listener == ProgressListener.NOOP || listener == null || type == null) { return null; } return deliverEvent(listener, new ProgressEvent(type)); }
[ "public", "static", "Future", "<", "?", ">", "publishProgress", "(", "final", "ProgressListener", "listener", ",", "final", "ProgressEventType", "type", ")", "{", "if", "(", "listener", "==", "ProgressListener", ".", "NOOP", "||", "listener", "==", "null", "||", "type", "==", "null", ")", "{", "return", "null", ";", "}", "return", "deliverEvent", "(", "listener", ",", "new", "ProgressEvent", "(", "type", ")", ")", ";", "}" ]
Used to deliver a progress event to the given listener. @return the future of a submitted task; or null if the delivery is synchronous with no future task involved. Note a listener should never block, and therefore returning null is the typical case.
[ "Used", "to", "deliver", "a", "progress", "event", "to", "the", "given", "listener", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/event/SDKProgressPublisher.java#L51-L59
20,546
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/event/SDKProgressPublisher.java
SDKProgressPublisher.publishResponseBytesDiscarded
public static Future<?> publishResponseBytesDiscarded( final ProgressListener listener, final long bytesDiscarded) { return publishResetEvent(listener, ProgressEventType.RESPONSE_BYTE_DISCARD_EVENT, bytesDiscarded); }
java
public static Future<?> publishResponseBytesDiscarded( final ProgressListener listener, final long bytesDiscarded) { return publishResetEvent(listener, ProgressEventType.RESPONSE_BYTE_DISCARD_EVENT, bytesDiscarded); }
[ "public", "static", "Future", "<", "?", ">", "publishResponseBytesDiscarded", "(", "final", "ProgressListener", "listener", ",", "final", "long", "bytesDiscarded", ")", "{", "return", "publishResetEvent", "(", "listener", ",", "ProgressEventType", ".", "RESPONSE_BYTE_DISCARD_EVENT", ",", "bytesDiscarded", ")", ";", "}" ]
Convenient method to publish a response bytes discard event to the given listener.
[ "Convenient", "method", "to", "publish", "a", "response", "bytes", "discard", "event", "to", "the", "given", "listener", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/event/SDKProgressPublisher.java#L191-L196
20,547
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.shutdown
public void shutdown() { shutDown = true; try { while (inflightReceiveMessageBatches > 0) Thread.sleep(100); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
java
public void shutdown() { shutDown = true; try { while (inflightReceiveMessageBatches > 0) Thread.sleep(100); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
[ "public", "void", "shutdown", "(", ")", "{", "shutDown", "=", "true", ";", "try", "{", "while", "(", "inflightReceiveMessageBatches", ">", "0", ")", "Thread", ".", "sleep", "(", "100", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "Thread", ".", "currentThread", "(", ")", ".", "interrupt", "(", ")", ";", "}", "}" ]
Prevents spawning of new retrieval batches and waits for all in-flight retrieval batches to finish
[ "Prevents", "spawning", "of", "new", "retrieval", "batches", "and", "waits", "for", "all", "in", "-", "flight", "retrieval", "batches", "to", "finish" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L116-L124
20,548
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.receiveMessageAsync
public QueueBufferFuture<ReceiveMessageRequest, ReceiveMessageResult> receiveMessageAsync(ReceiveMessageRequest rq, QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback) { if (shutDown) { throw new AmazonClientException("The client has been shut down."); } // issue the future... int numMessages = 10; if (rq.getMaxNumberOfMessages() != null) { numMessages = rq.getMaxNumberOfMessages(); } QueueBufferFuture<ReceiveMessageRequest, ReceiveMessageResult> toReturn = issueFuture(numMessages, callback); // attempt to satisfy it right away... satisfyFuturesFromBuffer(); // spawn more receive tasks if we need them... spawnMoreReceiveTasks(); return toReturn; }
java
public QueueBufferFuture<ReceiveMessageRequest, ReceiveMessageResult> receiveMessageAsync(ReceiveMessageRequest rq, QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback) { if (shutDown) { throw new AmazonClientException("The client has been shut down."); } // issue the future... int numMessages = 10; if (rq.getMaxNumberOfMessages() != null) { numMessages = rq.getMaxNumberOfMessages(); } QueueBufferFuture<ReceiveMessageRequest, ReceiveMessageResult> toReturn = issueFuture(numMessages, callback); // attempt to satisfy it right away... satisfyFuturesFromBuffer(); // spawn more receive tasks if we need them... spawnMoreReceiveTasks(); return toReturn; }
[ "public", "QueueBufferFuture", "<", "ReceiveMessageRequest", ",", "ReceiveMessageResult", ">", "receiveMessageAsync", "(", "ReceiveMessageRequest", "rq", ",", "QueueBufferCallback", "<", "ReceiveMessageRequest", ",", "ReceiveMessageResult", ">", "callback", ")", "{", "if", "(", "shutDown", ")", "{", "throw", "new", "AmazonClientException", "(", "\"The client has been shut down.\"", ")", ";", "}", "// issue the future...", "int", "numMessages", "=", "10", ";", "if", "(", "rq", ".", "getMaxNumberOfMessages", "(", ")", "!=", "null", ")", "{", "numMessages", "=", "rq", ".", "getMaxNumberOfMessages", "(", ")", ";", "}", "QueueBufferFuture", "<", "ReceiveMessageRequest", ",", "ReceiveMessageResult", ">", "toReturn", "=", "issueFuture", "(", "numMessages", ",", "callback", ")", ";", "// attempt to satisfy it right away...", "satisfyFuturesFromBuffer", "(", ")", ";", "// spawn more receive tasks if we need them...", "spawnMoreReceiveTasks", "(", ")", ";", "return", "toReturn", ";", "}" ]
Submits the request for retrieval of messages from the queue and returns a future that will be signalled when the request is satisfied. The future may already be signalled by the time it is returned. @return never null
[ "Submits", "the", "request", "for", "retrieval", "of", "messages", "from", "the", "queue", "and", "returns", "a", "future", "that", "will", "be", "signalled", "when", "the", "request", "is", "satisfied", ".", "The", "future", "may", "already", "be", "signalled", "by", "the", "time", "it", "is", "returned", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L133-L153
20,549
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.issueFuture
private ReceiveMessageFuture issueFuture(int size, QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback) { synchronized (futures) { ReceiveMessageFuture theFuture = new ReceiveMessageFuture(callback, size); futures.addLast(theFuture); return theFuture; } }
java
private ReceiveMessageFuture issueFuture(int size, QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback) { synchronized (futures) { ReceiveMessageFuture theFuture = new ReceiveMessageFuture(callback, size); futures.addLast(theFuture); return theFuture; } }
[ "private", "ReceiveMessageFuture", "issueFuture", "(", "int", "size", ",", "QueueBufferCallback", "<", "ReceiveMessageRequest", ",", "ReceiveMessageResult", ">", "callback", ")", "{", "synchronized", "(", "futures", ")", "{", "ReceiveMessageFuture", "theFuture", "=", "new", "ReceiveMessageFuture", "(", "callback", ",", "size", ")", ";", "futures", ".", "addLast", "(", "theFuture", ")", ";", "return", "theFuture", ";", "}", "}" ]
Creates and returns a new future object. Sleeps if the list of already-issued but as yet unsatisfied futures is over a throttle limit. @return never null
[ "Creates", "and", "returns", "a", "new", "future", "object", ".", "Sleeps", "if", "the", "list", "of", "already", "-", "issued", "but", "as", "yet", "unsatisfied", "futures", "is", "over", "a", "throttle", "limit", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L161-L168
20,550
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.satisfyFuturesFromBuffer
private void satisfyFuturesFromBuffer() { synchronized (futures) { synchronized (finishedTasks) { // attempt to satisfy futures until we run out of either futures or // finished tasks while ((!futures.isEmpty()) && (!finishedTasks.isEmpty())) { // Remove any expired tasks before attempting to fufill the future pruneExpiredTasks(); // Fufill the future from a non expired task if there is one. There is still a // slight chance that the first task could have expired between the time we // pruned and the time we fufill the future if (!finishedTasks.isEmpty()) { fufillFuture(futures.poll()); } } } } }
java
private void satisfyFuturesFromBuffer() { synchronized (futures) { synchronized (finishedTasks) { // attempt to satisfy futures until we run out of either futures or // finished tasks while ((!futures.isEmpty()) && (!finishedTasks.isEmpty())) { // Remove any expired tasks before attempting to fufill the future pruneExpiredTasks(); // Fufill the future from a non expired task if there is one. There is still a // slight chance that the first task could have expired between the time we // pruned and the time we fufill the future if (!finishedTasks.isEmpty()) { fufillFuture(futures.poll()); } } } } }
[ "private", "void", "satisfyFuturesFromBuffer", "(", ")", "{", "synchronized", "(", "futures", ")", "{", "synchronized", "(", "finishedTasks", ")", "{", "// attempt to satisfy futures until we run out of either futures or", "// finished tasks", "while", "(", "(", "!", "futures", ".", "isEmpty", "(", ")", ")", "&&", "(", "!", "finishedTasks", ".", "isEmpty", "(", ")", ")", ")", "{", "// Remove any expired tasks before attempting to fufill the future", "pruneExpiredTasks", "(", ")", ";", "// Fufill the future from a non expired task if there is one. There is still a", "// slight chance that the first task could have expired between the time we", "// pruned and the time we fufill the future", "if", "(", "!", "finishedTasks", ".", "isEmpty", "(", ")", ")", "{", "fufillFuture", "(", "futures", ".", "poll", "(", ")", ")", ";", "}", "}", "}", "}", "}" ]
Attempts to satisfy some or all of the already-issued futures from the local buffer. If the buffer is empty or there are no futures, this method won't do anything.
[ "Attempts", "to", "satisfy", "some", "or", "all", "of", "the", "already", "-", "issued", "futures", "from", "the", "local", "buffer", ".", "If", "the", "buffer", "is", "empty", "or", "there", "are", "no", "futures", "this", "method", "won", "t", "do", "anything", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L174-L191
20,551
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.fufillFuture
private void fufillFuture(ReceiveMessageFuture future) { ReceiveMessageBatchTask task = finishedTasks.getFirst(); ReceiveMessageResult result = new ReceiveMessageResult(); LinkedList<Message> messages = new LinkedList<Message>(); result.setMessages(messages); Exception exception = task.getException(); int numRetrieved = 0; boolean batchDone = false; while (numRetrieved < future.getRequestedSize()) { Message msg = task.removeMessage(); // a non-empty batch can still give back a null // message if the message expired. if (msg != null) { messages.add(msg); ++numRetrieved; } else { batchDone = true; break; } } // we may have just drained the batch. batchDone = batchDone || task.isEmpty() || (exception != null); if (batchDone) { finishedTasks.removeFirst(); } result.setMessages(messages); // if after the above runs the exception is not null, // the finished batch has encountered an error, and we will // report that in the Future. Otherwise, we will fill // the future with the receive result if (exception != null) { future.setFailure(exception); } else { future.setSuccess(result); } }
java
private void fufillFuture(ReceiveMessageFuture future) { ReceiveMessageBatchTask task = finishedTasks.getFirst(); ReceiveMessageResult result = new ReceiveMessageResult(); LinkedList<Message> messages = new LinkedList<Message>(); result.setMessages(messages); Exception exception = task.getException(); int numRetrieved = 0; boolean batchDone = false; while (numRetrieved < future.getRequestedSize()) { Message msg = task.removeMessage(); // a non-empty batch can still give back a null // message if the message expired. if (msg != null) { messages.add(msg); ++numRetrieved; } else { batchDone = true; break; } } // we may have just drained the batch. batchDone = batchDone || task.isEmpty() || (exception != null); if (batchDone) { finishedTasks.removeFirst(); } result.setMessages(messages); // if after the above runs the exception is not null, // the finished batch has encountered an error, and we will // report that in the Future. Otherwise, we will fill // the future with the receive result if (exception != null) { future.setFailure(exception); } else { future.setSuccess(result); } }
[ "private", "void", "fufillFuture", "(", "ReceiveMessageFuture", "future", ")", "{", "ReceiveMessageBatchTask", "task", "=", "finishedTasks", ".", "getFirst", "(", ")", ";", "ReceiveMessageResult", "result", "=", "new", "ReceiveMessageResult", "(", ")", ";", "LinkedList", "<", "Message", ">", "messages", "=", "new", "LinkedList", "<", "Message", ">", "(", ")", ";", "result", ".", "setMessages", "(", "messages", ")", ";", "Exception", "exception", "=", "task", ".", "getException", "(", ")", ";", "int", "numRetrieved", "=", "0", ";", "boolean", "batchDone", "=", "false", ";", "while", "(", "numRetrieved", "<", "future", ".", "getRequestedSize", "(", ")", ")", "{", "Message", "msg", "=", "task", ".", "removeMessage", "(", ")", ";", "// a non-empty batch can still give back a null", "// message if the message expired.", "if", "(", "msg", "!=", "null", ")", "{", "messages", ".", "add", "(", "msg", ")", ";", "++", "numRetrieved", ";", "}", "else", "{", "batchDone", "=", "true", ";", "break", ";", "}", "}", "// we may have just drained the batch.", "batchDone", "=", "batchDone", "||", "task", ".", "isEmpty", "(", ")", "||", "(", "exception", "!=", "null", ")", ";", "if", "(", "batchDone", ")", "{", "finishedTasks", ".", "removeFirst", "(", ")", ";", "}", "result", ".", "setMessages", "(", "messages", ")", ";", "// if after the above runs the exception is not null,", "// the finished batch has encountered an error, and we will", "// report that in the Future. Otherwise, we will fill", "// the future with the receive result", "if", "(", "exception", "!=", "null", ")", "{", "future", ".", "setFailure", "(", "exception", ")", ";", "}", "else", "{", "future", ".", "setSuccess", "(", "result", ")", ";", "}", "}" ]
Fills the future with whatever results were received by the full batch currently at the head of the completed batch queue. Those results may be retrieved messages, or an exception. This method assumes that you are holding the finished tasks lock locks when invoking it. violate this assumption at your own peril
[ "Fills", "the", "future", "with", "whatever", "results", "were", "received", "by", "the", "full", "batch", "currently", "at", "the", "head", "of", "the", "completed", "batch", "queue", ".", "Those", "results", "may", "be", "retrieved", "messages", "or", "an", "exception", ".", "This", "method", "assumes", "that", "you", "are", "holding", "the", "finished", "tasks", "lock", "locks", "when", "invoking", "it", ".", "violate", "this", "assumption", "at", "your", "own", "peril" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L199-L235
20,552
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.pruneExpiredTasks
private void pruneExpiredTasks() { int numberExpiredTasksPruned = pruneHeadTasks(new Predicate<ReceiveQueueBuffer.ReceiveMessageBatchTask>() { @Override public boolean test(ReceiveMessageBatchTask t) { return t.isExpired() && t.getException() == null; } }); // If we pruned any tasks because they are expired we also want to prune any empty tasks // afterwards so we have a chance to receive those expired messages again. if (numberExpiredTasksPruned > 0) { pruneHeadTasks(new Predicate<ReceiveQueueBuffer.ReceiveMessageBatchTask>() { @Override public boolean test(ReceiveMessageBatchTask t) { return t.isEmpty() && t.getException() == null; } }); } }
java
private void pruneExpiredTasks() { int numberExpiredTasksPruned = pruneHeadTasks(new Predicate<ReceiveQueueBuffer.ReceiveMessageBatchTask>() { @Override public boolean test(ReceiveMessageBatchTask t) { return t.isExpired() && t.getException() == null; } }); // If we pruned any tasks because they are expired we also want to prune any empty tasks // afterwards so we have a chance to receive those expired messages again. if (numberExpiredTasksPruned > 0) { pruneHeadTasks(new Predicate<ReceiveQueueBuffer.ReceiveMessageBatchTask>() { @Override public boolean test(ReceiveMessageBatchTask t) { return t.isEmpty() && t.getException() == null; } }); } }
[ "private", "void", "pruneExpiredTasks", "(", ")", "{", "int", "numberExpiredTasksPruned", "=", "pruneHeadTasks", "(", "new", "Predicate", "<", "ReceiveQueueBuffer", ".", "ReceiveMessageBatchTask", ">", "(", ")", "{", "@", "Override", "public", "boolean", "test", "(", "ReceiveMessageBatchTask", "t", ")", "{", "return", "t", ".", "isExpired", "(", ")", "&&", "t", ".", "getException", "(", ")", "==", "null", ";", "}", "}", ")", ";", "// If we pruned any tasks because they are expired we also want to prune any empty tasks", "// afterwards so we have a chance to receive those expired messages again.", "if", "(", "numberExpiredTasksPruned", ">", "0", ")", "{", "pruneHeadTasks", "(", "new", "Predicate", "<", "ReceiveQueueBuffer", ".", "ReceiveMessageBatchTask", ">", "(", ")", "{", "@", "Override", "public", "boolean", "test", "(", "ReceiveMessageBatchTask", "t", ")", "{", "return", "t", ".", "isEmpty", "(", ")", "&&", "t", ".", "getException", "(", ")", "==", "null", ";", "}", "}", ")", ";", "}", "}" ]
Prune any expired tasks that do not have an exception associated with them. This method assumes that you are holding the finishedTasks lock when invoking it
[ "Prune", "any", "expired", "tasks", "that", "do", "not", "have", "an", "exception", "associated", "with", "them", ".", "This", "method", "assumes", "that", "you", "are", "holding", "the", "finishedTasks", "lock", "when", "invoking", "it" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L241-L258
20,553
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.pruneHeadTasks
private int pruneHeadTasks(Predicate<ReceiveMessageBatchTask> pruneCondition) { int numberPruned = 0; while (!finishedTasks.isEmpty()) { if (pruneCondition.test(finishedTasks.getFirst())) { finishedTasks.removeFirst(); numberPruned++; } else { break; } } return numberPruned; }
java
private int pruneHeadTasks(Predicate<ReceiveMessageBatchTask> pruneCondition) { int numberPruned = 0; while (!finishedTasks.isEmpty()) { if (pruneCondition.test(finishedTasks.getFirst())) { finishedTasks.removeFirst(); numberPruned++; } else { break; } } return numberPruned; }
[ "private", "int", "pruneHeadTasks", "(", "Predicate", "<", "ReceiveMessageBatchTask", ">", "pruneCondition", ")", "{", "int", "numberPruned", "=", "0", ";", "while", "(", "!", "finishedTasks", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "pruneCondition", ".", "test", "(", "finishedTasks", ".", "getFirst", "(", ")", ")", ")", "{", "finishedTasks", ".", "removeFirst", "(", ")", ";", "numberPruned", "++", ";", "}", "else", "{", "break", ";", "}", "}", "return", "numberPruned", ";", "}" ]
Prune all tasks at the beginning of the finishedTasks list that meet the given condition. Once a task is found that does not meet the given condition the pruning stops. This method assumes that you are holding the finishedTasks lock when invoking it. @param pruneCondition Condition on whether a task is eligible to be pruned @return Number of total tasks pruned from finishedTasks
[ "Prune", "all", "tasks", "at", "the", "beginning", "of", "the", "finishedTasks", "list", "that", "meet", "the", "given", "condition", ".", "Once", "a", "task", "is", "found", "that", "does", "not", "meet", "the", "given", "condition", "the", "pruning", "stops", ".", "This", "method", "assumes", "that", "you", "are", "holding", "the", "finishedTasks", "lock", "when", "invoking", "it", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L269-L280
20,554
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.spawnMoreReceiveTasks
private void spawnMoreReceiveTasks() { if (shutDown) { return; } int desiredBatches = config.getMaxDoneReceiveBatches(); desiredBatches = desiredBatches < 1 ? 1 : desiredBatches; synchronized (finishedTasks) { if (finishedTasks.size() >= desiredBatches) return; // if we have some finished batches already, and // existing inflight batches will bring us to the limit, // don't spawn more. if our finished tasks cache is empty, we will // always spawn a thread. if (finishedTasks.size() > 0 && (finishedTasks.size() + inflightReceiveMessageBatches) >= desiredBatches) { return; } } synchronized (taskSpawnSyncPoint) { if (visibilityTimeoutNanos == -1) { GetQueueAttributesRequest request = new GetQueueAttributesRequest().withQueueUrl(qUrl) .withAttributeNames("VisibilityTimeout"); ResultConverter.appendUserAgent(request, AmazonSQSBufferedAsyncClient.USER_AGENT); long visibilityTimeoutSeconds = Long.parseLong(sqsClient.getQueueAttributes(request).getAttributes() .get("VisibilityTimeout")); visibilityTimeoutNanos = TimeUnit.NANOSECONDS.convert(visibilityTimeoutSeconds, TimeUnit.SECONDS); } int max = config.getMaxInflightReceiveBatches(); // must allow at least one inflight receive task, or receive won't // work at all. max = max > 0 ? max : 1; int toSpawn = max - inflightReceiveMessageBatches; if (toSpawn > 0) { ReceiveMessageBatchTask task = new ReceiveMessageBatchTask(this); ++inflightReceiveMessageBatches; ++bufferCounter; if (log.isTraceEnabled()) { log.trace("Spawned receive batch #" + bufferCounter + " (" + inflightReceiveMessageBatches + " of " + max + " inflight) for queue " + qUrl); } executor.execute(task); } } }
java
private void spawnMoreReceiveTasks() { if (shutDown) { return; } int desiredBatches = config.getMaxDoneReceiveBatches(); desiredBatches = desiredBatches < 1 ? 1 : desiredBatches; synchronized (finishedTasks) { if (finishedTasks.size() >= desiredBatches) return; // if we have some finished batches already, and // existing inflight batches will bring us to the limit, // don't spawn more. if our finished tasks cache is empty, we will // always spawn a thread. if (finishedTasks.size() > 0 && (finishedTasks.size() + inflightReceiveMessageBatches) >= desiredBatches) { return; } } synchronized (taskSpawnSyncPoint) { if (visibilityTimeoutNanos == -1) { GetQueueAttributesRequest request = new GetQueueAttributesRequest().withQueueUrl(qUrl) .withAttributeNames("VisibilityTimeout"); ResultConverter.appendUserAgent(request, AmazonSQSBufferedAsyncClient.USER_AGENT); long visibilityTimeoutSeconds = Long.parseLong(sqsClient.getQueueAttributes(request).getAttributes() .get("VisibilityTimeout")); visibilityTimeoutNanos = TimeUnit.NANOSECONDS.convert(visibilityTimeoutSeconds, TimeUnit.SECONDS); } int max = config.getMaxInflightReceiveBatches(); // must allow at least one inflight receive task, or receive won't // work at all. max = max > 0 ? max : 1; int toSpawn = max - inflightReceiveMessageBatches; if (toSpawn > 0) { ReceiveMessageBatchTask task = new ReceiveMessageBatchTask(this); ++inflightReceiveMessageBatches; ++bufferCounter; if (log.isTraceEnabled()) { log.trace("Spawned receive batch #" + bufferCounter + " (" + inflightReceiveMessageBatches + " of " + max + " inflight) for queue " + qUrl); } executor.execute(task); } } }
[ "private", "void", "spawnMoreReceiveTasks", "(", ")", "{", "if", "(", "shutDown", ")", "{", "return", ";", "}", "int", "desiredBatches", "=", "config", ".", "getMaxDoneReceiveBatches", "(", ")", ";", "desiredBatches", "=", "desiredBatches", "<", "1", "?", "1", ":", "desiredBatches", ";", "synchronized", "(", "finishedTasks", ")", "{", "if", "(", "finishedTasks", ".", "size", "(", ")", ">=", "desiredBatches", ")", "return", ";", "// if we have some finished batches already, and", "// existing inflight batches will bring us to the limit,", "// don't spawn more. if our finished tasks cache is empty, we will", "// always spawn a thread.", "if", "(", "finishedTasks", ".", "size", "(", ")", ">", "0", "&&", "(", "finishedTasks", ".", "size", "(", ")", "+", "inflightReceiveMessageBatches", ")", ">=", "desiredBatches", ")", "{", "return", ";", "}", "}", "synchronized", "(", "taskSpawnSyncPoint", ")", "{", "if", "(", "visibilityTimeoutNanos", "==", "-", "1", ")", "{", "GetQueueAttributesRequest", "request", "=", "new", "GetQueueAttributesRequest", "(", ")", ".", "withQueueUrl", "(", "qUrl", ")", ".", "withAttributeNames", "(", "\"VisibilityTimeout\"", ")", ";", "ResultConverter", ".", "appendUserAgent", "(", "request", ",", "AmazonSQSBufferedAsyncClient", ".", "USER_AGENT", ")", ";", "long", "visibilityTimeoutSeconds", "=", "Long", ".", "parseLong", "(", "sqsClient", ".", "getQueueAttributes", "(", "request", ")", ".", "getAttributes", "(", ")", ".", "get", "(", "\"VisibilityTimeout\"", ")", ")", ";", "visibilityTimeoutNanos", "=", "TimeUnit", ".", "NANOSECONDS", ".", "convert", "(", "visibilityTimeoutSeconds", ",", "TimeUnit", ".", "SECONDS", ")", ";", "}", "int", "max", "=", "config", ".", "getMaxInflightReceiveBatches", "(", ")", ";", "// must allow at least one inflight receive task, or receive won't", "// work at all.", "max", "=", "max", ">", "0", "?", "max", ":", "1", ";", "int", "toSpawn", "=", "max", "-", "inflightReceiveMessageBatches", ";", "if", "(", "toSpawn", ">", "0", ")", "{", "ReceiveMessageBatchTask", "task", "=", "new", "ReceiveMessageBatchTask", "(", "this", ")", ";", "++", "inflightReceiveMessageBatches", ";", "++", "bufferCounter", ";", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "{", "log", ".", "trace", "(", "\"Spawned receive batch #\"", "+", "bufferCounter", "+", "\" (\"", "+", "inflightReceiveMessageBatches", "+", "\" of \"", "+", "max", "+", "\" inflight) for queue \"", "+", "qUrl", ")", ";", "}", "executor", ".", "execute", "(", "task", ")", ";", "}", "}", "}" ]
maybe create more receive tasks. extra receive tasks won't be created if we are already at the maximum number of receive tasks, or if we are at the maximum number of prefetched buffers
[ "maybe", "create", "more", "receive", "tasks", ".", "extra", "receive", "tasks", "won", "t", "be", "created", "if", "we", "are", "already", "at", "the", "maximum", "number", "of", "receive", "tasks", "or", "if", "we", "are", "at", "the", "maximum", "number", "of", "prefetched", "buffers" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L286-L333
20,555
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.reportBatchFinished
void reportBatchFinished(ReceiveMessageBatchTask batch) { synchronized (finishedTasks) { finishedTasks.addLast(batch); if (log.isTraceEnabled()) { log.info("Queue " + qUrl + " now has " + finishedTasks.size() + " receive results cached "); } } synchronized (taskSpawnSyncPoint) { --inflightReceiveMessageBatches; } satisfyFuturesFromBuffer(); spawnMoreReceiveTasks(); }
java
void reportBatchFinished(ReceiveMessageBatchTask batch) { synchronized (finishedTasks) { finishedTasks.addLast(batch); if (log.isTraceEnabled()) { log.info("Queue " + qUrl + " now has " + finishedTasks.size() + " receive results cached "); } } synchronized (taskSpawnSyncPoint) { --inflightReceiveMessageBatches; } satisfyFuturesFromBuffer(); spawnMoreReceiveTasks(); }
[ "void", "reportBatchFinished", "(", "ReceiveMessageBatchTask", "batch", ")", "{", "synchronized", "(", "finishedTasks", ")", "{", "finishedTasks", ".", "addLast", "(", "batch", ")", ";", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "{", "log", ".", "info", "(", "\"Queue \"", "+", "qUrl", "+", "\" now has \"", "+", "finishedTasks", ".", "size", "(", ")", "+", "\" receive results cached \"", ")", ";", "}", "}", "synchronized", "(", "taskSpawnSyncPoint", ")", "{", "--", "inflightReceiveMessageBatches", ";", "}", "satisfyFuturesFromBuffer", "(", ")", ";", "spawnMoreReceiveTasks", "(", ")", ";", "}" ]
This method is called by the batches after they have finished retrieving the messages.
[ "This", "method", "is", "called", "by", "the", "batches", "after", "they", "have", "finished", "retrieving", "the", "messages", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L338-L350
20,556
aws/aws-sdk-java
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java
ReceiveQueueBuffer.clear
public void clear() { boolean done = false; while (!done) { ReceiveMessageBatchTask currentBatch = null; synchronized (finishedTasks) { currentBatch = finishedTasks.poll(); } if (currentBatch != null) { currentBatch.clear(); } else { // ran out of batches to clear done = true; } } }
java
public void clear() { boolean done = false; while (!done) { ReceiveMessageBatchTask currentBatch = null; synchronized (finishedTasks) { currentBatch = finishedTasks.poll(); } if (currentBatch != null) { currentBatch.clear(); } else { // ran out of batches to clear done = true; } } }
[ "public", "void", "clear", "(", ")", "{", "boolean", "done", "=", "false", ";", "while", "(", "!", "done", ")", "{", "ReceiveMessageBatchTask", "currentBatch", "=", "null", ";", "synchronized", "(", "finishedTasks", ")", "{", "currentBatch", "=", "finishedTasks", ".", "poll", "(", ")", ";", "}", "if", "(", "currentBatch", "!=", "null", ")", "{", "currentBatch", ".", "clear", "(", ")", ";", "}", "else", "{", "// ran out of batches to clear", "done", "=", "true", ";", "}", "}", "}" ]
Clears and nacks any pre-fetched messages in this buffer.
[ "Clears", "and", "nacks", "any", "pre", "-", "fetched", "messages", "in", "this", "buffer", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/ReceiveQueueBuffer.java#L355-L370
20,557
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/protocol/json/internal/MarshallerRegistry.java
MarshallerRegistry.merge
public MarshallerRegistry merge(MarshallerRegistry.Builder marshallerRegistryOverrides) { if(marshallerRegistryOverrides == null) { return this; } Builder merged = MarshallerRegistry.builder(); merged.copyMarshallersFromRegistry(this.marshallers); merged.copyMarshallersFromRegistry(marshallerRegistryOverrides.marshallers); return merged.build(); }
java
public MarshallerRegistry merge(MarshallerRegistry.Builder marshallerRegistryOverrides) { if(marshallerRegistryOverrides == null) { return this; } Builder merged = MarshallerRegistry.builder(); merged.copyMarshallersFromRegistry(this.marshallers); merged.copyMarshallersFromRegistry(marshallerRegistryOverrides.marshallers); return merged.build(); }
[ "public", "MarshallerRegistry", "merge", "(", "MarshallerRegistry", ".", "Builder", "marshallerRegistryOverrides", ")", "{", "if", "(", "marshallerRegistryOverrides", "==", "null", ")", "{", "return", "this", ";", "}", "Builder", "merged", "=", "MarshallerRegistry", ".", "builder", "(", ")", ";", "merged", ".", "copyMarshallersFromRegistry", "(", "this", ".", "marshallers", ")", ";", "merged", ".", "copyMarshallersFromRegistry", "(", "marshallerRegistryOverrides", ".", "marshallers", ")", ";", "return", "merged", ".", "build", "(", ")", ";", "}" ]
Merge the given overrides with 'this' registry. Overrides are higher precedence than 'this' registry. Both 'this' registry and the override registry are immutable so a new registry object is returned. If the marshallerRegistryOverrides are null then this method just returns the current registry since there is nothing to merge. @param marshallerRegistryOverrides Override registry. @return New {@link MarshallerRegistry} with marshallers merged.
[ "Merge", "the", "given", "overrides", "with", "this", "registry", ".", "Overrides", "are", "higher", "precedence", "than", "this", "registry", ".", "Both", "this", "registry", "and", "the", "override", "registry", "are", "immutable", "so", "a", "new", "registry", "object", "is", "returned", ".", "If", "the", "marshallerRegistryOverrides", "are", "null", "then", "this", "method", "just", "returns", "the", "current", "registry", "since", "there", "is", "nothing", "to", "merge", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/protocol/json/internal/MarshallerRegistry.java#L91-L99
20,558
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/CopyPartRequestFactory.java
CopyPartRequestFactory.getNextCopyPartRequest
public synchronized CopyPartRequest getNextCopyPartRequest() { final long partSize = Math.min(optimalPartSize, remainingBytes); CopyPartRequest req = new CopyPartRequest() .withSourceBucketName(origReq.getSourceBucketName()) .withSourceKey(origReq.getSourceKey()) .withUploadId(uploadId) .withPartNumber(partNumber++) .withDestinationBucketName(origReq.getDestinationBucketName()) .withDestinationKey(origReq.getDestinationKey()) .withSourceVersionId(origReq.getSourceVersionId()) .withFirstByte(Long.valueOf(offset)) .withLastByte(Long.valueOf(offset + partSize - 1)) .withSourceSSECustomerKey(origReq.getSourceSSECustomerKey()) .withDestinationSSECustomerKey(origReq.getDestinationSSECustomerKey()) .withRequesterPays(origReq.isRequesterPays()) // other meta data .withMatchingETagConstraints(origReq.getMatchingETagConstraints()) .withModifiedSinceConstraint(origReq.getModifiedSinceConstraint()) .withNonmatchingETagConstraints(origReq.getNonmatchingETagConstraints()) .withSourceVersionId(origReq.getSourceVersionId()) .withUnmodifiedSinceConstraint(origReq.getUnmodifiedSinceConstraint()) // general meta data .withGeneralProgressListener(origReq.getGeneralProgressListener()) .withRequestMetricCollector(origReq.getRequestMetricCollector()) ; offset += partSize; remainingBytes -= partSize; return req; }
java
public synchronized CopyPartRequest getNextCopyPartRequest() { final long partSize = Math.min(optimalPartSize, remainingBytes); CopyPartRequest req = new CopyPartRequest() .withSourceBucketName(origReq.getSourceBucketName()) .withSourceKey(origReq.getSourceKey()) .withUploadId(uploadId) .withPartNumber(partNumber++) .withDestinationBucketName(origReq.getDestinationBucketName()) .withDestinationKey(origReq.getDestinationKey()) .withSourceVersionId(origReq.getSourceVersionId()) .withFirstByte(Long.valueOf(offset)) .withLastByte(Long.valueOf(offset + partSize - 1)) .withSourceSSECustomerKey(origReq.getSourceSSECustomerKey()) .withDestinationSSECustomerKey(origReq.getDestinationSSECustomerKey()) .withRequesterPays(origReq.isRequesterPays()) // other meta data .withMatchingETagConstraints(origReq.getMatchingETagConstraints()) .withModifiedSinceConstraint(origReq.getModifiedSinceConstraint()) .withNonmatchingETagConstraints(origReq.getNonmatchingETagConstraints()) .withSourceVersionId(origReq.getSourceVersionId()) .withUnmodifiedSinceConstraint(origReq.getUnmodifiedSinceConstraint()) // general meta data .withGeneralProgressListener(origReq.getGeneralProgressListener()) .withRequestMetricCollector(origReq.getRequestMetricCollector()) ; offset += partSize; remainingBytes -= partSize; return req; }
[ "public", "synchronized", "CopyPartRequest", "getNextCopyPartRequest", "(", ")", "{", "final", "long", "partSize", "=", "Math", ".", "min", "(", "optimalPartSize", ",", "remainingBytes", ")", ";", "CopyPartRequest", "req", "=", "new", "CopyPartRequest", "(", ")", ".", "withSourceBucketName", "(", "origReq", ".", "getSourceBucketName", "(", ")", ")", ".", "withSourceKey", "(", "origReq", ".", "getSourceKey", "(", ")", ")", ".", "withUploadId", "(", "uploadId", ")", ".", "withPartNumber", "(", "partNumber", "++", ")", ".", "withDestinationBucketName", "(", "origReq", ".", "getDestinationBucketName", "(", ")", ")", ".", "withDestinationKey", "(", "origReq", ".", "getDestinationKey", "(", ")", ")", ".", "withSourceVersionId", "(", "origReq", ".", "getSourceVersionId", "(", ")", ")", ".", "withFirstByte", "(", "Long", ".", "valueOf", "(", "offset", ")", ")", ".", "withLastByte", "(", "Long", ".", "valueOf", "(", "offset", "+", "partSize", "-", "1", ")", ")", ".", "withSourceSSECustomerKey", "(", "origReq", ".", "getSourceSSECustomerKey", "(", ")", ")", ".", "withDestinationSSECustomerKey", "(", "origReq", ".", "getDestinationSSECustomerKey", "(", ")", ")", ".", "withRequesterPays", "(", "origReq", ".", "isRequesterPays", "(", ")", ")", "// other meta data", ".", "withMatchingETagConstraints", "(", "origReq", ".", "getMatchingETagConstraints", "(", ")", ")", ".", "withModifiedSinceConstraint", "(", "origReq", ".", "getModifiedSinceConstraint", "(", ")", ")", ".", "withNonmatchingETagConstraints", "(", "origReq", ".", "getNonmatchingETagConstraints", "(", ")", ")", ".", "withSourceVersionId", "(", "origReq", ".", "getSourceVersionId", "(", ")", ")", ".", "withUnmodifiedSinceConstraint", "(", "origReq", ".", "getUnmodifiedSinceConstraint", "(", ")", ")", "// general meta data", ".", "withGeneralProgressListener", "(", "origReq", ".", "getGeneralProgressListener", "(", ")", ")", ".", "withRequestMetricCollector", "(", "origReq", ".", "getRequestMetricCollector", "(", ")", ")", ";", "offset", "+=", "partSize", ";", "remainingBytes", "-=", "partSize", ";", "return", "req", ";", "}" ]
Constructs a copy part requests and returns it. @return Returns a new copy part request
[ "Constructs", "a", "copy", "part", "requests", "and", "returns", "it", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/CopyPartRequestFactory.java#L61-L90
20,559
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/BucketNotificationConfiguration.java
BucketNotificationConfiguration.withNotificationConfiguration
public BucketNotificationConfiguration withNotificationConfiguration( Map<String, NotificationConfiguration> notificationConfiguration) { configurations.clear(); configurations.putAll(notificationConfiguration); return this; }
java
public BucketNotificationConfiguration withNotificationConfiguration( Map<String, NotificationConfiguration> notificationConfiguration) { configurations.clear(); configurations.putAll(notificationConfiguration); return this; }
[ "public", "BucketNotificationConfiguration", "withNotificationConfiguration", "(", "Map", "<", "String", ",", "NotificationConfiguration", ">", "notificationConfiguration", ")", "{", "configurations", ".", "clear", "(", ")", ";", "configurations", ".", "putAll", "(", "notificationConfiguration", ")", ";", "return", "this", ";", "}" ]
Sets the given notification configurations and returns this object. @param notificationConfiguration the notification configurations to set @return The updated {@link BucketNotificationConfiguration} object.
[ "Sets", "the", "given", "notification", "configurations", "and", "returns", "this", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/BucketNotificationConfiguration.java#L103-L108
20,560
aws/aws-sdk-java
aws-java-sdk-workspaces/src/main/java/com/amazonaws/services/workspaces/AmazonWorkspacesAsyncClient.java
AmazonWorkspacesAsyncClient.describeWorkspaceDirectoriesAsync
@Override public java.util.concurrent.Future<DescribeWorkspaceDirectoriesResult> describeWorkspaceDirectoriesAsync( com.amazonaws.handlers.AsyncHandler<DescribeWorkspaceDirectoriesRequest, DescribeWorkspaceDirectoriesResult> asyncHandler) { return describeWorkspaceDirectoriesAsync(new DescribeWorkspaceDirectoriesRequest(), asyncHandler); }
java
@Override public java.util.concurrent.Future<DescribeWorkspaceDirectoriesResult> describeWorkspaceDirectoriesAsync( com.amazonaws.handlers.AsyncHandler<DescribeWorkspaceDirectoriesRequest, DescribeWorkspaceDirectoriesResult> asyncHandler) { return describeWorkspaceDirectoriesAsync(new DescribeWorkspaceDirectoriesRequest(), asyncHandler); }
[ "@", "Override", "public", "java", ".", "util", ".", "concurrent", ".", "Future", "<", "DescribeWorkspaceDirectoriesResult", ">", "describeWorkspaceDirectoriesAsync", "(", "com", ".", "amazonaws", ".", "handlers", ".", "AsyncHandler", "<", "DescribeWorkspaceDirectoriesRequest", ",", "DescribeWorkspaceDirectoriesResult", ">", "asyncHandler", ")", "{", "return", "describeWorkspaceDirectoriesAsync", "(", "new", "DescribeWorkspaceDirectoriesRequest", "(", ")", ",", "asyncHandler", ")", ";", "}" ]
Simplified method form for invoking the DescribeWorkspaceDirectories operation with an AsyncHandler. @see #describeWorkspaceDirectoriesAsync(DescribeWorkspaceDirectoriesRequest, com.amazonaws.handlers.AsyncHandler)
[ "Simplified", "method", "form", "for", "invoking", "the", "DescribeWorkspaceDirectories", "operation", "with", "an", "AsyncHandler", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workspaces/src/main/java/com/amazonaws/services/workspaces/AmazonWorkspacesAsyncClient.java#L783-L788
20,561
aws/aws-sdk-java
aws-java-sdk-importexport/src/main/java/com/amazonaws/services/importexport/AmazonImportExportClient.java
AmazonImportExportClient.getShippingLabel
@Override public GetShippingLabelResult getShippingLabel(GetShippingLabelRequest request) { request = beforeClientExecution(request); return executeGetShippingLabel(request); }
java
@Override public GetShippingLabelResult getShippingLabel(GetShippingLabelRequest request) { request = beforeClientExecution(request); return executeGetShippingLabel(request); }
[ "@", "Override", "public", "GetShippingLabelResult", "getShippingLabel", "(", "GetShippingLabelRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeGetShippingLabel", "(", "request", ")", ";", "}" ]
This operation generates a pre-paid UPS shipping label that you will use to ship your device to AWS for processing. @param getShippingLabelRequest @return Result of the GetShippingLabel operation returned by the service. @throws InvalidJobIdException The JOBID was missing, not found, or not associated with the AWS account. @throws ExpiredJobIdException Indicates that the specified job has expired out of the system. @throws CanceledJobIdException The specified job ID has been canceled and is no longer valid. @throws InvalidAccessKeyIdException The AWS Access Key ID specified in the request did not match the manifest's accessKeyId value. The manifest and the request authentication must use the same AWS Access Key ID. @throws InvalidAddressException The address specified in the manifest is invalid. @throws InvalidVersionException The client tool version is invalid. @throws InvalidParameterException One or more parameters had an invalid value. @sample AmazonImportExport.GetShippingLabel
[ "This", "operation", "generates", "a", "pre", "-", "paid", "UPS", "shipping", "label", "that", "you", "will", "use", "to", "ship", "your", "device", "to", "AWS", "for", "processing", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-importexport/src/main/java/com/amazonaws/services/importexport/AmazonImportExportClient.java#L476-L480
20,562
aws/aws-sdk-java
aws-java-sdk-importexport/src/main/java/com/amazonaws/services/importexport/AmazonImportExportClient.java
AmazonImportExportClient.getStatus
@Override public GetStatusResult getStatus(GetStatusRequest request) { request = beforeClientExecution(request); return executeGetStatus(request); }
java
@Override public GetStatusResult getStatus(GetStatusRequest request) { request = beforeClientExecution(request); return executeGetStatus(request); }
[ "@", "Override", "public", "GetStatusResult", "getStatus", "(", "GetStatusRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeGetStatus", "(", "request", ")", ";", "}" ]
This operation returns information about a job, including where the job is in the processing pipeline, the status of the results, and the signature value associated with the job. You can only return information about jobs you own. @param getStatusRequest Input structure for the GetStatus operation. @return Result of the GetStatus operation returned by the service. @throws InvalidJobIdException The JOBID was missing, not found, or not associated with the AWS account. @throws ExpiredJobIdException Indicates that the specified job has expired out of the system. @throws CanceledJobIdException The specified job ID has been canceled and is no longer valid. @throws InvalidAccessKeyIdException The AWS Access Key ID specified in the request did not match the manifest's accessKeyId value. The manifest and the request authentication must use the same AWS Access Key ID. @throws InvalidVersionException The client tool version is invalid. @sample AmazonImportExport.GetStatus
[ "This", "operation", "returns", "information", "about", "a", "job", "including", "where", "the", "job", "is", "in", "the", "processing", "pipeline", "the", "status", "of", "the", "results", "and", "the", "signature", "value", "associated", "with", "the", "job", ".", "You", "can", "only", "return", "information", "about", "jobs", "you", "own", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-importexport/src/main/java/com/amazonaws/services/importexport/AmazonImportExportClient.java#L538-L542
20,563
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/util/AWSRequestMetricsFullSupport.java
AWSRequestMetricsFullSupport.addProperty
@Override public void addProperty(String propertyName, Object value) { List<Object> propertyList = properties.get(propertyName); if (propertyList == null) { propertyList = new ArrayList<Object>(); properties.put(propertyName, propertyList); } propertyList.add(value); }
java
@Override public void addProperty(String propertyName, Object value) { List<Object> propertyList = properties.get(propertyName); if (propertyList == null) { propertyList = new ArrayList<Object>(); properties.put(propertyName, propertyList); } propertyList.add(value); }
[ "@", "Override", "public", "void", "addProperty", "(", "String", "propertyName", ",", "Object", "value", ")", "{", "List", "<", "Object", ">", "propertyList", "=", "properties", ".", "get", "(", "propertyName", ")", ";", "if", "(", "propertyList", "==", "null", ")", "{", "propertyList", "=", "new", "ArrayList", "<", "Object", ">", "(", ")", ";", "properties", ".", "put", "(", "propertyName", ",", "propertyList", ")", ";", "}", "propertyList", ".", "add", "(", "value", ")", ";", "}" ]
Add a property. If you add the same property more than once, it stores all values a list. This feature is enabled if the system property "com.amazonaws.sdk.enableRuntimeProfiling" is set, or if a {@link RequestMetricCollector} is in use either at the request, web service client, or AWS SDK level. @param propertyName The name of the property @param value The property value
[ "Add", "a", "property", ".", "If", "you", "add", "the", "same", "property", "more", "than", "once", "it", "stores", "all", "values", "a", "list", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/AWSRequestMetricsFullSupport.java#L171-L180
20,564
aws/aws-sdk-java
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SegmentGroupList.java
SegmentGroupList.setGroups
public void setGroups(java.util.Collection<SegmentGroup> groups) { if (groups == null) { this.groups = null; return; } this.groups = new java.util.ArrayList<SegmentGroup>(groups); }
java
public void setGroups(java.util.Collection<SegmentGroup> groups) { if (groups == null) { this.groups = null; return; } this.groups = new java.util.ArrayList<SegmentGroup>(groups); }
[ "public", "void", "setGroups", "(", "java", ".", "util", ".", "Collection", "<", "SegmentGroup", ">", "groups", ")", "{", "if", "(", "groups", "==", "null", ")", "{", "this", ".", "groups", "=", "null", ";", "return", ";", "}", "this", ".", "groups", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "SegmentGroup", ">", "(", "groups", ")", ";", "}" ]
A set of segment criteria to evaluate. @param groups A set of segment criteria to evaluate.
[ "A", "set", "of", "segment", "criteria", "to", "evaluate", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/SegmentGroupList.java#L55-L62
20,565
aws/aws-sdk-java
aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java
SignerUtils.buildCustomPolicy
public static String buildCustomPolicy(String resourcePath, Date expiresOn, Date activeFrom, String ipAddress) { return "{\"Statement\": [{" + "\"Resource\":\"" + resourcePath + "\"" + ",\"Condition\":{" + "\"DateLessThan\":{\"AWS:EpochTime\":" + MILLISECONDS.toSeconds(expiresOn.getTime()) + "}" + (ipAddress == null ? "" : ",\"IpAddress\":{\"AWS:SourceIp\":\"" + ipAddress + "\"}" ) + (activeFrom == null ? "" : ",\"DateGreaterThan\":{\"AWS:EpochTime\":" + MILLISECONDS.toSeconds(activeFrom.getTime()) + "}" ) + "}}]}"; }
java
public static String buildCustomPolicy(String resourcePath, Date expiresOn, Date activeFrom, String ipAddress) { return "{\"Statement\": [{" + "\"Resource\":\"" + resourcePath + "\"" + ",\"Condition\":{" + "\"DateLessThan\":{\"AWS:EpochTime\":" + MILLISECONDS.toSeconds(expiresOn.getTime()) + "}" + (ipAddress == null ? "" : ",\"IpAddress\":{\"AWS:SourceIp\":\"" + ipAddress + "\"}" ) + (activeFrom == null ? "" : ",\"DateGreaterThan\":{\"AWS:EpochTime\":" + MILLISECONDS.toSeconds(activeFrom.getTime()) + "}" ) + "}}]}"; }
[ "public", "static", "String", "buildCustomPolicy", "(", "String", "resourcePath", ",", "Date", "expiresOn", ",", "Date", "activeFrom", ",", "String", "ipAddress", ")", "{", "return", "\"{\\\"Statement\\\": [{\"", "+", "\"\\\"Resource\\\":\\\"\"", "+", "resourcePath", "+", "\"\\\"\"", "+", "\",\\\"Condition\\\":{\"", "+", "\"\\\"DateLessThan\\\":{\\\"AWS:EpochTime\\\":\"", "+", "MILLISECONDS", ".", "toSeconds", "(", "expiresOn", ".", "getTime", "(", ")", ")", "+", "\"}\"", "+", "(", "ipAddress", "==", "null", "?", "\"\"", ":", "\",\\\"IpAddress\\\":{\\\"AWS:SourceIp\\\":\\\"\"", "+", "ipAddress", "+", "\"\\\"}\"", ")", "+", "(", "activeFrom", "==", "null", "?", "\"\"", ":", "\",\\\"DateGreaterThan\\\":{\\\"AWS:EpochTime\\\":\"", "+", "MILLISECONDS", ".", "toSeconds", "(", "activeFrom", ".", "getTime", "(", ")", ")", "+", "\"}\"", ")", "+", "\"}}]}\"", ";", "}" ]
Returns a custom policy for the given parameters.
[ "Returns", "a", "custom", "policy", "for", "the", "given", "parameters", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java#L71-L92
20,566
aws/aws-sdk-java
aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java
SignerUtils.makeBytesUrlSafe
public static String makeBytesUrlSafe(byte[] bytes) { byte[] encoded = Base64.encode(bytes); for (int i=0; i < encoded.length; i++) { switch(encoded[i]) { case '+': encoded[i] = '-'; continue; case '=': encoded[i] = '_'; continue; case '/': encoded[i] = '~'; continue; default: continue; } } return new String(encoded, UTF8); }
java
public static String makeBytesUrlSafe(byte[] bytes) { byte[] encoded = Base64.encode(bytes); for (int i=0; i < encoded.length; i++) { switch(encoded[i]) { case '+': encoded[i] = '-'; continue; case '=': encoded[i] = '_'; continue; case '/': encoded[i] = '~'; continue; default: continue; } } return new String(encoded, UTF8); }
[ "public", "static", "String", "makeBytesUrlSafe", "(", "byte", "[", "]", "bytes", ")", "{", "byte", "[", "]", "encoded", "=", "Base64", ".", "encode", "(", "bytes", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "encoded", ".", "length", ";", "i", "++", ")", "{", "switch", "(", "encoded", "[", "i", "]", ")", "{", "case", "'", "'", ":", "encoded", "[", "i", "]", "=", "'", "'", ";", "continue", ";", "case", "'", "'", ":", "encoded", "[", "i", "]", "=", "'", "'", ";", "continue", ";", "case", "'", "'", ":", "encoded", "[", "i", "]", "=", "'", "'", ";", "continue", ";", "default", ":", "continue", ";", "}", "}", "return", "new", "String", "(", "encoded", ",", "UTF8", ")", ";", "}" ]
Converts the given data to be safe for use in signed URLs for a private distribution by using specialized Base64 encoding.
[ "Converts", "the", "given", "data", "to", "be", "safe", "for", "use", "in", "signed", "URLs", "for", "a", "private", "distribution", "by", "using", "specialized", "Base64", "encoding", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java#L97-L113
20,567
aws/aws-sdk-java
aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java
SignerUtils.generateResourcePath
public static String generateResourcePath(final Protocol protocol, final String distributionDomain, final String resourcePath) { return protocol == Protocol.http || protocol == Protocol.https ? protocol + "://" + distributionDomain + "/" + resourcePath : resourcePath ; }
java
public static String generateResourcePath(final Protocol protocol, final String distributionDomain, final String resourcePath) { return protocol == Protocol.http || protocol == Protocol.https ? protocol + "://" + distributionDomain + "/" + resourcePath : resourcePath ; }
[ "public", "static", "String", "generateResourcePath", "(", "final", "Protocol", "protocol", ",", "final", "String", "distributionDomain", ",", "final", "String", "resourcePath", ")", "{", "return", "protocol", "==", "Protocol", ".", "http", "||", "protocol", "==", "Protocol", ".", "https", "?", "protocol", "+", "\"://\"", "+", "distributionDomain", "+", "\"/\"", "+", "resourcePath", ":", "resourcePath", ";", "}" ]
Returns the resource path for the given distribution, object, and protocol.
[ "Returns", "the", "resource", "path", "for", "the", "given", "distribution", "object", "and", "protocol", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java#L127-L133
20,568
aws/aws-sdk-java
aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java
SignerUtils.signWithSha1RSA
public static byte[] signWithSha1RSA(byte[] dataToSign, PrivateKey privateKey) throws InvalidKeyException { Signature signature; try { signature = Signature.getInstance("SHA1withRSA"); signature.initSign(privateKey, srand); signature.update(dataToSign); return signature.sign(); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException(e); } catch (SignatureException e) { throw new IllegalStateException(e); } }
java
public static byte[] signWithSha1RSA(byte[] dataToSign, PrivateKey privateKey) throws InvalidKeyException { Signature signature; try { signature = Signature.getInstance("SHA1withRSA"); signature.initSign(privateKey, srand); signature.update(dataToSign); return signature.sign(); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException(e); } catch (SignatureException e) { throw new IllegalStateException(e); } }
[ "public", "static", "byte", "[", "]", "signWithSha1RSA", "(", "byte", "[", "]", "dataToSign", ",", "PrivateKey", "privateKey", ")", "throws", "InvalidKeyException", "{", "Signature", "signature", ";", "try", "{", "signature", "=", "Signature", ".", "getInstance", "(", "\"SHA1withRSA\"", ")", ";", "signature", ".", "initSign", "(", "privateKey", ",", "srand", ")", ";", "signature", ".", "update", "(", "dataToSign", ")", ";", "return", "signature", ".", "sign", "(", ")", ";", "}", "catch", "(", "NoSuchAlgorithmException", "e", ")", "{", "throw", "new", "IllegalStateException", "(", "e", ")", ";", "}", "catch", "(", "SignatureException", "e", ")", "{", "throw", "new", "IllegalStateException", "(", "e", ")", ";", "}", "}" ]
Signs the data given with the private key given, using the SHA1withRSA algorithm provided by bouncy castle.
[ "Signs", "the", "data", "given", "with", "the", "private", "key", "given", "using", "the", "SHA1withRSA", "algorithm", "provided", "by", "bouncy", "castle", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java#L139-L152
20,569
aws/aws-sdk-java
aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/GetMembersResult.java
GetMembersResult.setUnprocessedAccounts
public void setUnprocessedAccounts(java.util.Collection<UnprocessedAccount> unprocessedAccounts) { if (unprocessedAccounts == null) { this.unprocessedAccounts = null; return; } this.unprocessedAccounts = new java.util.ArrayList<UnprocessedAccount>(unprocessedAccounts); }
java
public void setUnprocessedAccounts(java.util.Collection<UnprocessedAccount> unprocessedAccounts) { if (unprocessedAccounts == null) { this.unprocessedAccounts = null; return; } this.unprocessedAccounts = new java.util.ArrayList<UnprocessedAccount>(unprocessedAccounts); }
[ "public", "void", "setUnprocessedAccounts", "(", "java", ".", "util", ".", "Collection", "<", "UnprocessedAccount", ">", "unprocessedAccounts", ")", "{", "if", "(", "unprocessedAccounts", "==", "null", ")", "{", "this", ".", "unprocessedAccounts", "=", "null", ";", "return", ";", "}", "this", ".", "unprocessedAccounts", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "UnprocessedAccount", ">", "(", "unprocessedAccounts", ")", ";", "}" ]
A list of objects containing the unprocessed account and a result string explaining why it was unprocessed. @param unprocessedAccounts A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
[ "A", "list", "of", "objects", "containing", "the", "unprocessed", "account", "and", "a", "result", "string", "explaining", "why", "it", "was", "unprocessed", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/GetMembersResult.java#L101-L108
20,570
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/CryptoConfiguration.java
CryptoConfiguration.getKmsRegion
@Deprecated public Regions getKmsRegion() { if (awskmsRegion == null) return null; return Regions.fromName(awskmsRegion.getName()); }
java
@Deprecated public Regions getKmsRegion() { if (awskmsRegion == null) return null; return Regions.fromName(awskmsRegion.getName()); }
[ "@", "Deprecated", "public", "Regions", "getKmsRegion", "(", ")", "{", "if", "(", "awskmsRegion", "==", "null", ")", "return", "null", ";", "return", "Regions", ".", "fromName", "(", "awskmsRegion", ".", "getName", "(", ")", ")", ";", "}" ]
Returns the the KMS region explicitly specified for the AWS KMS client when such client is internally instantiated; or null if no explicit KMS region is specified. This KMS region parameter is ignored when the AWS KMS client of the S3 encryption client is explicitly passed in by the users, instead of being implicitly created. @Deprecated This method is not forward compatible. Throws IllegalArguementException when a new region is encountered. @use {@link #getAwsKmsRegion()} instead
[ "Returns", "the", "the", "KMS", "region", "explicitly", "specified", "for", "the", "AWS", "KMS", "client", "when", "such", "client", "is", "internally", "instantiated", ";", "or", "null", "if", "no", "explicit", "KMS", "region", "is", "specified", ".", "This", "KMS", "region", "parameter", "is", "ignored", "when", "the", "AWS", "KMS", "client", "of", "the", "S3", "encryption", "client", "is", "explicitly", "passed", "in", "by", "the", "users", "instead", "of", "being", "implicitly", "created", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/CryptoConfiguration.java#L411-L415
20,571
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/CryptoConfiguration.java
CryptoConfiguration.setKmsRegion
@Deprecated public void setKmsRegion(Regions kmsRegion) { if (kmsRegion != null) { setAwsKmsRegion(Region.getRegion(kmsRegion)); } else { setAwsKmsRegion(null); } }
java
@Deprecated public void setKmsRegion(Regions kmsRegion) { if (kmsRegion != null) { setAwsKmsRegion(Region.getRegion(kmsRegion)); } else { setAwsKmsRegion(null); } }
[ "@", "Deprecated", "public", "void", "setKmsRegion", "(", "Regions", "kmsRegion", ")", "{", "if", "(", "kmsRegion", "!=", "null", ")", "{", "setAwsKmsRegion", "(", "Region", ".", "getRegion", "(", "kmsRegion", ")", ")", ";", "}", "else", "{", "setAwsKmsRegion", "(", "null", ")", ";", "}", "}" ]
Sets the KMS region for the AWS KMS client when such client is internally instantiated instead of externally passed in by users; or null if no explicit KMS region is explicitly configured.This KMS region parameter is ignored when the AWS KMS client of the S3 encryption client is explicitly passed in by the users, instead of being implicitly created. @Deprecated This method is not forward compatible. Doesn't handle new regions. @use {@link #setAwsKmsRegion(com.amazonaws.regions.Region)} instead
[ "Sets", "the", "KMS", "region", "for", "the", "AWS", "KMS", "client", "when", "such", "client", "is", "internally", "instantiated", "instead", "of", "externally", "passed", "in", "by", "users", ";", "or", "null", "if", "no", "explicit", "KMS", "region", "is", "explicitly", "configured", ".", "This", "KMS", "region", "parameter", "is", "ignored", "when", "the", "AWS", "KMS", "client", "of", "the", "S3", "encryption", "client", "is", "explicitly", "passed", "in", "by", "the", "users", "instead", "of", "being", "implicitly", "created", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/CryptoConfiguration.java#L429-L436
20,572
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/internal/FIFOCache.java
FIFOCache.add
public T add(String key, T value) { wlock.lock(); try { return map.put(key, value); } finally { wlock.unlock(); } }
java
public T add(String key, T value) { wlock.lock(); try { return map.put(key, value); } finally { wlock.unlock(); } }
[ "public", "T", "add", "(", "String", "key", ",", "T", "value", ")", "{", "wlock", ".", "lock", "(", ")", ";", "try", "{", "return", "map", ".", "put", "(", "key", ",", "value", ")", ";", "}", "finally", "{", "wlock", ".", "unlock", "(", ")", ";", "}", "}" ]
Adds an entry to the cache, evicting the earliest entry if necessary.
[ "Adds", "an", "entry", "to", "the", "cache", "evicting", "the", "earliest", "entry", "if", "necessary", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/internal/FIFOCache.java#L53-L60
20,573
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/internal/FIFOCache.java
FIFOCache.get
public T get(String key) { rlock.lock(); try { return map.get(key); } finally { rlock.unlock(); } }
java
public T get(String key) { rlock.lock(); try { return map.get(key); } finally { rlock.unlock(); } }
[ "public", "T", "get", "(", "String", "key", ")", "{", "rlock", ".", "lock", "(", ")", ";", "try", "{", "return", "map", ".", "get", "(", "key", ")", ";", "}", "finally", "{", "rlock", ".", "unlock", "(", ")", ";", "}", "}" ]
Returns the value of the given key; or null of no such entry exists.
[ "Returns", "the", "value", "of", "the", "given", "key", ";", "or", "null", "of", "no", "such", "entry", "exists", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/internal/FIFOCache.java#L63-L70
20,574
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/Encryption.java
Encryption.withEncryptionType
public Encryption withEncryptionType(SSEAlgorithm encryptionType) { setEncryptionType(encryptionType == null ? null : encryptionType.toString()); return this; }
java
public Encryption withEncryptionType(SSEAlgorithm encryptionType) { setEncryptionType(encryptionType == null ? null : encryptionType.toString()); return this; }
[ "public", "Encryption", "withEncryptionType", "(", "SSEAlgorithm", "encryptionType", ")", "{", "setEncryptionType", "(", "encryptionType", "==", "null", "?", "null", ":", "encryptionType", ".", "toString", "(", ")", ")", ";", "return", "this", ";", "}" ]
Sets the encryptionType @param encryptionType The new encryptionType value. @return This object for method chaining.
[ "Sets", "the", "encryptionType" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/Encryption.java#L73-L76
20,575
aws/aws-sdk-java
aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSAsyncClient.java
AWSKMSAsyncClient.createKeyAsync
@Override public java.util.concurrent.Future<CreateKeyResult> createKeyAsync(com.amazonaws.handlers.AsyncHandler<CreateKeyRequest, CreateKeyResult> asyncHandler) { return createKeyAsync(new CreateKeyRequest(), asyncHandler); }
java
@Override public java.util.concurrent.Future<CreateKeyResult> createKeyAsync(com.amazonaws.handlers.AsyncHandler<CreateKeyRequest, CreateKeyResult> asyncHandler) { return createKeyAsync(new CreateKeyRequest(), asyncHandler); }
[ "@", "Override", "public", "java", ".", "util", ".", "concurrent", ".", "Future", "<", "CreateKeyResult", ">", "createKeyAsync", "(", "com", ".", "amazonaws", ".", "handlers", ".", "AsyncHandler", "<", "CreateKeyRequest", ",", "CreateKeyResult", ">", "asyncHandler", ")", "{", "return", "createKeyAsync", "(", "new", "CreateKeyRequest", "(", ")", ",", "asyncHandler", ")", ";", "}" ]
Simplified method form for invoking the CreateKey operation with an AsyncHandler. @see #createKeyAsync(CreateKeyRequest, com.amazonaws.handlers.AsyncHandler)
[ "Simplified", "method", "form", "for", "invoking", "the", "CreateKey", "operation", "with", "an", "AsyncHandler", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSAsyncClient.java#L559-L563
20,576
aws/aws-sdk-java
aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSAsyncClient.java
AWSKMSAsyncClient.generateRandomAsync
@Override public java.util.concurrent.Future<GenerateRandomResult> generateRandomAsync( com.amazonaws.handlers.AsyncHandler<GenerateRandomRequest, GenerateRandomResult> asyncHandler) { return generateRandomAsync(new GenerateRandomRequest(), asyncHandler); }
java
@Override public java.util.concurrent.Future<GenerateRandomResult> generateRandomAsync( com.amazonaws.handlers.AsyncHandler<GenerateRandomRequest, GenerateRandomResult> asyncHandler) { return generateRandomAsync(new GenerateRandomRequest(), asyncHandler); }
[ "@", "Override", "public", "java", ".", "util", ".", "concurrent", ".", "Future", "<", "GenerateRandomResult", ">", "generateRandomAsync", "(", "com", ".", "amazonaws", ".", "handlers", ".", "AsyncHandler", "<", "GenerateRandomRequest", ",", "GenerateRandomResult", ">", "asyncHandler", ")", "{", "return", "generateRandomAsync", "(", "new", "GenerateRandomRequest", "(", ")", ",", "asyncHandler", ")", ";", "}" ]
Simplified method form for invoking the GenerateRandom operation with an AsyncHandler. @see #generateRandomAsync(GenerateRandomRequest, com.amazonaws.handlers.AsyncHandler)
[ "Simplified", "method", "form", "for", "invoking", "the", "GenerateRandom", "operation", "with", "an", "AsyncHandler", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSAsyncClient.java#L1078-L1083
20,577
aws/aws-sdk-java
aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSAsyncClient.java
AWSKMSAsyncClient.listKeysAsync
@Override public java.util.concurrent.Future<ListKeysResult> listKeysAsync(com.amazonaws.handlers.AsyncHandler<ListKeysRequest, ListKeysResult> asyncHandler) { return listKeysAsync(new ListKeysRequest(), asyncHandler); }
java
@Override public java.util.concurrent.Future<ListKeysResult> listKeysAsync(com.amazonaws.handlers.AsyncHandler<ListKeysRequest, ListKeysResult> asyncHandler) { return listKeysAsync(new ListKeysRequest(), asyncHandler); }
[ "@", "Override", "public", "java", ".", "util", ".", "concurrent", ".", "Future", "<", "ListKeysResult", ">", "listKeysAsync", "(", "com", ".", "amazonaws", ".", "handlers", ".", "AsyncHandler", "<", "ListKeysRequest", ",", "ListKeysResult", ">", "asyncHandler", ")", "{", "return", "listKeysAsync", "(", "new", "ListKeysRequest", "(", ")", ",", "asyncHandler", ")", ";", "}" ]
Simplified method form for invoking the ListKeys operation with an AsyncHandler. @see #listKeysAsync(ListKeysRequest, com.amazonaws.handlers.AsyncHandler)
[ "Simplified", "method", "form", "for", "invoking", "the", "ListKeys", "operation", "with", "an", "AsyncHandler", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/AWSKMSAsyncClient.java#L1388-L1392
20,578
aws/aws-sdk-java
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java
DocumentationUtils.stripHTMLTags
public static String stripHTMLTags(String documentation) { if (documentation == null) { return ""; } if (documentation.startsWith("<")) { int startTagIndex = documentation.indexOf(">"); final int closingTagIndex = documentation.lastIndexOf("<"); if (closingTagIndex > startTagIndex) { documentation = stripHTMLTags(documentation.substring (startTagIndex + 1, closingTagIndex)); } else { documentation = stripHTMLTags(documentation.substring (startTagIndex + 1)); } } return documentation.trim(); }
java
public static String stripHTMLTags(String documentation) { if (documentation == null) { return ""; } if (documentation.startsWith("<")) { int startTagIndex = documentation.indexOf(">"); final int closingTagIndex = documentation.lastIndexOf("<"); if (closingTagIndex > startTagIndex) { documentation = stripHTMLTags(documentation.substring (startTagIndex + 1, closingTagIndex)); } else { documentation = stripHTMLTags(documentation.substring (startTagIndex + 1)); } } return documentation.trim(); }
[ "public", "static", "String", "stripHTMLTags", "(", "String", "documentation", ")", "{", "if", "(", "documentation", "==", "null", ")", "{", "return", "\"\"", ";", "}", "if", "(", "documentation", ".", "startsWith", "(", "\"<\"", ")", ")", "{", "int", "startTagIndex", "=", "documentation", ".", "indexOf", "(", "\">\"", ")", ";", "final", "int", "closingTagIndex", "=", "documentation", ".", "lastIndexOf", "(", "\"<\"", ")", ";", "if", "(", "closingTagIndex", ">", "startTagIndex", ")", "{", "documentation", "=", "stripHTMLTags", "(", "documentation", ".", "substring", "(", "startTagIndex", "+", "1", ",", "closingTagIndex", ")", ")", ";", "}", "else", "{", "documentation", "=", "stripHTMLTags", "(", "documentation", ".", "substring", "(", "startTagIndex", "+", "1", ")", ")", ";", "}", "}", "return", "documentation", ".", "trim", "(", ")", ";", "}" ]
Returns a documentation with HTML tags prefixed and suffixed removed, or returns empty string if the input is empty or null. This method is to be used when constructing documentation for method parameters. @param documentation unprocessed input documentation @return HTML tag stripped documentation or empty string if input was null.
[ "Returns", "a", "documentation", "with", "HTML", "tags", "prefixed", "and", "suffixed", "removed", "or", "returns", "empty", "string", "if", "the", "input", "is", "empty", "or", "null", ".", "This", "method", "is", "to", "be", "used", "when", "constructing", "documentation", "for", "method", "parameters", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java#L79-L98
20,579
aws/aws-sdk-java
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java
DocumentationUtils.escapeIllegalCharacters
public static String escapeIllegalCharacters(String documentation) { if (documentation == null) { return ""; } /* * this specifically handles a case where a '* /' sequence may * be present in documentation and inadvertently terminate that Java * comment line, resulting in broken code. */ documentation = documentation.replaceAll("\\*\\/", "*&#47;"); return documentation; }
java
public static String escapeIllegalCharacters(String documentation) { if (documentation == null) { return ""; } /* * this specifically handles a case where a '* /' sequence may * be present in documentation and inadvertently terminate that Java * comment line, resulting in broken code. */ documentation = documentation.replaceAll("\\*\\/", "*&#47;"); return documentation; }
[ "public", "static", "String", "escapeIllegalCharacters", "(", "String", "documentation", ")", "{", "if", "(", "documentation", "==", "null", ")", "{", "return", "\"\"", ";", "}", "/*\n * this specifically handles a case where a '* /' sequence may\n * be present in documentation and inadvertently terminate that Java\n * comment line, resulting in broken code.\n */", "documentation", "=", "documentation", ".", "replaceAll", "(", "\"\\\\*\\\\/\"", ",", "\"*&#47;\"", ")", ";", "return", "documentation", ";", "}" ]
Escapes Java comment breaking illegal character sequences. @param documentation unprocessed input documentation @return escaped documentation, or empty string if input was null
[ "Escapes", "Java", "comment", "breaking", "illegal", "character", "sequences", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java#L107-L120
20,580
aws/aws-sdk-java
aws-java-sdk-opensdk/src/main/java/com/amazonaws/opensdk/internal/protocol/ApiGatewayErrorResponseHandler.java
ApiGatewayErrorResponseHandler.createException
private BaseException createException(int httpStatusCode, JsonContent jsonContent) { return unmarshallers.stream() .filter(u -> u.matches(httpStatusCode)) .findFirst() .map(u -> safeUnmarshall(jsonContent, u)) .orElseThrow(this::createUnknownException); }
java
private BaseException createException(int httpStatusCode, JsonContent jsonContent) { return unmarshallers.stream() .filter(u -> u.matches(httpStatusCode)) .findFirst() .map(u -> safeUnmarshall(jsonContent, u)) .orElseThrow(this::createUnknownException); }
[ "private", "BaseException", "createException", "(", "int", "httpStatusCode", ",", "JsonContent", "jsonContent", ")", "{", "return", "unmarshallers", ".", "stream", "(", ")", ".", "filter", "(", "u", "->", "u", ".", "matches", "(", "httpStatusCode", ")", ")", ".", "findFirst", "(", ")", ".", "map", "(", "u", "->", "safeUnmarshall", "(", "jsonContent", ",", "u", ")", ")", ".", "orElseThrow", "(", "this", "::", "createUnknownException", ")", ";", "}" ]
Create an AmazonServiceException using the chain of unmarshallers. This method will never return null, it will always return a valid exception. @param httpStatusCode Http status code to find an appropriate unmarshaller @param jsonContent JsonContent of HTTP response @return Unmarshalled exception
[ "Create", "an", "AmazonServiceException", "using", "the", "chain", "of", "unmarshallers", ".", "This", "method", "will", "never", "return", "null", "it", "will", "always", "return", "a", "valid", "exception", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opensdk/src/main/java/com/amazonaws/opensdk/internal/protocol/ApiGatewayErrorResponseHandler.java#L80-L86
20,581
aws/aws-sdk-java
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointsResponse.java
EndpointsResponse.setItem
public void setItem(java.util.Collection<EndpointResponse> item) { if (item == null) { this.item = null; return; } this.item = new java.util.ArrayList<EndpointResponse>(item); }
java
public void setItem(java.util.Collection<EndpointResponse> item) { if (item == null) { this.item = null; return; } this.item = new java.util.ArrayList<EndpointResponse>(item); }
[ "public", "void", "setItem", "(", "java", ".", "util", ".", "Collection", "<", "EndpointResponse", ">", "item", ")", "{", "if", "(", "item", "==", "null", ")", "{", "this", ".", "item", "=", "null", ";", "return", ";", "}", "this", ".", "item", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "EndpointResponse", ">", "(", "item", ")", ";", "}" ]
The list of endpoints. @param item The list of endpoints.
[ "The", "list", "of", "endpoints", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointsResponse.java#L49-L56
20,582
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/S3V4AuthErrorRetryStrategy.java
S3V4AuthErrorRetryStrategy.redirectToS3External
private AuthRetryParameters redirectToS3External() { AWSS3V4Signer v4Signer = buildSigV4Signer(Regions.US_EAST_1.getName()); try { URI bucketEndpoint = new URI( String.format("https://%s.s3-external-1.amazonaws.com", endpointResolver.getBucketName())); return buildRetryParams(v4Signer, bucketEndpoint); } catch (URISyntaxException e) { throw new SdkClientException( "Failed to re-send the request to \"s3-external-1.amazonaws.com\". " + V4_REGION_WARNING, e); } }
java
private AuthRetryParameters redirectToS3External() { AWSS3V4Signer v4Signer = buildSigV4Signer(Regions.US_EAST_1.getName()); try { URI bucketEndpoint = new URI( String.format("https://%s.s3-external-1.amazonaws.com", endpointResolver.getBucketName())); return buildRetryParams(v4Signer, bucketEndpoint); } catch (URISyntaxException e) { throw new SdkClientException( "Failed to re-send the request to \"s3-external-1.amazonaws.com\". " + V4_REGION_WARNING, e); } }
[ "private", "AuthRetryParameters", "redirectToS3External", "(", ")", "{", "AWSS3V4Signer", "v4Signer", "=", "buildSigV4Signer", "(", "Regions", ".", "US_EAST_1", ".", "getName", "(", ")", ")", ";", "try", "{", "URI", "bucketEndpoint", "=", "new", "URI", "(", "String", ".", "format", "(", "\"https://%s.s3-external-1.amazonaws.com\"", ",", "endpointResolver", ".", "getBucketName", "(", ")", ")", ")", ";", "return", "buildRetryParams", "(", "v4Signer", ",", "bucketEndpoint", ")", ";", "}", "catch", "(", "URISyntaxException", "e", ")", "{", "throw", "new", "SdkClientException", "(", "\"Failed to re-send the request to \\\"s3-external-1.amazonaws.com\\\". \"", "+", "V4_REGION_WARNING", ",", "e", ")", ";", "}", "}" ]
If the response doesn't have the x-amz-region header we have to resort to sending a request to s3-external-1 @return
[ "If", "the", "response", "doesn", "t", "have", "the", "x", "-", "amz", "-", "region", "header", "we", "have", "to", "resort", "to", "sending", "a", "request", "to", "s3", "-", "external", "-", "1" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/S3V4AuthErrorRetryStrategy.java#L97-L107
20,583
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java
AmazonWebServiceRequest.setRequestCredentials
@Deprecated public void setRequestCredentials(AWSCredentials credentials) { this.credentialsProvider = credentials == null ? null : new StaticCredentialsProvider(credentials); }
java
@Deprecated public void setRequestCredentials(AWSCredentials credentials) { this.credentialsProvider = credentials == null ? null : new StaticCredentialsProvider(credentials); }
[ "@", "Deprecated", "public", "void", "setRequestCredentials", "(", "AWSCredentials", "credentials", ")", "{", "this", ".", "credentialsProvider", "=", "credentials", "==", "null", "?", "null", ":", "new", "StaticCredentialsProvider", "(", "credentials", ")", ";", "}" ]
Sets the optional credentials to use for this request, overriding the default credentials set at the client level. @param credentials The optional AWS security credentials to use for this request, overriding the default credentials set at the client level. @deprecated by {@link #setRequestCredentialsProvider(AWSCredentialsProvider)}. If you must use {@link AWSCredentials} you can wrap it with a {@link com.amazonaws.auth.AWSStaticCredentialsProvider}.
[ "Sets", "the", "optional", "credentials", "to", "use", "for", "this", "request", "overriding", "the", "default", "credentials", "set", "at", "the", "client", "level", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L96-L99
20,584
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java
AmazonWebServiceRequest.withRequestCredentialsProvider
public <T extends AmazonWebServiceRequest> T withRequestCredentialsProvider(final AWSCredentialsProvider credentialsProvider) { setRequestCredentialsProvider(credentialsProvider); @SuppressWarnings("unchecked") T t = (T) this; return t; }
java
public <T extends AmazonWebServiceRequest> T withRequestCredentialsProvider(final AWSCredentialsProvider credentialsProvider) { setRequestCredentialsProvider(credentialsProvider); @SuppressWarnings("unchecked") T t = (T) this; return t; }
[ "public", "<", "T", "extends", "AmazonWebServiceRequest", ">", "T", "withRequestCredentialsProvider", "(", "final", "AWSCredentialsProvider", "credentialsProvider", ")", "{", "setRequestCredentialsProvider", "(", "credentialsProvider", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "T", "t", "=", "(", "T", ")", "this", ";", "return", "t", ";", "}" ]
Sets the optional credentials provider to use for this request, overriding the default credentials provider at the client level. @param credentialsProvider The optional AWS security credentials provider to use for this request, overriding the default credentials provider at the client level. @return A reference to this updated object so that method calls can be chained together.
[ "Sets", "the", "optional", "credentials", "provider", "to", "use", "for", "this", "request", "overriding", "the", "default", "credentials", "provider", "at", "the", "client", "level", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L147-L152
20,585
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java
AmazonWebServiceRequest.withRequestMetricCollector
public <T extends AmazonWebServiceRequest> T withRequestMetricCollector(RequestMetricCollector metricCollector) { setRequestMetricCollector(metricCollector); @SuppressWarnings("unchecked") T t = (T) this; return t; }
java
public <T extends AmazonWebServiceRequest> T withRequestMetricCollector(RequestMetricCollector metricCollector) { setRequestMetricCollector(metricCollector); @SuppressWarnings("unchecked") T t = (T) this; return t; }
[ "public", "<", "T", "extends", "AmazonWebServiceRequest", ">", "T", "withRequestMetricCollector", "(", "RequestMetricCollector", "metricCollector", ")", "{", "setRequestMetricCollector", "(", "metricCollector", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "T", "t", "=", "(", "T", ")", "this", ";", "return", "t", ";", "}" ]
Specifies a request level metric collector which takes precedence over the ones at the http client level and AWS SDK level.
[ "Specifies", "a", "request", "level", "metric", "collector", "which", "takes", "precedence", "over", "the", "ones", "at", "the", "http", "client", "level", "and", "AWS", "SDK", "level", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L180-L185
20,586
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java
AmazonWebServiceRequest.withGeneralProgressListener
public <T extends AmazonWebServiceRequest> T withGeneralProgressListener(ProgressListener progressListener) { setGeneralProgressListener(progressListener); @SuppressWarnings("unchecked") T t = (T) this; return t; }
java
public <T extends AmazonWebServiceRequest> T withGeneralProgressListener(ProgressListener progressListener) { setGeneralProgressListener(progressListener); @SuppressWarnings("unchecked") T t = (T) this; return t; }
[ "public", "<", "T", "extends", "AmazonWebServiceRequest", ">", "T", "withGeneralProgressListener", "(", "ProgressListener", "progressListener", ")", "{", "setGeneralProgressListener", "(", "progressListener", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "T", "t", "=", "(", "T", ")", "this", ";", "return", "t", ";", "}" ]
Sets the optional progress listener for receiving updates about the progress of the request, and returns a reference to this object so that method calls can be chained together. @param progressListener The new progress listener. @return A reference to this updated object so that method calls can be chained together.
[ "Sets", "the", "optional", "progress", "listener", "for", "receiving", "updates", "about", "the", "progress", "of", "the", "request", "and", "returns", "a", "reference", "to", "this", "object", "so", "that", "method", "calls", "can", "be", "chained", "together", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L216-L221
20,587
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java
AmazonWebServiceRequest.getCustomRequestHeaders
public Map<String, String> getCustomRequestHeaders() { if (customRequestHeaders == null) { return null; } return Collections.unmodifiableMap(customRequestHeaders); }
java
public Map<String, String> getCustomRequestHeaders() { if (customRequestHeaders == null) { return null; } return Collections.unmodifiableMap(customRequestHeaders); }
[ "public", "Map", "<", "String", ",", "String", ">", "getCustomRequestHeaders", "(", ")", "{", "if", "(", "customRequestHeaders", "==", "null", ")", "{", "return", "null", ";", "}", "return", "Collections", ".", "unmodifiableMap", "(", "customRequestHeaders", ")", ";", "}" ]
Returns an immutable map of custom header names to header values. @return The immutable map of custom header names to header values.
[ "Returns", "an", "immutable", "map", "of", "custom", "header", "names", "to", "header", "values", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L228-L233
20,588
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java
AmazonWebServiceRequest.copyBaseTo
protected final <T extends AmazonWebServiceRequest> T copyBaseTo(T target) { if (customRequestHeaders != null) { for (Map.Entry<String, String> e : customRequestHeaders.entrySet()) target.putCustomRequestHeader(e.getKey(), e.getValue()); } if (customQueryParameters != null) { for (Map.Entry<String, List<String>> e : customQueryParameters.entrySet()) { if (e.getValue() != null) { for (String value : e.getValue()) { target.putCustomQueryParameter(e.getKey(), value); } } } } target.setRequestCredentialsProvider(credentialsProvider); target.setGeneralProgressListener(progressListener); target.setRequestMetricCollector(requestMetricCollector); requestClientOptions.copyTo(target.getRequestClientOptions()); return target; }
java
protected final <T extends AmazonWebServiceRequest> T copyBaseTo(T target) { if (customRequestHeaders != null) { for (Map.Entry<String, String> e : customRequestHeaders.entrySet()) target.putCustomRequestHeader(e.getKey(), e.getValue()); } if (customQueryParameters != null) { for (Map.Entry<String, List<String>> e : customQueryParameters.entrySet()) { if (e.getValue() != null) { for (String value : e.getValue()) { target.putCustomQueryParameter(e.getKey(), value); } } } } target.setRequestCredentialsProvider(credentialsProvider); target.setGeneralProgressListener(progressListener); target.setRequestMetricCollector(requestMetricCollector); requestClientOptions.copyTo(target.getRequestClientOptions()); return target; }
[ "protected", "final", "<", "T", "extends", "AmazonWebServiceRequest", ">", "T", "copyBaseTo", "(", "T", "target", ")", "{", "if", "(", "customRequestHeaders", "!=", "null", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", "e", ":", "customRequestHeaders", ".", "entrySet", "(", ")", ")", "target", ".", "putCustomRequestHeader", "(", ".", "getKey", "(", ")", ",", ".", "getValue", "(", ")", ")", ";", "}", "if", "(", "customQueryParameters", "!=", "null", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "List", "<", "String", ">", ">", "e", ":", "customQueryParameters", ".", "entrySet", "(", ")", ")", "{", "if", "(", "e", ".", "getValue", "(", ")", "!=", "null", ")", "{", "for", "(", "String", "value", ":", "e", ".", "getValue", "(", ")", ")", "{", "target", ".", "putCustomQueryParameter", "(", "e", ".", "getKey", "(", ")", ",", "value", ")", ";", "}", "}", "}", "}", "target", ".", "setRequestCredentialsProvider", "(", "credentialsProvider", ")", ";", "target", ".", "setGeneralProgressListener", "(", "progressListener", ")", ";", "target", ".", "setRequestMetricCollector", "(", "requestMetricCollector", ")", ";", "requestClientOptions", ".", "copyTo", "(", "target", ".", "getRequestClientOptions", "(", ")", ")", ";", "return", "target", ";", "}" ]
Copies the internal state of this base class to that of the target request. @return the target request
[ "Copies", "the", "internal", "state", "of", "this", "base", "class", "to", "that", "of", "the", "target", "request", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L305-L325
20,589
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java
AmazonWebServiceRequest.getCloneRoot
public AmazonWebServiceRequest getCloneRoot() { AmazonWebServiceRequest cloneRoot = cloneSource; if (cloneRoot != null) { while (cloneRoot.getCloneSource() != null) { cloneRoot = cloneRoot.getCloneSource(); } } return cloneRoot; }
java
public AmazonWebServiceRequest getCloneRoot() { AmazonWebServiceRequest cloneRoot = cloneSource; if (cloneRoot != null) { while (cloneRoot.getCloneSource() != null) { cloneRoot = cloneRoot.getCloneSource(); } } return cloneRoot; }
[ "public", "AmazonWebServiceRequest", "getCloneRoot", "(", ")", "{", "AmazonWebServiceRequest", "cloneRoot", "=", "cloneSource", ";", "if", "(", "cloneRoot", "!=", "null", ")", "{", "while", "(", "cloneRoot", ".", "getCloneSource", "(", ")", "!=", "null", ")", "{", "cloneRoot", "=", "cloneRoot", ".", "getCloneSource", "(", ")", ";", "}", "}", "return", "cloneRoot", ";", "}" ]
Returns the root object from which the current object was cloned; or null if there isn't one.
[ "Returns", "the", "root", "object", "from", "which", "the", "current", "object", "was", "cloned", ";", "or", "null", "if", "there", "isn", "t", "one", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L338-L346
20,590
aws/aws-sdk-java
aws-java-sdk-codegen-maven-plugin/src/main/java/com/amazonaws/codegen/maven/plugin/GenerationMojo.java
GenerationMojo.loadRequiredModel
private <T> T loadRequiredModel(Class<T> clzz, String location) throws MojoExecutionException { return ModelLoaderUtils.loadModel(clzz, getResourceLocation(location)); }
java
private <T> T loadRequiredModel(Class<T> clzz, String location) throws MojoExecutionException { return ModelLoaderUtils.loadModel(clzz, getResourceLocation(location)); }
[ "private", "<", "T", ">", "T", "loadRequiredModel", "(", "Class", "<", "T", ">", "clzz", ",", "String", "location", ")", "throws", "MojoExecutionException", "{", "return", "ModelLoaderUtils", ".", "loadModel", "(", "clzz", ",", "getResourceLocation", "(", "location", ")", ")", ";", "}" ]
Load required model from the project resources.
[ "Load", "required", "model", "from", "the", "project", "resources", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codegen-maven-plugin/src/main/java/com/amazonaws/codegen/maven/plugin/GenerationMojo.java#L100-L102
20,591
aws/aws-sdk-java
aws-java-sdk-codegen-maven-plugin/src/main/java/com/amazonaws/codegen/maven/plugin/GenerationMojo.java
GenerationMojo.loadOptionalModel
private <T> Optional<T> loadOptionalModel(Class<T> clzz, String location) { return ModelLoaderUtils.loadOptionalModel(clzz, getResourceLocation(location)); }
java
private <T> Optional<T> loadOptionalModel(Class<T> clzz, String location) { return ModelLoaderUtils.loadOptionalModel(clzz, getResourceLocation(location)); }
[ "private", "<", "T", ">", "Optional", "<", "T", ">", "loadOptionalModel", "(", "Class", "<", "T", ">", "clzz", ",", "String", "location", ")", "{", "return", "ModelLoaderUtils", ".", "loadOptionalModel", "(", "clzz", ",", "getResourceLocation", "(", "location", ")", ")", ";", "}" ]
Load an optional model from the project resources. @return Model or empty optional if not present.
[ "Load", "an", "optional", "model", "from", "the", "project", "resources", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codegen-maven-plugin/src/main/java/com/amazonaws/codegen/maven/plugin/GenerationMojo.java#L109-L111
20,592
aws/aws-sdk-java
aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/waiters/AmazonAppStreamWaiters.java
AmazonAppStreamWaiters.fleetStarted
public Waiter<DescribeFleetsRequest> fleetStarted() { return new WaiterBuilder<DescribeFleetsRequest, DescribeFleetsResult>().withSdkFunction(new DescribeFleetsFunction(client)) .withAcceptors(new FleetStarted.IsACTIVEMatcher(), new FleetStarted.IsPENDING_DEACTIVATEMatcher(), new FleetStarted.IsINACTIVEMatcher()) .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(30))) .withExecutorService(executorService).build(); }
java
public Waiter<DescribeFleetsRequest> fleetStarted() { return new WaiterBuilder<DescribeFleetsRequest, DescribeFleetsResult>().withSdkFunction(new DescribeFleetsFunction(client)) .withAcceptors(new FleetStarted.IsACTIVEMatcher(), new FleetStarted.IsPENDING_DEACTIVATEMatcher(), new FleetStarted.IsINACTIVEMatcher()) .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(30))) .withExecutorService(executorService).build(); }
[ "public", "Waiter", "<", "DescribeFleetsRequest", ">", "fleetStarted", "(", ")", "{", "return", "new", "WaiterBuilder", "<", "DescribeFleetsRequest", ",", "DescribeFleetsResult", ">", "(", ")", ".", "withSdkFunction", "(", "new", "DescribeFleetsFunction", "(", "client", ")", ")", ".", "withAcceptors", "(", "new", "FleetStarted", ".", "IsACTIVEMatcher", "(", ")", ",", "new", "FleetStarted", ".", "IsPENDING_DEACTIVATEMatcher", "(", ")", ",", "new", "FleetStarted", ".", "IsINACTIVEMatcher", "(", ")", ")", ".", "withDefaultPollingStrategy", "(", "new", "PollingStrategy", "(", "new", "MaxAttemptsRetryStrategy", "(", "40", ")", ",", "new", "FixedDelayStrategy", "(", "30", ")", ")", ")", ".", "withExecutorService", "(", "executorService", ")", ".", "build", "(", ")", ";", "}" ]
Builds a FleetStarted waiter by using custom parameters waiterParameters and other parameters defined in the waiters specification, and then polls until it determines whether the resource entered the desired state or not, where polling criteria is bound by either default polling strategy or custom polling strategy.
[ "Builds", "a", "FleetStarted", "waiter", "by", "using", "custom", "parameters", "waiterParameters", "and", "other", "parameters", "defined", "in", "the", "waiters", "specification", "and", "then", "polls", "until", "it", "determines", "whether", "the", "resource", "entered", "the", "desired", "state", "or", "not", "where", "polling", "criteria", "is", "bound", "by", "either", "default", "polling", "strategy", "or", "custom", "polling", "strategy", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/waiters/AmazonAppStreamWaiters.java#L51-L57
20,593
aws/aws-sdk-java
aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/waiters/AmazonAppStreamWaiters.java
AmazonAppStreamWaiters.fleetStopped
public Waiter<DescribeFleetsRequest> fleetStopped() { return new WaiterBuilder<DescribeFleetsRequest, DescribeFleetsResult>().withSdkFunction(new DescribeFleetsFunction(client)) .withAcceptors(new FleetStopped.IsINACTIVEMatcher(), new FleetStopped.IsPENDING_ACTIVATEMatcher(), new FleetStopped.IsACTIVEMatcher()) .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(30))) .withExecutorService(executorService).build(); }
java
public Waiter<DescribeFleetsRequest> fleetStopped() { return new WaiterBuilder<DescribeFleetsRequest, DescribeFleetsResult>().withSdkFunction(new DescribeFleetsFunction(client)) .withAcceptors(new FleetStopped.IsINACTIVEMatcher(), new FleetStopped.IsPENDING_ACTIVATEMatcher(), new FleetStopped.IsACTIVEMatcher()) .withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(30))) .withExecutorService(executorService).build(); }
[ "public", "Waiter", "<", "DescribeFleetsRequest", ">", "fleetStopped", "(", ")", "{", "return", "new", "WaiterBuilder", "<", "DescribeFleetsRequest", ",", "DescribeFleetsResult", ">", "(", ")", ".", "withSdkFunction", "(", "new", "DescribeFleetsFunction", "(", "client", ")", ")", ".", "withAcceptors", "(", "new", "FleetStopped", ".", "IsINACTIVEMatcher", "(", ")", ",", "new", "FleetStopped", ".", "IsPENDING_ACTIVATEMatcher", "(", ")", ",", "new", "FleetStopped", ".", "IsACTIVEMatcher", "(", ")", ")", ".", "withDefaultPollingStrategy", "(", "new", "PollingStrategy", "(", "new", "MaxAttemptsRetryStrategy", "(", "40", ")", ",", "new", "FixedDelayStrategy", "(", "30", ")", ")", ")", ".", "withExecutorService", "(", "executorService", ")", ".", "build", "(", ")", ";", "}" ]
Builds a FleetStopped waiter by using custom parameters waiterParameters and other parameters defined in the waiters specification, and then polls until it determines whether the resource entered the desired state or not, where polling criteria is bound by either default polling strategy or custom polling strategy.
[ "Builds", "a", "FleetStopped", "waiter", "by", "using", "custom", "parameters", "waiterParameters", "and", "other", "parameters", "defined", "in", "the", "waiters", "specification", "and", "then", "polls", "until", "it", "determines", "whether", "the", "resource", "entered", "the", "desired", "state", "or", "not", "where", "polling", "criteria", "is", "bound", "by", "either", "default", "polling", "strategy", "or", "custom", "polling", "strategy", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/waiters/AmazonAppStreamWaiters.java#L64-L70
20,594
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java
AwsClientBuilder.resolveRequestHandlers
private List<RequestHandler2> resolveRequestHandlers() { return (requestHandlers == null) ? new ArrayList<RequestHandler2>() : new ArrayList<RequestHandler2>(requestHandlers); }
java
private List<RequestHandler2> resolveRequestHandlers() { return (requestHandlers == null) ? new ArrayList<RequestHandler2>() : new ArrayList<RequestHandler2>(requestHandlers); }
[ "private", "List", "<", "RequestHandler2", ">", "resolveRequestHandlers", "(", ")", "{", "return", "(", "requestHandlers", "==", "null", ")", "?", "new", "ArrayList", "<", "RequestHandler2", ">", "(", ")", ":", "new", "ArrayList", "<", "RequestHandler2", ">", "(", "requestHandlers", ")", ";", "}" ]
Request handlers are copied to a new list to avoid mutation, if no request handlers are provided to the builder we supply an empty list.
[ "Request", "handlers", "are", "copied", "to", "a", "new", "list", "to", "avoid", "mutation", "if", "no", "request", "handlers", "are", "provided", "to", "the", "builder", "we", "supply", "an", "empty", "list", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java#L371-L374
20,595
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java
AwsClientBuilder.getAdvancedConfig
protected final <T> T getAdvancedConfig(AdvancedConfig.Key<T> key) { return advancedConfig.get(key); }
java
protected final <T> T getAdvancedConfig(AdvancedConfig.Key<T> key) { return advancedConfig.get(key); }
[ "protected", "final", "<", "T", ">", "T", "getAdvancedConfig", "(", "AdvancedConfig", ".", "Key", "<", "T", ">", "key", ")", "{", "return", "advancedConfig", ".", "get", "(", "key", ")", ";", "}" ]
Get the current value of an advanced config option. @param key Key of value to get. @param <T> Type of value to get. @return Value if set, otherwise null.
[ "Get", "the", "current", "value", "of", "an", "advanced", "config", "option", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java#L400-L402
20,596
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java
AwsClientBuilder.putAdvancedConfig
protected final <T> void putAdvancedConfig(AdvancedConfig.Key<T> key, T value) { advancedConfig.put(key, value); }
java
protected final <T> void putAdvancedConfig(AdvancedConfig.Key<T> key, T value) { advancedConfig.put(key, value); }
[ "protected", "final", "<", "T", ">", "void", "putAdvancedConfig", "(", "AdvancedConfig", ".", "Key", "<", "T", ">", "key", ",", "T", "value", ")", "{", "advancedConfig", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
Sets the value of an advanced config option. @param key Key of value to set. @param value The new value. @param <T> Type of value.
[ "Sets", "the", "value", "of", "an", "advanced", "config", "option", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java#L410-L412
20,597
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java
AwsClientBuilder.configureMutableProperties
@SdkInternalApi final TypeToBuild configureMutableProperties(TypeToBuild clientInterface) { AmazonWebServiceClient client = (AmazonWebServiceClient) clientInterface; setRegion(client); client.makeImmutable(); return clientInterface; }
java
@SdkInternalApi final TypeToBuild configureMutableProperties(TypeToBuild clientInterface) { AmazonWebServiceClient client = (AmazonWebServiceClient) clientInterface; setRegion(client); client.makeImmutable(); return clientInterface; }
[ "@", "SdkInternalApi", "final", "TypeToBuild", "configureMutableProperties", "(", "TypeToBuild", "clientInterface", ")", "{", "AmazonWebServiceClient", "client", "=", "(", "AmazonWebServiceClient", ")", "clientInterface", ";", "setRegion", "(", "client", ")", ";", "client", ".", "makeImmutable", "(", ")", ";", "return", "clientInterface", ";", "}" ]
Region and endpoint logic is tightly coupled to the client class right now so it's easier to set them after client creation and let the normal logic kick in. Ideally this should resolve the endpoint and signer information here and just pass that information as is to the client. @param clientInterface Client to configure
[ "Region", "and", "endpoint", "logic", "is", "tightly", "coupled", "to", "the", "client", "class", "right", "now", "so", "it", "s", "easier", "to", "set", "them", "after", "client", "creation", "and", "let", "the", "normal", "logic", "kick", "in", ".", "Ideally", "this", "should", "resolve", "the", "endpoint", "and", "signer", "information", "here", "and", "just", "pass", "that", "information", "as", "is", "to", "the", "client", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/client/builder/AwsClientBuilder.java#L421-L427
20,598
aws/aws-sdk-java
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/ImportJobsResponse.java
ImportJobsResponse.setItem
public void setItem(java.util.Collection<ImportJobResponse> item) { if (item == null) { this.item = null; return; } this.item = new java.util.ArrayList<ImportJobResponse>(item); }
java
public void setItem(java.util.Collection<ImportJobResponse> item) { if (item == null) { this.item = null; return; } this.item = new java.util.ArrayList<ImportJobResponse>(item); }
[ "public", "void", "setItem", "(", "java", ".", "util", ".", "Collection", "<", "ImportJobResponse", ">", "item", ")", "{", "if", "(", "item", "==", "null", ")", "{", "this", ".", "item", "=", "null", ";", "return", ";", "}", "this", ".", "item", "=", "new", "java", ".", "util", ".", "ArrayList", "<", "ImportJobResponse", ">", "(", "item", ")", ";", "}" ]
A list of import jobs for the application. @param item A list of import jobs for the application.
[ "A", "list", "of", "import", "jobs", "for", "the", "application", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/ImportJobsResponse.java#L51-L58
20,599
aws/aws-sdk-java
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/MessageRequest.java
MessageRequest.withAddresses
public MessageRequest withAddresses(java.util.Map<String, AddressConfiguration> addresses) { setAddresses(addresses); return this; }
java
public MessageRequest withAddresses(java.util.Map<String, AddressConfiguration> addresses) { setAddresses(addresses); return this; }
[ "public", "MessageRequest", "withAddresses", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "AddressConfiguration", ">", "addresses", ")", "{", "setAddresses", "(", "addresses", ")", ";", "return", "this", ";", "}" ]
A map of key-value pairs, where each key is an address and each value is an AddressConfiguration object. An address can be a push notification token, a phone number, or an email address. @param addresses A map of key-value pairs, where each key is an address and each value is an AddressConfiguration object. An address can be a push notification token, a phone number, or an email address. @return Returns a reference to this object so that method calls can be chained together.
[ "A", "map", "of", "key", "-", "value", "pairs", "where", "each", "key", "is", "an", "address", "and", "each", "value", "is", "an", "AddressConfiguration", "object", ".", "An", "address", "can", "be", "a", "push", "notification", "token", "a", "phone", "number", "or", "an", "email", "address", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/MessageRequest.java#L85-L88