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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
19,600
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/auth/AWS4Signer.java
|
AWS4Signer.generateExpirationDate
|
private long generateExpirationDate(Date expirationDate) {
long expirationInSeconds = expirationDate != null ? ((expirationDate
.getTime() - clock.currentTimeMillis()) / 1000L)
: PRESIGN_URL_MAX_EXPIRATION_SECONDS;
if (expirationInSeconds > PRESIGN_URL_MAX_EXPIRATION_SECONDS) {
throw new SdkClientException(
"Requests that are pre-signed by SigV4 algorithm are valid for at most 7 days. "
+ "The expiration date set on the current request ["
+ AWS4SignerUtils.formatTimestamp(expirationDate
.getTime()) + "] has exceeded this limit.");
}
return expirationInSeconds;
}
|
java
|
private long generateExpirationDate(Date expirationDate) {
long expirationInSeconds = expirationDate != null ? ((expirationDate
.getTime() - clock.currentTimeMillis()) / 1000L)
: PRESIGN_URL_MAX_EXPIRATION_SECONDS;
if (expirationInSeconds > PRESIGN_URL_MAX_EXPIRATION_SECONDS) {
throw new SdkClientException(
"Requests that are pre-signed by SigV4 algorithm are valid for at most 7 days. "
+ "The expiration date set on the current request ["
+ AWS4SignerUtils.formatTimestamp(expirationDate
.getTime()) + "] has exceeded this limit.");
}
return expirationInSeconds;
}
|
[
"private",
"long",
"generateExpirationDate",
"(",
"Date",
"expirationDate",
")",
"{",
"long",
"expirationInSeconds",
"=",
"expirationDate",
"!=",
"null",
"?",
"(",
"(",
"expirationDate",
".",
"getTime",
"(",
")",
"-",
"clock",
".",
"currentTimeMillis",
"(",
")",
")",
"/",
"1000L",
")",
":",
"PRESIGN_URL_MAX_EXPIRATION_SECONDS",
";",
"if",
"(",
"expirationInSeconds",
">",
"PRESIGN_URL_MAX_EXPIRATION_SECONDS",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Requests that are pre-signed by SigV4 algorithm are valid for at most 7 days. \"",
"+",
"\"The expiration date set on the current request [\"",
"+",
"AWS4SignerUtils",
".",
"formatTimestamp",
"(",
"expirationDate",
".",
"getTime",
"(",
")",
")",
"+",
"\"] has exceeded this limit.\"",
")",
";",
"}",
"return",
"expirationInSeconds",
";",
"}"
] |
Generates an expiration date for the presigned url. If user has specified
an expiration date, check if it is in the given limit.
|
[
"Generates",
"an",
"expiration",
"date",
"for",
"the",
"presigned",
"url",
".",
"If",
"user",
"has",
"specified",
"an",
"expiration",
"date",
"check",
"if",
"it",
"is",
"in",
"the",
"given",
"limit",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AWS4Signer.java#L604-L618
|
19,601
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/auth/AWS4Signer.java
|
AWS4Signer.newSigningKey
|
protected byte[] newSigningKey(AWSCredentials credentials,
String dateStamp, String regionName, String serviceName) {
byte[] kSecret = ("AWS4" + credentials.getAWSSecretKey())
.getBytes(Charset.forName("UTF-8"));
byte[] kDate = sign(dateStamp, kSecret, SigningAlgorithm.HmacSHA256);
byte[] kRegion = sign(regionName, kDate, SigningAlgorithm.HmacSHA256);
byte[] kService = sign(serviceName, kRegion,
SigningAlgorithm.HmacSHA256);
return sign(AWS4_TERMINATOR, kService, SigningAlgorithm.HmacSHA256);
}
|
java
|
protected byte[] newSigningKey(AWSCredentials credentials,
String dateStamp, String regionName, String serviceName) {
byte[] kSecret = ("AWS4" + credentials.getAWSSecretKey())
.getBytes(Charset.forName("UTF-8"));
byte[] kDate = sign(dateStamp, kSecret, SigningAlgorithm.HmacSHA256);
byte[] kRegion = sign(regionName, kDate, SigningAlgorithm.HmacSHA256);
byte[] kService = sign(serviceName, kRegion,
SigningAlgorithm.HmacSHA256);
return sign(AWS4_TERMINATOR, kService, SigningAlgorithm.HmacSHA256);
}
|
[
"protected",
"byte",
"[",
"]",
"newSigningKey",
"(",
"AWSCredentials",
"credentials",
",",
"String",
"dateStamp",
",",
"String",
"regionName",
",",
"String",
"serviceName",
")",
"{",
"byte",
"[",
"]",
"kSecret",
"=",
"(",
"\"AWS4\"",
"+",
"credentials",
".",
"getAWSSecretKey",
"(",
")",
")",
".",
"getBytes",
"(",
"Charset",
".",
"forName",
"(",
"\"UTF-8\"",
")",
")",
";",
"byte",
"[",
"]",
"kDate",
"=",
"sign",
"(",
"dateStamp",
",",
"kSecret",
",",
"SigningAlgorithm",
".",
"HmacSHA256",
")",
";",
"byte",
"[",
"]",
"kRegion",
"=",
"sign",
"(",
"regionName",
",",
"kDate",
",",
"SigningAlgorithm",
".",
"HmacSHA256",
")",
";",
"byte",
"[",
"]",
"kService",
"=",
"sign",
"(",
"serviceName",
",",
"kRegion",
",",
"SigningAlgorithm",
".",
"HmacSHA256",
")",
";",
"return",
"sign",
"(",
"AWS4_TERMINATOR",
",",
"kService",
",",
"SigningAlgorithm",
".",
"HmacSHA256",
")",
";",
"}"
] |
Generates a new signing key from the given parameters and returns it.
|
[
"Generates",
"a",
"new",
"signing",
"key",
"from",
"the",
"given",
"parameters",
"and",
"returns",
"it",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AWS4Signer.java#L623-L632
|
19,602
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapperFieldModel.java
|
DynamoDBMapperFieldModel.globalSecondaryIndexNames
|
public final List<String> globalSecondaryIndexNames(final KeyType keyType) {
if (properties.globalSecondaryIndexNames().containsKey(keyType)) {
return properties.globalSecondaryIndexNames().get(keyType);
}
return Collections.emptyList();
}
|
java
|
public final List<String> globalSecondaryIndexNames(final KeyType keyType) {
if (properties.globalSecondaryIndexNames().containsKey(keyType)) {
return properties.globalSecondaryIndexNames().get(keyType);
}
return Collections.emptyList();
}
|
[
"public",
"final",
"List",
"<",
"String",
">",
"globalSecondaryIndexNames",
"(",
"final",
"KeyType",
"keyType",
")",
"{",
"if",
"(",
"properties",
".",
"globalSecondaryIndexNames",
"(",
")",
".",
"containsKey",
"(",
"keyType",
")",
")",
"{",
"return",
"properties",
".",
"globalSecondaryIndexNames",
"(",
")",
".",
"get",
"(",
"keyType",
")",
";",
"}",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}"
] |
Gets the global secondary indexes.
@param keyType The key type.
@return The list of global secondary indexes.
|
[
"Gets",
"the",
"global",
"secondary",
"indexes",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapperFieldModel.java#L196-L201
|
19,603
|
aws/aws-sdk-java
|
aws-java-sdk-opensdk/src/main/java/com/amazonaws/opensdk/SdkResponseMetadata.java
|
SdkResponseMetadata.header
|
public Optional<String> header(String headerName) {
return Optional.ofNullable(httpMetadata.getHttpHeaders().get(headerName));
}
|
java
|
public Optional<String> header(String headerName) {
return Optional.ofNullable(httpMetadata.getHttpHeaders().get(headerName));
}
|
[
"public",
"Optional",
"<",
"String",
">",
"header",
"(",
"String",
"headerName",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"httpMetadata",
".",
"getHttpHeaders",
"(",
")",
".",
"get",
"(",
"headerName",
")",
")",
";",
"}"
] |
Get a specific header from the HTTP response.
@param headerName Header to retrieve.
@return Optional of header value.
|
[
"Get",
"a",
"specific",
"header",
"from",
"the",
"HTTP",
"response",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opensdk/src/main/java/com/amazonaws/opensdk/SdkResponseMetadata.java#L52-L54
|
19,604
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java
|
ProcessCredentialsProvider.parseProcessOutput
|
private JsonNode parseProcessOutput(String processOutput) {
JsonNode credentialsJson = Jackson.jsonNodeOf(processOutput);
if (!credentialsJson.isObject()) {
throw new IllegalStateException("Process did not return a JSON object.");
}
JsonNode version = credentialsJson.get("Version");
if (version == null || !version.isInt() || version.asInt() != 1) {
throw new IllegalStateException("Unsupported credential version: " + version);
}
return credentialsJson;
}
|
java
|
private JsonNode parseProcessOutput(String processOutput) {
JsonNode credentialsJson = Jackson.jsonNodeOf(processOutput);
if (!credentialsJson.isObject()) {
throw new IllegalStateException("Process did not return a JSON object.");
}
JsonNode version = credentialsJson.get("Version");
if (version == null || !version.isInt() || version.asInt() != 1) {
throw new IllegalStateException("Unsupported credential version: " + version);
}
return credentialsJson;
}
|
[
"private",
"JsonNode",
"parseProcessOutput",
"(",
"String",
"processOutput",
")",
"{",
"JsonNode",
"credentialsJson",
"=",
"Jackson",
".",
"jsonNodeOf",
"(",
"processOutput",
")",
";",
"if",
"(",
"!",
"credentialsJson",
".",
"isObject",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Process did not return a JSON object.\"",
")",
";",
"}",
"JsonNode",
"version",
"=",
"credentialsJson",
".",
"get",
"(",
"\"Version\"",
")",
";",
"if",
"(",
"version",
"==",
"null",
"||",
"!",
"version",
".",
"isInt",
"(",
")",
"||",
"version",
".",
"asInt",
"(",
")",
"!=",
"1",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Unsupported credential version: \"",
"+",
"version",
")",
";",
"}",
"return",
"credentialsJson",
";",
"}"
] |
Parse the output from the credentials process.
|
[
"Parse",
"the",
"output",
"from",
"the",
"credentials",
"process",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java#L141-L153
|
19,605
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java
|
ProcessCredentialsProvider.credentials
|
private AWSCredentials credentials(JsonNode credentialsJson) {
String accessKeyId = getText(credentialsJson, "AccessKeyId");
String secretAccessKey = getText(credentialsJson, "SecretAccessKey");
String sessionToken = getText(credentialsJson, "SessionToken");
ValidationUtils.assertStringNotEmpty(accessKeyId, "AccessKeyId");
ValidationUtils.assertStringNotEmpty(accessKeyId, "SecretAccessKey");
if (sessionToken != null) {
return new BasicSessionCredentials(accessKeyId, secretAccessKey, sessionToken);
} else {
return new BasicAWSCredentials(accessKeyId, secretAccessKey);
}
}
|
java
|
private AWSCredentials credentials(JsonNode credentialsJson) {
String accessKeyId = getText(credentialsJson, "AccessKeyId");
String secretAccessKey = getText(credentialsJson, "SecretAccessKey");
String sessionToken = getText(credentialsJson, "SessionToken");
ValidationUtils.assertStringNotEmpty(accessKeyId, "AccessKeyId");
ValidationUtils.assertStringNotEmpty(accessKeyId, "SecretAccessKey");
if (sessionToken != null) {
return new BasicSessionCredentials(accessKeyId, secretAccessKey, sessionToken);
} else {
return new BasicAWSCredentials(accessKeyId, secretAccessKey);
}
}
|
[
"private",
"AWSCredentials",
"credentials",
"(",
"JsonNode",
"credentialsJson",
")",
"{",
"String",
"accessKeyId",
"=",
"getText",
"(",
"credentialsJson",
",",
"\"AccessKeyId\"",
")",
";",
"String",
"secretAccessKey",
"=",
"getText",
"(",
"credentialsJson",
",",
"\"SecretAccessKey\"",
")",
";",
"String",
"sessionToken",
"=",
"getText",
"(",
"credentialsJson",
",",
"\"SessionToken\"",
")",
";",
"ValidationUtils",
".",
"assertStringNotEmpty",
"(",
"accessKeyId",
",",
"\"AccessKeyId\"",
")",
";",
"ValidationUtils",
".",
"assertStringNotEmpty",
"(",
"accessKeyId",
",",
"\"SecretAccessKey\"",
")",
";",
"if",
"(",
"sessionToken",
"!=",
"null",
")",
"{",
"return",
"new",
"BasicSessionCredentials",
"(",
"accessKeyId",
",",
"secretAccessKey",
",",
"sessionToken",
")",
";",
"}",
"else",
"{",
"return",
"new",
"BasicAWSCredentials",
"(",
"accessKeyId",
",",
"secretAccessKey",
")",
";",
"}",
"}"
] |
Parse the process output to retrieve the credentials.
|
[
"Parse",
"the",
"process",
"output",
"to",
"retrieve",
"the",
"credentials",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java#L158-L171
|
19,606
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java
|
ProcessCredentialsProvider.credentialExpirationTime
|
private DateTime credentialExpirationTime(JsonNode credentialsJson) {
String expiration = getText(credentialsJson, "Expiration");
if (expiration != null) {
DateTime credentialExpiration = new DateTime(DateUtils.parseISO8601Date(expiration));
credentialExpiration = credentialExpiration.minus(expirationBufferUnit.toMillis(expirationBufferValue));
return credentialExpiration;
} else {
return DateTime.now().plusYears(9999);
}
}
|
java
|
private DateTime credentialExpirationTime(JsonNode credentialsJson) {
String expiration = getText(credentialsJson, "Expiration");
if (expiration != null) {
DateTime credentialExpiration = new DateTime(DateUtils.parseISO8601Date(expiration));
credentialExpiration = credentialExpiration.minus(expirationBufferUnit.toMillis(expirationBufferValue));
return credentialExpiration;
} else {
return DateTime.now().plusYears(9999);
}
}
|
[
"private",
"DateTime",
"credentialExpirationTime",
"(",
"JsonNode",
"credentialsJson",
")",
"{",
"String",
"expiration",
"=",
"getText",
"(",
"credentialsJson",
",",
"\"Expiration\"",
")",
";",
"if",
"(",
"expiration",
"!=",
"null",
")",
"{",
"DateTime",
"credentialExpiration",
"=",
"new",
"DateTime",
"(",
"DateUtils",
".",
"parseISO8601Date",
"(",
"expiration",
")",
")",
";",
"credentialExpiration",
"=",
"credentialExpiration",
".",
"minus",
"(",
"expirationBufferUnit",
".",
"toMillis",
"(",
"expirationBufferValue",
")",
")",
";",
"return",
"credentialExpiration",
";",
"}",
"else",
"{",
"return",
"DateTime",
".",
"now",
"(",
")",
".",
"plusYears",
"(",
"9999",
")",
";",
"}",
"}"
] |
Parse the process output to retrieve the expiration date and time. The result includes any configured expiration buffer.
|
[
"Parse",
"the",
"process",
"output",
"to",
"retrieve",
"the",
"expiration",
"date",
"and",
"time",
".",
"The",
"result",
"includes",
"any",
"configured",
"expiration",
"buffer",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java#L176-L186
|
19,607
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java
|
ProcessCredentialsProvider.getText
|
private String getText(JsonNode jsonObject, String nodeName) {
JsonNode subNode = jsonObject.get(nodeName);
if (subNode == null) {
return null;
}
if (!subNode.isTextual()) {
throw new IllegalStateException(nodeName + " from credential process should be textual, but was " +
subNode.getNodeType());
}
return subNode.asText();
}
|
java
|
private String getText(JsonNode jsonObject, String nodeName) {
JsonNode subNode = jsonObject.get(nodeName);
if (subNode == null) {
return null;
}
if (!subNode.isTextual()) {
throw new IllegalStateException(nodeName + " from credential process should be textual, but was " +
subNode.getNodeType());
}
return subNode.asText();
}
|
[
"private",
"String",
"getText",
"(",
"JsonNode",
"jsonObject",
",",
"String",
"nodeName",
")",
"{",
"JsonNode",
"subNode",
"=",
"jsonObject",
".",
"get",
"(",
"nodeName",
")",
";",
"if",
"(",
"subNode",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"subNode",
".",
"isTextual",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"nodeName",
"+",
"\" from credential process should be textual, but was \"",
"+",
"subNode",
".",
"getNodeType",
"(",
")",
")",
";",
"}",
"return",
"subNode",
".",
"asText",
"(",
")",
";",
"}"
] |
Get a textual value from a json object, throwing an exception if the node is missing or not textual.
|
[
"Get",
"a",
"textual",
"value",
"from",
"a",
"json",
"object",
"throwing",
"an",
"exception",
"if",
"the",
"node",
"is",
"missing",
"or",
"not",
"textual",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java#L191-L204
|
19,608
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java
|
ProcessCredentialsProvider.executeCommand
|
private String executeCommand() throws IOException, InterruptedException {
ProcessBuilder processBuilder = new ProcessBuilder(command);
ByteArrayOutputStream commandOutput = new ByteArrayOutputStream();
Process process = processBuilder.start();
try {
IOUtils.copy(process.getInputStream(), commandOutput, processOutputLimit);
process.waitFor();
if (process.exitValue() != 0) {
throw new IllegalStateException("Command returned non-zero exit value: " + process.exitValue());
}
return new String(commandOutput.toByteArray(), StringUtils.UTF8);
} finally {
process.destroy();
}
}
|
java
|
private String executeCommand() throws IOException, InterruptedException {
ProcessBuilder processBuilder = new ProcessBuilder(command);
ByteArrayOutputStream commandOutput = new ByteArrayOutputStream();
Process process = processBuilder.start();
try {
IOUtils.copy(process.getInputStream(), commandOutput, processOutputLimit);
process.waitFor();
if (process.exitValue() != 0) {
throw new IllegalStateException("Command returned non-zero exit value: " + process.exitValue());
}
return new String(commandOutput.toByteArray(), StringUtils.UTF8);
} finally {
process.destroy();
}
}
|
[
"private",
"String",
"executeCommand",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"ProcessBuilder",
"processBuilder",
"=",
"new",
"ProcessBuilder",
"(",
"command",
")",
";",
"ByteArrayOutputStream",
"commandOutput",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"Process",
"process",
"=",
"processBuilder",
".",
"start",
"(",
")",
";",
"try",
"{",
"IOUtils",
".",
"copy",
"(",
"process",
".",
"getInputStream",
"(",
")",
",",
"commandOutput",
",",
"processOutputLimit",
")",
";",
"process",
".",
"waitFor",
"(",
")",
";",
"if",
"(",
"process",
".",
"exitValue",
"(",
")",
"!=",
"0",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Command returned non-zero exit value: \"",
"+",
"process",
".",
"exitValue",
"(",
")",
")",
";",
"}",
"return",
"new",
"String",
"(",
"commandOutput",
".",
"toByteArray",
"(",
")",
",",
"StringUtils",
".",
"UTF8",
")",
";",
"}",
"finally",
"{",
"process",
".",
"destroy",
"(",
")",
";",
"}",
"}"
] |
Execute the external process to retrieve credentials.
|
[
"Execute",
"the",
"external",
"process",
"to",
"retrieve",
"credentials",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/ProcessCredentialsProvider.java#L209-L228
|
19,609
|
aws/aws-sdk-java
|
aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/SecretsManagerSecretResourceData.java
|
SecretsManagerSecretResourceData.setAdditionalStagingLabelsToDownload
|
public void setAdditionalStagingLabelsToDownload(java.util.Collection<String> additionalStagingLabelsToDownload) {
if (additionalStagingLabelsToDownload == null) {
this.additionalStagingLabelsToDownload = null;
return;
}
this.additionalStagingLabelsToDownload = new java.util.ArrayList<String>(additionalStagingLabelsToDownload);
}
|
java
|
public void setAdditionalStagingLabelsToDownload(java.util.Collection<String> additionalStagingLabelsToDownload) {
if (additionalStagingLabelsToDownload == null) {
this.additionalStagingLabelsToDownload = null;
return;
}
this.additionalStagingLabelsToDownload = new java.util.ArrayList<String>(additionalStagingLabelsToDownload);
}
|
[
"public",
"void",
"setAdditionalStagingLabelsToDownload",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"additionalStagingLabelsToDownload",
")",
"{",
"if",
"(",
"additionalStagingLabelsToDownload",
"==",
"null",
")",
"{",
"this",
".",
"additionalStagingLabelsToDownload",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"additionalStagingLabelsToDownload",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"String",
">",
"(",
"additionalStagingLabelsToDownload",
")",
";",
"}"
] |
Optional. The staging labels whose values you want to make available on the core, in addition to ''AWSCURRENT''.
@param additionalStagingLabelsToDownload
Optional. The staging labels whose values you want to make available on the core, in addition to
''AWSCURRENT''.
|
[
"Optional",
".",
"The",
"staging",
"labels",
"whose",
"values",
"you",
"want",
"to",
"make",
"available",
"on",
"the",
"core",
"in",
"addition",
"to",
"AWSCURRENT",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/SecretsManagerSecretResourceData.java#L98-L105
|
19,610
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/monitoring/ProfileCsmConfigurationProvider.java
|
ProfileCsmConfigurationProvider.getProfilesConfigFile
|
private ProfilesConfigFile getProfilesConfigFile() {
if (configFile == null) {
synchronized (this) {
if (configFile == null) {
try {
configFile = new ProfilesConfigFile(configFileLocationProvider.getLocation());
} catch (Exception e) {
throw new SdkClientException("Unable to load config file", e);
}
}
}
}
return configFile;
}
|
java
|
private ProfilesConfigFile getProfilesConfigFile() {
if (configFile == null) {
synchronized (this) {
if (configFile == null) {
try {
configFile = new ProfilesConfigFile(configFileLocationProvider.getLocation());
} catch (Exception e) {
throw new SdkClientException("Unable to load config file", e);
}
}
}
}
return configFile;
}
|
[
"private",
"ProfilesConfigFile",
"getProfilesConfigFile",
"(",
")",
"{",
"if",
"(",
"configFile",
"==",
"null",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"configFile",
"==",
"null",
")",
"{",
"try",
"{",
"configFile",
"=",
"new",
"ProfilesConfigFile",
"(",
"configFileLocationProvider",
".",
"getLocation",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Unable to load config file\"",
",",
"e",
")",
";",
"}",
"}",
"}",
"}",
"return",
"configFile",
";",
"}"
] |
ProfilesConfigFile immediately loads the profiles at construction time
|
[
"ProfilesConfigFile",
"immediately",
"loads",
"the",
"profiles",
"at",
"construction",
"time"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/monitoring/ProfileCsmConfigurationProvider.java#L132-L145
|
19,611
|
aws/aws-sdk-java
|
aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/UpdateConfigurationResult.java
|
UpdateConfigurationResult.setWarnings
|
public void setWarnings(java.util.Collection<SanitizationWarning> warnings) {
if (warnings == null) {
this.warnings = null;
return;
}
this.warnings = new java.util.ArrayList<SanitizationWarning>(warnings);
}
|
java
|
public void setWarnings(java.util.Collection<SanitizationWarning> warnings) {
if (warnings == null) {
this.warnings = null;
return;
}
this.warnings = new java.util.ArrayList<SanitizationWarning>(warnings);
}
|
[
"public",
"void",
"setWarnings",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"SanitizationWarning",
">",
"warnings",
")",
"{",
"if",
"(",
"warnings",
"==",
"null",
")",
"{",
"this",
".",
"warnings",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"warnings",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"SanitizationWarning",
">",
"(",
"warnings",
")",
";",
"}"
] |
The list of the first 20 warnings about the configuration XML elements or attributes that were sanitized.
@param warnings
The list of the first 20 warnings about the configuration XML elements or attributes that were sanitized.
|
[
"The",
"list",
"of",
"the",
"first",
"20",
"warnings",
"about",
"the",
"configuration",
"XML",
"elements",
"or",
"attributes",
"that",
"were",
"sanitized",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/UpdateConfigurationResult.java#L235-L242
|
19,612
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/S3Location.java
|
S3Location.withCannedACL
|
public S3Location withCannedACL(CannedAccessControlList cannedACL) {
setCannedACL(cannedACL == null ? null : cannedACL.toString());
return this;
}
|
java
|
public S3Location withCannedACL(CannedAccessControlList cannedACL) {
setCannedACL(cannedACL == null ? null : cannedACL.toString());
return this;
}
|
[
"public",
"S3Location",
"withCannedACL",
"(",
"CannedAccessControlList",
"cannedACL",
")",
"{",
"setCannedACL",
"(",
"cannedACL",
"==",
"null",
"?",
"null",
":",
"cannedACL",
".",
"toString",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] |
Sets the canned ACL to apply to the restore results.
@param cannedACL The new cannedACL value.
@return This object for method chaining.
|
[
"Sets",
"the",
"canned",
"ACL",
"to",
"apply",
"to",
"the",
"restore",
"results",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/S3Location.java#L180-L183
|
19,613
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/S3Location.java
|
S3Location.withStorageClass
|
public S3Location withStorageClass(StorageClass storageClass) {
setStorageClass(storageClass == null ? null : storageClass.toString());
return this;
}
|
java
|
public S3Location withStorageClass(StorageClass storageClass) {
setStorageClass(storageClass == null ? null : storageClass.toString());
return this;
}
|
[
"public",
"S3Location",
"withStorageClass",
"(",
"StorageClass",
"storageClass",
")",
"{",
"setStorageClass",
"(",
"storageClass",
"==",
"null",
"?",
"null",
":",
"storageClass",
".",
"toString",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] |
Sets the class of storage used to store the restore results.
@param storageClass The new storageClass value.
@return This object for method chaining.
|
[
"Sets",
"the",
"class",
"of",
"storage",
"used",
"to",
"store",
"the",
"restore",
"results",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/S3Location.java#L299-L302
|
19,614
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/RepeatableFileInputStream.java
|
RepeatableFileInputStream.reset
|
@Override
public void reset() throws IOException {
this.fis.close();
abortIfNeeded();
this.fis = new FileInputStream(file);
long skipped = 0;
long toSkip = markPoint;
while (toSkip > 0) {
skipped = this.fis.skip(toSkip);
toSkip -= skipped;
}
if (log.isDebugEnabled()) {
log.debug("Reset to mark point " + markPoint
+ " after returning " + bytesReadPastMarkPoint + " bytes");
}
this.bytesReadPastMarkPoint = 0;
}
|
java
|
@Override
public void reset() throws IOException {
this.fis.close();
abortIfNeeded();
this.fis = new FileInputStream(file);
long skipped = 0;
long toSkip = markPoint;
while (toSkip > 0) {
skipped = this.fis.skip(toSkip);
toSkip -= skipped;
}
if (log.isDebugEnabled()) {
log.debug("Reset to mark point " + markPoint
+ " after returning " + bytesReadPastMarkPoint + " bytes");
}
this.bytesReadPastMarkPoint = 0;
}
|
[
"@",
"Override",
"public",
"void",
"reset",
"(",
")",
"throws",
"IOException",
"{",
"this",
".",
"fis",
".",
"close",
"(",
")",
";",
"abortIfNeeded",
"(",
")",
";",
"this",
".",
"fis",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"long",
"skipped",
"=",
"0",
";",
"long",
"toSkip",
"=",
"markPoint",
";",
"while",
"(",
"toSkip",
">",
"0",
")",
"{",
"skipped",
"=",
"this",
".",
"fis",
".",
"skip",
"(",
"toSkip",
")",
";",
"toSkip",
"-=",
"skipped",
";",
"}",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Reset to mark point \"",
"+",
"markPoint",
"+",
"\" after returning \"",
"+",
"bytesReadPastMarkPoint",
"+",
"\" bytes\"",
")",
";",
"}",
"this",
".",
"bytesReadPastMarkPoint",
"=",
"0",
";",
"}"
] |
Resets the input stream to the last mark point, or the beginning of the
stream if there is no mark point, by creating a new FileInputStream based
on the underlying file.
@throws IOException
when the FileInputStream cannot be re-created.
|
[
"Resets",
"the",
"input",
"stream",
"to",
"the",
"last",
"mark",
"point",
"or",
"the",
"beginning",
"of",
"the",
"stream",
"if",
"there",
"is",
"no",
"mark",
"point",
"by",
"creating",
"a",
"new",
"FileInputStream",
"based",
"on",
"the",
"underlying",
"file",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/RepeatableFileInputStream.java#L83-L101
|
19,615
|
aws/aws-sdk-java
|
aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java
|
ArchiveTransferManager.upload
|
public UploadResult upload(final String accountId, final String vaultName, final String archiveDescription, final File file)
throws AmazonServiceException, AmazonClientException, FileNotFoundException {
return upload(accountId, vaultName, archiveDescription, file, null);
}
|
java
|
public UploadResult upload(final String accountId, final String vaultName, final String archiveDescription, final File file)
throws AmazonServiceException, AmazonClientException, FileNotFoundException {
return upload(accountId, vaultName, archiveDescription, file, null);
}
|
[
"public",
"UploadResult",
"upload",
"(",
"final",
"String",
"accountId",
",",
"final",
"String",
"vaultName",
",",
"final",
"String",
"archiveDescription",
",",
"final",
"File",
"file",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
",",
"FileNotFoundException",
"{",
"return",
"upload",
"(",
"accountId",
",",
"vaultName",
",",
"archiveDescription",
",",
"file",
",",
"null",
")",
";",
"}"
] |
Uploads the specified file to Amazon Glacier for archival storage in the
specified vault in the specified user's account. For small archives, this
method will upload the archive directly to Glacier. For larger archives,
this method will use Glacier's multipart upload API to split the upload
into multiple parts for better error recovery if any errors are
encountered while streaming the data to Amazon Glacier.
@param accountId
The ID for the account which owns the Glacier vault being
uploaded to. To use the same account the developer is using to
make requests to AWS, the value <code>"-"</code> can be used
instead of the full account ID.
@param vaultName
The name of the vault to upload to.
@param archiveDescription
The description of the new archive being uploaded.
@param file
The file to upload to Amazon Glacier.
@return The result of the upload, including the archive ID needed to
access the upload later.
@throws AmazonServiceException
If any problems were encountered while communicating with
AWS.
@throws AmazonClientException
If any problems were encountered inside the AWS SDK for Java
client code in making requests or processing responses from
AWS.
@throws FileNotFoundException
If the specified file to upload doesn't exist.
|
[
"Uploads",
"the",
"specified",
"file",
"to",
"Amazon",
"Glacier",
"for",
"archival",
"storage",
"in",
"the",
"specified",
"vault",
"in",
"the",
"specified",
"user",
"s",
"account",
".",
"For",
"small",
"archives",
"this",
"method",
"will",
"upload",
"the",
"archive",
"directly",
"to",
"Glacier",
".",
"For",
"larger",
"archives",
"this",
"method",
"will",
"use",
"Glacier",
"s",
"multipart",
"upload",
"API",
"to",
"split",
"the",
"upload",
"into",
"multiple",
"parts",
"for",
"better",
"error",
"recovery",
"if",
"any",
"errors",
"are",
"encountered",
"while",
"streaming",
"the",
"data",
"to",
"Amazon",
"Glacier",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java#L284-L287
|
19,616
|
aws/aws-sdk-java
|
aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java
|
ArchiveTransferManager.upload
|
public UploadResult upload(final String accountId, final String vaultName,
final String archiveDescription, final File file,
ProgressListener progressListener) throws AmazonServiceException,
AmazonClientException {
if (file.length() > MULTIPART_UPLOAD_SIZE_THRESHOLD) {
return uploadInMultipleParts(accountId, vaultName,
archiveDescription, file, progressListener);
} else {
return uploadInSinglePart(accountId, vaultName, archiveDescription,
file, progressListener);
}
}
|
java
|
public UploadResult upload(final String accountId, final String vaultName,
final String archiveDescription, final File file,
ProgressListener progressListener) throws AmazonServiceException,
AmazonClientException {
if (file.length() > MULTIPART_UPLOAD_SIZE_THRESHOLD) {
return uploadInMultipleParts(accountId, vaultName,
archiveDescription, file, progressListener);
} else {
return uploadInSinglePart(accountId, vaultName, archiveDescription,
file, progressListener);
}
}
|
[
"public",
"UploadResult",
"upload",
"(",
"final",
"String",
"accountId",
",",
"final",
"String",
"vaultName",
",",
"final",
"String",
"archiveDescription",
",",
"final",
"File",
"file",
",",
"ProgressListener",
"progressListener",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
"{",
"if",
"(",
"file",
".",
"length",
"(",
")",
">",
"MULTIPART_UPLOAD_SIZE_THRESHOLD",
")",
"{",
"return",
"uploadInMultipleParts",
"(",
"accountId",
",",
"vaultName",
",",
"archiveDescription",
",",
"file",
",",
"progressListener",
")",
";",
"}",
"else",
"{",
"return",
"uploadInSinglePart",
"(",
"accountId",
",",
"vaultName",
",",
"archiveDescription",
",",
"file",
",",
"progressListener",
")",
";",
"}",
"}"
] |
Uploads the specified file to Amazon Glacier for archival storage in the
specified vault in the specified user's account. For small archives, this
method will upload the archive directly to Glacier. For larger archives,
this method will use Glacier's multipart upload API to split the upload
into multiple parts for better error recovery if any errors are
encountered while streaming the data to Amazon Glacier. You can also add
an optional progress listener for receiving updates about the upload
status.
@param accountId
The ID for the account which owns the Glacier vault being
uploaded to. To use the same account the developer is using to
make requests to AWS, the value <code>"-"</code> can be used
instead of the full account ID.
@param vaultName
The name of the vault to upload to.
@param archiveDescription
The description of the new archive being uploaded.
@param file
The file to upload to Amazon Glacier.
@param progressListener
The optional progress listener for receiving updates about
the upload status.
@return The result of the upload, including the archive ID needed to
access the upload later.
@throws AmazonServiceException
If any problems were encountered while communicating with
AWS.
@throws AmazonClientException
If any problems were encountered inside the AWS SDK for Java
client code in making requests or processing responses from
AWS.
|
[
"Uploads",
"the",
"specified",
"file",
"to",
"Amazon",
"Glacier",
"for",
"archival",
"storage",
"in",
"the",
"specified",
"vault",
"in",
"the",
"specified",
"user",
"s",
"account",
".",
"For",
"small",
"archives",
"this",
"method",
"will",
"upload",
"the",
"archive",
"directly",
"to",
"Glacier",
".",
"For",
"larger",
"archives",
"this",
"method",
"will",
"use",
"Glacier",
"s",
"multipart",
"upload",
"API",
"to",
"split",
"the",
"upload",
"into",
"multiple",
"parts",
"for",
"better",
"error",
"recovery",
"if",
"any",
"errors",
"are",
"encountered",
"while",
"streaming",
"the",
"data",
"to",
"Amazon",
"Glacier",
".",
"You",
"can",
"also",
"add",
"an",
"optional",
"progress",
"listener",
"for",
"receiving",
"updates",
"about",
"the",
"upload",
"status",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java#L325-L336
|
19,617
|
aws/aws-sdk-java
|
aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java
|
ArchiveTransferManager.download
|
public void download(final String vaultName, final String archiveId, final File file)
throws AmazonServiceException, AmazonClientException {
download(null, vaultName, archiveId, file);
}
|
java
|
public void download(final String vaultName, final String archiveId, final File file)
throws AmazonServiceException, AmazonClientException {
download(null, vaultName, archiveId, file);
}
|
[
"public",
"void",
"download",
"(",
"final",
"String",
"vaultName",
",",
"final",
"String",
"archiveId",
",",
"final",
"File",
"file",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
"{",
"download",
"(",
"null",
",",
"vaultName",
",",
"archiveId",
",",
"file",
")",
";",
"}"
] |
Downloads an archive from Amazon Glacier in the specified vault for the
current user's account, and saves it to the specified file. Amazon
Glacier is optimized for long term storage of data that isn't needed
quickly. This method will first make a request to Amazon Glacier to
prepare the archive to be downloaded. Once Glacier has finished preparing
the archive to be downloaded, this method will start downloading the data
and storing it in the specified file. Also, this method will download the
archive in multiple chunks using range retrieval for better error
recovery if any errors are encountered while streaming the data from
Amazon Glacier.
@param vaultName
The name of the vault to download the archive from.
@param archiveId
The unique ID of the archive to download.
@param file
The file in which to save the archive.
@throws AmazonServiceException
If any problems were encountered while communicating with
AWS.
@throws AmazonClientException
If any problems were encountered inside the AWS SDK for Java
client code in making requests or processing responses from
AWS.
|
[
"Downloads",
"an",
"archive",
"from",
"Amazon",
"Glacier",
"in",
"the",
"specified",
"vault",
"for",
"the",
"current",
"user",
"s",
"account",
"and",
"saves",
"it",
"to",
"the",
"specified",
"file",
".",
"Amazon",
"Glacier",
"is",
"optimized",
"for",
"long",
"term",
"storage",
"of",
"data",
"that",
"isn",
"t",
"needed",
"quickly",
".",
"This",
"method",
"will",
"first",
"make",
"a",
"request",
"to",
"Amazon",
"Glacier",
"to",
"prepare",
"the",
"archive",
"to",
"be",
"downloaded",
".",
"Once",
"Glacier",
"has",
"finished",
"preparing",
"the",
"archive",
"to",
"be",
"downloaded",
"this",
"method",
"will",
"start",
"downloading",
"the",
"data",
"and",
"storing",
"it",
"in",
"the",
"specified",
"file",
".",
"Also",
"this",
"method",
"will",
"download",
"the",
"archive",
"in",
"multiple",
"chunks",
"using",
"range",
"retrieval",
"for",
"better",
"error",
"recovery",
"if",
"any",
"errors",
"are",
"encountered",
"while",
"streaming",
"the",
"data",
"from",
"Amazon",
"Glacier",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java#L365-L368
|
19,618
|
aws/aws-sdk-java
|
aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java
|
ArchiveTransferManager.download
|
public void download(final String accountId, final String vaultName,
final String archiveId, final File file,
ProgressListener progressListener) throws AmazonServiceException,
AmazonClientException {
JobStatusMonitor jobStatusMonitor = null;
String jobId = null;
publishProgress(progressListener, ProgressEventType.TRANSFER_PREPARING_EVENT);
try {
if (credentialsProvider != null && clientConfiguration != null) {
jobStatusMonitor = new JobStatusMonitor(credentialsProvider, clientConfiguration);
} else {
jobStatusMonitor = new JobStatusMonitor(sqs, sns);
}
JobParameters jobParameters = new JobParameters()
.withArchiveId(archiveId)
.withType("archive-retrieval")
.withSNSTopic(jobStatusMonitor.getTopicArn());
InitiateJobResult archiveRetrievalResult =
glacier.initiateJob(new InitiateJobRequest()
.withAccountId(accountId)
.withVaultName(vaultName)
.withJobParameters(jobParameters));
jobId = archiveRetrievalResult.getJobId();
jobStatusMonitor.waitForJobToComplete(jobId);
} catch (Throwable t) {
publishProgress(progressListener, ProgressEventType.TRANSFER_FAILED_EVENT);
throw failure(t);
} finally {
if (jobStatusMonitor != null) {
jobStatusMonitor.shutdown();
}
}
downloadJobOutput(accountId, vaultName, jobId, file, progressListener);
}
|
java
|
public void download(final String accountId, final String vaultName,
final String archiveId, final File file,
ProgressListener progressListener) throws AmazonServiceException,
AmazonClientException {
JobStatusMonitor jobStatusMonitor = null;
String jobId = null;
publishProgress(progressListener, ProgressEventType.TRANSFER_PREPARING_EVENT);
try {
if (credentialsProvider != null && clientConfiguration != null) {
jobStatusMonitor = new JobStatusMonitor(credentialsProvider, clientConfiguration);
} else {
jobStatusMonitor = new JobStatusMonitor(sqs, sns);
}
JobParameters jobParameters = new JobParameters()
.withArchiveId(archiveId)
.withType("archive-retrieval")
.withSNSTopic(jobStatusMonitor.getTopicArn());
InitiateJobResult archiveRetrievalResult =
glacier.initiateJob(new InitiateJobRequest()
.withAccountId(accountId)
.withVaultName(vaultName)
.withJobParameters(jobParameters));
jobId = archiveRetrievalResult.getJobId();
jobStatusMonitor.waitForJobToComplete(jobId);
} catch (Throwable t) {
publishProgress(progressListener, ProgressEventType.TRANSFER_FAILED_EVENT);
throw failure(t);
} finally {
if (jobStatusMonitor != null) {
jobStatusMonitor.shutdown();
}
}
downloadJobOutput(accountId, vaultName, jobId, file, progressListener);
}
|
[
"public",
"void",
"download",
"(",
"final",
"String",
"accountId",
",",
"final",
"String",
"vaultName",
",",
"final",
"String",
"archiveId",
",",
"final",
"File",
"file",
",",
"ProgressListener",
"progressListener",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
"{",
"JobStatusMonitor",
"jobStatusMonitor",
"=",
"null",
";",
"String",
"jobId",
"=",
"null",
";",
"publishProgress",
"(",
"progressListener",
",",
"ProgressEventType",
".",
"TRANSFER_PREPARING_EVENT",
")",
";",
"try",
"{",
"if",
"(",
"credentialsProvider",
"!=",
"null",
"&&",
"clientConfiguration",
"!=",
"null",
")",
"{",
"jobStatusMonitor",
"=",
"new",
"JobStatusMonitor",
"(",
"credentialsProvider",
",",
"clientConfiguration",
")",
";",
"}",
"else",
"{",
"jobStatusMonitor",
"=",
"new",
"JobStatusMonitor",
"(",
"sqs",
",",
"sns",
")",
";",
"}",
"JobParameters",
"jobParameters",
"=",
"new",
"JobParameters",
"(",
")",
".",
"withArchiveId",
"(",
"archiveId",
")",
".",
"withType",
"(",
"\"archive-retrieval\"",
")",
".",
"withSNSTopic",
"(",
"jobStatusMonitor",
".",
"getTopicArn",
"(",
")",
")",
";",
"InitiateJobResult",
"archiveRetrievalResult",
"=",
"glacier",
".",
"initiateJob",
"(",
"new",
"InitiateJobRequest",
"(",
")",
".",
"withAccountId",
"(",
"accountId",
")",
".",
"withVaultName",
"(",
"vaultName",
")",
".",
"withJobParameters",
"(",
"jobParameters",
")",
")",
";",
"jobId",
"=",
"archiveRetrievalResult",
".",
"getJobId",
"(",
")",
";",
"jobStatusMonitor",
".",
"waitForJobToComplete",
"(",
"jobId",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"publishProgress",
"(",
"progressListener",
",",
"ProgressEventType",
".",
"TRANSFER_FAILED_EVENT",
")",
";",
"throw",
"failure",
"(",
"t",
")",
";",
"}",
"finally",
"{",
"if",
"(",
"jobStatusMonitor",
"!=",
"null",
")",
"{",
"jobStatusMonitor",
".",
"shutdown",
"(",
")",
";",
"}",
"}",
"downloadJobOutput",
"(",
"accountId",
",",
"vaultName",
",",
"jobId",
",",
"file",
",",
"progressListener",
")",
";",
"}"
] |
Downloads an archive from Amazon Glacier in the specified vault in the
specified user's account, and saves it to the specified file. Amazon
Glacier is optimized for long term storage of data that isn't needed
quickly. This method will first make a request to Amazon Glacier to
prepare the archive to be downloaded. Once Glacier has finished preparing
the archive to be downloaded, this method will start downloading the data
and storing it in the specified file. You can also add an optional
progress listener for receiving updates about the download status.
@param accountId
The ID for the account which owns the Glacier vault where the
archive is being downloaded from. To use the same account the
developer is using to make requests to AWS, the value
<code>"-"</code> can be used instead of the full account ID.
@param vaultName
The name of the vault to download the archive from.
@param archiveId
The unique ID of the archive to download.
@param file
The file in which to save the archive.
@param progressListener
The optional progress listener for receiving updates about the
download status.
@throws AmazonServiceException
If any problems were encountered while communicating with
AWS.
@throws AmazonClientException
If any problems were encountered inside the AWS SDK for Java
client code in making requests or processing responses from
AWS.
|
[
"Downloads",
"an",
"archive",
"from",
"Amazon",
"Glacier",
"in",
"the",
"specified",
"vault",
"in",
"the",
"specified",
"user",
"s",
"account",
"and",
"saves",
"it",
"to",
"the",
"specified",
"file",
".",
"Amazon",
"Glacier",
"is",
"optimized",
"for",
"long",
"term",
"storage",
"of",
"data",
"that",
"isn",
"t",
"needed",
"quickly",
".",
"This",
"method",
"will",
"first",
"make",
"a",
"request",
"to",
"Amazon",
"Glacier",
"to",
"prepare",
"the",
"archive",
"to",
"be",
"downloaded",
".",
"Once",
"Glacier",
"has",
"finished",
"preparing",
"the",
"archive",
"to",
"be",
"downloaded",
"this",
"method",
"will",
"start",
"downloading",
"the",
"data",
"and",
"storing",
"it",
"in",
"the",
"specified",
"file",
".",
"You",
"can",
"also",
"add",
"an",
"optional",
"progress",
"listener",
"for",
"receiving",
"updates",
"about",
"the",
"download",
"status",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java#L437-L475
|
19,619
|
aws/aws-sdk-java
|
aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java
|
ArchiveTransferManager.downloadOneChunk
|
private void downloadOneChunk(String accountId, String vaultName,
String jobId, RandomAccessFile output, long currentPosition,
long endPosition, ProgressListener progressListener) {
final long chunkSize = endPosition - currentPosition + 1;
TreeHashInputStream input = null;
int retries = 0;
while (true) {
try {
GetJobOutputRequest req = new GetJobOutputRequest()
.withAccountId(accountId)
.withVaultName(vaultName)
.withRange("bytes=" + currentPosition + "-" + endPosition)
.withJobId(jobId)
.withGeneralProgressListener(progressListener)
;
GetJobOutputResult jobOutputResult = glacier.getJobOutput(req);
try {
input = new TreeHashInputStream(new BufferedInputStream(jobOutputResult.getBody()));
appendToFile(output, input);
} catch (NoSuchAlgorithmException e) {
throw failure(e, "Unable to compute hash for data integrity");
} finally {
closeQuietly(input, log);
}
// Only do tree-hash check when the output checksum is returned from Glacier
if (null != jobOutputResult.getChecksum()) {
// Checksum does not match
if (!input.getTreeHash().equalsIgnoreCase(jobOutputResult.getChecksum())) {
// Discard the chunk of bytes received
publishResponseBytesDiscarded(progressListener, chunkSize);
if (log.isDebugEnabled())
log.debug("reverting " + chunkSize);
throw new IOException("Client side computed hash doesn't match server side hash; possible data corruption");
}
} else {
log.warn("Cannot validate the downloaded output since no tree-hash checksum is returned from Glacier. "
+ "Make sure the InitiateJob and GetJobOutput requests use tree-hash-aligned ranges.");
}
// Successfully download
return;
// We will retry IO exception
} catch (IOException ioe) {
if (retries < DEFAULT_MAX_RETRIES) {
retries++;
if (log.isDebugEnabled()) {
log.debug(retries
+ " retry downloadOneChunk accountId="
+ accountId + ", vaultName=" + vaultName
+ ", jobId=" + jobId + ", currentPosition="
+ currentPosition + " endPosition="
+ endPosition);
}
try {
output.seek(currentPosition);
} catch (IOException e) {
throw new AmazonClientException("Unable to download the archive: " + ioe.getMessage(), e);
}
} else {
throw new AmazonClientException("Unable to download the archive: " + ioe.getMessage(), ioe);
}
}
}
}
|
java
|
private void downloadOneChunk(String accountId, String vaultName,
String jobId, RandomAccessFile output, long currentPosition,
long endPosition, ProgressListener progressListener) {
final long chunkSize = endPosition - currentPosition + 1;
TreeHashInputStream input = null;
int retries = 0;
while (true) {
try {
GetJobOutputRequest req = new GetJobOutputRequest()
.withAccountId(accountId)
.withVaultName(vaultName)
.withRange("bytes=" + currentPosition + "-" + endPosition)
.withJobId(jobId)
.withGeneralProgressListener(progressListener)
;
GetJobOutputResult jobOutputResult = glacier.getJobOutput(req);
try {
input = new TreeHashInputStream(new BufferedInputStream(jobOutputResult.getBody()));
appendToFile(output, input);
} catch (NoSuchAlgorithmException e) {
throw failure(e, "Unable to compute hash for data integrity");
} finally {
closeQuietly(input, log);
}
// Only do tree-hash check when the output checksum is returned from Glacier
if (null != jobOutputResult.getChecksum()) {
// Checksum does not match
if (!input.getTreeHash().equalsIgnoreCase(jobOutputResult.getChecksum())) {
// Discard the chunk of bytes received
publishResponseBytesDiscarded(progressListener, chunkSize);
if (log.isDebugEnabled())
log.debug("reverting " + chunkSize);
throw new IOException("Client side computed hash doesn't match server side hash; possible data corruption");
}
} else {
log.warn("Cannot validate the downloaded output since no tree-hash checksum is returned from Glacier. "
+ "Make sure the InitiateJob and GetJobOutput requests use tree-hash-aligned ranges.");
}
// Successfully download
return;
// We will retry IO exception
} catch (IOException ioe) {
if (retries < DEFAULT_MAX_RETRIES) {
retries++;
if (log.isDebugEnabled()) {
log.debug(retries
+ " retry downloadOneChunk accountId="
+ accountId + ", vaultName=" + vaultName
+ ", jobId=" + jobId + ", currentPosition="
+ currentPosition + " endPosition="
+ endPosition);
}
try {
output.seek(currentPosition);
} catch (IOException e) {
throw new AmazonClientException("Unable to download the archive: " + ioe.getMessage(), e);
}
} else {
throw new AmazonClientException("Unable to download the archive: " + ioe.getMessage(), ioe);
}
}
}
}
|
[
"private",
"void",
"downloadOneChunk",
"(",
"String",
"accountId",
",",
"String",
"vaultName",
",",
"String",
"jobId",
",",
"RandomAccessFile",
"output",
",",
"long",
"currentPosition",
",",
"long",
"endPosition",
",",
"ProgressListener",
"progressListener",
")",
"{",
"final",
"long",
"chunkSize",
"=",
"endPosition",
"-",
"currentPosition",
"+",
"1",
";",
"TreeHashInputStream",
"input",
"=",
"null",
";",
"int",
"retries",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"GetJobOutputRequest",
"req",
"=",
"new",
"GetJobOutputRequest",
"(",
")",
".",
"withAccountId",
"(",
"accountId",
")",
".",
"withVaultName",
"(",
"vaultName",
")",
".",
"withRange",
"(",
"\"bytes=\"",
"+",
"currentPosition",
"+",
"\"-\"",
"+",
"endPosition",
")",
".",
"withJobId",
"(",
"jobId",
")",
".",
"withGeneralProgressListener",
"(",
"progressListener",
")",
";",
"GetJobOutputResult",
"jobOutputResult",
"=",
"glacier",
".",
"getJobOutput",
"(",
"req",
")",
";",
"try",
"{",
"input",
"=",
"new",
"TreeHashInputStream",
"(",
"new",
"BufferedInputStream",
"(",
"jobOutputResult",
".",
"getBody",
"(",
")",
")",
")",
";",
"appendToFile",
"(",
"output",
",",
"input",
")",
";",
"}",
"catch",
"(",
"NoSuchAlgorithmException",
"e",
")",
"{",
"throw",
"failure",
"(",
"e",
",",
"\"Unable to compute hash for data integrity\"",
")",
";",
"}",
"finally",
"{",
"closeQuietly",
"(",
"input",
",",
"log",
")",
";",
"}",
"// Only do tree-hash check when the output checksum is returned from Glacier",
"if",
"(",
"null",
"!=",
"jobOutputResult",
".",
"getChecksum",
"(",
")",
")",
"{",
"// Checksum does not match",
"if",
"(",
"!",
"input",
".",
"getTreeHash",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"jobOutputResult",
".",
"getChecksum",
"(",
")",
")",
")",
"{",
"// Discard the chunk of bytes received ",
"publishResponseBytesDiscarded",
"(",
"progressListener",
",",
"chunkSize",
")",
";",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"reverting \"",
"+",
"chunkSize",
")",
";",
"throw",
"new",
"IOException",
"(",
"\"Client side computed hash doesn't match server side hash; possible data corruption\"",
")",
";",
"}",
"}",
"else",
"{",
"log",
".",
"warn",
"(",
"\"Cannot validate the downloaded output since no tree-hash checksum is returned from Glacier. \"",
"+",
"\"Make sure the InitiateJob and GetJobOutput requests use tree-hash-aligned ranges.\"",
")",
";",
"}",
"// Successfully download",
"return",
";",
"// We will retry IO exception",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"if",
"(",
"retries",
"<",
"DEFAULT_MAX_RETRIES",
")",
"{",
"retries",
"++",
";",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"retries",
"+",
"\" retry downloadOneChunk accountId=\"",
"+",
"accountId",
"+",
"\", vaultName=\"",
"+",
"vaultName",
"+",
"\", jobId=\"",
"+",
"jobId",
"+",
"\", currentPosition=\"",
"+",
"currentPosition",
"+",
"\" endPosition=\"",
"+",
"endPosition",
")",
";",
"}",
"try",
"{",
"output",
".",
"seek",
"(",
"currentPosition",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"AmazonClientException",
"(",
"\"Unable to download the archive: \"",
"+",
"ioe",
".",
"getMessage",
"(",
")",
",",
"e",
")",
";",
"}",
"}",
"else",
"{",
"throw",
"new",
"AmazonClientException",
"(",
"\"Unable to download the archive: \"",
"+",
"ioe",
".",
"getMessage",
"(",
")",
",",
"ioe",
")",
";",
"}",
"}",
"}",
"}"
] |
Download one chunk from Amazon Glacier. It will do the retry if any
errors are encountered while streaming the data from Amazon Glacier.
|
[
"Download",
"one",
"chunk",
"from",
"Amazon",
"Glacier",
".",
"It",
"will",
"do",
"the",
"retry",
"if",
"any",
"errors",
"are",
"encountered",
"while",
"streaming",
"the",
"data",
"from",
"Amazon",
"Glacier",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java#L592-L655
|
19,620
|
aws/aws-sdk-java
|
aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java
|
ArchiveTransferManager.appendToFile
|
private void appendToFile(RandomAccessFile output, InputStream input)
throws IOException {
byte[] buffer = new byte[1024 * 1024];
int bytesRead = 0;
do {
bytesRead = input.read(buffer);
if (bytesRead < 0)
break;
output.write(buffer, 0, bytesRead);
} while (bytesRead > 0);
return;
}
|
java
|
private void appendToFile(RandomAccessFile output, InputStream input)
throws IOException {
byte[] buffer = new byte[1024 * 1024];
int bytesRead = 0;
do {
bytesRead = input.read(buffer);
if (bytesRead < 0)
break;
output.write(buffer, 0, bytesRead);
} while (bytesRead > 0);
return;
}
|
[
"private",
"void",
"appendToFile",
"(",
"RandomAccessFile",
"output",
",",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"1024",
"*",
"1024",
"]",
";",
"int",
"bytesRead",
"=",
"0",
";",
"do",
"{",
"bytesRead",
"=",
"input",
".",
"read",
"(",
"buffer",
")",
";",
"if",
"(",
"bytesRead",
"<",
"0",
")",
"break",
";",
"output",
".",
"write",
"(",
"buffer",
",",
"0",
",",
"bytesRead",
")",
";",
"}",
"while",
"(",
"bytesRead",
">",
"0",
")",
";",
"return",
";",
"}"
] |
Writes the data from the given input stream to the given output stream.
|
[
"Writes",
"the",
"data",
"from",
"the",
"given",
"input",
"stream",
"to",
"the",
"given",
"output",
"stream",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java#L660-L671
|
19,621
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/util/NamespaceRemovingInputStream.java
|
NamespaceRemovingInputStream.matchXmlNamespaceAttribute
|
private int matchXmlNamespaceAttribute(String s) {
/*
* The regex we're simulating is: "xmlns\\s*=\\s*\".+?\".*"
*/
StringPrefixSlicer stringSlicer = new StringPrefixSlicer(s);
if (stringSlicer.removePrefix("xmlns") == false) return -1;
stringSlicer.removeRepeatingPrefix(" ");
if (stringSlicer.removePrefix("=") == false) return -1;
stringSlicer.removeRepeatingPrefix(" ");
if (stringSlicer.removePrefix("\"") == false) return -1;
if (stringSlicer.removePrefixEndingWith("\"") == false) return -1;
return s.length() - stringSlicer.getString().length();
}
|
java
|
private int matchXmlNamespaceAttribute(String s) {
/*
* The regex we're simulating is: "xmlns\\s*=\\s*\".+?\".*"
*/
StringPrefixSlicer stringSlicer = new StringPrefixSlicer(s);
if (stringSlicer.removePrefix("xmlns") == false) return -1;
stringSlicer.removeRepeatingPrefix(" ");
if (stringSlicer.removePrefix("=") == false) return -1;
stringSlicer.removeRepeatingPrefix(" ");
if (stringSlicer.removePrefix("\"") == false) return -1;
if (stringSlicer.removePrefixEndingWith("\"") == false) return -1;
return s.length() - stringSlicer.getString().length();
}
|
[
"private",
"int",
"matchXmlNamespaceAttribute",
"(",
"String",
"s",
")",
"{",
"/*\n * The regex we're simulating is: \"xmlns\\\\s*=\\\\s*\\\".+?\\\".*\"\n */",
"StringPrefixSlicer",
"stringSlicer",
"=",
"new",
"StringPrefixSlicer",
"(",
"s",
")",
";",
"if",
"(",
"stringSlicer",
".",
"removePrefix",
"(",
"\"xmlns\"",
")",
"==",
"false",
")",
"return",
"-",
"1",
";",
"stringSlicer",
".",
"removeRepeatingPrefix",
"(",
"\" \"",
")",
";",
"if",
"(",
"stringSlicer",
".",
"removePrefix",
"(",
"\"=\"",
")",
"==",
"false",
")",
"return",
"-",
"1",
";",
"stringSlicer",
".",
"removeRepeatingPrefix",
"(",
"\" \"",
")",
";",
"if",
"(",
"stringSlicer",
".",
"removePrefix",
"(",
"\"\\\"\"",
")",
"==",
"false",
")",
"return",
"-",
"1",
";",
"if",
"(",
"stringSlicer",
".",
"removePrefixEndingWith",
"(",
"\"\\\"\"",
")",
"==",
"false",
")",
"return",
"-",
"1",
";",
"return",
"s",
".",
"length",
"(",
")",
"-",
"stringSlicer",
".",
"getString",
"(",
")",
".",
"length",
"(",
")",
";",
"}"
] |
Checks if the string starts with a complete XML namespace attribute, and
if so, returns the number of characters that match.
@param s
The string to check for an XML namespace definition.
@return -1 if no XML namespace definition was found, otherwise the length
of the identified XML namespace definition.
|
[
"Checks",
"if",
"the",
"string",
"starts",
"with",
"a",
"complete",
"XML",
"namespace",
"attribute",
"and",
"if",
"so",
"returns",
"the",
"number",
"of",
"characters",
"that",
"match",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/NamespaceRemovingInputStream.java#L113-L128
|
19,622
|
aws/aws-sdk-java
|
aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/ContentManager.java
|
ContentManager.getDocumentStream
|
public GetDocumentStreamResult getDocumentStream(final GetDocumentStreamRequest getDocumentStreamRequest) {
String versionId = getDocumentStreamRequest.getVersionId();
if (versionId == null) {
GetDocumentRequest getDocumentRequest = new GetDocumentRequest();
getDocumentRequest.setDocumentId(getDocumentStreamRequest.getDocumentId());
String requestAuthenticationToken = getDocumentStreamRequest.getAuthenticationToken();
if (requestAuthenticationToken != null) {
getDocumentRequest.setAuthenticationToken(requestAuthenticationToken);
} else {
getDocumentRequest.setAuthenticationToken(authenticationToken);
}
GetDocumentResult result = client.getDocument(getDocumentRequest);
versionId = result.getMetadata().getLatestVersionMetadata().getId();
}
GetDocumentStreamResult getDocumentStreamResult = new GetDocumentStreamResult(getDocumentStreamRequest);
getDocumentStreamResult.setVersionId(versionId);
InputStream stream = getDocumentVersionStream(getDocumentStreamRequest.getDocumentId(), versionId);
getDocumentStreamResult.setStream(stream);
return getDocumentStreamResult;
}
|
java
|
public GetDocumentStreamResult getDocumentStream(final GetDocumentStreamRequest getDocumentStreamRequest) {
String versionId = getDocumentStreamRequest.getVersionId();
if (versionId == null) {
GetDocumentRequest getDocumentRequest = new GetDocumentRequest();
getDocumentRequest.setDocumentId(getDocumentStreamRequest.getDocumentId());
String requestAuthenticationToken = getDocumentStreamRequest.getAuthenticationToken();
if (requestAuthenticationToken != null) {
getDocumentRequest.setAuthenticationToken(requestAuthenticationToken);
} else {
getDocumentRequest.setAuthenticationToken(authenticationToken);
}
GetDocumentResult result = client.getDocument(getDocumentRequest);
versionId = result.getMetadata().getLatestVersionMetadata().getId();
}
GetDocumentStreamResult getDocumentStreamResult = new GetDocumentStreamResult(getDocumentStreamRequest);
getDocumentStreamResult.setVersionId(versionId);
InputStream stream = getDocumentVersionStream(getDocumentStreamRequest.getDocumentId(), versionId);
getDocumentStreamResult.setStream(stream);
return getDocumentStreamResult;
}
|
[
"public",
"GetDocumentStreamResult",
"getDocumentStream",
"(",
"final",
"GetDocumentStreamRequest",
"getDocumentStreamRequest",
")",
"{",
"String",
"versionId",
"=",
"getDocumentStreamRequest",
".",
"getVersionId",
"(",
")",
";",
"if",
"(",
"versionId",
"==",
"null",
")",
"{",
"GetDocumentRequest",
"getDocumentRequest",
"=",
"new",
"GetDocumentRequest",
"(",
")",
";",
"getDocumentRequest",
".",
"setDocumentId",
"(",
"getDocumentStreamRequest",
".",
"getDocumentId",
"(",
")",
")",
";",
"String",
"requestAuthenticationToken",
"=",
"getDocumentStreamRequest",
".",
"getAuthenticationToken",
"(",
")",
";",
"if",
"(",
"requestAuthenticationToken",
"!=",
"null",
")",
"{",
"getDocumentRequest",
".",
"setAuthenticationToken",
"(",
"requestAuthenticationToken",
")",
";",
"}",
"else",
"{",
"getDocumentRequest",
".",
"setAuthenticationToken",
"(",
"authenticationToken",
")",
";",
"}",
"GetDocumentResult",
"result",
"=",
"client",
".",
"getDocument",
"(",
"getDocumentRequest",
")",
";",
"versionId",
"=",
"result",
".",
"getMetadata",
"(",
")",
".",
"getLatestVersionMetadata",
"(",
")",
".",
"getId",
"(",
")",
";",
"}",
"GetDocumentStreamResult",
"getDocumentStreamResult",
"=",
"new",
"GetDocumentStreamResult",
"(",
"getDocumentStreamRequest",
")",
";",
"getDocumentStreamResult",
".",
"setVersionId",
"(",
"versionId",
")",
";",
"InputStream",
"stream",
"=",
"getDocumentVersionStream",
"(",
"getDocumentStreamRequest",
".",
"getDocumentId",
"(",
")",
",",
"versionId",
")",
";",
"getDocumentStreamResult",
".",
"setStream",
"(",
"stream",
")",
";",
"return",
"getDocumentStreamResult",
";",
"}"
] |
Gets document stream from WorkDocs.
If VersionId of GetDocumentStreamRequest is not specified,
then the latest version of specified document is retrieved.
Clients must close the stream once content is read.
@param getDocumentStreamRequest Request specifying parameters of the operation.
@return Result containing stream of requested document content.
|
[
"Gets",
"document",
"stream",
"from",
"WorkDocs",
".",
"If",
"VersionId",
"of",
"GetDocumentStreamRequest",
"is",
"not",
"specified",
"then",
"the",
"latest",
"version",
"of",
"specified",
"document",
"is",
"retrieved",
".",
"Clients",
"must",
"close",
"the",
"stream",
"once",
"content",
"is",
"read",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/ContentManager.java#L92-L115
|
19,623
|
aws/aws-sdk-java
|
aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/ContentManager.java
|
ContentManager.uploadDocumentStream
|
public UploadDocumentStreamResult uploadDocumentStream(UploadDocumentStreamRequest uploadDocumentStreamRequest) {
InputStream stream = uploadDocumentStreamRequest.getStream();
if (stream == null) {
throw new IllegalArgumentException("InputStream must be specified.");
}
InitiateDocumentVersionUploadRequest initiateDocumentVersionUploadRequest = new InitiateDocumentVersionUploadRequest();
initiateDocumentVersionUploadRequest.setParentFolderId(uploadDocumentStreamRequest.getParentFolderId());
initiateDocumentVersionUploadRequest.setName(uploadDocumentStreamRequest.getDocumentName());
initiateDocumentVersionUploadRequest.setContentType(uploadDocumentStreamRequest.getContentType());
initiateDocumentVersionUploadRequest.setContentCreatedTimestamp(uploadDocumentStreamRequest.getContentCreatedTimestamp());
initiateDocumentVersionUploadRequest.setContentModifiedTimestamp(uploadDocumentStreamRequest.getContentModifiedTimestamp());
initiateDocumentVersionUploadRequest.setDocumentSizeInBytes(uploadDocumentStreamRequest.getDocumentSizeInBytes());
initiateDocumentVersionUploadRequest.setId(uploadDocumentStreamRequest.getDocumentId());
String requestAuthenticationToken = uploadDocumentStreamRequest.getAuthenticationToken();
if (requestAuthenticationToken != null) {
initiateDocumentVersionUploadRequest.setAuthenticationToken(requestAuthenticationToken);
} else {
initiateDocumentVersionUploadRequest.setAuthenticationToken(authenticationToken);
}
InitiateDocumentVersionUploadResult result = client.initiateDocumentVersionUpload(initiateDocumentVersionUploadRequest);
UploadMetadata uploadMetadata = result.getUploadMetadata();
String documentId = result.getMetadata().getId();
String versionId = result.getMetadata().getLatestVersionMetadata().getId();
String uploadUrl = uploadMetadata.getUploadUrl();
try {
URL url = new URL(uploadUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("PUT");
connection.setRequestProperty("Content-Type", uploadDocumentStreamRequest.getContentType());
connection.setRequestProperty("x-amz-server-side-encryption", "AES256");
OutputStream outputStream = connection.getOutputStream();
IOUtils.copy(stream, outputStream);
connection.getResponseCode();
} catch (MalformedURLException e) {
throw new SdkClientException(e);
} catch (IOException e) {
throw new SdkClientException(e);
}
UpdateDocumentVersionRequest updateDocumentVersionRequest = new UpdateDocumentVersionRequest();
updateDocumentVersionRequest.setDocumentId(documentId);
updateDocumentVersionRequest.setVersionId(versionId);
updateDocumentVersionRequest.setVersionStatus(DocumentVersionStatus.ACTIVE);
if (authenticationToken != null) {
updateDocumentVersionRequest.setAuthenticationToken(authenticationToken);
}
UpdateDocumentVersionResult updateDocumentVersionResult = client.updateDocumentVersion(updateDocumentVersionRequest);
UploadDocumentStreamResult uploadDocumentStreamResult = new UploadDocumentStreamResult(
uploadDocumentStreamRequest);
uploadDocumentStreamResult.setDocumentId(documentId);
uploadDocumentStreamResult.setVersionId(versionId);
return uploadDocumentStreamResult;
}
|
java
|
public UploadDocumentStreamResult uploadDocumentStream(UploadDocumentStreamRequest uploadDocumentStreamRequest) {
InputStream stream = uploadDocumentStreamRequest.getStream();
if (stream == null) {
throw new IllegalArgumentException("InputStream must be specified.");
}
InitiateDocumentVersionUploadRequest initiateDocumentVersionUploadRequest = new InitiateDocumentVersionUploadRequest();
initiateDocumentVersionUploadRequest.setParentFolderId(uploadDocumentStreamRequest.getParentFolderId());
initiateDocumentVersionUploadRequest.setName(uploadDocumentStreamRequest.getDocumentName());
initiateDocumentVersionUploadRequest.setContentType(uploadDocumentStreamRequest.getContentType());
initiateDocumentVersionUploadRequest.setContentCreatedTimestamp(uploadDocumentStreamRequest.getContentCreatedTimestamp());
initiateDocumentVersionUploadRequest.setContentModifiedTimestamp(uploadDocumentStreamRequest.getContentModifiedTimestamp());
initiateDocumentVersionUploadRequest.setDocumentSizeInBytes(uploadDocumentStreamRequest.getDocumentSizeInBytes());
initiateDocumentVersionUploadRequest.setId(uploadDocumentStreamRequest.getDocumentId());
String requestAuthenticationToken = uploadDocumentStreamRequest.getAuthenticationToken();
if (requestAuthenticationToken != null) {
initiateDocumentVersionUploadRequest.setAuthenticationToken(requestAuthenticationToken);
} else {
initiateDocumentVersionUploadRequest.setAuthenticationToken(authenticationToken);
}
InitiateDocumentVersionUploadResult result = client.initiateDocumentVersionUpload(initiateDocumentVersionUploadRequest);
UploadMetadata uploadMetadata = result.getUploadMetadata();
String documentId = result.getMetadata().getId();
String versionId = result.getMetadata().getLatestVersionMetadata().getId();
String uploadUrl = uploadMetadata.getUploadUrl();
try {
URL url = new URL(uploadUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("PUT");
connection.setRequestProperty("Content-Type", uploadDocumentStreamRequest.getContentType());
connection.setRequestProperty("x-amz-server-side-encryption", "AES256");
OutputStream outputStream = connection.getOutputStream();
IOUtils.copy(stream, outputStream);
connection.getResponseCode();
} catch (MalformedURLException e) {
throw new SdkClientException(e);
} catch (IOException e) {
throw new SdkClientException(e);
}
UpdateDocumentVersionRequest updateDocumentVersionRequest = new UpdateDocumentVersionRequest();
updateDocumentVersionRequest.setDocumentId(documentId);
updateDocumentVersionRequest.setVersionId(versionId);
updateDocumentVersionRequest.setVersionStatus(DocumentVersionStatus.ACTIVE);
if (authenticationToken != null) {
updateDocumentVersionRequest.setAuthenticationToken(authenticationToken);
}
UpdateDocumentVersionResult updateDocumentVersionResult = client.updateDocumentVersion(updateDocumentVersionRequest);
UploadDocumentStreamResult uploadDocumentStreamResult = new UploadDocumentStreamResult(
uploadDocumentStreamRequest);
uploadDocumentStreamResult.setDocumentId(documentId);
uploadDocumentStreamResult.setVersionId(versionId);
return uploadDocumentStreamResult;
}
|
[
"public",
"UploadDocumentStreamResult",
"uploadDocumentStream",
"(",
"UploadDocumentStreamRequest",
"uploadDocumentStreamRequest",
")",
"{",
"InputStream",
"stream",
"=",
"uploadDocumentStreamRequest",
".",
"getStream",
"(",
")",
";",
"if",
"(",
"stream",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"InputStream must be specified.\"",
")",
";",
"}",
"InitiateDocumentVersionUploadRequest",
"initiateDocumentVersionUploadRequest",
"=",
"new",
"InitiateDocumentVersionUploadRequest",
"(",
")",
";",
"initiateDocumentVersionUploadRequest",
".",
"setParentFolderId",
"(",
"uploadDocumentStreamRequest",
".",
"getParentFolderId",
"(",
")",
")",
";",
"initiateDocumentVersionUploadRequest",
".",
"setName",
"(",
"uploadDocumentStreamRequest",
".",
"getDocumentName",
"(",
")",
")",
";",
"initiateDocumentVersionUploadRequest",
".",
"setContentType",
"(",
"uploadDocumentStreamRequest",
".",
"getContentType",
"(",
")",
")",
";",
"initiateDocumentVersionUploadRequest",
".",
"setContentCreatedTimestamp",
"(",
"uploadDocumentStreamRequest",
".",
"getContentCreatedTimestamp",
"(",
")",
")",
";",
"initiateDocumentVersionUploadRequest",
".",
"setContentModifiedTimestamp",
"(",
"uploadDocumentStreamRequest",
".",
"getContentModifiedTimestamp",
"(",
")",
")",
";",
"initiateDocumentVersionUploadRequest",
".",
"setDocumentSizeInBytes",
"(",
"uploadDocumentStreamRequest",
".",
"getDocumentSizeInBytes",
"(",
")",
")",
";",
"initiateDocumentVersionUploadRequest",
".",
"setId",
"(",
"uploadDocumentStreamRequest",
".",
"getDocumentId",
"(",
")",
")",
";",
"String",
"requestAuthenticationToken",
"=",
"uploadDocumentStreamRequest",
".",
"getAuthenticationToken",
"(",
")",
";",
"if",
"(",
"requestAuthenticationToken",
"!=",
"null",
")",
"{",
"initiateDocumentVersionUploadRequest",
".",
"setAuthenticationToken",
"(",
"requestAuthenticationToken",
")",
";",
"}",
"else",
"{",
"initiateDocumentVersionUploadRequest",
".",
"setAuthenticationToken",
"(",
"authenticationToken",
")",
";",
"}",
"InitiateDocumentVersionUploadResult",
"result",
"=",
"client",
".",
"initiateDocumentVersionUpload",
"(",
"initiateDocumentVersionUploadRequest",
")",
";",
"UploadMetadata",
"uploadMetadata",
"=",
"result",
".",
"getUploadMetadata",
"(",
")",
";",
"String",
"documentId",
"=",
"result",
".",
"getMetadata",
"(",
")",
".",
"getId",
"(",
")",
";",
"String",
"versionId",
"=",
"result",
".",
"getMetadata",
"(",
")",
".",
"getLatestVersionMetadata",
"(",
")",
".",
"getId",
"(",
")",
";",
"String",
"uploadUrl",
"=",
"uploadMetadata",
".",
"getUploadUrl",
"(",
")",
";",
"try",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"uploadUrl",
")",
";",
"HttpURLConnection",
"connection",
"=",
"(",
"HttpURLConnection",
")",
"url",
".",
"openConnection",
"(",
")",
";",
"connection",
".",
"setDoOutput",
"(",
"true",
")",
";",
"connection",
".",
"setRequestMethod",
"(",
"\"PUT\"",
")",
";",
"connection",
".",
"setRequestProperty",
"(",
"\"Content-Type\"",
",",
"uploadDocumentStreamRequest",
".",
"getContentType",
"(",
")",
")",
";",
"connection",
".",
"setRequestProperty",
"(",
"\"x-amz-server-side-encryption\"",
",",
"\"AES256\"",
")",
";",
"OutputStream",
"outputStream",
"=",
"connection",
".",
"getOutputStream",
"(",
")",
";",
"IOUtils",
".",
"copy",
"(",
"stream",
",",
"outputStream",
")",
";",
"connection",
".",
"getResponseCode",
"(",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"e",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"e",
")",
";",
"}",
"UpdateDocumentVersionRequest",
"updateDocumentVersionRequest",
"=",
"new",
"UpdateDocumentVersionRequest",
"(",
")",
";",
"updateDocumentVersionRequest",
".",
"setDocumentId",
"(",
"documentId",
")",
";",
"updateDocumentVersionRequest",
".",
"setVersionId",
"(",
"versionId",
")",
";",
"updateDocumentVersionRequest",
".",
"setVersionStatus",
"(",
"DocumentVersionStatus",
".",
"ACTIVE",
")",
";",
"if",
"(",
"authenticationToken",
"!=",
"null",
")",
"{",
"updateDocumentVersionRequest",
".",
"setAuthenticationToken",
"(",
"authenticationToken",
")",
";",
"}",
"UpdateDocumentVersionResult",
"updateDocumentVersionResult",
"=",
"client",
".",
"updateDocumentVersion",
"(",
"updateDocumentVersionRequest",
")",
";",
"UploadDocumentStreamResult",
"uploadDocumentStreamResult",
"=",
"new",
"UploadDocumentStreamResult",
"(",
"uploadDocumentStreamRequest",
")",
";",
"uploadDocumentStreamResult",
".",
"setDocumentId",
"(",
"documentId",
")",
";",
"uploadDocumentStreamResult",
".",
"setVersionId",
"(",
"versionId",
")",
";",
"return",
"uploadDocumentStreamResult",
";",
"}"
] |
Uploads document stream to WorkDocs.
If document ID is specified, then it creates a new version under this document.
If document ID is not specified, then it creates a new document and uploads content to its only version.\
Client must close the input stream once upload operation is complete.
@param uploadDocumentStreamRequest Request specifying parameters of the operation.
@return Result containing metadata of the newly created document or version.
|
[
"Uploads",
"document",
"stream",
"to",
"WorkDocs",
".",
"If",
"document",
"ID",
"is",
"specified",
"then",
"it",
"creates",
"a",
"new",
"version",
"under",
"this",
"document",
".",
"If",
"document",
"ID",
"is",
"not",
"specified",
"then",
"it",
"creates",
"a",
"new",
"document",
"and",
"uploads",
"content",
"to",
"its",
"only",
"version",
".",
"\\",
"Client",
"must",
"close",
"the",
"input",
"stream",
"once",
"upload",
"operation",
"is",
"complete",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/ContentManager.java#L143-L204
|
19,624
|
aws/aws-sdk-java
|
aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/waiters/AmazonElasticTranscoderWaiters.java
|
AmazonElasticTranscoderWaiters.jobComplete
|
public Waiter<ReadJobRequest> jobComplete() {
return new WaiterBuilder<ReadJobRequest, ReadJobResult>().withSdkFunction(new ReadJobFunction(client))
.withAcceptors(new JobComplete.IsCompleteMatcher(), new JobComplete.IsCanceledMatcher(), new JobComplete.IsErrorMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(120), new FixedDelayStrategy(30)))
.withExecutorService(executorService).build();
}
|
java
|
public Waiter<ReadJobRequest> jobComplete() {
return new WaiterBuilder<ReadJobRequest, ReadJobResult>().withSdkFunction(new ReadJobFunction(client))
.withAcceptors(new JobComplete.IsCompleteMatcher(), new JobComplete.IsCanceledMatcher(), new JobComplete.IsErrorMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(120), new FixedDelayStrategy(30)))
.withExecutorService(executorService).build();
}
|
[
"public",
"Waiter",
"<",
"ReadJobRequest",
">",
"jobComplete",
"(",
")",
"{",
"return",
"new",
"WaiterBuilder",
"<",
"ReadJobRequest",
",",
"ReadJobResult",
">",
"(",
")",
".",
"withSdkFunction",
"(",
"new",
"ReadJobFunction",
"(",
"client",
")",
")",
".",
"withAcceptors",
"(",
"new",
"JobComplete",
".",
"IsCompleteMatcher",
"(",
")",
",",
"new",
"JobComplete",
".",
"IsCanceledMatcher",
"(",
")",
",",
"new",
"JobComplete",
".",
"IsErrorMatcher",
"(",
")",
")",
".",
"withDefaultPollingStrategy",
"(",
"new",
"PollingStrategy",
"(",
"new",
"MaxAttemptsRetryStrategy",
"(",
"120",
")",
",",
"new",
"FixedDelayStrategy",
"(",
"30",
")",
")",
")",
".",
"withExecutorService",
"(",
"executorService",
")",
".",
"build",
"(",
")",
";",
"}"
] |
Builds a JobComplete 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",
"JobComplete",
"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-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/waiters/AmazonElasticTranscoderWaiters.java#L51-L57
|
19,625
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java
|
TransferManager.isDownloadParallel
|
private boolean isDownloadParallel(PresignedUrlDownloadRequest request, Long startByte, Long endByte,
long partialObjectMaxSize) {
return !configuration.isDisableParallelDownloads() && !(s3 instanceof AmazonS3Encryption)
// Can't rely on set range as endbyte can be set to random number longer than actual size. This results in
// making large number of partial requests even after the entire file is read from S3
&& request.getRange() == null
// This is when SDK can compute the endByte through the object metadata
&& (startByte != null && endByte != null && endByte - startByte + 1 > partialObjectMaxSize);
}
|
java
|
private boolean isDownloadParallel(PresignedUrlDownloadRequest request, Long startByte, Long endByte,
long partialObjectMaxSize) {
return !configuration.isDisableParallelDownloads() && !(s3 instanceof AmazonS3Encryption)
// Can't rely on set range as endbyte can be set to random number longer than actual size. This results in
// making large number of partial requests even after the entire file is read from S3
&& request.getRange() == null
// This is when SDK can compute the endByte through the object metadata
&& (startByte != null && endByte != null && endByte - startByte + 1 > partialObjectMaxSize);
}
|
[
"private",
"boolean",
"isDownloadParallel",
"(",
"PresignedUrlDownloadRequest",
"request",
",",
"Long",
"startByte",
",",
"Long",
"endByte",
",",
"long",
"partialObjectMaxSize",
")",
"{",
"return",
"!",
"configuration",
".",
"isDisableParallelDownloads",
"(",
")",
"&&",
"!",
"(",
"s3",
"instanceof",
"AmazonS3Encryption",
")",
"// Can't rely on set range as endbyte can be set to random number longer than actual size. This results in",
"// making large number of partial requests even after the entire file is read from S3",
"&&",
"request",
".",
"getRange",
"(",
")",
"==",
"null",
"// This is when SDK can compute the endByte through the object metadata",
"&&",
"(",
"startByte",
"!=",
"null",
"&&",
"endByte",
"!=",
"null",
"&&",
"endByte",
"-",
"startByte",
"+",
"1",
">",
"partialObjectMaxSize",
")",
";",
"}"
] |
Returns a boolean value indicating if object can be downloaded in parallel
when using presigned url.
|
[
"Returns",
"a",
"boolean",
"value",
"indicating",
"if",
"object",
"can",
"be",
"downloaded",
"in",
"parallel",
"when",
"using",
"presigned",
"url",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java#L1276-L1284
|
19,626
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java
|
TransferManager.resumeDownload
|
public Download resumeDownload(PersistableDownload persistableDownload) {
assertParameterNotNull(persistableDownload,
"PausedDownload is mandatory to resume a download.");
GetObjectRequest request = new GetObjectRequest(
persistableDownload.getBucketName(), persistableDownload.getKey(),
persistableDownload.getVersionId());
if (persistableDownload.getRange() != null
&& persistableDownload.getRange().length == 2) {
long[] range = persistableDownload.getRange();
request.setRange(range[0], range[1]);
}
request.setRequesterPays(persistableDownload.isRequesterPays());
request.setResponseHeaders(persistableDownload.getResponseHeaders());
return doDownload(request, new File(persistableDownload.getFile()), null, null,
APPEND_MODE, 0,
persistableDownload);
}
|
java
|
public Download resumeDownload(PersistableDownload persistableDownload) {
assertParameterNotNull(persistableDownload,
"PausedDownload is mandatory to resume a download.");
GetObjectRequest request = new GetObjectRequest(
persistableDownload.getBucketName(), persistableDownload.getKey(),
persistableDownload.getVersionId());
if (persistableDownload.getRange() != null
&& persistableDownload.getRange().length == 2) {
long[] range = persistableDownload.getRange();
request.setRange(range[0], range[1]);
}
request.setRequesterPays(persistableDownload.isRequesterPays());
request.setResponseHeaders(persistableDownload.getResponseHeaders());
return doDownload(request, new File(persistableDownload.getFile()), null, null,
APPEND_MODE, 0,
persistableDownload);
}
|
[
"public",
"Download",
"resumeDownload",
"(",
"PersistableDownload",
"persistableDownload",
")",
"{",
"assertParameterNotNull",
"(",
"persistableDownload",
",",
"\"PausedDownload is mandatory to resume a download.\"",
")",
";",
"GetObjectRequest",
"request",
"=",
"new",
"GetObjectRequest",
"(",
"persistableDownload",
".",
"getBucketName",
"(",
")",
",",
"persistableDownload",
".",
"getKey",
"(",
")",
",",
"persistableDownload",
".",
"getVersionId",
"(",
")",
")",
";",
"if",
"(",
"persistableDownload",
".",
"getRange",
"(",
")",
"!=",
"null",
"&&",
"persistableDownload",
".",
"getRange",
"(",
")",
".",
"length",
"==",
"2",
")",
"{",
"long",
"[",
"]",
"range",
"=",
"persistableDownload",
".",
"getRange",
"(",
")",
";",
"request",
".",
"setRange",
"(",
"range",
"[",
"0",
"]",
",",
"range",
"[",
"1",
"]",
")",
";",
"}",
"request",
".",
"setRequesterPays",
"(",
"persistableDownload",
".",
"isRequesterPays",
"(",
")",
")",
";",
"request",
".",
"setResponseHeaders",
"(",
"persistableDownload",
".",
"getResponseHeaders",
"(",
")",
")",
";",
"return",
"doDownload",
"(",
"request",
",",
"new",
"File",
"(",
"persistableDownload",
".",
"getFile",
"(",
")",
")",
",",
"null",
",",
"null",
",",
"APPEND_MODE",
",",
"0",
",",
"persistableDownload",
")",
";",
"}"
] |
Resumes an download operation. This download operation uses the same
configuration as the original download. Any data already fetched will be
skipped, and only the remaining data is retrieved from Amazon S3.
@param persistableDownload
the download to resume.
@return A new <code>Download</code> object to use to check the state of
the download, listen for progress notifications, and otherwise
manage the download.
@throws AmazonClientException
If any errors are encountered in the client while making the
request or handling the response.
@throws AmazonServiceException
If any errors occurred in Amazon S3 while processing the
request.
|
[
"Resumes",
"an",
"download",
"operation",
".",
"This",
"download",
"operation",
"uses",
"the",
"same",
"configuration",
"as",
"the",
"original",
"download",
".",
"Any",
"data",
"already",
"fetched",
"will",
"be",
"skipped",
"and",
"only",
"the",
"remaining",
"data",
"is",
"retrieved",
"from",
"Amazon",
"S3",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java#L2279-L2296
|
19,627
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.changeMessageVisibilityAsync
|
@Override
public java.util.concurrent.Future<ChangeMessageVisibilityResult> changeMessageVisibilityAsync(String queueUrl, String receiptHandle,
Integer visibilityTimeout, com.amazonaws.handlers.AsyncHandler<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult> asyncHandler) {
return changeMessageVisibilityAsync(
new ChangeMessageVisibilityRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle).withVisibilityTimeout(visibilityTimeout),
asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<ChangeMessageVisibilityResult> changeMessageVisibilityAsync(String queueUrl, String receiptHandle,
Integer visibilityTimeout, com.amazonaws.handlers.AsyncHandler<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult> asyncHandler) {
return changeMessageVisibilityAsync(
new ChangeMessageVisibilityRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle).withVisibilityTimeout(visibilityTimeout),
asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"ChangeMessageVisibilityResult",
">",
"changeMessageVisibilityAsync",
"(",
"String",
"queueUrl",
",",
"String",
"receiptHandle",
",",
"Integer",
"visibilityTimeout",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"ChangeMessageVisibilityRequest",
",",
"ChangeMessageVisibilityResult",
">",
"asyncHandler",
")",
"{",
"return",
"changeMessageVisibilityAsync",
"(",
"new",
"ChangeMessageVisibilityRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withReceiptHandle",
"(",
"receiptHandle",
")",
".",
"withVisibilityTimeout",
"(",
"visibilityTimeout",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the ChangeMessageVisibility operation with an AsyncHandler.
@see #changeMessageVisibilityAsync(ChangeMessageVisibilityRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"ChangeMessageVisibility",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L98-L105
|
19,628
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.changeMessageVisibilityBatchAsync
|
@Override
public java.util.concurrent.Future<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatchAsync(String queueUrl,
java.util.List<ChangeMessageVisibilityBatchRequestEntry> entries,
com.amazonaws.handlers.AsyncHandler<ChangeMessageVisibilityBatchRequest, ChangeMessageVisibilityBatchResult> asyncHandler) {
return changeMessageVisibilityBatchAsync(new ChangeMessageVisibilityBatchRequest().withQueueUrl(queueUrl).withEntries(entries), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatchAsync(String queueUrl,
java.util.List<ChangeMessageVisibilityBatchRequestEntry> entries,
com.amazonaws.handlers.AsyncHandler<ChangeMessageVisibilityBatchRequest, ChangeMessageVisibilityBatchResult> asyncHandler) {
return changeMessageVisibilityBatchAsync(new ChangeMessageVisibilityBatchRequest().withQueueUrl(queueUrl).withEntries(entries), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"ChangeMessageVisibilityBatchResult",
">",
"changeMessageVisibilityBatchAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"List",
"<",
"ChangeMessageVisibilityBatchRequestEntry",
">",
"entries",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"ChangeMessageVisibilityBatchRequest",
",",
"ChangeMessageVisibilityBatchResult",
">",
"asyncHandler",
")",
"{",
"return",
"changeMessageVisibilityBatchAsync",
"(",
"new",
"ChangeMessageVisibilityBatchRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withEntries",
"(",
"entries",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the ChangeMessageVisibilityBatch operation with an AsyncHandler.
@see #changeMessageVisibilityBatchAsync(ChangeMessageVisibilityBatchRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"ChangeMessageVisibilityBatch",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L137-L143
|
19,629
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.createQueueAsync
|
@Override
public java.util.concurrent.Future<CreateQueueResult> createQueueAsync(String queueName) {
return createQueueAsync(new CreateQueueRequest().withQueueName(queueName));
}
|
java
|
@Override
public java.util.concurrent.Future<CreateQueueResult> createQueueAsync(String queueName) {
return createQueueAsync(new CreateQueueRequest().withQueueName(queueName));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"CreateQueueResult",
">",
"createQueueAsync",
"(",
"String",
"queueName",
")",
"{",
"return",
"createQueueAsync",
"(",
"new",
"CreateQueueRequest",
"(",
")",
".",
"withQueueName",
"(",
"queueName",
")",
")",
";",
"}"
] |
Simplified method form for invoking the CreateQueue operation.
@see #createQueueAsync(CreateQueueRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"CreateQueue",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L163-L167
|
19,630
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.createQueueAsync
|
@Override
public java.util.concurrent.Future<CreateQueueResult> createQueueAsync(String queueName,
com.amazonaws.handlers.AsyncHandler<CreateQueueRequest, CreateQueueResult> asyncHandler) {
return createQueueAsync(new CreateQueueRequest().withQueueName(queueName), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<CreateQueueResult> createQueueAsync(String queueName,
com.amazonaws.handlers.AsyncHandler<CreateQueueRequest, CreateQueueResult> asyncHandler) {
return createQueueAsync(new CreateQueueRequest().withQueueName(queueName), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"CreateQueueResult",
">",
"createQueueAsync",
"(",
"String",
"queueName",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"CreateQueueRequest",
",",
"CreateQueueResult",
">",
"asyncHandler",
")",
"{",
"return",
"createQueueAsync",
"(",
"new",
"CreateQueueRequest",
"(",
")",
".",
"withQueueName",
"(",
"queueName",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the CreateQueue operation with an AsyncHandler.
@see #createQueueAsync(CreateQueueRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"CreateQueue",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L174-L179
|
19,631
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.deleteMessageAsync
|
@Override
public java.util.concurrent.Future<DeleteMessageResult> deleteMessageAsync(String queueUrl, String receiptHandle) {
return deleteMessageAsync(new DeleteMessageRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle));
}
|
java
|
@Override
public java.util.concurrent.Future<DeleteMessageResult> deleteMessageAsync(String queueUrl, String receiptHandle) {
return deleteMessageAsync(new DeleteMessageRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"DeleteMessageResult",
">",
"deleteMessageAsync",
"(",
"String",
"queueUrl",
",",
"String",
"receiptHandle",
")",
"{",
"return",
"deleteMessageAsync",
"(",
"new",
"DeleteMessageRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withReceiptHandle",
"(",
"receiptHandle",
")",
")",
";",
"}"
] |
Simplified method form for invoking the DeleteMessage operation.
@see #deleteMessageAsync(DeleteMessageRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"DeleteMessage",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L199-L203
|
19,632
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.deleteMessageAsync
|
@Override
public java.util.concurrent.Future<DeleteMessageResult> deleteMessageAsync(String queueUrl, String receiptHandle,
com.amazonaws.handlers.AsyncHandler<DeleteMessageRequest, DeleteMessageResult> asyncHandler) {
return deleteMessageAsync(new DeleteMessageRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<DeleteMessageResult> deleteMessageAsync(String queueUrl, String receiptHandle,
com.amazonaws.handlers.AsyncHandler<DeleteMessageRequest, DeleteMessageResult> asyncHandler) {
return deleteMessageAsync(new DeleteMessageRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"DeleteMessageResult",
">",
"deleteMessageAsync",
"(",
"String",
"queueUrl",
",",
"String",
"receiptHandle",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"DeleteMessageRequest",
",",
"DeleteMessageResult",
">",
"asyncHandler",
")",
"{",
"return",
"deleteMessageAsync",
"(",
"new",
"DeleteMessageRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withReceiptHandle",
"(",
"receiptHandle",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the DeleteMessage operation with an AsyncHandler.
@see #deleteMessageAsync(DeleteMessageRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"DeleteMessage",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L210-L215
|
19,633
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.deleteMessageBatchAsync
|
@Override
public java.util.concurrent.Future<DeleteMessageBatchResult> deleteMessageBatchAsync(String queueUrl, java.util.List<DeleteMessageBatchRequestEntry> entries) {
return deleteMessageBatchAsync(new DeleteMessageBatchRequest().withQueueUrl(queueUrl).withEntries(entries));
}
|
java
|
@Override
public java.util.concurrent.Future<DeleteMessageBatchResult> deleteMessageBatchAsync(String queueUrl, java.util.List<DeleteMessageBatchRequestEntry> entries) {
return deleteMessageBatchAsync(new DeleteMessageBatchRequest().withQueueUrl(queueUrl).withEntries(entries));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"DeleteMessageBatchResult",
">",
"deleteMessageBatchAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"List",
"<",
"DeleteMessageBatchRequestEntry",
">",
"entries",
")",
"{",
"return",
"deleteMessageBatchAsync",
"(",
"new",
"DeleteMessageBatchRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withEntries",
"(",
"entries",
")",
")",
";",
"}"
] |
Simplified method form for invoking the DeleteMessageBatch operation.
@see #deleteMessageBatchAsync(DeleteMessageBatchRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"DeleteMessageBatch",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L235-L239
|
19,634
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.deleteMessageBatchAsync
|
@Override
public java.util.concurrent.Future<DeleteMessageBatchResult> deleteMessageBatchAsync(String queueUrl,
java.util.List<DeleteMessageBatchRequestEntry> entries,
com.amazonaws.handlers.AsyncHandler<DeleteMessageBatchRequest, DeleteMessageBatchResult> asyncHandler) {
return deleteMessageBatchAsync(new DeleteMessageBatchRequest().withQueueUrl(queueUrl).withEntries(entries), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<DeleteMessageBatchResult> deleteMessageBatchAsync(String queueUrl,
java.util.List<DeleteMessageBatchRequestEntry> entries,
com.amazonaws.handlers.AsyncHandler<DeleteMessageBatchRequest, DeleteMessageBatchResult> asyncHandler) {
return deleteMessageBatchAsync(new DeleteMessageBatchRequest().withQueueUrl(queueUrl).withEntries(entries), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"DeleteMessageBatchResult",
">",
"deleteMessageBatchAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"List",
"<",
"DeleteMessageBatchRequestEntry",
">",
"entries",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"DeleteMessageBatchRequest",
",",
"DeleteMessageBatchResult",
">",
"asyncHandler",
")",
"{",
"return",
"deleteMessageBatchAsync",
"(",
"new",
"DeleteMessageBatchRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withEntries",
"(",
"entries",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the DeleteMessageBatch operation with an AsyncHandler.
@see #deleteMessageBatchAsync(DeleteMessageBatchRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"DeleteMessageBatch",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L246-L252
|
19,635
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.deleteQueueAsync
|
@Override
public java.util.concurrent.Future<DeleteQueueResult> deleteQueueAsync(String queueUrl) {
return deleteQueueAsync(new DeleteQueueRequest().withQueueUrl(queueUrl));
}
|
java
|
@Override
public java.util.concurrent.Future<DeleteQueueResult> deleteQueueAsync(String queueUrl) {
return deleteQueueAsync(new DeleteQueueRequest().withQueueUrl(queueUrl));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"DeleteQueueResult",
">",
"deleteQueueAsync",
"(",
"String",
"queueUrl",
")",
"{",
"return",
"deleteQueueAsync",
"(",
"new",
"DeleteQueueRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
")",
";",
"}"
] |
Simplified method form for invoking the DeleteQueue operation.
@see #deleteQueueAsync(DeleteQueueRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"DeleteQueue",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L272-L276
|
19,636
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.deleteQueueAsync
|
@Override
public java.util.concurrent.Future<DeleteQueueResult> deleteQueueAsync(String queueUrl,
com.amazonaws.handlers.AsyncHandler<DeleteQueueRequest, DeleteQueueResult> asyncHandler) {
return deleteQueueAsync(new DeleteQueueRequest().withQueueUrl(queueUrl), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<DeleteQueueResult> deleteQueueAsync(String queueUrl,
com.amazonaws.handlers.AsyncHandler<DeleteQueueRequest, DeleteQueueResult> asyncHandler) {
return deleteQueueAsync(new DeleteQueueRequest().withQueueUrl(queueUrl), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"DeleteQueueResult",
">",
"deleteQueueAsync",
"(",
"String",
"queueUrl",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"DeleteQueueRequest",
",",
"DeleteQueueResult",
">",
"asyncHandler",
")",
"{",
"return",
"deleteQueueAsync",
"(",
"new",
"DeleteQueueRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the DeleteQueue operation with an AsyncHandler.
@see #deleteQueueAsync(DeleteQueueRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"DeleteQueue",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L283-L288
|
19,637
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.getQueueAttributesAsync
|
@Override
public java.util.concurrent.Future<GetQueueAttributesResult> getQueueAttributesAsync(String queueUrl, java.util.List<String> attributeNames) {
return getQueueAttributesAsync(new GetQueueAttributesRequest().withQueueUrl(queueUrl).withAttributeNames(attributeNames));
}
|
java
|
@Override
public java.util.concurrent.Future<GetQueueAttributesResult> getQueueAttributesAsync(String queueUrl, java.util.List<String> attributeNames) {
return getQueueAttributesAsync(new GetQueueAttributesRequest().withQueueUrl(queueUrl).withAttributeNames(attributeNames));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"GetQueueAttributesResult",
">",
"getQueueAttributesAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"attributeNames",
")",
"{",
"return",
"getQueueAttributesAsync",
"(",
"new",
"GetQueueAttributesRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withAttributeNames",
"(",
"attributeNames",
")",
")",
";",
"}"
] |
Simplified method form for invoking the GetQueueAttributes operation.
@see #getQueueAttributesAsync(GetQueueAttributesRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"GetQueueAttributes",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L308-L312
|
19,638
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.getQueueAttributesAsync
|
@Override
public java.util.concurrent.Future<GetQueueAttributesResult> getQueueAttributesAsync(String queueUrl, java.util.List<String> attributeNames,
com.amazonaws.handlers.AsyncHandler<GetQueueAttributesRequest, GetQueueAttributesResult> asyncHandler) {
return getQueueAttributesAsync(new GetQueueAttributesRequest().withQueueUrl(queueUrl).withAttributeNames(attributeNames), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<GetQueueAttributesResult> getQueueAttributesAsync(String queueUrl, java.util.List<String> attributeNames,
com.amazonaws.handlers.AsyncHandler<GetQueueAttributesRequest, GetQueueAttributesResult> asyncHandler) {
return getQueueAttributesAsync(new GetQueueAttributesRequest().withQueueUrl(queueUrl).withAttributeNames(attributeNames), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"GetQueueAttributesResult",
">",
"getQueueAttributesAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"attributeNames",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"GetQueueAttributesRequest",
",",
"GetQueueAttributesResult",
">",
"asyncHandler",
")",
"{",
"return",
"getQueueAttributesAsync",
"(",
"new",
"GetQueueAttributesRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withAttributeNames",
"(",
"attributeNames",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the GetQueueAttributes operation with an AsyncHandler.
@see #getQueueAttributesAsync(GetQueueAttributesRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"GetQueueAttributes",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L319-L324
|
19,639
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.getQueueUrlAsync
|
@Override
public java.util.concurrent.Future<GetQueueUrlResult> getQueueUrlAsync(String queueName) {
return getQueueUrlAsync(new GetQueueUrlRequest().withQueueName(queueName));
}
|
java
|
@Override
public java.util.concurrent.Future<GetQueueUrlResult> getQueueUrlAsync(String queueName) {
return getQueueUrlAsync(new GetQueueUrlRequest().withQueueName(queueName));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"GetQueueUrlResult",
">",
"getQueueUrlAsync",
"(",
"String",
"queueName",
")",
"{",
"return",
"getQueueUrlAsync",
"(",
"new",
"GetQueueUrlRequest",
"(",
")",
".",
"withQueueName",
"(",
"queueName",
")",
")",
";",
"}"
] |
Simplified method form for invoking the GetQueueUrl operation.
@see #getQueueUrlAsync(GetQueueUrlRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"GetQueueUrl",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L344-L348
|
19,640
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.getQueueUrlAsync
|
@Override
public java.util.concurrent.Future<GetQueueUrlResult> getQueueUrlAsync(String queueName,
com.amazonaws.handlers.AsyncHandler<GetQueueUrlRequest, GetQueueUrlResult> asyncHandler) {
return getQueueUrlAsync(new GetQueueUrlRequest().withQueueName(queueName), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<GetQueueUrlResult> getQueueUrlAsync(String queueName,
com.amazonaws.handlers.AsyncHandler<GetQueueUrlRequest, GetQueueUrlResult> asyncHandler) {
return getQueueUrlAsync(new GetQueueUrlRequest().withQueueName(queueName), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"GetQueueUrlResult",
">",
"getQueueUrlAsync",
"(",
"String",
"queueName",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"GetQueueUrlRequest",
",",
"GetQueueUrlResult",
">",
"asyncHandler",
")",
"{",
"return",
"getQueueUrlAsync",
"(",
"new",
"GetQueueUrlRequest",
"(",
")",
".",
"withQueueName",
"(",
"queueName",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the GetQueueUrl operation with an AsyncHandler.
@see #getQueueUrlAsync(GetQueueUrlRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"GetQueueUrl",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L355-L360
|
19,641
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.listQueueTagsAsync
|
@Override
public java.util.concurrent.Future<ListQueueTagsResult> listQueueTagsAsync(String queueUrl) {
return listQueueTagsAsync(new ListQueueTagsRequest().withQueueUrl(queueUrl));
}
|
java
|
@Override
public java.util.concurrent.Future<ListQueueTagsResult> listQueueTagsAsync(String queueUrl) {
return listQueueTagsAsync(new ListQueueTagsRequest().withQueueUrl(queueUrl));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"ListQueueTagsResult",
">",
"listQueueTagsAsync",
"(",
"String",
"queueUrl",
")",
"{",
"return",
"listQueueTagsAsync",
"(",
"new",
"ListQueueTagsRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
")",
";",
"}"
] |
Simplified method form for invoking the ListQueueTags operation.
@see #listQueueTagsAsync(ListQueueTagsRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"ListQueueTags",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L393-L397
|
19,642
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.listQueueTagsAsync
|
@Override
public java.util.concurrent.Future<ListQueueTagsResult> listQueueTagsAsync(String queueUrl,
com.amazonaws.handlers.AsyncHandler<ListQueueTagsRequest, ListQueueTagsResult> asyncHandler) {
return listQueueTagsAsync(new ListQueueTagsRequest().withQueueUrl(queueUrl), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<ListQueueTagsResult> listQueueTagsAsync(String queueUrl,
com.amazonaws.handlers.AsyncHandler<ListQueueTagsRequest, ListQueueTagsResult> asyncHandler) {
return listQueueTagsAsync(new ListQueueTagsRequest().withQueueUrl(queueUrl), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"ListQueueTagsResult",
">",
"listQueueTagsAsync",
"(",
"String",
"queueUrl",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"ListQueueTagsRequest",
",",
"ListQueueTagsResult",
">",
"asyncHandler",
")",
"{",
"return",
"listQueueTagsAsync",
"(",
"new",
"ListQueueTagsRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the ListQueueTags operation with an AsyncHandler.
@see #listQueueTagsAsync(ListQueueTagsRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"ListQueueTags",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L404-L409
|
19,643
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.listQueuesAsync
|
@Override
public java.util.concurrent.Future<ListQueuesResult> listQueuesAsync(String queueNamePrefix) {
return listQueuesAsync(new ListQueuesRequest().withQueueNamePrefix(queueNamePrefix));
}
|
java
|
@Override
public java.util.concurrent.Future<ListQueuesResult> listQueuesAsync(String queueNamePrefix) {
return listQueuesAsync(new ListQueuesRequest().withQueueNamePrefix(queueNamePrefix));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"ListQueuesResult",
">",
"listQueuesAsync",
"(",
"String",
"queueNamePrefix",
")",
"{",
"return",
"listQueuesAsync",
"(",
"new",
"ListQueuesRequest",
"(",
")",
".",
"withQueueNamePrefix",
"(",
"queueNamePrefix",
")",
")",
";",
"}"
] |
Simplified method form for invoking the ListQueues operation.
@see #listQueuesAsync(ListQueuesRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"ListQueues",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L451-L455
|
19,644
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.receiveMessageAsync
|
@Override
public java.util.concurrent.Future<ReceiveMessageResult> receiveMessageAsync(String queueUrl) {
return receiveMessageAsync(new ReceiveMessageRequest().withQueueUrl(queueUrl));
}
|
java
|
@Override
public java.util.concurrent.Future<ReceiveMessageResult> receiveMessageAsync(String queueUrl) {
return receiveMessageAsync(new ReceiveMessageRequest().withQueueUrl(queueUrl));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"ReceiveMessageResult",
">",
"receiveMessageAsync",
"(",
"String",
"queueUrl",
")",
"{",
"return",
"receiveMessageAsync",
"(",
"new",
"ReceiveMessageRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
")",
";",
"}"
] |
Simplified method form for invoking the ReceiveMessage operation.
@see #receiveMessageAsync(ReceiveMessageRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"ReceiveMessage",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L500-L504
|
19,645
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.receiveMessageAsync
|
@Override
public java.util.concurrent.Future<ReceiveMessageResult> receiveMessageAsync(String queueUrl,
com.amazonaws.handlers.AsyncHandler<ReceiveMessageRequest, ReceiveMessageResult> asyncHandler) {
return receiveMessageAsync(new ReceiveMessageRequest().withQueueUrl(queueUrl), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<ReceiveMessageResult> receiveMessageAsync(String queueUrl,
com.amazonaws.handlers.AsyncHandler<ReceiveMessageRequest, ReceiveMessageResult> asyncHandler) {
return receiveMessageAsync(new ReceiveMessageRequest().withQueueUrl(queueUrl), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"ReceiveMessageResult",
">",
"receiveMessageAsync",
"(",
"String",
"queueUrl",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"ReceiveMessageRequest",
",",
"ReceiveMessageResult",
">",
"asyncHandler",
")",
"{",
"return",
"receiveMessageAsync",
"(",
"new",
"ReceiveMessageRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the ReceiveMessage operation with an AsyncHandler.
@see #receiveMessageAsync(ReceiveMessageRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"ReceiveMessage",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L511-L516
|
19,646
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.sendMessageAsync
|
@Override
public java.util.concurrent.Future<SendMessageResult> sendMessageAsync(String queueUrl, String messageBody) {
return sendMessageAsync(new SendMessageRequest().withQueueUrl(queueUrl).withMessageBody(messageBody));
}
|
java
|
@Override
public java.util.concurrent.Future<SendMessageResult> sendMessageAsync(String queueUrl, String messageBody) {
return sendMessageAsync(new SendMessageRequest().withQueueUrl(queueUrl).withMessageBody(messageBody));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"SendMessageResult",
">",
"sendMessageAsync",
"(",
"String",
"queueUrl",
",",
"String",
"messageBody",
")",
"{",
"return",
"sendMessageAsync",
"(",
"new",
"SendMessageRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withMessageBody",
"(",
"messageBody",
")",
")",
";",
"}"
] |
Simplified method form for invoking the SendMessage operation.
@see #sendMessageAsync(SendMessageRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"SendMessage",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L572-L576
|
19,647
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.sendMessageAsync
|
@Override
public java.util.concurrent.Future<SendMessageResult> sendMessageAsync(String queueUrl, String messageBody,
com.amazonaws.handlers.AsyncHandler<SendMessageRequest, SendMessageResult> asyncHandler) {
return sendMessageAsync(new SendMessageRequest().withQueueUrl(queueUrl).withMessageBody(messageBody), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<SendMessageResult> sendMessageAsync(String queueUrl, String messageBody,
com.amazonaws.handlers.AsyncHandler<SendMessageRequest, SendMessageResult> asyncHandler) {
return sendMessageAsync(new SendMessageRequest().withQueueUrl(queueUrl).withMessageBody(messageBody), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"SendMessageResult",
">",
"sendMessageAsync",
"(",
"String",
"queueUrl",
",",
"String",
"messageBody",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"SendMessageRequest",
",",
"SendMessageResult",
">",
"asyncHandler",
")",
"{",
"return",
"sendMessageAsync",
"(",
"new",
"SendMessageRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withMessageBody",
"(",
"messageBody",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the SendMessage operation with an AsyncHandler.
@see #sendMessageAsync(SendMessageRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"SendMessage",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L583-L588
|
19,648
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.sendMessageBatchAsync
|
@Override
public java.util.concurrent.Future<SendMessageBatchResult> sendMessageBatchAsync(String queueUrl, java.util.List<SendMessageBatchRequestEntry> entries) {
return sendMessageBatchAsync(new SendMessageBatchRequest().withQueueUrl(queueUrl).withEntries(entries));
}
|
java
|
@Override
public java.util.concurrent.Future<SendMessageBatchResult> sendMessageBatchAsync(String queueUrl, java.util.List<SendMessageBatchRequestEntry> entries) {
return sendMessageBatchAsync(new SendMessageBatchRequest().withQueueUrl(queueUrl).withEntries(entries));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"SendMessageBatchResult",
">",
"sendMessageBatchAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"List",
"<",
"SendMessageBatchRequestEntry",
">",
"entries",
")",
"{",
"return",
"sendMessageBatchAsync",
"(",
"new",
"SendMessageBatchRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withEntries",
"(",
"entries",
")",
")",
";",
"}"
] |
Simplified method form for invoking the SendMessageBatch operation.
@see #sendMessageBatchAsync(SendMessageBatchRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"SendMessageBatch",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L608-L612
|
19,649
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.sendMessageBatchAsync
|
@Override
public java.util.concurrent.Future<SendMessageBatchResult> sendMessageBatchAsync(String queueUrl, java.util.List<SendMessageBatchRequestEntry> entries,
com.amazonaws.handlers.AsyncHandler<SendMessageBatchRequest, SendMessageBatchResult> asyncHandler) {
return sendMessageBatchAsync(new SendMessageBatchRequest().withQueueUrl(queueUrl).withEntries(entries), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<SendMessageBatchResult> sendMessageBatchAsync(String queueUrl, java.util.List<SendMessageBatchRequestEntry> entries,
com.amazonaws.handlers.AsyncHandler<SendMessageBatchRequest, SendMessageBatchResult> asyncHandler) {
return sendMessageBatchAsync(new SendMessageBatchRequest().withQueueUrl(queueUrl).withEntries(entries), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"SendMessageBatchResult",
">",
"sendMessageBatchAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"List",
"<",
"SendMessageBatchRequestEntry",
">",
"entries",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"SendMessageBatchRequest",
",",
"SendMessageBatchResult",
">",
"asyncHandler",
")",
"{",
"return",
"sendMessageBatchAsync",
"(",
"new",
"SendMessageBatchRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withEntries",
"(",
"entries",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the SendMessageBatch operation with an AsyncHandler.
@see #sendMessageBatchAsync(SendMessageBatchRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"SendMessageBatch",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L619-L624
|
19,650
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.setQueueAttributesAsync
|
@Override
public java.util.concurrent.Future<SetQueueAttributesResult> setQueueAttributesAsync(String queueUrl, java.util.Map<String, String> attributes) {
return setQueueAttributesAsync(new SetQueueAttributesRequest().withQueueUrl(queueUrl).withAttributes(attributes));
}
|
java
|
@Override
public java.util.concurrent.Future<SetQueueAttributesResult> setQueueAttributesAsync(String queueUrl, java.util.Map<String, String> attributes) {
return setQueueAttributesAsync(new SetQueueAttributesRequest().withQueueUrl(queueUrl).withAttributes(attributes));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"SetQueueAttributesResult",
">",
"setQueueAttributesAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"return",
"setQueueAttributesAsync",
"(",
"new",
"SetQueueAttributesRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withAttributes",
"(",
"attributes",
")",
")",
";",
"}"
] |
Simplified method form for invoking the SetQueueAttributes operation.
@see #setQueueAttributesAsync(SetQueueAttributesRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"SetQueueAttributes",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L644-L648
|
19,651
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.setQueueAttributesAsync
|
@Override
public java.util.concurrent.Future<SetQueueAttributesResult> setQueueAttributesAsync(String queueUrl, java.util.Map<String, String> attributes,
com.amazonaws.handlers.AsyncHandler<SetQueueAttributesRequest, SetQueueAttributesResult> asyncHandler) {
return setQueueAttributesAsync(new SetQueueAttributesRequest().withQueueUrl(queueUrl).withAttributes(attributes), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<SetQueueAttributesResult> setQueueAttributesAsync(String queueUrl, java.util.Map<String, String> attributes,
com.amazonaws.handlers.AsyncHandler<SetQueueAttributesRequest, SetQueueAttributesResult> asyncHandler) {
return setQueueAttributesAsync(new SetQueueAttributesRequest().withQueueUrl(queueUrl).withAttributes(attributes), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"SetQueueAttributesResult",
">",
"setQueueAttributesAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"SetQueueAttributesRequest",
",",
"SetQueueAttributesResult",
">",
"asyncHandler",
")",
"{",
"return",
"setQueueAttributesAsync",
"(",
"new",
"SetQueueAttributesRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withAttributes",
"(",
"attributes",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the SetQueueAttributes operation with an AsyncHandler.
@see #setQueueAttributesAsync(SetQueueAttributesRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"SetQueueAttributes",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L655-L660
|
19,652
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.tagQueueAsync
|
@Override
public java.util.concurrent.Future<TagQueueResult> tagQueueAsync(String queueUrl, java.util.Map<String, String> tags) {
return tagQueueAsync(new TagQueueRequest().withQueueUrl(queueUrl).withTags(tags));
}
|
java
|
@Override
public java.util.concurrent.Future<TagQueueResult> tagQueueAsync(String queueUrl, java.util.Map<String, String> tags) {
return tagQueueAsync(new TagQueueRequest().withQueueUrl(queueUrl).withTags(tags));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"TagQueueResult",
">",
"tagQueueAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"tagQueueAsync",
"(",
"new",
"TagQueueRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withTags",
"(",
"tags",
")",
")",
";",
"}"
] |
Simplified method form for invoking the TagQueue operation.
@see #tagQueueAsync(TagQueueRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"TagQueue",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L680-L684
|
19,653
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.tagQueueAsync
|
@Override
public java.util.concurrent.Future<TagQueueResult> tagQueueAsync(String queueUrl, java.util.Map<String, String> tags,
com.amazonaws.handlers.AsyncHandler<TagQueueRequest, TagQueueResult> asyncHandler) {
return tagQueueAsync(new TagQueueRequest().withQueueUrl(queueUrl).withTags(tags), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<TagQueueResult> tagQueueAsync(String queueUrl, java.util.Map<String, String> tags,
com.amazonaws.handlers.AsyncHandler<TagQueueRequest, TagQueueResult> asyncHandler) {
return tagQueueAsync(new TagQueueRequest().withQueueUrl(queueUrl).withTags(tags), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"TagQueueResult",
">",
"tagQueueAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"TagQueueRequest",
",",
"TagQueueResult",
">",
"asyncHandler",
")",
"{",
"return",
"tagQueueAsync",
"(",
"new",
"TagQueueRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withTags",
"(",
"tags",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the TagQueue operation with an AsyncHandler.
@see #tagQueueAsync(TagQueueRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"TagQueue",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L691-L696
|
19,654
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.untagQueueAsync
|
@Override
public java.util.concurrent.Future<UntagQueueResult> untagQueueAsync(String queueUrl, java.util.List<String> tagKeys) {
return untagQueueAsync(new UntagQueueRequest().withQueueUrl(queueUrl).withTagKeys(tagKeys));
}
|
java
|
@Override
public java.util.concurrent.Future<UntagQueueResult> untagQueueAsync(String queueUrl, java.util.List<String> tagKeys) {
return untagQueueAsync(new UntagQueueRequest().withQueueUrl(queueUrl).withTagKeys(tagKeys));
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"UntagQueueResult",
">",
"untagQueueAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"tagKeys",
")",
"{",
"return",
"untagQueueAsync",
"(",
"new",
"UntagQueueRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withTagKeys",
"(",
"tagKeys",
")",
")",
";",
"}"
] |
Simplified method form for invoking the UntagQueue operation.
@see #untagQueueAsync(UntagQueueRequest)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"UntagQueue",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L716-L720
|
19,655
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java
|
AbstractAmazonSQSAsync.untagQueueAsync
|
@Override
public java.util.concurrent.Future<UntagQueueResult> untagQueueAsync(String queueUrl, java.util.List<String> tagKeys,
com.amazonaws.handlers.AsyncHandler<UntagQueueRequest, UntagQueueResult> asyncHandler) {
return untagQueueAsync(new UntagQueueRequest().withQueueUrl(queueUrl).withTagKeys(tagKeys), asyncHandler);
}
|
java
|
@Override
public java.util.concurrent.Future<UntagQueueResult> untagQueueAsync(String queueUrl, java.util.List<String> tagKeys,
com.amazonaws.handlers.AsyncHandler<UntagQueueRequest, UntagQueueResult> asyncHandler) {
return untagQueueAsync(new UntagQueueRequest().withQueueUrl(queueUrl).withTagKeys(tagKeys), asyncHandler);
}
|
[
"@",
"Override",
"public",
"java",
".",
"util",
".",
"concurrent",
".",
"Future",
"<",
"UntagQueueResult",
">",
"untagQueueAsync",
"(",
"String",
"queueUrl",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"tagKeys",
",",
"com",
".",
"amazonaws",
".",
"handlers",
".",
"AsyncHandler",
"<",
"UntagQueueRequest",
",",
"UntagQueueResult",
">",
"asyncHandler",
")",
"{",
"return",
"untagQueueAsync",
"(",
"new",
"UntagQueueRequest",
"(",
")",
".",
"withQueueUrl",
"(",
"queueUrl",
")",
".",
"withTagKeys",
"(",
"tagKeys",
")",
",",
"asyncHandler",
")",
";",
"}"
] |
Simplified method form for invoking the UntagQueue operation with an AsyncHandler.
@see #untagQueueAsync(UntagQueueRequest, com.amazonaws.handlers.AsyncHandler)
|
[
"Simplified",
"method",
"form",
"for",
"invoking",
"the",
"UntagQueue",
"operation",
"with",
"an",
"AsyncHandler",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/AbstractAmazonSQSAsync.java#L727-L732
|
19,656
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java
|
ShapeModel.tryFindMemberModelByC2jName
|
private MemberModel tryFindMemberModelByC2jName(String memberC2jName, boolean ignoreCase) {
final List<MemberModel> memberModels = getMembers();
final String expectedName = ignoreCase ? StringUtils.lowerCase(memberC2jName)
: memberC2jName;
if (memberModels != null) {
for (MemberModel member : memberModels) {
String actualName = ignoreCase ? StringUtils.lowerCase(member.getC2jName())
: member.getC2jName();
if (expectedName.equals(actualName)) {
return member;
}
}
}
return null;
}
|
java
|
private MemberModel tryFindMemberModelByC2jName(String memberC2jName, boolean ignoreCase) {
final List<MemberModel> memberModels = getMembers();
final String expectedName = ignoreCase ? StringUtils.lowerCase(memberC2jName)
: memberC2jName;
if (memberModels != null) {
for (MemberModel member : memberModels) {
String actualName = ignoreCase ? StringUtils.lowerCase(member.getC2jName())
: member.getC2jName();
if (expectedName.equals(actualName)) {
return member;
}
}
}
return null;
}
|
[
"private",
"MemberModel",
"tryFindMemberModelByC2jName",
"(",
"String",
"memberC2jName",
",",
"boolean",
"ignoreCase",
")",
"{",
"final",
"List",
"<",
"MemberModel",
">",
"memberModels",
"=",
"getMembers",
"(",
")",
";",
"final",
"String",
"expectedName",
"=",
"ignoreCase",
"?",
"StringUtils",
".",
"lowerCase",
"(",
"memberC2jName",
")",
":",
"memberC2jName",
";",
"if",
"(",
"memberModels",
"!=",
"null",
")",
"{",
"for",
"(",
"MemberModel",
"member",
":",
"memberModels",
")",
"{",
"String",
"actualName",
"=",
"ignoreCase",
"?",
"StringUtils",
".",
"lowerCase",
"(",
"member",
".",
"getC2jName",
"(",
")",
")",
":",
"member",
".",
"getC2jName",
"(",
")",
";",
"if",
"(",
"expectedName",
".",
"equals",
"(",
"actualName",
")",
")",
"{",
"return",
"member",
";",
"}",
"}",
"}",
"return",
"null",
";",
"}"
] |
Tries to find the member model associated with the given c2j member name from this shape
model. Returns the member model if present else returns null.
|
[
"Tries",
"to",
"find",
"the",
"member",
"model",
"associated",
"with",
"the",
"given",
"c2j",
"member",
"name",
"from",
"this",
"shape",
"model",
".",
"Returns",
"the",
"member",
"model",
"if",
"present",
"else",
"returns",
"null",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java#L353-L370
|
19,657
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java
|
ShapeModel.findMemberModelByC2jName
|
public MemberModel findMemberModelByC2jName(String memberC2jName) {
MemberModel model = tryFindMemberModelByC2jName(memberC2jName, false);
if (model == null) {
throw new IllegalArgumentException(memberC2jName + " member (c2j name) does not exist in the shape.");
}
return model;
}
|
java
|
public MemberModel findMemberModelByC2jName(String memberC2jName) {
MemberModel model = tryFindMemberModelByC2jName(memberC2jName, false);
if (model == null) {
throw new IllegalArgumentException(memberC2jName + " member (c2j name) does not exist in the shape.");
}
return model;
}
|
[
"public",
"MemberModel",
"findMemberModelByC2jName",
"(",
"String",
"memberC2jName",
")",
"{",
"MemberModel",
"model",
"=",
"tryFindMemberModelByC2jName",
"(",
"memberC2jName",
",",
"false",
")",
";",
"if",
"(",
"model",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"memberC2jName",
"+",
"\" member (c2j name) does not exist in the shape.\"",
")",
";",
"}",
"return",
"model",
";",
"}"
] |
Returns the member model associated with the given c2j member name from this shape model.
|
[
"Returns",
"the",
"member",
"model",
"associated",
"with",
"the",
"given",
"c2j",
"member",
"name",
"from",
"this",
"shape",
"model",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java#L375-L384
|
19,658
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java
|
ShapeModel.removeMemberByC2jName
|
public boolean removeMemberByC2jName(String memberC2jName, boolean ignoreCase) {
// Implicitly depending on the default equals and hashcode
// implementation of the class MemberModel
MemberModel model = tryFindMemberModelByC2jName(memberC2jName, ignoreCase);
return model == null ? false : members.remove(model);
}
|
java
|
public boolean removeMemberByC2jName(String memberC2jName, boolean ignoreCase) {
// Implicitly depending on the default equals and hashcode
// implementation of the class MemberModel
MemberModel model = tryFindMemberModelByC2jName(memberC2jName, ignoreCase);
return model == null ? false : members.remove(model);
}
|
[
"public",
"boolean",
"removeMemberByC2jName",
"(",
"String",
"memberC2jName",
",",
"boolean",
"ignoreCase",
")",
"{",
"// Implicitly depending on the default equals and hashcode",
"// implementation of the class MemberModel",
"MemberModel",
"model",
"=",
"tryFindMemberModelByC2jName",
"(",
"memberC2jName",
",",
"ignoreCase",
")",
";",
"return",
"model",
"==",
"null",
"?",
"false",
":",
"members",
".",
"remove",
"(",
"model",
")",
";",
"}"
] |
Takes in the c2j member name as input and removes if the shape contains a member with the
given name. Return false otherwise.
|
[
"Takes",
"in",
"the",
"c2j",
"member",
"name",
"as",
"input",
"and",
"removes",
"if",
"the",
"shape",
"contains",
"a",
"member",
"with",
"the",
"given",
"name",
".",
"Return",
"false",
"otherwise",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java#L390-L395
|
19,659
|
aws/aws-sdk-java
|
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java
|
ShapeModel.findEnumModelByValue
|
public EnumModel findEnumModelByValue(String enumValue) {
if (enums != null) {
for (EnumModel enumModel : enums) {
if (enumValue.equals(enumModel.getValue())) {
return enumModel;
}
}
}
return null;
}
|
java
|
public EnumModel findEnumModelByValue(String enumValue) {
if (enums != null) {
for (EnumModel enumModel : enums) {
if (enumValue.equals(enumModel.getValue())) {
return enumModel;
}
}
}
return null;
}
|
[
"public",
"EnumModel",
"findEnumModelByValue",
"(",
"String",
"enumValue",
")",
"{",
"if",
"(",
"enums",
"!=",
"null",
")",
"{",
"for",
"(",
"EnumModel",
"enumModel",
":",
"enums",
")",
"{",
"if",
"(",
"enumValue",
".",
"equals",
"(",
"enumModel",
".",
"getValue",
"(",
")",
")",
")",
"{",
"return",
"enumModel",
";",
"}",
"}",
"}",
"return",
"null",
";",
"}"
] |
Returns the enum model for the given enum value.
Returns null if no such enum value exists.
|
[
"Returns",
"the",
"enum",
"model",
"for",
"the",
"given",
"enum",
"value",
".",
"Returns",
"null",
"if",
"no",
"such",
"enum",
"value",
"exists",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java#L401-L411
|
19,660
|
aws/aws-sdk-java
|
aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointBatchRequest.java
|
EndpointBatchRequest.setItem
|
public void setItem(java.util.Collection<EndpointBatchItem> item) {
if (item == null) {
this.item = null;
return;
}
this.item = new java.util.ArrayList<EndpointBatchItem>(item);
}
|
java
|
public void setItem(java.util.Collection<EndpointBatchItem> item) {
if (item == null) {
this.item = null;
return;
}
this.item = new java.util.ArrayList<EndpointBatchItem>(item);
}
|
[
"public",
"void",
"setItem",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"EndpointBatchItem",
">",
"item",
")",
"{",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"this",
".",
"item",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"item",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"EndpointBatchItem",
">",
"(",
"item",
")",
";",
"}"
] |
List of items to update. Maximum 100 items
@param item
List of items to update. Maximum 100 items
|
[
"List",
"of",
"items",
"to",
"update",
".",
"Maximum",
"100",
"items"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointBatchRequest.java#L49-L56
|
19,661
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java
|
TableKeysAndAttributes.withPrimaryKeys
|
public TableKeysAndAttributes withPrimaryKeys(PrimaryKey... primaryKeys) {
if (primaryKeys == null)
this.primaryKeys = null;
else {
Set<String> pkNameSet = null;
for (PrimaryKey pk : primaryKeys) {
if (pkNameSet == null)
pkNameSet = pk.getComponentNameSet();
else {
if (!pkNameSet.equals(pk.getComponentNameSet())) {
throw new IllegalArgumentException(
"primary key attribute names must be consistent for the specified primary keys");
}
}
}
this.primaryKeys = new ArrayList<PrimaryKey>(Arrays.asList(primaryKeys));
}
return this;
}
|
java
|
public TableKeysAndAttributes withPrimaryKeys(PrimaryKey... primaryKeys) {
if (primaryKeys == null)
this.primaryKeys = null;
else {
Set<String> pkNameSet = null;
for (PrimaryKey pk : primaryKeys) {
if (pkNameSet == null)
pkNameSet = pk.getComponentNameSet();
else {
if (!pkNameSet.equals(pk.getComponentNameSet())) {
throw new IllegalArgumentException(
"primary key attribute names must be consistent for the specified primary keys");
}
}
}
this.primaryKeys = new ArrayList<PrimaryKey>(Arrays.asList(primaryKeys));
}
return this;
}
|
[
"public",
"TableKeysAndAttributes",
"withPrimaryKeys",
"(",
"PrimaryKey",
"...",
"primaryKeys",
")",
"{",
"if",
"(",
"primaryKeys",
"==",
"null",
")",
"this",
".",
"primaryKeys",
"=",
"null",
";",
"else",
"{",
"Set",
"<",
"String",
">",
"pkNameSet",
"=",
"null",
";",
"for",
"(",
"PrimaryKey",
"pk",
":",
"primaryKeys",
")",
"{",
"if",
"(",
"pkNameSet",
"==",
"null",
")",
"pkNameSet",
"=",
"pk",
".",
"getComponentNameSet",
"(",
")",
";",
"else",
"{",
"if",
"(",
"!",
"pkNameSet",
".",
"equals",
"(",
"pk",
".",
"getComponentNameSet",
"(",
")",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"primary key attribute names must be consistent for the specified primary keys\"",
")",
";",
"}",
"}",
"}",
"this",
".",
"primaryKeys",
"=",
"new",
"ArrayList",
"<",
"PrimaryKey",
">",
"(",
"Arrays",
".",
"asList",
"(",
"primaryKeys",
")",
")",
";",
"}",
"return",
"this",
";",
"}"
] |
Used to specify multiple primary keys. A primary key could consist of
either a hash-key or both a hash-key and a range-key depending on the
schema of the table.
|
[
"Used",
"to",
"specify",
"multiple",
"primary",
"keys",
".",
"A",
"primary",
"key",
"could",
"consist",
"of",
"either",
"a",
"hash",
"-",
"key",
"or",
"both",
"a",
"hash",
"-",
"key",
"and",
"a",
"range",
"-",
"key",
"depending",
"on",
"the",
"schema",
"of",
"the",
"table",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java#L59-L77
|
19,662
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java
|
TableKeysAndAttributes.withHashOnlyKeys
|
public TableKeysAndAttributes withHashOnlyKeys(String hashKeyName, Object ... hashKeyValues) {
if (hashKeyName == null)
throw new IllegalArgumentException();
PrimaryKey[] primaryKeys = new PrimaryKey[hashKeyValues.length];
for (int i=0; i < hashKeyValues.length; i++)
primaryKeys[i] = new PrimaryKey(hashKeyName, hashKeyValues[i]);
return withPrimaryKeys(primaryKeys);
}
|
java
|
public TableKeysAndAttributes withHashOnlyKeys(String hashKeyName, Object ... hashKeyValues) {
if (hashKeyName == null)
throw new IllegalArgumentException();
PrimaryKey[] primaryKeys = new PrimaryKey[hashKeyValues.length];
for (int i=0; i < hashKeyValues.length; i++)
primaryKeys[i] = new PrimaryKey(hashKeyName, hashKeyValues[i]);
return withPrimaryKeys(primaryKeys);
}
|
[
"public",
"TableKeysAndAttributes",
"withHashOnlyKeys",
"(",
"String",
"hashKeyName",
",",
"Object",
"...",
"hashKeyValues",
")",
"{",
"if",
"(",
"hashKeyName",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"PrimaryKey",
"[",
"]",
"primaryKeys",
"=",
"new",
"PrimaryKey",
"[",
"hashKeyValues",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"hashKeyValues",
".",
"length",
";",
"i",
"++",
")",
"primaryKeys",
"[",
"i",
"]",
"=",
"new",
"PrimaryKey",
"(",
"hashKeyName",
",",
"hashKeyValues",
"[",
"i",
"]",
")",
";",
"return",
"withPrimaryKeys",
"(",
"primaryKeys",
")",
";",
"}"
] |
Used to specify multiple hash-only primary keys.
@param hashKeyName hash-only key name
@param hashKeyValues a list of hash key values
|
[
"Used",
"to",
"specify",
"multiple",
"hash",
"-",
"only",
"primary",
"keys",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java#L84-L91
|
19,663
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java
|
TableKeysAndAttributes.withHashAndRangeKeys
|
public TableKeysAndAttributes withHashAndRangeKeys(
String hashKeyName, String rangeKeyName,
Object... alternatingHashAndRangeKeyValues) {
if (hashKeyName == null)
throw new IllegalArgumentException("hash key name must be specified");
if (rangeKeyName == null)
throw new IllegalArgumentException("range key name must be specified");
if (alternatingHashAndRangeKeyValues.length % 2 != 0)
throw new IllegalArgumentException("number of hash and range key values must be the same");
final int len = alternatingHashAndRangeKeyValues.length / 2;
PrimaryKey[] primaryKeys = new PrimaryKey[len];
for (int i=0; i < alternatingHashAndRangeKeyValues.length; i += 2) {
primaryKeys[i >> 1] = new PrimaryKey(
hashKeyName, alternatingHashAndRangeKeyValues[i],
rangeKeyName, alternatingHashAndRangeKeyValues[i+1]);
}
return withPrimaryKeys(primaryKeys);
}
|
java
|
public TableKeysAndAttributes withHashAndRangeKeys(
String hashKeyName, String rangeKeyName,
Object... alternatingHashAndRangeKeyValues) {
if (hashKeyName == null)
throw new IllegalArgumentException("hash key name must be specified");
if (rangeKeyName == null)
throw new IllegalArgumentException("range key name must be specified");
if (alternatingHashAndRangeKeyValues.length % 2 != 0)
throw new IllegalArgumentException("number of hash and range key values must be the same");
final int len = alternatingHashAndRangeKeyValues.length / 2;
PrimaryKey[] primaryKeys = new PrimaryKey[len];
for (int i=0; i < alternatingHashAndRangeKeyValues.length; i += 2) {
primaryKeys[i >> 1] = new PrimaryKey(
hashKeyName, alternatingHashAndRangeKeyValues[i],
rangeKeyName, alternatingHashAndRangeKeyValues[i+1]);
}
return withPrimaryKeys(primaryKeys);
}
|
[
"public",
"TableKeysAndAttributes",
"withHashAndRangeKeys",
"(",
"String",
"hashKeyName",
",",
"String",
"rangeKeyName",
",",
"Object",
"...",
"alternatingHashAndRangeKeyValues",
")",
"{",
"if",
"(",
"hashKeyName",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"hash key name must be specified\"",
")",
";",
"if",
"(",
"rangeKeyName",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"range key name must be specified\"",
")",
";",
"if",
"(",
"alternatingHashAndRangeKeyValues",
".",
"length",
"%",
"2",
"!=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"number of hash and range key values must be the same\"",
")",
";",
"final",
"int",
"len",
"=",
"alternatingHashAndRangeKeyValues",
".",
"length",
"/",
"2",
";",
"PrimaryKey",
"[",
"]",
"primaryKeys",
"=",
"new",
"PrimaryKey",
"[",
"len",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"alternatingHashAndRangeKeyValues",
".",
"length",
";",
"i",
"+=",
"2",
")",
"{",
"primaryKeys",
"[",
"i",
">>",
"1",
"]",
"=",
"new",
"PrimaryKey",
"(",
"hashKeyName",
",",
"alternatingHashAndRangeKeyValues",
"[",
"i",
"]",
",",
"rangeKeyName",
",",
"alternatingHashAndRangeKeyValues",
"[",
"i",
"+",
"1",
"]",
")",
";",
"}",
"return",
"withPrimaryKeys",
"(",
"primaryKeys",
")",
";",
"}"
] |
Used to specify multiple hash-and-range primary keys.
@param hashKeyName
hash key name
@param rangeKeyName
range key name
@param alternatingHashAndRangeKeyValues
a list of alternating hash key value and range key value
|
[
"Used",
"to",
"specify",
"multiple",
"hash",
"-",
"and",
"-",
"range",
"primary",
"keys",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java#L103-L120
|
19,664
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java
|
TableKeysAndAttributes.addPrimaryKey
|
public TableKeysAndAttributes addPrimaryKey(PrimaryKey primaryKey) {
if (primaryKey != null) {
if (primaryKeys == null)
primaryKeys = new ArrayList<PrimaryKey>();
checkConsistency(primaryKey);
this.primaryKeys.add(primaryKey);
}
return this;
}
|
java
|
public TableKeysAndAttributes addPrimaryKey(PrimaryKey primaryKey) {
if (primaryKey != null) {
if (primaryKeys == null)
primaryKeys = new ArrayList<PrimaryKey>();
checkConsistency(primaryKey);
this.primaryKeys.add(primaryKey);
}
return this;
}
|
[
"public",
"TableKeysAndAttributes",
"addPrimaryKey",
"(",
"PrimaryKey",
"primaryKey",
")",
"{",
"if",
"(",
"primaryKey",
"!=",
"null",
")",
"{",
"if",
"(",
"primaryKeys",
"==",
"null",
")",
"primaryKeys",
"=",
"new",
"ArrayList",
"<",
"PrimaryKey",
">",
"(",
")",
";",
"checkConsistency",
"(",
"primaryKey",
")",
";",
"this",
".",
"primaryKeys",
".",
"add",
"(",
"primaryKey",
")",
";",
"}",
"return",
"this",
";",
"}"
] |
Adds a primary key to be included in the batch get-item operation. A
primary key could consist of either a hash-key or both a
hash-key and a range-key depending on the schema of the table.
|
[
"Adds",
"a",
"primary",
"key",
"to",
"be",
"included",
"in",
"the",
"batch",
"get",
"-",
"item",
"operation",
".",
"A",
"primary",
"key",
"could",
"consist",
"of",
"either",
"a",
"hash",
"-",
"key",
"or",
"both",
"a",
"hash",
"-",
"key",
"and",
"a",
"range",
"-",
"key",
"depending",
"on",
"the",
"schema",
"of",
"the",
"table",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java#L127-L135
|
19,665
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java
|
TableKeysAndAttributes.addHashOnlyPrimaryKey
|
public TableKeysAndAttributes addHashOnlyPrimaryKey(
String hashKeyName, Object hashKeyValue) {
this.addPrimaryKey(new PrimaryKey(hashKeyName, hashKeyValue));
return this;
}
|
java
|
public TableKeysAndAttributes addHashOnlyPrimaryKey(
String hashKeyName, Object hashKeyValue) {
this.addPrimaryKey(new PrimaryKey(hashKeyName, hashKeyValue));
return this;
}
|
[
"public",
"TableKeysAndAttributes",
"addHashOnlyPrimaryKey",
"(",
"String",
"hashKeyName",
",",
"Object",
"hashKeyValue",
")",
"{",
"this",
".",
"addPrimaryKey",
"(",
"new",
"PrimaryKey",
"(",
"hashKeyName",
",",
"hashKeyValue",
")",
")",
";",
"return",
"this",
";",
"}"
] |
Adds a hash-only primary key to be included in the batch get-item
operation.
@param hashKeyName name of the hash key attribute name
@param hashKeyValue name of the hash key value
@return the current instance for method chaining purposes
|
[
"Adds",
"a",
"hash",
"-",
"only",
"primary",
"key",
"to",
"be",
"included",
"in",
"the",
"batch",
"get",
"-",
"item",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java#L155-L159
|
19,666
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java
|
TableKeysAndAttributes.addHashOnlyPrimaryKeys
|
public TableKeysAndAttributes addHashOnlyPrimaryKeys(String hashKeyName,
Object ... hashKeyValues) {
for (Object hashKeyValue: hashKeyValues) {
this.addPrimaryKey(new PrimaryKey(hashKeyName, hashKeyValue));
}
return this;
}
|
java
|
public TableKeysAndAttributes addHashOnlyPrimaryKeys(String hashKeyName,
Object ... hashKeyValues) {
for (Object hashKeyValue: hashKeyValues) {
this.addPrimaryKey(new PrimaryKey(hashKeyName, hashKeyValue));
}
return this;
}
|
[
"public",
"TableKeysAndAttributes",
"addHashOnlyPrimaryKeys",
"(",
"String",
"hashKeyName",
",",
"Object",
"...",
"hashKeyValues",
")",
"{",
"for",
"(",
"Object",
"hashKeyValue",
":",
"hashKeyValues",
")",
"{",
"this",
".",
"addPrimaryKey",
"(",
"new",
"PrimaryKey",
"(",
"hashKeyName",
",",
"hashKeyValue",
")",
")",
";",
"}",
"return",
"this",
";",
"}"
] |
Adds multiple hash-only primary keys to be included in the batch get-item
operation.
@param hashKeyName name of the hash key attribute name
@param hashKeyValues multiple hash key values
@return the current instance for method chaining purposes
|
[
"Adds",
"multiple",
"hash",
"-",
"only",
"primary",
"keys",
"to",
"be",
"included",
"in",
"the",
"batch",
"get",
"-",
"item",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java#L169-L175
|
19,667
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java
|
TableKeysAndAttributes.addHashAndRangePrimaryKeys
|
public TableKeysAndAttributes addHashAndRangePrimaryKeys(
String hashKeyName, String rangeKeyName,
Object ... alternatingHashRangeKeyValues) {
if (alternatingHashRangeKeyValues.length % 2 != 0) {
throw new IllegalArgumentException(
"The multiple hash and range key values must alternate");
}
for (int i =0; i < alternatingHashRangeKeyValues.length; i+=2) {
Object hashKeyValue = alternatingHashRangeKeyValues[i];
Object rangeKeyValue = alternatingHashRangeKeyValues[i+1];
this.addPrimaryKey(
new PrimaryKey()
.addComponent(hashKeyName, hashKeyValue)
.addComponent(rangeKeyName, rangeKeyValue)
);
}
return this;
}
|
java
|
public TableKeysAndAttributes addHashAndRangePrimaryKeys(
String hashKeyName, String rangeKeyName,
Object ... alternatingHashRangeKeyValues) {
if (alternatingHashRangeKeyValues.length % 2 != 0) {
throw new IllegalArgumentException(
"The multiple hash and range key values must alternate");
}
for (int i =0; i < alternatingHashRangeKeyValues.length; i+=2) {
Object hashKeyValue = alternatingHashRangeKeyValues[i];
Object rangeKeyValue = alternatingHashRangeKeyValues[i+1];
this.addPrimaryKey(
new PrimaryKey()
.addComponent(hashKeyName, hashKeyValue)
.addComponent(rangeKeyName, rangeKeyValue)
);
}
return this;
}
|
[
"public",
"TableKeysAndAttributes",
"addHashAndRangePrimaryKeys",
"(",
"String",
"hashKeyName",
",",
"String",
"rangeKeyName",
",",
"Object",
"...",
"alternatingHashRangeKeyValues",
")",
"{",
"if",
"(",
"alternatingHashRangeKeyValues",
".",
"length",
"%",
"2",
"!=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The multiple hash and range key values must alternate\"",
")",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"alternatingHashRangeKeyValues",
".",
"length",
";",
"i",
"+=",
"2",
")",
"{",
"Object",
"hashKeyValue",
"=",
"alternatingHashRangeKeyValues",
"[",
"i",
"]",
";",
"Object",
"rangeKeyValue",
"=",
"alternatingHashRangeKeyValues",
"[",
"i",
"+",
"1",
"]",
";",
"this",
".",
"addPrimaryKey",
"(",
"new",
"PrimaryKey",
"(",
")",
".",
"addComponent",
"(",
"hashKeyName",
",",
"hashKeyValue",
")",
".",
"addComponent",
"(",
"rangeKeyName",
",",
"rangeKeyValue",
")",
")",
";",
"}",
"return",
"this",
";",
"}"
] |
Adds multiple hash-and-range primary keys to be included in the batch
get-item operation.
@param hashKeyName
name of the hash key attribute name
@param rangeKeyName
name of the range key attribute name
@param alternatingHashRangeKeyValues
used to specify multiple alternating hash key and range key
values
@return the current instance for method chaining purposes
|
[
"Adds",
"multiple",
"hash",
"-",
"and",
"-",
"range",
"primary",
"keys",
"to",
"be",
"included",
"in",
"the",
"batch",
"get",
"-",
"item",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java#L190-L207
|
19,668
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java
|
TableKeysAndAttributes.withAttributeNames
|
public TableKeysAndAttributes withAttributeNames(String ... attributeNames) {
if (attributeNames == null)
this.attributeNames = null;
else
this.attributeNames = Collections.unmodifiableSet(
new LinkedHashSet<String>(Arrays.asList(attributeNames)));
return this;
}
|
java
|
public TableKeysAndAttributes withAttributeNames(String ... attributeNames) {
if (attributeNames == null)
this.attributeNames = null;
else
this.attributeNames = Collections.unmodifiableSet(
new LinkedHashSet<String>(Arrays.asList(attributeNames)));
return this;
}
|
[
"public",
"TableKeysAndAttributes",
"withAttributeNames",
"(",
"String",
"...",
"attributeNames",
")",
"{",
"if",
"(",
"attributeNames",
"==",
"null",
")",
"this",
".",
"attributeNames",
"=",
"null",
";",
"else",
"this",
".",
"attributeNames",
"=",
"Collections",
".",
"unmodifiableSet",
"(",
"new",
"LinkedHashSet",
"<",
"String",
">",
"(",
"Arrays",
".",
"asList",
"(",
"attributeNames",
")",
")",
")",
";",
"return",
"this",
";",
"}"
] |
Used to specify the attributes to be retrieved in each item returned
from the batch get-item operation.
@param attributeNames names of the attributes to be retrieved in each
item returned from the batch get-item operation.
@return the current instance for method chaining purposes
|
[
"Used",
"to",
"specify",
"the",
"attributes",
"to",
"be",
"retrieved",
"in",
"each",
"item",
"returned",
"from",
"the",
"batch",
"get",
"-",
"item",
"operation",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java#L249-L256
|
19,669
|
aws/aws-sdk-java
|
aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/waiters/AWSOpsWorksWaiters.java
|
AWSOpsWorksWaiters.appExists
|
public Waiter<DescribeAppsRequest> appExists() {
return new WaiterBuilder<DescribeAppsRequest, DescribeAppsResult>().withSdkFunction(new DescribeAppsFunction(client))
.withAcceptors(new HttpSuccessStatusAcceptor(WaiterState.SUCCESS), new HttpFailureStatusAcceptor(400, WaiterState.FAILURE))
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(1)))
.withExecutorService(executorService).build();
}
|
java
|
public Waiter<DescribeAppsRequest> appExists() {
return new WaiterBuilder<DescribeAppsRequest, DescribeAppsResult>().withSdkFunction(new DescribeAppsFunction(client))
.withAcceptors(new HttpSuccessStatusAcceptor(WaiterState.SUCCESS), new HttpFailureStatusAcceptor(400, WaiterState.FAILURE))
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(1)))
.withExecutorService(executorService).build();
}
|
[
"public",
"Waiter",
"<",
"DescribeAppsRequest",
">",
"appExists",
"(",
")",
"{",
"return",
"new",
"WaiterBuilder",
"<",
"DescribeAppsRequest",
",",
"DescribeAppsResult",
">",
"(",
")",
".",
"withSdkFunction",
"(",
"new",
"DescribeAppsFunction",
"(",
"client",
")",
")",
".",
"withAcceptors",
"(",
"new",
"HttpSuccessStatusAcceptor",
"(",
"WaiterState",
".",
"SUCCESS",
")",
",",
"new",
"HttpFailureStatusAcceptor",
"(",
"400",
",",
"WaiterState",
".",
"FAILURE",
")",
")",
".",
"withDefaultPollingStrategy",
"(",
"new",
"PollingStrategy",
"(",
"new",
"MaxAttemptsRetryStrategy",
"(",
"40",
")",
",",
"new",
"FixedDelayStrategy",
"(",
"1",
")",
")",
")",
".",
"withExecutorService",
"(",
"executorService",
")",
".",
"build",
"(",
")",
";",
"}"
] |
Builds a AppExists 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",
"AppExists",
"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-opsworks/src/main/java/com/amazonaws/services/opsworks/waiters/AWSOpsWorksWaiters.java#L69-L75
|
19,670
|
aws/aws-sdk-java
|
aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/waiters/AWSOpsWorksWaiters.java
|
AWSOpsWorksWaiters.instanceOnline
|
public Waiter<DescribeInstancesRequest> instanceOnline() {
return new WaiterBuilder<DescribeInstancesRequest, DescribeInstancesResult>()
.withSdkFunction(new DescribeInstancesFunction(client))
.withAcceptors(new InstanceOnline.IsOnlineMatcher(), new InstanceOnline.IsSetup_failedMatcher(), new InstanceOnline.IsShutting_downMatcher(),
new InstanceOnline.IsStart_failedMatcher(), new InstanceOnline.IsStoppedMatcher(), new InstanceOnline.IsStoppingMatcher(),
new InstanceOnline.IsTerminatingMatcher(), new InstanceOnline.IsTerminatedMatcher(), new InstanceOnline.IsStop_failedMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(15)))
.withExecutorService(executorService).build();
}
|
java
|
public Waiter<DescribeInstancesRequest> instanceOnline() {
return new WaiterBuilder<DescribeInstancesRequest, DescribeInstancesResult>()
.withSdkFunction(new DescribeInstancesFunction(client))
.withAcceptors(new InstanceOnline.IsOnlineMatcher(), new InstanceOnline.IsSetup_failedMatcher(), new InstanceOnline.IsShutting_downMatcher(),
new InstanceOnline.IsStart_failedMatcher(), new InstanceOnline.IsStoppedMatcher(), new InstanceOnline.IsStoppingMatcher(),
new InstanceOnline.IsTerminatingMatcher(), new InstanceOnline.IsTerminatedMatcher(), new InstanceOnline.IsStop_failedMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(15)))
.withExecutorService(executorService).build();
}
|
[
"public",
"Waiter",
"<",
"DescribeInstancesRequest",
">",
"instanceOnline",
"(",
")",
"{",
"return",
"new",
"WaiterBuilder",
"<",
"DescribeInstancesRequest",
",",
"DescribeInstancesResult",
">",
"(",
")",
".",
"withSdkFunction",
"(",
"new",
"DescribeInstancesFunction",
"(",
"client",
")",
")",
".",
"withAcceptors",
"(",
"new",
"InstanceOnline",
".",
"IsOnlineMatcher",
"(",
")",
",",
"new",
"InstanceOnline",
".",
"IsSetup_failedMatcher",
"(",
")",
",",
"new",
"InstanceOnline",
".",
"IsShutting_downMatcher",
"(",
")",
",",
"new",
"InstanceOnline",
".",
"IsStart_failedMatcher",
"(",
")",
",",
"new",
"InstanceOnline",
".",
"IsStoppedMatcher",
"(",
")",
",",
"new",
"InstanceOnline",
".",
"IsStoppingMatcher",
"(",
")",
",",
"new",
"InstanceOnline",
".",
"IsTerminatingMatcher",
"(",
")",
",",
"new",
"InstanceOnline",
".",
"IsTerminatedMatcher",
"(",
")",
",",
"new",
"InstanceOnline",
".",
"IsStop_failedMatcher",
"(",
")",
")",
".",
"withDefaultPollingStrategy",
"(",
"new",
"PollingStrategy",
"(",
"new",
"MaxAttemptsRetryStrategy",
"(",
"40",
")",
",",
"new",
"FixedDelayStrategy",
"(",
"15",
")",
")",
")",
".",
"withExecutorService",
"(",
"executorService",
")",
".",
"build",
"(",
")",
";",
"}"
] |
Builds a InstanceOnline 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",
"InstanceOnline",
"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-opsworks/src/main/java/com/amazonaws/services/opsworks/waiters/AWSOpsWorksWaiters.java#L82-L91
|
19,671
|
aws/aws-sdk-java
|
aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/waiters/AWSOpsWorksWaiters.java
|
AWSOpsWorksWaiters.instanceRegistered
|
public Waiter<DescribeInstancesRequest> instanceRegistered() {
return new WaiterBuilder<DescribeInstancesRequest, DescribeInstancesResult>()
.withSdkFunction(new DescribeInstancesFunction(client))
.withAcceptors(new InstanceRegistered.IsRegisteredMatcher(), new InstanceRegistered.IsSetup_failedMatcher(),
new InstanceRegistered.IsShutting_downMatcher(), new InstanceRegistered.IsStoppedMatcher(), new InstanceRegistered.IsStoppingMatcher(),
new InstanceRegistered.IsTerminatingMatcher(), new InstanceRegistered.IsTerminatedMatcher(),
new InstanceRegistered.IsStop_failedMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(15)))
.withExecutorService(executorService).build();
}
|
java
|
public Waiter<DescribeInstancesRequest> instanceRegistered() {
return new WaiterBuilder<DescribeInstancesRequest, DescribeInstancesResult>()
.withSdkFunction(new DescribeInstancesFunction(client))
.withAcceptors(new InstanceRegistered.IsRegisteredMatcher(), new InstanceRegistered.IsSetup_failedMatcher(),
new InstanceRegistered.IsShutting_downMatcher(), new InstanceRegistered.IsStoppedMatcher(), new InstanceRegistered.IsStoppingMatcher(),
new InstanceRegistered.IsTerminatingMatcher(), new InstanceRegistered.IsTerminatedMatcher(),
new InstanceRegistered.IsStop_failedMatcher())
.withDefaultPollingStrategy(new PollingStrategy(new MaxAttemptsRetryStrategy(40), new FixedDelayStrategy(15)))
.withExecutorService(executorService).build();
}
|
[
"public",
"Waiter",
"<",
"DescribeInstancesRequest",
">",
"instanceRegistered",
"(",
")",
"{",
"return",
"new",
"WaiterBuilder",
"<",
"DescribeInstancesRequest",
",",
"DescribeInstancesResult",
">",
"(",
")",
".",
"withSdkFunction",
"(",
"new",
"DescribeInstancesFunction",
"(",
"client",
")",
")",
".",
"withAcceptors",
"(",
"new",
"InstanceRegistered",
".",
"IsRegisteredMatcher",
"(",
")",
",",
"new",
"InstanceRegistered",
".",
"IsSetup_failedMatcher",
"(",
")",
",",
"new",
"InstanceRegistered",
".",
"IsShutting_downMatcher",
"(",
")",
",",
"new",
"InstanceRegistered",
".",
"IsStoppedMatcher",
"(",
")",
",",
"new",
"InstanceRegistered",
".",
"IsStoppingMatcher",
"(",
")",
",",
"new",
"InstanceRegistered",
".",
"IsTerminatingMatcher",
"(",
")",
",",
"new",
"InstanceRegistered",
".",
"IsTerminatedMatcher",
"(",
")",
",",
"new",
"InstanceRegistered",
".",
"IsStop_failedMatcher",
"(",
")",
")",
".",
"withDefaultPollingStrategy",
"(",
"new",
"PollingStrategy",
"(",
"new",
"MaxAttemptsRetryStrategy",
"(",
"40",
")",
",",
"new",
"FixedDelayStrategy",
"(",
"15",
")",
")",
")",
".",
"withExecutorService",
"(",
"executorService",
")",
".",
"build",
"(",
")",
";",
"}"
] |
Builds a InstanceRegistered 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",
"InstanceRegistered",
"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-opsworks/src/main/java/com/amazonaws/services/opsworks/waiters/AWSOpsWorksWaiters.java#L127-L137
|
19,672
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/PresignedUrlDownloadImpl.java
|
PresignedUrlDownloadImpl.setState
|
@Override
public void setState(TransferState state) {
super.setState(state);
switch (state) {
case Completed :
fireProgressEvent(ProgressEventType.TRANSFER_COMPLETED_EVENT);
break;
case Canceled:
fireProgressEvent(ProgressEventType.TRANSFER_CANCELED_EVENT);
break;
case Failed:
fireProgressEvent(ProgressEventType.TRANSFER_FAILED_EVENT);
break;
default:
break;
}
}
|
java
|
@Override
public void setState(TransferState state) {
super.setState(state);
switch (state) {
case Completed :
fireProgressEvent(ProgressEventType.TRANSFER_COMPLETED_EVENT);
break;
case Canceled:
fireProgressEvent(ProgressEventType.TRANSFER_CANCELED_EVENT);
break;
case Failed:
fireProgressEvent(ProgressEventType.TRANSFER_FAILED_EVENT);
break;
default:
break;
}
}
|
[
"@",
"Override",
"public",
"void",
"setState",
"(",
"TransferState",
"state",
")",
"{",
"super",
".",
"setState",
"(",
"state",
")",
";",
"switch",
"(",
"state",
")",
"{",
"case",
"Completed",
":",
"fireProgressEvent",
"(",
"ProgressEventType",
".",
"TRANSFER_COMPLETED_EVENT",
")",
";",
"break",
";",
"case",
"Canceled",
":",
"fireProgressEvent",
"(",
"ProgressEventType",
".",
"TRANSFER_CANCELED_EVENT",
")",
";",
"break",
";",
"case",
"Failed",
":",
"fireProgressEvent",
"(",
"ProgressEventType",
".",
"TRANSFER_FAILED_EVENT",
")",
";",
"break",
";",
"default",
":",
"break",
";",
"}",
"}"
] |
This method is also responsible for firing COMPLETED signal to the
listeners.
|
[
"This",
"method",
"is",
"also",
"responsible",
"for",
"firing",
"COMPLETED",
"signal",
"to",
"the",
"listeners",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/PresignedUrlDownloadImpl.java#L72-L89
|
19,673
|
aws/aws-sdk-java
|
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/PresignUrlDownloadCallable.java
|
PresignUrlDownloadCallable.updateDownloadStatus
|
private void updateDownloadStatus(S3Object result) {
if (result == null) {
download.setState(Transfer.TransferState.Canceled);
download.setMonitor(new DownloadMonitor(download, null));
} else {
download.setState(Transfer.TransferState.Completed);
}
}
|
java
|
private void updateDownloadStatus(S3Object result) {
if (result == null) {
download.setState(Transfer.TransferState.Canceled);
download.setMonitor(new DownloadMonitor(download, null));
} else {
download.setState(Transfer.TransferState.Completed);
}
}
|
[
"private",
"void",
"updateDownloadStatus",
"(",
"S3Object",
"result",
")",
"{",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"download",
".",
"setState",
"(",
"Transfer",
".",
"TransferState",
".",
"Canceled",
")",
";",
"download",
".",
"setMonitor",
"(",
"new",
"DownloadMonitor",
"(",
"download",
",",
"null",
")",
")",
";",
"}",
"else",
"{",
"download",
".",
"setState",
"(",
"Transfer",
".",
"TransferState",
".",
"Completed",
")",
";",
"}",
"}"
] |
Takes the result from serial download,
updates the transfer state and monitor in downloadImpl object
based on the result.
|
[
"Takes",
"the",
"result",
"from",
"serial",
"download",
"updates",
"the",
"transfer",
"state",
"and",
"monitor",
"in",
"downloadImpl",
"object",
"based",
"on",
"the",
"result",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/PresignUrlDownloadCallable.java#L99-L106
|
19,674
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/request/impl/ApacheHttpRequestFactory.java
|
ApacheHttpRequestFactory.addHeadersToRequest
|
private void addHeadersToRequest(HttpRequestBase httpRequest, Request<?> request) {
httpRequest.addHeader(HttpHeaders.HOST, getHostHeaderValue(request.getEndpoint()));
// Copy over any other headers already in our request
for (Entry<String, String> entry : request.getHeaders().entrySet()) {
/*
* HttpClient4 fills in the Content-Length header and complains if
* it's already present, so we skip it here. We also skip the Host
* header to avoid sending it twice, which will interfere with some
* signing schemes.
*/
if (!(ignoreHeaders.contains(entry.getKey()))) {
httpRequest.addHeader(entry.getKey(), entry.getValue());
}
}
/* Set content type and encoding */
if (httpRequest.getHeaders(HttpHeaders.CONTENT_TYPE) == null || httpRequest
.getHeaders
(HttpHeaders.CONTENT_TYPE).length == 0) {
httpRequest.addHeader(HttpHeaders.CONTENT_TYPE,
"application/x-www-form-urlencoded; " +
"charset=" + DEFAULT_ENCODING.toLowerCase());
}
}
|
java
|
private void addHeadersToRequest(HttpRequestBase httpRequest, Request<?> request) {
httpRequest.addHeader(HttpHeaders.HOST, getHostHeaderValue(request.getEndpoint()));
// Copy over any other headers already in our request
for (Entry<String, String> entry : request.getHeaders().entrySet()) {
/*
* HttpClient4 fills in the Content-Length header and complains if
* it's already present, so we skip it here. We also skip the Host
* header to avoid sending it twice, which will interfere with some
* signing schemes.
*/
if (!(ignoreHeaders.contains(entry.getKey()))) {
httpRequest.addHeader(entry.getKey(), entry.getValue());
}
}
/* Set content type and encoding */
if (httpRequest.getHeaders(HttpHeaders.CONTENT_TYPE) == null || httpRequest
.getHeaders
(HttpHeaders.CONTENT_TYPE).length == 0) {
httpRequest.addHeader(HttpHeaders.CONTENT_TYPE,
"application/x-www-form-urlencoded; " +
"charset=" + DEFAULT_ENCODING.toLowerCase());
}
}
|
[
"private",
"void",
"addHeadersToRequest",
"(",
"HttpRequestBase",
"httpRequest",
",",
"Request",
"<",
"?",
">",
"request",
")",
"{",
"httpRequest",
".",
"addHeader",
"(",
"HttpHeaders",
".",
"HOST",
",",
"getHostHeaderValue",
"(",
"request",
".",
"getEndpoint",
"(",
")",
")",
")",
";",
"// Copy over any other headers already in our request",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"request",
".",
"getHeaders",
"(",
")",
".",
"entrySet",
"(",
")",
")",
"{",
"/*\n * HttpClient4 fills in the Content-Length header and complains if\n * it's already present, so we skip it here. We also skip the Host\n * header to avoid sending it twice, which will interfere with some\n * signing schemes.\n */",
"if",
"(",
"!",
"(",
"ignoreHeaders",
".",
"contains",
"(",
"entry",
".",
"getKey",
"(",
")",
")",
")",
")",
"{",
"httpRequest",
".",
"addHeader",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
"entry",
".",
"getValue",
"(",
")",
")",
";",
"}",
"}",
"/* Set content type and encoding */",
"if",
"(",
"httpRequest",
".",
"getHeaders",
"(",
"HttpHeaders",
".",
"CONTENT_TYPE",
")",
"==",
"null",
"||",
"httpRequest",
".",
"getHeaders",
"(",
"HttpHeaders",
".",
"CONTENT_TYPE",
")",
".",
"length",
"==",
"0",
")",
"{",
"httpRequest",
".",
"addHeader",
"(",
"HttpHeaders",
".",
"CONTENT_TYPE",
",",
"\"application/x-www-form-urlencoded; \"",
"+",
"\"charset=\"",
"+",
"DEFAULT_ENCODING",
".",
"toLowerCase",
"(",
")",
")",
";",
"}",
"}"
] |
Configures the headers in the specified Apache HTTP request.
|
[
"Configures",
"the",
"headers",
"in",
"the",
"specified",
"Apache",
"HTTP",
"request",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/request/impl/ApacheHttpRequestFactory.java#L190-L215
|
19,675
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/request/impl/ApacheHttpRequestFactory.java
|
ApacheHttpRequestFactory.addProxyConfig
|
private void addProxyConfig(RequestConfig.Builder requestConfigBuilder, HttpClientSettings settings) {
if (settings.isProxyEnabled() && settings.isAuthenticatedProxy() && settings.getProxyAuthenticationMethods() != null) {
List<String> apacheAuthenticationSchemes = new ArrayList<String>();
for (ProxyAuthenticationMethod authenticationMethod : settings.getProxyAuthenticationMethods()) {
apacheAuthenticationSchemes.add(toApacheAuthenticationScheme(authenticationMethod));
}
requestConfigBuilder.setProxyPreferredAuthSchemes(apacheAuthenticationSchemes);
}
}
|
java
|
private void addProxyConfig(RequestConfig.Builder requestConfigBuilder, HttpClientSettings settings) {
if (settings.isProxyEnabled() && settings.isAuthenticatedProxy() && settings.getProxyAuthenticationMethods() != null) {
List<String> apacheAuthenticationSchemes = new ArrayList<String>();
for (ProxyAuthenticationMethod authenticationMethod : settings.getProxyAuthenticationMethods()) {
apacheAuthenticationSchemes.add(toApacheAuthenticationScheme(authenticationMethod));
}
requestConfigBuilder.setProxyPreferredAuthSchemes(apacheAuthenticationSchemes);
}
}
|
[
"private",
"void",
"addProxyConfig",
"(",
"RequestConfig",
".",
"Builder",
"requestConfigBuilder",
",",
"HttpClientSettings",
"settings",
")",
"{",
"if",
"(",
"settings",
".",
"isProxyEnabled",
"(",
")",
"&&",
"settings",
".",
"isAuthenticatedProxy",
"(",
")",
"&&",
"settings",
".",
"getProxyAuthenticationMethods",
"(",
")",
"!=",
"null",
")",
"{",
"List",
"<",
"String",
">",
"apacheAuthenticationSchemes",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"ProxyAuthenticationMethod",
"authenticationMethod",
":",
"settings",
".",
"getProxyAuthenticationMethods",
"(",
")",
")",
"{",
"apacheAuthenticationSchemes",
".",
"add",
"(",
"toApacheAuthenticationScheme",
"(",
"authenticationMethod",
")",
")",
";",
"}",
"requestConfigBuilder",
".",
"setProxyPreferredAuthSchemes",
"(",
"apacheAuthenticationSchemes",
")",
";",
"}",
"}"
] |
Update the provided request configuration builder to specify the proxy authentication schemes that should be used when
authenticating against the HTTP proxy.
@see ClientConfiguration#setProxyAuthenticationMethods(List)
|
[
"Update",
"the",
"provided",
"request",
"configuration",
"builder",
"to",
"specify",
"the",
"proxy",
"authentication",
"schemes",
"that",
"should",
"be",
"used",
"when",
"authenticating",
"against",
"the",
"HTTP",
"proxy",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/request/impl/ApacheHttpRequestFactory.java#L237-L247
|
19,676
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/request/impl/ApacheHttpRequestFactory.java
|
ApacheHttpRequestFactory.toApacheAuthenticationScheme
|
private String toApacheAuthenticationScheme(ProxyAuthenticationMethod authenticationMethod) {
if (authenticationMethod == null) {
throw new IllegalStateException("The configured proxy authentication methods must not be null.");
}
switch (authenticationMethod) {
case NTLM: return AuthSchemes.NTLM;
case BASIC: return AuthSchemes.BASIC;
case DIGEST: return AuthSchemes.DIGEST;
case SPNEGO: return AuthSchemes.SPNEGO;
case KERBEROS: return AuthSchemes.KERBEROS;
default: throw new IllegalStateException("Unknown authentication scheme: " + authenticationMethod);
}
}
|
java
|
private String toApacheAuthenticationScheme(ProxyAuthenticationMethod authenticationMethod) {
if (authenticationMethod == null) {
throw new IllegalStateException("The configured proxy authentication methods must not be null.");
}
switch (authenticationMethod) {
case NTLM: return AuthSchemes.NTLM;
case BASIC: return AuthSchemes.BASIC;
case DIGEST: return AuthSchemes.DIGEST;
case SPNEGO: return AuthSchemes.SPNEGO;
case KERBEROS: return AuthSchemes.KERBEROS;
default: throw new IllegalStateException("Unknown authentication scheme: " + authenticationMethod);
}
}
|
[
"private",
"String",
"toApacheAuthenticationScheme",
"(",
"ProxyAuthenticationMethod",
"authenticationMethod",
")",
"{",
"if",
"(",
"authenticationMethod",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The configured proxy authentication methods must not be null.\"",
")",
";",
"}",
"switch",
"(",
"authenticationMethod",
")",
"{",
"case",
"NTLM",
":",
"return",
"AuthSchemes",
".",
"NTLM",
";",
"case",
"BASIC",
":",
"return",
"AuthSchemes",
".",
"BASIC",
";",
"case",
"DIGEST",
":",
"return",
"AuthSchemes",
".",
"DIGEST",
";",
"case",
"SPNEGO",
":",
"return",
"AuthSchemes",
".",
"SPNEGO",
";",
"case",
"KERBEROS",
":",
"return",
"AuthSchemes",
".",
"KERBEROS",
";",
"default",
":",
"throw",
"new",
"IllegalStateException",
"(",
"\"Unknown authentication scheme: \"",
"+",
"authenticationMethod",
")",
";",
"}",
"}"
] |
Convert the customer-facing authentication method into an apache-specific authentication method.
|
[
"Convert",
"the",
"customer",
"-",
"facing",
"authentication",
"method",
"into",
"an",
"apache",
"-",
"specific",
"authentication",
"method",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/request/impl/ApacheHttpRequestFactory.java#L252-L265
|
19,677
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
|
QueueBuffer.sendMessage
|
public Future<SendMessageResult> sendMessage(SendMessageRequest request,
AsyncHandler<SendMessageRequest, SendMessageResult> handler) {
QueueBufferCallback<SendMessageRequest, SendMessageResult> callback = null;
if (handler != null) {
callback = new QueueBufferCallback<SendMessageRequest, SendMessageResult>(handler, request);
}
QueueBufferFuture<SendMessageRequest, SendMessageResult> future = sendBuffer.sendMessage(request, callback);
future.setBuffer(this);
return future;
}
|
java
|
public Future<SendMessageResult> sendMessage(SendMessageRequest request,
AsyncHandler<SendMessageRequest, SendMessageResult> handler) {
QueueBufferCallback<SendMessageRequest, SendMessageResult> callback = null;
if (handler != null) {
callback = new QueueBufferCallback<SendMessageRequest, SendMessageResult>(handler, request);
}
QueueBufferFuture<SendMessageRequest, SendMessageResult> future = sendBuffer.sendMessage(request, callback);
future.setBuffer(this);
return future;
}
|
[
"public",
"Future",
"<",
"SendMessageResult",
">",
"sendMessage",
"(",
"SendMessageRequest",
"request",
",",
"AsyncHandler",
"<",
"SendMessageRequest",
",",
"SendMessageResult",
">",
"handler",
")",
"{",
"QueueBufferCallback",
"<",
"SendMessageRequest",
",",
"SendMessageResult",
">",
"callback",
"=",
"null",
";",
"if",
"(",
"handler",
"!=",
"null",
")",
"{",
"callback",
"=",
"new",
"QueueBufferCallback",
"<",
"SendMessageRequest",
",",
"SendMessageResult",
">",
"(",
"handler",
",",
"request",
")",
";",
"}",
"QueueBufferFuture",
"<",
"SendMessageRequest",
",",
"SendMessageResult",
">",
"future",
"=",
"sendBuffer",
".",
"sendMessage",
"(",
"request",
",",
"callback",
")",
";",
"future",
".",
"setBuffer",
"(",
"this",
")",
";",
"return",
"future",
";",
"}"
] |
asynchronously enqueues a message to SQS.
@return a Future object that will be notified when the operation is completed; never null
|
[
"asynchronously",
"enqueues",
"a",
"message",
"to",
"SQS",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java#L80-L89
|
19,678
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
|
QueueBuffer.sendMessageSync
|
public SendMessageResult sendMessageSync(SendMessageRequest request) {
Future<SendMessageResult> future = sendMessage(request, null);
return waitForFuture(future);
}
|
java
|
public SendMessageResult sendMessageSync(SendMessageRequest request) {
Future<SendMessageResult> future = sendMessage(request, null);
return waitForFuture(future);
}
|
[
"public",
"SendMessageResult",
"sendMessageSync",
"(",
"SendMessageRequest",
"request",
")",
"{",
"Future",
"<",
"SendMessageResult",
">",
"future",
"=",
"sendMessage",
"(",
"request",
",",
"null",
")",
";",
"return",
"waitForFuture",
"(",
"future",
")",
";",
"}"
] |
Sends a message to SQS and returns the SQS reply.
@return never null
|
[
"Sends",
"a",
"message",
"to",
"SQS",
"and",
"returns",
"the",
"SQS",
"reply",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java#L96-L99
|
19,679
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
|
QueueBuffer.deleteMessage
|
public Future<DeleteMessageResult> deleteMessage(DeleteMessageRequest request,
AsyncHandler<DeleteMessageRequest, DeleteMessageResult> handler) {
QueueBufferCallback<DeleteMessageRequest, DeleteMessageResult> callback = null;
if (handler != null) {
callback = new QueueBufferCallback<DeleteMessageRequest, DeleteMessageResult>(handler, request);
}
QueueBufferFuture<DeleteMessageRequest, DeleteMessageResult> future = sendBuffer.deleteMessage(request, callback);
future.setBuffer(this);
return future;
}
|
java
|
public Future<DeleteMessageResult> deleteMessage(DeleteMessageRequest request,
AsyncHandler<DeleteMessageRequest, DeleteMessageResult> handler) {
QueueBufferCallback<DeleteMessageRequest, DeleteMessageResult> callback = null;
if (handler != null) {
callback = new QueueBufferCallback<DeleteMessageRequest, DeleteMessageResult>(handler, request);
}
QueueBufferFuture<DeleteMessageRequest, DeleteMessageResult> future = sendBuffer.deleteMessage(request, callback);
future.setBuffer(this);
return future;
}
|
[
"public",
"Future",
"<",
"DeleteMessageResult",
">",
"deleteMessage",
"(",
"DeleteMessageRequest",
"request",
",",
"AsyncHandler",
"<",
"DeleteMessageRequest",
",",
"DeleteMessageResult",
">",
"handler",
")",
"{",
"QueueBufferCallback",
"<",
"DeleteMessageRequest",
",",
"DeleteMessageResult",
">",
"callback",
"=",
"null",
";",
"if",
"(",
"handler",
"!=",
"null",
")",
"{",
"callback",
"=",
"new",
"QueueBufferCallback",
"<",
"DeleteMessageRequest",
",",
"DeleteMessageResult",
">",
"(",
"handler",
",",
"request",
")",
";",
"}",
"QueueBufferFuture",
"<",
"DeleteMessageRequest",
",",
"DeleteMessageResult",
">",
"future",
"=",
"sendBuffer",
".",
"deleteMessage",
"(",
"request",
",",
"callback",
")",
";",
"future",
".",
"setBuffer",
"(",
"this",
")",
";",
"return",
"future",
";",
"}"
] |
Asynchronously deletes a message from SQS.
@return a Future object that will be notified when the operation is completed; never null
|
[
"Asynchronously",
"deletes",
"a",
"message",
"from",
"SQS",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java#L107-L117
|
19,680
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
|
QueueBuffer.deleteMessageSync
|
public DeleteMessageResult deleteMessageSync(DeleteMessageRequest request) {
Future<DeleteMessageResult> future = deleteMessage(request, null);
return waitForFuture(future);
}
|
java
|
public DeleteMessageResult deleteMessageSync(DeleteMessageRequest request) {
Future<DeleteMessageResult> future = deleteMessage(request, null);
return waitForFuture(future);
}
|
[
"public",
"DeleteMessageResult",
"deleteMessageSync",
"(",
"DeleteMessageRequest",
"request",
")",
"{",
"Future",
"<",
"DeleteMessageResult",
">",
"future",
"=",
"deleteMessage",
"(",
"request",
",",
"null",
")",
";",
"return",
"waitForFuture",
"(",
"future",
")",
";",
"}"
] |
Deletes a message from SQS. Does not return until a confirmation from SQS has been received
@return never null
|
[
"Deletes",
"a",
"message",
"from",
"SQS",
".",
"Does",
"not",
"return",
"until",
"a",
"confirmation",
"from",
"SQS",
"has",
"been",
"received"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java#L124-L127
|
19,681
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
|
QueueBuffer.changeMessageVisibility
|
public Future<ChangeMessageVisibilityResult> changeMessageVisibility(ChangeMessageVisibilityRequest request,
AsyncHandler<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult> handler) {
QueueBufferCallback<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult> callback = null;
if (handler != null) {
callback = new QueueBufferCallback<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult>(handler, request);
}
QueueBufferFuture<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult> future =
sendBuffer.changeMessageVisibility(request, callback);
future.setBuffer(this);
return future;
}
|
java
|
public Future<ChangeMessageVisibilityResult> changeMessageVisibility(ChangeMessageVisibilityRequest request,
AsyncHandler<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult> handler) {
QueueBufferCallback<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult> callback = null;
if (handler != null) {
callback = new QueueBufferCallback<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult>(handler, request);
}
QueueBufferFuture<ChangeMessageVisibilityRequest, ChangeMessageVisibilityResult> future =
sendBuffer.changeMessageVisibility(request, callback);
future.setBuffer(this);
return future;
}
|
[
"public",
"Future",
"<",
"ChangeMessageVisibilityResult",
">",
"changeMessageVisibility",
"(",
"ChangeMessageVisibilityRequest",
"request",
",",
"AsyncHandler",
"<",
"ChangeMessageVisibilityRequest",
",",
"ChangeMessageVisibilityResult",
">",
"handler",
")",
"{",
"QueueBufferCallback",
"<",
"ChangeMessageVisibilityRequest",
",",
"ChangeMessageVisibilityResult",
">",
"callback",
"=",
"null",
";",
"if",
"(",
"handler",
"!=",
"null",
")",
"{",
"callback",
"=",
"new",
"QueueBufferCallback",
"<",
"ChangeMessageVisibilityRequest",
",",
"ChangeMessageVisibilityResult",
">",
"(",
"handler",
",",
"request",
")",
";",
"}",
"QueueBufferFuture",
"<",
"ChangeMessageVisibilityRequest",
",",
"ChangeMessageVisibilityResult",
">",
"future",
"=",
"sendBuffer",
".",
"changeMessageVisibility",
"(",
"request",
",",
"callback",
")",
";",
"future",
".",
"setBuffer",
"(",
"this",
")",
";",
"return",
"future",
";",
"}"
] |
asynchronously adjust a message's visibility timeout to SQS.
@return a Future object that will be notified when the operation is completed; never null
|
[
"asynchronously",
"adjust",
"a",
"message",
"s",
"visibility",
"timeout",
"to",
"SQS",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java#L135-L146
|
19,682
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
|
QueueBuffer.changeMessageVisibilitySync
|
public ChangeMessageVisibilityResult changeMessageVisibilitySync(ChangeMessageVisibilityRequest request) {
Future<ChangeMessageVisibilityResult> future = sendBuffer.changeMessageVisibility(request, null);
return waitForFuture(future);
}
|
java
|
public ChangeMessageVisibilityResult changeMessageVisibilitySync(ChangeMessageVisibilityRequest request) {
Future<ChangeMessageVisibilityResult> future = sendBuffer.changeMessageVisibility(request, null);
return waitForFuture(future);
}
|
[
"public",
"ChangeMessageVisibilityResult",
"changeMessageVisibilitySync",
"(",
"ChangeMessageVisibilityRequest",
"request",
")",
"{",
"Future",
"<",
"ChangeMessageVisibilityResult",
">",
"future",
"=",
"sendBuffer",
".",
"changeMessageVisibility",
"(",
"request",
",",
"null",
")",
";",
"return",
"waitForFuture",
"(",
"future",
")",
";",
"}"
] |
Changes visibility of a message in SQS. Does not return until a confirmation from SQS has
been received.
@return
|
[
"Changes",
"visibility",
"of",
"a",
"message",
"in",
"SQS",
".",
"Does",
"not",
"return",
"until",
"a",
"confirmation",
"from",
"SQS",
"has",
"been",
"received",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java#L153-L156
|
19,683
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
|
QueueBuffer.receiveMessage
|
public Future<ReceiveMessageResult> receiveMessage(ReceiveMessageRequest rq,
AsyncHandler<ReceiveMessageRequest, ReceiveMessageResult> handler) {
if (canBeRetrievedFromQueueBuffer(rq)) {
QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback = null;
if (handler != null) {
callback = new QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult>(handler, rq);
}
QueueBufferFuture<ReceiveMessageRequest, ReceiveMessageResult> future = receiveBuffer.receiveMessageAsync(
rq, callback);
future.setBuffer(this);
return future;
} else if (handler != null) {
return realSqs.receiveMessageAsync(rq, handler);
} else {
return realSqs.receiveMessageAsync(rq);
}
}
|
java
|
public Future<ReceiveMessageResult> receiveMessage(ReceiveMessageRequest rq,
AsyncHandler<ReceiveMessageRequest, ReceiveMessageResult> handler) {
if (canBeRetrievedFromQueueBuffer(rq)) {
QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback = null;
if (handler != null) {
callback = new QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult>(handler, rq);
}
QueueBufferFuture<ReceiveMessageRequest, ReceiveMessageResult> future = receiveBuffer.receiveMessageAsync(
rq, callback);
future.setBuffer(this);
return future;
} else if (handler != null) {
return realSqs.receiveMessageAsync(rq, handler);
} else {
return realSqs.receiveMessageAsync(rq);
}
}
|
[
"public",
"Future",
"<",
"ReceiveMessageResult",
">",
"receiveMessage",
"(",
"ReceiveMessageRequest",
"rq",
",",
"AsyncHandler",
"<",
"ReceiveMessageRequest",
",",
"ReceiveMessageResult",
">",
"handler",
")",
"{",
"if",
"(",
"canBeRetrievedFromQueueBuffer",
"(",
"rq",
")",
")",
"{",
"QueueBufferCallback",
"<",
"ReceiveMessageRequest",
",",
"ReceiveMessageResult",
">",
"callback",
"=",
"null",
";",
"if",
"(",
"handler",
"!=",
"null",
")",
"{",
"callback",
"=",
"new",
"QueueBufferCallback",
"<",
"ReceiveMessageRequest",
",",
"ReceiveMessageResult",
">",
"(",
"handler",
",",
"rq",
")",
";",
"}",
"QueueBufferFuture",
"<",
"ReceiveMessageRequest",
",",
"ReceiveMessageResult",
">",
"future",
"=",
"receiveBuffer",
".",
"receiveMessageAsync",
"(",
"rq",
",",
"callback",
")",
";",
"future",
".",
"setBuffer",
"(",
"this",
")",
";",
"return",
"future",
";",
"}",
"else",
"if",
"(",
"handler",
"!=",
"null",
")",
"{",
"return",
"realSqs",
".",
"receiveMessageAsync",
"(",
"rq",
",",
"handler",
")",
";",
"}",
"else",
"{",
"return",
"realSqs",
".",
"receiveMessageAsync",
"(",
"rq",
")",
";",
"}",
"}"
] |
Submits a request to receive some messages from SQS.
@return a Future object that will be notified when the operation is completed; never null;
|
[
"Submits",
"a",
"request",
"to",
"receive",
"some",
"messages",
"from",
"SQS",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java#L164-L181
|
19,684
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
|
QueueBuffer.receiveMessageSync
|
public ReceiveMessageResult receiveMessageSync(ReceiveMessageRequest rq) {
Future<ReceiveMessageResult> future = receiveMessage(rq, null);
return waitForFuture(future);
}
|
java
|
public ReceiveMessageResult receiveMessageSync(ReceiveMessageRequest rq) {
Future<ReceiveMessageResult> future = receiveMessage(rq, null);
return waitForFuture(future);
}
|
[
"public",
"ReceiveMessageResult",
"receiveMessageSync",
"(",
"ReceiveMessageRequest",
"rq",
")",
"{",
"Future",
"<",
"ReceiveMessageResult",
">",
"future",
"=",
"receiveMessage",
"(",
"rq",
",",
"null",
")",
";",
"return",
"waitForFuture",
"(",
"future",
")",
";",
"}"
] |
Retrieves messages from an SQS queue.
@return never null
|
[
"Retrieves",
"messages",
"from",
"an",
"SQS",
"queue",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java#L188-L191
|
19,685
|
aws/aws-sdk-java
|
aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
|
QueueBuffer.waitForFuture
|
private <ResultType> ResultType waitForFuture(Future<ResultType> future) {
ResultType toReturn = null;
try {
toReturn = future.get();
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
AmazonClientException ce = new AmazonClientException(
"Thread interrupted while waiting for execution result");
ce.initCause(ie);
throw ce;
} catch (ExecutionException ee) {
// if the cause of the execution exception is an SQS exception, extract it
// and throw the extracted exception to the clients
// otherwise, wrap ee in an SQS exception and throw that.
Throwable cause = ee.getCause();
if (cause instanceof AmazonClientException) {
throw (AmazonClientException) cause;
}
AmazonClientException ce = new AmazonClientException(
"Caught an exception while waiting for request to complete...");
ce.initCause(ee);
throw ce;
}
return toReturn;
}
|
java
|
private <ResultType> ResultType waitForFuture(Future<ResultType> future) {
ResultType toReturn = null;
try {
toReturn = future.get();
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
AmazonClientException ce = new AmazonClientException(
"Thread interrupted while waiting for execution result");
ce.initCause(ie);
throw ce;
} catch (ExecutionException ee) {
// if the cause of the execution exception is an SQS exception, extract it
// and throw the extracted exception to the clients
// otherwise, wrap ee in an SQS exception and throw that.
Throwable cause = ee.getCause();
if (cause instanceof AmazonClientException) {
throw (AmazonClientException) cause;
}
AmazonClientException ce = new AmazonClientException(
"Caught an exception while waiting for request to complete...");
ce.initCause(ee);
throw ce;
}
return toReturn;
}
|
[
"private",
"<",
"ResultType",
">",
"ResultType",
"waitForFuture",
"(",
"Future",
"<",
"ResultType",
">",
"future",
")",
"{",
"ResultType",
"toReturn",
"=",
"null",
";",
"try",
"{",
"toReturn",
"=",
"future",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"ie",
")",
"{",
"Thread",
".",
"currentThread",
"(",
")",
".",
"interrupt",
"(",
")",
";",
"AmazonClientException",
"ce",
"=",
"new",
"AmazonClientException",
"(",
"\"Thread interrupted while waiting for execution result\"",
")",
";",
"ce",
".",
"initCause",
"(",
"ie",
")",
";",
"throw",
"ce",
";",
"}",
"catch",
"(",
"ExecutionException",
"ee",
")",
"{",
"// if the cause of the execution exception is an SQS exception, extract it",
"// and throw the extracted exception to the clients",
"// otherwise, wrap ee in an SQS exception and throw that.",
"Throwable",
"cause",
"=",
"ee",
".",
"getCause",
"(",
")",
";",
"if",
"(",
"cause",
"instanceof",
"AmazonClientException",
")",
"{",
"throw",
"(",
"AmazonClientException",
")",
"cause",
";",
"}",
"AmazonClientException",
"ce",
"=",
"new",
"AmazonClientException",
"(",
"\"Caught an exception while waiting for request to complete...\"",
")",
";",
"ce",
".",
"initCause",
"(",
"ee",
")",
";",
"throw",
"ce",
";",
"}",
"return",
"toReturn",
";",
"}"
] |
this method carefully waits for futures. If waiting throws, it converts the exceptions to the
exceptions that SQS clients expect. This is what we use to turn asynchronous calls into
synchronous ones
|
[
"this",
"method",
"carefully",
"waits",
"for",
"futures",
".",
"If",
"waiting",
"throws",
"it",
"converts",
"the",
"exceptions",
"to",
"the",
"exceptions",
"that",
"SQS",
"clients",
"expect",
".",
"This",
"is",
"what",
"we",
"use",
"to",
"turn",
"asynchronous",
"calls",
"into",
"synchronous",
"ones"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java#L257-L285
|
19,686
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java
|
ApacheUtils.isRequestSuccessful
|
public static boolean isRequestSuccessful(org.apache.http.HttpResponse response) {
int status = response.getStatusLine().getStatusCode();
return status / 100 == HttpStatus.SC_OK / 100;
}
|
java
|
public static boolean isRequestSuccessful(org.apache.http.HttpResponse response) {
int status = response.getStatusLine().getStatusCode();
return status / 100 == HttpStatus.SC_OK / 100;
}
|
[
"public",
"static",
"boolean",
"isRequestSuccessful",
"(",
"org",
".",
"apache",
".",
"http",
".",
"HttpResponse",
"response",
")",
"{",
"int",
"status",
"=",
"response",
".",
"getStatusLine",
"(",
")",
".",
"getStatusCode",
"(",
")",
";",
"return",
"status",
"/",
"100",
"==",
"HttpStatus",
".",
"SC_OK",
"/",
"100",
";",
"}"
] |
Checks if the request was successful or not based on the status code.
@param response HTTP response
@return True if the request was successful (i.e. has a 2xx status code), false otherwise.
|
[
"Checks",
"if",
"the",
"request",
"was",
"successful",
"or",
"not",
"based",
"on",
"the",
"status",
"code",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java#L52-L55
|
19,687
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java
|
ApacheUtils.createResponse
|
public static HttpResponse createResponse(Request<?> request,
HttpRequestBase method,
org.apache.http.HttpResponse apacheHttpResponse,
HttpContext context) throws IOException {
HttpResponse httpResponse = new HttpResponse(request, method, context);
if (apacheHttpResponse.getEntity() != null) {
httpResponse.setContent(apacheHttpResponse.getEntity().getContent());
}
httpResponse.setStatusCode(apacheHttpResponse.getStatusLine().getStatusCode());
httpResponse.setStatusText(apacheHttpResponse.getStatusLine().getReasonPhrase());
for (Header header : apacheHttpResponse.getAllHeaders()) {
httpResponse.addHeader(header.getName(), header.getValue());
}
return httpResponse;
}
|
java
|
public static HttpResponse createResponse(Request<?> request,
HttpRequestBase method,
org.apache.http.HttpResponse apacheHttpResponse,
HttpContext context) throws IOException {
HttpResponse httpResponse = new HttpResponse(request, method, context);
if (apacheHttpResponse.getEntity() != null) {
httpResponse.setContent(apacheHttpResponse.getEntity().getContent());
}
httpResponse.setStatusCode(apacheHttpResponse.getStatusLine().getStatusCode());
httpResponse.setStatusText(apacheHttpResponse.getStatusLine().getReasonPhrase());
for (Header header : apacheHttpResponse.getAllHeaders()) {
httpResponse.addHeader(header.getName(), header.getValue());
}
return httpResponse;
}
|
[
"public",
"static",
"HttpResponse",
"createResponse",
"(",
"Request",
"<",
"?",
">",
"request",
",",
"HttpRequestBase",
"method",
",",
"org",
".",
"apache",
".",
"http",
".",
"HttpResponse",
"apacheHttpResponse",
",",
"HttpContext",
"context",
")",
"throws",
"IOException",
"{",
"HttpResponse",
"httpResponse",
"=",
"new",
"HttpResponse",
"(",
"request",
",",
"method",
",",
"context",
")",
";",
"if",
"(",
"apacheHttpResponse",
".",
"getEntity",
"(",
")",
"!=",
"null",
")",
"{",
"httpResponse",
".",
"setContent",
"(",
"apacheHttpResponse",
".",
"getEntity",
"(",
")",
".",
"getContent",
"(",
")",
")",
";",
"}",
"httpResponse",
".",
"setStatusCode",
"(",
"apacheHttpResponse",
".",
"getStatusLine",
"(",
")",
".",
"getStatusCode",
"(",
")",
")",
";",
"httpResponse",
".",
"setStatusText",
"(",
"apacheHttpResponse",
".",
"getStatusLine",
"(",
")",
".",
"getReasonPhrase",
"(",
")",
")",
";",
"for",
"(",
"Header",
"header",
":",
"apacheHttpResponse",
".",
"getAllHeaders",
"(",
")",
")",
"{",
"httpResponse",
".",
"addHeader",
"(",
"header",
".",
"getName",
"(",
")",
",",
"header",
".",
"getValue",
"(",
")",
")",
";",
"}",
"return",
"httpResponse",
";",
"}"
] |
Creates and initializes an HttpResponse object suitable to be passed to an HTTP response
handler object.
@param request Marshalled request object.
@param method The HTTP method that was invoked to get the response.
@param context The HTTP context associated with the request and response.
@return The new, initialized HttpResponse object ready to be passed to an HTTP response
handler object.
@throws IOException If there were any problems getting any response information from the
HttpClient method object.
|
[
"Creates",
"and",
"initializes",
"an",
"HttpResponse",
"object",
"suitable",
"to",
"be",
"passed",
"to",
"an",
"HTTP",
"response",
"handler",
"object",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java#L69-L86
|
19,688
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java
|
ApacheUtils.newStringEntity
|
public static HttpEntity newStringEntity(String s) {
try {
return new StringEntity(s);
} catch (UnsupportedEncodingException e) {
throw new SdkClientException("Unable to create HTTP entity: " + e.getMessage(), e);
}
}
|
java
|
public static HttpEntity newStringEntity(String s) {
try {
return new StringEntity(s);
} catch (UnsupportedEncodingException e) {
throw new SdkClientException("Unable to create HTTP entity: " + e.getMessage(), e);
}
}
|
[
"public",
"static",
"HttpEntity",
"newStringEntity",
"(",
"String",
"s",
")",
"{",
"try",
"{",
"return",
"new",
"StringEntity",
"(",
"s",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Unable to create HTTP entity: \"",
"+",
"e",
".",
"getMessage",
"(",
")",
",",
"e",
")",
";",
"}",
"}"
] |
Utility function for creating a new StringEntity and wrapping any errors
as a SdkClientException.
@param s The string contents of the returned HTTP entity.
@return A new StringEntity with the specified contents.
|
[
"Utility",
"function",
"for",
"creating",
"a",
"new",
"StringEntity",
"and",
"wrapping",
"any",
"errors",
"as",
"a",
"SdkClientException",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java#L95-L101
|
19,689
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java
|
ApacheUtils.newBufferedHttpEntity
|
public static HttpEntity newBufferedHttpEntity(HttpEntity entity) throws
FakeIOException {
try {
return new BufferedHttpEntity(entity);
} catch (FakeIOException e) {
// Only for test simulation.
throw e;
} catch (IOException e) {
throw new SdkClientException("Unable to create HTTP entity: " + e.getMessage(), e);
}
}
|
java
|
public static HttpEntity newBufferedHttpEntity(HttpEntity entity) throws
FakeIOException {
try {
return new BufferedHttpEntity(entity);
} catch (FakeIOException e) {
// Only for test simulation.
throw e;
} catch (IOException e) {
throw new SdkClientException("Unable to create HTTP entity: " + e.getMessage(), e);
}
}
|
[
"public",
"static",
"HttpEntity",
"newBufferedHttpEntity",
"(",
"HttpEntity",
"entity",
")",
"throws",
"FakeIOException",
"{",
"try",
"{",
"return",
"new",
"BufferedHttpEntity",
"(",
"entity",
")",
";",
"}",
"catch",
"(",
"FakeIOException",
"e",
")",
"{",
"// Only for test simulation.",
"throw",
"e",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Unable to create HTTP entity: \"",
"+",
"e",
".",
"getMessage",
"(",
")",
",",
"e",
")",
";",
"}",
"}"
] |
Utility function for creating a new BufferedEntity and wrapping any errors
as a SdkClientException.
@param entity The HTTP entity to wrap with a buffered HTTP entity.
@return A new BufferedHttpEntity wrapping the specified entity.
@throws FakeIOException only for test simulation
|
[
"Utility",
"function",
"for",
"creating",
"a",
"new",
"BufferedEntity",
"and",
"wrapping",
"any",
"errors",
"as",
"a",
"SdkClientException",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java#L111-L121
|
19,690
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java
|
ApacheUtils.newClientContext
|
public static HttpClientContext newClientContext(HttpClientSettings settings,
Map<String, ? extends Object>
attributes) {
final HttpClientContext clientContext = new HttpClientContext();
if (attributes != null && !attributes.isEmpty()) {
for (Map.Entry<String, ?> entry : attributes.entrySet()) {
clientContext.setAttribute(entry.getKey(), entry.getValue());
}
}
addPreemptiveAuthenticationProxy(clientContext, settings);
clientContext.setAttribute(HttpContextUtils.DISABLE_SOCKET_PROXY_PROPERTY, settings.disableSocketProxy());
return clientContext;
}
|
java
|
public static HttpClientContext newClientContext(HttpClientSettings settings,
Map<String, ? extends Object>
attributes) {
final HttpClientContext clientContext = new HttpClientContext();
if (attributes != null && !attributes.isEmpty()) {
for (Map.Entry<String, ?> entry : attributes.entrySet()) {
clientContext.setAttribute(entry.getKey(), entry.getValue());
}
}
addPreemptiveAuthenticationProxy(clientContext, settings);
clientContext.setAttribute(HttpContextUtils.DISABLE_SOCKET_PROXY_PROPERTY, settings.disableSocketProxy());
return clientContext;
}
|
[
"public",
"static",
"HttpClientContext",
"newClientContext",
"(",
"HttpClientSettings",
"settings",
",",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"attributes",
")",
"{",
"final",
"HttpClientContext",
"clientContext",
"=",
"new",
"HttpClientContext",
"(",
")",
";",
"if",
"(",
"attributes",
"!=",
"null",
"&&",
"!",
"attributes",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"?",
">",
"entry",
":",
"attributes",
".",
"entrySet",
"(",
")",
")",
"{",
"clientContext",
".",
"setAttribute",
"(",
"entry",
".",
"getKey",
"(",
")",
",",
"entry",
".",
"getValue",
"(",
")",
")",
";",
"}",
"}",
"addPreemptiveAuthenticationProxy",
"(",
"clientContext",
",",
"settings",
")",
";",
"clientContext",
".",
"setAttribute",
"(",
"HttpContextUtils",
".",
"DISABLE_SOCKET_PROXY_PROPERTY",
",",
"settings",
".",
"disableSocketProxy",
"(",
")",
")",
";",
"return",
"clientContext",
";",
"}"
] |
Returns a new HttpClientContext used for request execution.
|
[
"Returns",
"a",
"new",
"HttpClientContext",
"used",
"for",
"request",
"execution",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java#L126-L142
|
19,691
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java
|
ApacheUtils.newProxyCredentialsProvider
|
public static CredentialsProvider newProxyCredentialsProvider
(HttpClientSettings settings) {
final CredentialsProvider provider = new BasicCredentialsProvider();
provider.setCredentials(newAuthScope(settings), newNTCredentials(settings));
return provider;
}
|
java
|
public static CredentialsProvider newProxyCredentialsProvider
(HttpClientSettings settings) {
final CredentialsProvider provider = new BasicCredentialsProvider();
provider.setCredentials(newAuthScope(settings), newNTCredentials(settings));
return provider;
}
|
[
"public",
"static",
"CredentialsProvider",
"newProxyCredentialsProvider",
"(",
"HttpClientSettings",
"settings",
")",
"{",
"final",
"CredentialsProvider",
"provider",
"=",
"new",
"BasicCredentialsProvider",
"(",
")",
";",
"provider",
".",
"setCredentials",
"(",
"newAuthScope",
"(",
"settings",
")",
",",
"newNTCredentials",
"(",
"settings",
")",
")",
";",
"return",
"provider",
";",
"}"
] |
Returns a new Credentials Provider for use with proxy authentication.
|
[
"Returns",
"a",
"new",
"Credentials",
"Provider",
"for",
"use",
"with",
"proxy",
"authentication",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java#L147-L152
|
19,692
|
aws/aws-sdk-java
|
aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java
|
ApacheUtils.newNTCredentials
|
private static Credentials newNTCredentials(HttpClientSettings settings) {
return new NTCredentials(settings.getProxyUsername(),
settings.getProxyPassword(),
settings.getProxyWorkstation(),
settings.getProxyDomain());
}
|
java
|
private static Credentials newNTCredentials(HttpClientSettings settings) {
return new NTCredentials(settings.getProxyUsername(),
settings.getProxyPassword(),
settings.getProxyWorkstation(),
settings.getProxyDomain());
}
|
[
"private",
"static",
"Credentials",
"newNTCredentials",
"(",
"HttpClientSettings",
"settings",
")",
"{",
"return",
"new",
"NTCredentials",
"(",
"settings",
".",
"getProxyUsername",
"(",
")",
",",
"settings",
".",
"getProxyPassword",
"(",
")",
",",
"settings",
".",
"getProxyWorkstation",
"(",
")",
",",
"settings",
".",
"getProxyDomain",
"(",
")",
")",
";",
"}"
] |
Returns a new instance of NTCredentials used for proxy authentication.
|
[
"Returns",
"a",
"new",
"instance",
"of",
"NTCredentials",
"used",
"for",
"proxy",
"authentication",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/utils/ApacheUtils.java#L157-L162
|
19,693
|
aws/aws-sdk-java
|
src/samples/AmazonKinesisFirehose/AmazonKinesisFirehoseToS3Sample.java
|
AmazonKinesisFirehoseToS3Sample.createDeliveryStream
|
private static void createDeliveryStream() throws Exception {
boolean deliveryStreamExists = false;
LOG.info("Checking if " + deliveryStreamName + " already exits");
List<String> deliveryStreamNames = listDeliveryStreams();
if (deliveryStreamNames != null && deliveryStreamNames.contains(deliveryStreamName)) {
deliveryStreamExists = true;
LOG.info("DeliveryStream " + deliveryStreamName + " already exists. Not creating the new delivery stream");
} else {
LOG.info("DeliveryStream " + deliveryStreamName + " does not exist");
}
if (!deliveryStreamExists) {
// Create deliveryStream
CreateDeliveryStreamRequest createDeliveryStreamRequest = new CreateDeliveryStreamRequest();
createDeliveryStreamRequest.setDeliveryStreamName(deliveryStreamName);
S3DestinationConfiguration s3DestinationConfiguration = new S3DestinationConfiguration();
s3DestinationConfiguration.setBucketARN(s3BucketARN);
s3DestinationConfiguration.setPrefix(s3ObjectPrefix);
// Could also specify GZIP or ZIP
s3DestinationConfiguration.setCompressionFormat(CompressionFormat.UNCOMPRESSED);
// Encryption configuration is optional
EncryptionConfiguration encryptionConfiguration = new EncryptionConfiguration();
if (!StringUtils.isNullOrEmpty(s3DestinationAWSKMSKeyId)) {
encryptionConfiguration.setKMSEncryptionConfig(new KMSEncryptionConfig()
.withAWSKMSKeyARN(s3DestinationAWSKMSKeyId));
} else {
encryptionConfiguration.setNoEncryptionConfig(NoEncryptionConfig.NoEncryption);
}
s3DestinationConfiguration.setEncryptionConfiguration(encryptionConfiguration);
BufferingHints bufferingHints = null;
if (s3DestinationSizeInMBs != null || s3DestinationIntervalInSeconds != null) {
bufferingHints = new BufferingHints();
bufferingHints.setSizeInMBs(s3DestinationSizeInMBs);
bufferingHints.setIntervalInSeconds(s3DestinationIntervalInSeconds);
}
s3DestinationConfiguration.setBufferingHints(bufferingHints);
// Create and set IAM role so that firehose service has access to the S3Buckets to put data
// and KMS keys (if provided) to encrypt data. Please check the trustPolicyDocument.json and
// permissionsPolicyDocument.json files for the trust and permissions policies set for the role.
String iamRoleArn = createIamRole(s3ObjectPrefix);
s3DestinationConfiguration.setRoleARN(iamRoleArn);
createDeliveryStreamRequest.setS3DestinationConfiguration(s3DestinationConfiguration);
firehoseClient.createDeliveryStream(createDeliveryStreamRequest);
// The Delivery Stream is now being created.
LOG.info("Creating DeliveryStream : " + deliveryStreamName);
waitForDeliveryStreamToBecomeAvailable(deliveryStreamName);
}
}
|
java
|
private static void createDeliveryStream() throws Exception {
boolean deliveryStreamExists = false;
LOG.info("Checking if " + deliveryStreamName + " already exits");
List<String> deliveryStreamNames = listDeliveryStreams();
if (deliveryStreamNames != null && deliveryStreamNames.contains(deliveryStreamName)) {
deliveryStreamExists = true;
LOG.info("DeliveryStream " + deliveryStreamName + " already exists. Not creating the new delivery stream");
} else {
LOG.info("DeliveryStream " + deliveryStreamName + " does not exist");
}
if (!deliveryStreamExists) {
// Create deliveryStream
CreateDeliveryStreamRequest createDeliveryStreamRequest = new CreateDeliveryStreamRequest();
createDeliveryStreamRequest.setDeliveryStreamName(deliveryStreamName);
S3DestinationConfiguration s3DestinationConfiguration = new S3DestinationConfiguration();
s3DestinationConfiguration.setBucketARN(s3BucketARN);
s3DestinationConfiguration.setPrefix(s3ObjectPrefix);
// Could also specify GZIP or ZIP
s3DestinationConfiguration.setCompressionFormat(CompressionFormat.UNCOMPRESSED);
// Encryption configuration is optional
EncryptionConfiguration encryptionConfiguration = new EncryptionConfiguration();
if (!StringUtils.isNullOrEmpty(s3DestinationAWSKMSKeyId)) {
encryptionConfiguration.setKMSEncryptionConfig(new KMSEncryptionConfig()
.withAWSKMSKeyARN(s3DestinationAWSKMSKeyId));
} else {
encryptionConfiguration.setNoEncryptionConfig(NoEncryptionConfig.NoEncryption);
}
s3DestinationConfiguration.setEncryptionConfiguration(encryptionConfiguration);
BufferingHints bufferingHints = null;
if (s3DestinationSizeInMBs != null || s3DestinationIntervalInSeconds != null) {
bufferingHints = new BufferingHints();
bufferingHints.setSizeInMBs(s3DestinationSizeInMBs);
bufferingHints.setIntervalInSeconds(s3DestinationIntervalInSeconds);
}
s3DestinationConfiguration.setBufferingHints(bufferingHints);
// Create and set IAM role so that firehose service has access to the S3Buckets to put data
// and KMS keys (if provided) to encrypt data. Please check the trustPolicyDocument.json and
// permissionsPolicyDocument.json files for the trust and permissions policies set for the role.
String iamRoleArn = createIamRole(s3ObjectPrefix);
s3DestinationConfiguration.setRoleARN(iamRoleArn);
createDeliveryStreamRequest.setS3DestinationConfiguration(s3DestinationConfiguration);
firehoseClient.createDeliveryStream(createDeliveryStreamRequest);
// The Delivery Stream is now being created.
LOG.info("Creating DeliveryStream : " + deliveryStreamName);
waitForDeliveryStreamToBecomeAvailable(deliveryStreamName);
}
}
|
[
"private",
"static",
"void",
"createDeliveryStream",
"(",
")",
"throws",
"Exception",
"{",
"boolean",
"deliveryStreamExists",
"=",
"false",
";",
"LOG",
".",
"info",
"(",
"\"Checking if \"",
"+",
"deliveryStreamName",
"+",
"\" already exits\"",
")",
";",
"List",
"<",
"String",
">",
"deliveryStreamNames",
"=",
"listDeliveryStreams",
"(",
")",
";",
"if",
"(",
"deliveryStreamNames",
"!=",
"null",
"&&",
"deliveryStreamNames",
".",
"contains",
"(",
"deliveryStreamName",
")",
")",
"{",
"deliveryStreamExists",
"=",
"true",
";",
"LOG",
".",
"info",
"(",
"\"DeliveryStream \"",
"+",
"deliveryStreamName",
"+",
"\" already exists. Not creating the new delivery stream\"",
")",
";",
"}",
"else",
"{",
"LOG",
".",
"info",
"(",
"\"DeliveryStream \"",
"+",
"deliveryStreamName",
"+",
"\" does not exist\"",
")",
";",
"}",
"if",
"(",
"!",
"deliveryStreamExists",
")",
"{",
"// Create deliveryStream",
"CreateDeliveryStreamRequest",
"createDeliveryStreamRequest",
"=",
"new",
"CreateDeliveryStreamRequest",
"(",
")",
";",
"createDeliveryStreamRequest",
".",
"setDeliveryStreamName",
"(",
"deliveryStreamName",
")",
";",
"S3DestinationConfiguration",
"s3DestinationConfiguration",
"=",
"new",
"S3DestinationConfiguration",
"(",
")",
";",
"s3DestinationConfiguration",
".",
"setBucketARN",
"(",
"s3BucketARN",
")",
";",
"s3DestinationConfiguration",
".",
"setPrefix",
"(",
"s3ObjectPrefix",
")",
";",
"// Could also specify GZIP or ZIP",
"s3DestinationConfiguration",
".",
"setCompressionFormat",
"(",
"CompressionFormat",
".",
"UNCOMPRESSED",
")",
";",
"// Encryption configuration is optional",
"EncryptionConfiguration",
"encryptionConfiguration",
"=",
"new",
"EncryptionConfiguration",
"(",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"s3DestinationAWSKMSKeyId",
")",
")",
"{",
"encryptionConfiguration",
".",
"setKMSEncryptionConfig",
"(",
"new",
"KMSEncryptionConfig",
"(",
")",
".",
"withAWSKMSKeyARN",
"(",
"s3DestinationAWSKMSKeyId",
")",
")",
";",
"}",
"else",
"{",
"encryptionConfiguration",
".",
"setNoEncryptionConfig",
"(",
"NoEncryptionConfig",
".",
"NoEncryption",
")",
";",
"}",
"s3DestinationConfiguration",
".",
"setEncryptionConfiguration",
"(",
"encryptionConfiguration",
")",
";",
"BufferingHints",
"bufferingHints",
"=",
"null",
";",
"if",
"(",
"s3DestinationSizeInMBs",
"!=",
"null",
"||",
"s3DestinationIntervalInSeconds",
"!=",
"null",
")",
"{",
"bufferingHints",
"=",
"new",
"BufferingHints",
"(",
")",
";",
"bufferingHints",
".",
"setSizeInMBs",
"(",
"s3DestinationSizeInMBs",
")",
";",
"bufferingHints",
".",
"setIntervalInSeconds",
"(",
"s3DestinationIntervalInSeconds",
")",
";",
"}",
"s3DestinationConfiguration",
".",
"setBufferingHints",
"(",
"bufferingHints",
")",
";",
"// Create and set IAM role so that firehose service has access to the S3Buckets to put data ",
"// and KMS keys (if provided) to encrypt data. Please check the trustPolicyDocument.json and ",
"// permissionsPolicyDocument.json files for the trust and permissions policies set for the role.",
"String",
"iamRoleArn",
"=",
"createIamRole",
"(",
"s3ObjectPrefix",
")",
";",
"s3DestinationConfiguration",
".",
"setRoleARN",
"(",
"iamRoleArn",
")",
";",
"createDeliveryStreamRequest",
".",
"setS3DestinationConfiguration",
"(",
"s3DestinationConfiguration",
")",
";",
"firehoseClient",
".",
"createDeliveryStream",
"(",
"createDeliveryStreamRequest",
")",
";",
"// The Delivery Stream is now being created.",
"LOG",
".",
"info",
"(",
"\"Creating DeliveryStream : \"",
"+",
"deliveryStreamName",
")",
";",
"waitForDeliveryStreamToBecomeAvailable",
"(",
"deliveryStreamName",
")",
";",
"}",
"}"
] |
Method to create delivery stream for S3 destination configuration.
@throws Exception
|
[
"Method",
"to",
"create",
"delivery",
"stream",
"for",
"S3",
"destination",
"configuration",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/src/samples/AmazonKinesisFirehose/AmazonKinesisFirehoseToS3Sample.java#L206-L262
|
19,694
|
aws/aws-sdk-java
|
src/samples/AmazonKinesisFirehose/AmazonKinesisFirehoseToS3Sample.java
|
AmazonKinesisFirehoseToS3Sample.updateDeliveryStream
|
private static void updateDeliveryStream() throws Exception {
DeliveryStreamDescription deliveryStreamDescription = describeDeliveryStream(deliveryStreamName);
LOG.info("Updating DeliveryStream Destination: " + deliveryStreamName + " with new configuration options");
// get(0) -> DeliveryStream currently supports only one destination per DeliveryStream
UpdateDestinationRequest updateDestinationRequest =
new UpdateDestinationRequest()
.withDeliveryStreamName(deliveryStreamName)
.withCurrentDeliveryStreamVersionId(deliveryStreamDescription.getVersionId())
.withDestinationId(deliveryStreamDescription.getDestinations().get(0).getDestinationId());
S3DestinationUpdate s3DestinationUpdate = new S3DestinationUpdate();
s3DestinationUpdate.withPrefix(updateS3ObjectPrefix);
BufferingHints bufferingHints = null;
if (updateSizeInMBs != null || updateIntervalInSeconds != null) {
bufferingHints = new BufferingHints();
bufferingHints.setSizeInMBs(updateSizeInMBs);
bufferingHints.setIntervalInSeconds(updateIntervalInSeconds);
}
s3DestinationUpdate.setBufferingHints(bufferingHints);
// Update the role policy with new s3Prefix configuration
putRolePolicy(updateS3ObjectPrefix);
updateDestinationRequest.setS3DestinationUpdate(s3DestinationUpdate);
// Update deliveryStream destination with new configuration options such as s3Prefix and Buffering Hints.
// Can also update Compression format, KMS key values and IAM Role.
firehoseClient.updateDestination(updateDestinationRequest);
}
|
java
|
private static void updateDeliveryStream() throws Exception {
DeliveryStreamDescription deliveryStreamDescription = describeDeliveryStream(deliveryStreamName);
LOG.info("Updating DeliveryStream Destination: " + deliveryStreamName + " with new configuration options");
// get(0) -> DeliveryStream currently supports only one destination per DeliveryStream
UpdateDestinationRequest updateDestinationRequest =
new UpdateDestinationRequest()
.withDeliveryStreamName(deliveryStreamName)
.withCurrentDeliveryStreamVersionId(deliveryStreamDescription.getVersionId())
.withDestinationId(deliveryStreamDescription.getDestinations().get(0).getDestinationId());
S3DestinationUpdate s3DestinationUpdate = new S3DestinationUpdate();
s3DestinationUpdate.withPrefix(updateS3ObjectPrefix);
BufferingHints bufferingHints = null;
if (updateSizeInMBs != null || updateIntervalInSeconds != null) {
bufferingHints = new BufferingHints();
bufferingHints.setSizeInMBs(updateSizeInMBs);
bufferingHints.setIntervalInSeconds(updateIntervalInSeconds);
}
s3DestinationUpdate.setBufferingHints(bufferingHints);
// Update the role policy with new s3Prefix configuration
putRolePolicy(updateS3ObjectPrefix);
updateDestinationRequest.setS3DestinationUpdate(s3DestinationUpdate);
// Update deliveryStream destination with new configuration options such as s3Prefix and Buffering Hints.
// Can also update Compression format, KMS key values and IAM Role.
firehoseClient.updateDestination(updateDestinationRequest);
}
|
[
"private",
"static",
"void",
"updateDeliveryStream",
"(",
")",
"throws",
"Exception",
"{",
"DeliveryStreamDescription",
"deliveryStreamDescription",
"=",
"describeDeliveryStream",
"(",
"deliveryStreamName",
")",
";",
"LOG",
".",
"info",
"(",
"\"Updating DeliveryStream Destination: \"",
"+",
"deliveryStreamName",
"+",
"\" with new configuration options\"",
")",
";",
"// get(0) -> DeliveryStream currently supports only one destination per DeliveryStream",
"UpdateDestinationRequest",
"updateDestinationRequest",
"=",
"new",
"UpdateDestinationRequest",
"(",
")",
".",
"withDeliveryStreamName",
"(",
"deliveryStreamName",
")",
".",
"withCurrentDeliveryStreamVersionId",
"(",
"deliveryStreamDescription",
".",
"getVersionId",
"(",
")",
")",
".",
"withDestinationId",
"(",
"deliveryStreamDescription",
".",
"getDestinations",
"(",
")",
".",
"get",
"(",
"0",
")",
".",
"getDestinationId",
"(",
")",
")",
";",
"S3DestinationUpdate",
"s3DestinationUpdate",
"=",
"new",
"S3DestinationUpdate",
"(",
")",
";",
"s3DestinationUpdate",
".",
"withPrefix",
"(",
"updateS3ObjectPrefix",
")",
";",
"BufferingHints",
"bufferingHints",
"=",
"null",
";",
"if",
"(",
"updateSizeInMBs",
"!=",
"null",
"||",
"updateIntervalInSeconds",
"!=",
"null",
")",
"{",
"bufferingHints",
"=",
"new",
"BufferingHints",
"(",
")",
";",
"bufferingHints",
".",
"setSizeInMBs",
"(",
"updateSizeInMBs",
")",
";",
"bufferingHints",
".",
"setIntervalInSeconds",
"(",
"updateIntervalInSeconds",
")",
";",
"}",
"s3DestinationUpdate",
".",
"setBufferingHints",
"(",
"bufferingHints",
")",
";",
"// Update the role policy with new s3Prefix configuration",
"putRolePolicy",
"(",
"updateS3ObjectPrefix",
")",
";",
"updateDestinationRequest",
".",
"setS3DestinationUpdate",
"(",
"s3DestinationUpdate",
")",
";",
"// Update deliveryStream destination with new configuration options such as s3Prefix and Buffering Hints.",
"// Can also update Compression format, KMS key values and IAM Role.",
"firehoseClient",
".",
"updateDestination",
"(",
"updateDestinationRequest",
")",
";",
"}"
] |
Method to update s3 destination with updated s3Prefix, and buffering hints values.
@throws Exception
|
[
"Method",
"to",
"update",
"s3",
"destination",
"with",
"updated",
"s3Prefix",
"and",
"buffering",
"hints",
"values",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/src/samples/AmazonKinesisFirehose/AmazonKinesisFirehoseToS3Sample.java#L269-L299
|
19,695
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java
|
TableUtils.waitUntilExists
|
public static void waitUntilExists(final AmazonDynamoDB dynamo, final String tableName)
throws InterruptedException {
waitUntilExists(dynamo, tableName, DEFAULT_WAIT_TIMEOUT, DEFAULT_WAIT_INTERVAL);
}
|
java
|
public static void waitUntilExists(final AmazonDynamoDB dynamo, final String tableName)
throws InterruptedException {
waitUntilExists(dynamo, tableName, DEFAULT_WAIT_TIMEOUT, DEFAULT_WAIT_INTERVAL);
}
|
[
"public",
"static",
"void",
"waitUntilExists",
"(",
"final",
"AmazonDynamoDB",
"dynamo",
",",
"final",
"String",
"tableName",
")",
"throws",
"InterruptedException",
"{",
"waitUntilExists",
"(",
"dynamo",
",",
"tableName",
",",
"DEFAULT_WAIT_TIMEOUT",
",",
"DEFAULT_WAIT_INTERVAL",
")",
";",
"}"
] |
Waits up to 10 minutes for a specified DynamoDB table to resolve,
indicating that it exists. If the table doesn't return a result after
this time, a SdkClientException is thrown.
@param dynamo
The DynamoDB client to use to make requests.
@param tableName
The name of the table being resolved.
@throws SdkClientException
If the specified table does not resolve before this method
times out and stops polling.
@throws InterruptedException
If the thread is interrupted while waiting for the table to
resolve.
|
[
"Waits",
"up",
"to",
"10",
"minutes",
"for",
"a",
"specified",
"DynamoDB",
"table",
"to",
"resolve",
"indicating",
"that",
"it",
"exists",
".",
"If",
"the",
"table",
"doesn",
"t",
"return",
"a",
"result",
"after",
"this",
"time",
"a",
"SdkClientException",
"is",
"thrown",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java#L83-L86
|
19,696
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java
|
TableUtils.waitUntilExists
|
public static void waitUntilExists(final AmazonDynamoDB dynamo, final String tableName, final int timeout,
final int interval) throws InterruptedException {
TableDescription table = waitForTableDescription(dynamo, tableName, null, timeout, interval);
if (table == null) {
throw new SdkClientException("Table " + tableName + " never returned a result");
}
}
|
java
|
public static void waitUntilExists(final AmazonDynamoDB dynamo, final String tableName, final int timeout,
final int interval) throws InterruptedException {
TableDescription table = waitForTableDescription(dynamo, tableName, null, timeout, interval);
if (table == null) {
throw new SdkClientException("Table " + tableName + " never returned a result");
}
}
|
[
"public",
"static",
"void",
"waitUntilExists",
"(",
"final",
"AmazonDynamoDB",
"dynamo",
",",
"final",
"String",
"tableName",
",",
"final",
"int",
"timeout",
",",
"final",
"int",
"interval",
")",
"throws",
"InterruptedException",
"{",
"TableDescription",
"table",
"=",
"waitForTableDescription",
"(",
"dynamo",
",",
"tableName",
",",
"null",
",",
"timeout",
",",
"interval",
")",
";",
"if",
"(",
"table",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Table \"",
"+",
"tableName",
"+",
"\" never returned a result\"",
")",
";",
"}",
"}"
] |
Waits up to a specified amount of time for a specified DynamoDB table to
resolve, indicating that it exists. If the table doesn't return a result
after this time, a SdkClientException is thrown.
@param dynamo
The DynamoDB client to use to make requests.
@param tableName
The name of the table being resolved.
@param timeout
The maximum number of milliseconds to wait.
@param interval
The poll interval in milliseconds.
@throws SdkClientException
If the specified table does not resolve before this method
times out and stops polling.
@throws InterruptedException
If the thread is interrupted while waiting for the table to
resolve.
|
[
"Waits",
"up",
"to",
"a",
"specified",
"amount",
"of",
"time",
"for",
"a",
"specified",
"DynamoDB",
"table",
"to",
"resolve",
"indicating",
"that",
"it",
"exists",
".",
"If",
"the",
"table",
"doesn",
"t",
"return",
"a",
"result",
"after",
"this",
"time",
"a",
"SdkClientException",
"is",
"thrown",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java#L109-L116
|
19,697
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java
|
TableUtils.waitForTableDescription
|
private static TableDescription waitForTableDescription(final AmazonDynamoDB dynamo, final String tableName,
TableStatus desiredStatus, final int timeout, final int interval)
throws InterruptedException, IllegalArgumentException {
if (timeout < 0) {
throw new IllegalArgumentException("Timeout must be >= 0");
}
if (interval <= 0 || interval >= timeout) {
throw new IllegalArgumentException("Interval must be > 0 and < timeout");
}
long startTime = System.currentTimeMillis();
long endTime = startTime + timeout;
TableDescription table = null;
while (System.currentTimeMillis() < endTime) {
try {
table = dynamo.describeTable(new DescribeTableRequest(tableName)).getTable();
if (desiredStatus == null || table.getTableStatus().equals(desiredStatus.toString())) {
return table;
}
} catch (ResourceNotFoundException rnfe) {
// ResourceNotFound means the table doesn't exist yet,
// so ignore this error and just keep polling.
}
Thread.sleep(interval);
}
return table;
}
|
java
|
private static TableDescription waitForTableDescription(final AmazonDynamoDB dynamo, final String tableName,
TableStatus desiredStatus, final int timeout, final int interval)
throws InterruptedException, IllegalArgumentException {
if (timeout < 0) {
throw new IllegalArgumentException("Timeout must be >= 0");
}
if (interval <= 0 || interval >= timeout) {
throw new IllegalArgumentException("Interval must be > 0 and < timeout");
}
long startTime = System.currentTimeMillis();
long endTime = startTime + timeout;
TableDescription table = null;
while (System.currentTimeMillis() < endTime) {
try {
table = dynamo.describeTable(new DescribeTableRequest(tableName)).getTable();
if (desiredStatus == null || table.getTableStatus().equals(desiredStatus.toString())) {
return table;
}
} catch (ResourceNotFoundException rnfe) {
// ResourceNotFound means the table doesn't exist yet,
// so ignore this error and just keep polling.
}
Thread.sleep(interval);
}
return table;
}
|
[
"private",
"static",
"TableDescription",
"waitForTableDescription",
"(",
"final",
"AmazonDynamoDB",
"dynamo",
",",
"final",
"String",
"tableName",
",",
"TableStatus",
"desiredStatus",
",",
"final",
"int",
"timeout",
",",
"final",
"int",
"interval",
")",
"throws",
"InterruptedException",
",",
"IllegalArgumentException",
"{",
"if",
"(",
"timeout",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Timeout must be >= 0\"",
")",
";",
"}",
"if",
"(",
"interval",
"<=",
"0",
"||",
"interval",
">=",
"timeout",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Interval must be > 0 and < timeout\"",
")",
";",
"}",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"endTime",
"=",
"startTime",
"+",
"timeout",
";",
"TableDescription",
"table",
"=",
"null",
";",
"while",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"<",
"endTime",
")",
"{",
"try",
"{",
"table",
"=",
"dynamo",
".",
"describeTable",
"(",
"new",
"DescribeTableRequest",
"(",
"tableName",
")",
")",
".",
"getTable",
"(",
")",
";",
"if",
"(",
"desiredStatus",
"==",
"null",
"||",
"table",
".",
"getTableStatus",
"(",
")",
".",
"equals",
"(",
"desiredStatus",
".",
"toString",
"(",
")",
")",
")",
"{",
"return",
"table",
";",
"}",
"}",
"catch",
"(",
"ResourceNotFoundException",
"rnfe",
")",
"{",
"// ResourceNotFound means the table doesn't exist yet,",
"// so ignore this error and just keep polling.",
"}",
"Thread",
".",
"sleep",
"(",
"interval",
")",
";",
"}",
"return",
"table",
";",
"}"
] |
Wait for the table to reach the desired status and returns the table
description
@param dynamo
Dynamo client to use
@param tableName
Table name to poll status of
@param desiredStatus
Desired {@link TableStatus} to wait for. If null this method
simply waits until DescribeTable returns something non-null
(i.e. any status)
@param timeout
Timeout in milliseconds to continue to poll for desired status
@param interval
Time to wait in milliseconds between poll attempts
@return Null if DescribeTables never returns a result, otherwise the
result of the last poll attempt (which may or may not have the
desired state)
@throws InterruptedException
@throws {@link
IllegalArgumentException} If timeout or interval is invalid
|
[
"Wait",
"for",
"the",
"table",
"to",
"reach",
"the",
"desired",
"status",
"and",
"returns",
"the",
"table",
"description"
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java#L197-L225
|
19,698
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java
|
TableUtils.createTableIfNotExists
|
public static final boolean createTableIfNotExists(final AmazonDynamoDB dynamo, final CreateTableRequest createTableRequest) {
try {
dynamo.createTable(createTableRequest);
return true;
} catch (final ResourceInUseException e) {
if (LOG.isTraceEnabled()) {
LOG.trace("Table " + createTableRequest.getTableName() + " already exists", e);
}
}
return false;
}
|
java
|
public static final boolean createTableIfNotExists(final AmazonDynamoDB dynamo, final CreateTableRequest createTableRequest) {
try {
dynamo.createTable(createTableRequest);
return true;
} catch (final ResourceInUseException e) {
if (LOG.isTraceEnabled()) {
LOG.trace("Table " + createTableRequest.getTableName() + " already exists", e);
}
}
return false;
}
|
[
"public",
"static",
"final",
"boolean",
"createTableIfNotExists",
"(",
"final",
"AmazonDynamoDB",
"dynamo",
",",
"final",
"CreateTableRequest",
"createTableRequest",
")",
"{",
"try",
"{",
"dynamo",
".",
"createTable",
"(",
"createTableRequest",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"final",
"ResourceInUseException",
"e",
")",
"{",
"if",
"(",
"LOG",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"Table \"",
"+",
"createTableRequest",
".",
"getTableName",
"(",
")",
"+",
"\" already exists\"",
",",
"e",
")",
";",
"}",
"}",
"return",
"false",
";",
"}"
] |
Creates the table and ignores any errors if it already exists.
@param dynamo The Dynamo client to use.
@param createTableRequest The create table request.
@return True if created, false otherwise.
|
[
"Creates",
"the",
"table",
"and",
"ignores",
"any",
"errors",
"if",
"it",
"already",
"exists",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java#L233-L243
|
19,699
|
aws/aws-sdk-java
|
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java
|
TableUtils.deleteTableIfExists
|
public static final boolean deleteTableIfExists(final AmazonDynamoDB dynamo, final DeleteTableRequest deleteTableRequest) {
try {
dynamo.deleteTable(deleteTableRequest);
return true;
} catch (final ResourceNotFoundException e) {
if (LOG.isTraceEnabled()) {
LOG.trace("Table " + deleteTableRequest.getTableName() + " does not exist", e);
}
}
return false;
}
|
java
|
public static final boolean deleteTableIfExists(final AmazonDynamoDB dynamo, final DeleteTableRequest deleteTableRequest) {
try {
dynamo.deleteTable(deleteTableRequest);
return true;
} catch (final ResourceNotFoundException e) {
if (LOG.isTraceEnabled()) {
LOG.trace("Table " + deleteTableRequest.getTableName() + " does not exist", e);
}
}
return false;
}
|
[
"public",
"static",
"final",
"boolean",
"deleteTableIfExists",
"(",
"final",
"AmazonDynamoDB",
"dynamo",
",",
"final",
"DeleteTableRequest",
"deleteTableRequest",
")",
"{",
"try",
"{",
"dynamo",
".",
"deleteTable",
"(",
"deleteTableRequest",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"final",
"ResourceNotFoundException",
"e",
")",
"{",
"if",
"(",
"LOG",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"Table \"",
"+",
"deleteTableRequest",
".",
"getTableName",
"(",
")",
"+",
"\" does not exist\"",
",",
"e",
")",
";",
"}",
"}",
"return",
"false",
";",
"}"
] |
Deletes the table and ignores any errors if it doesn't exist.
@param dynamo The Dynamo client to use.
@param deleteTableRequest The delete table request.
@return True if deleted, false otherwise.
|
[
"Deletes",
"the",
"table",
"and",
"ignores",
"any",
"errors",
"if",
"it",
"doesn",
"t",
"exist",
"."
] |
aa38502458969b2d13a1c3665a56aba600e4dbd0
|
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java#L251-L261
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.