idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
13,300
public Optional < String > header ( String headerName ) { return Optional . ofNullable ( httpMetadata . getHttpHeaders ( ) . get ( headerName ) ) ; }
Get a specific header from the HTTP response .
13,301
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 ( versi...
Parse the output from the credentials process .
13,302
private AWSCredentials credentials ( JsonNode credentialsJson ) { String accessKeyId = getText ( credentialsJson , "AccessKeyId" ) ; String secretAccessKey = getText ( credentialsJson , "SecretAccessKey" ) ; String sessionToken = getText ( credentialsJson , "SessionToken" ) ; ValidationUtils . assertStringNotEmpty ( ac...
Parse the process output to retrieve the credentials .
13,303
private DateTime credentialExpirationTime ( JsonNode credentialsJson ) { String expiration = getText ( credentialsJson , "Expiration" ) ; if ( expiration != null ) { DateTime credentialExpiration = new DateTime ( DateUtils . parseISO8601Date ( expiration ) ) ; credentialExpiration = credentialExpiration . minus ( expir...
Parse the process output to retrieve the expiration date and time . The result includes any configured expiration buffer .
13,304
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 ( ...
Get a textual value from a json object throwing an exception if the node is missing or not textual .
13,305
private String executeCommand ( ) throws IOException , InterruptedException { ProcessBuilder processBuilder = new ProcessBuilder ( command ) ; ByteArrayOutputStream commandOutput = new ByteArrayOutputStream ( ) ; Process process = processBuilder . start ( ) ; try { IOUtils . copy ( process . getInputStream ( ) , comman...
Execute the external process to retrieve credentials .
13,306
public void setAdditionalStagingLabelsToDownload ( java . util . Collection < String > additionalStagingLabelsToDownload ) { if ( additionalStagingLabelsToDownload == null ) { this . additionalStagingLabelsToDownload = null ; return ; } this . additionalStagingLabelsToDownload = new java . util . ArrayList < String > (...
Optional . The staging labels whose values you want to make available on the core in addition to AWSCURRENT .
13,307
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 ) ...
ProfilesConfigFile immediately loads the profiles at construction time
13,308
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 .
13,309
public S3Location withCannedACL ( CannedAccessControlList cannedACL ) { setCannedACL ( cannedACL == null ? null : cannedACL . toString ( ) ) ; return this ; }
Sets the canned ACL to apply to the restore results .
13,310
public S3Location withStorageClass ( StorageClass storageClass ) { setStorageClass ( storageClass == null ? null : storageClass . toString ( ) ) ; return this ; }
Sets the class of storage used to store the restore results .
13,311
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...
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 .
13,312
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 bett...
13,313
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 ( accou...
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 bett...
13,314
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...
13,315
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 , ProgressEv...
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 . Onc...
13,316
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 ) { ...
Download one chunk from Amazon Glacier . It will do the retry if any errors are encountered while streaming the data from Amazon Glacier .
13,317
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 .
13,318
private int matchXmlNamespaceAttribute ( String s ) { StringPrefixSlicer stringSlicer = new StringPrefixSlicer ( s ) ; if ( stringSlicer . removePrefix ( "xmlns" ) == false ) return - 1 ; stringSlicer . removeRepeatingPrefix ( " " ) ; if ( stringSlicer . removePrefix ( "=" ) == false ) return - 1 ; stringSlicer . remov...
Checks if the string starts with a complete XML namespace attribute and if so returns the number of characters that match .
13,319
public GetDocumentStreamResult getDocumentStream ( final GetDocumentStreamRequest getDocumentStreamRequest ) { String versionId = getDocumentStreamRequest . getVersionId ( ) ; if ( versionId == null ) { GetDocumentRequest getDocumentRequest = new GetDocumentRequest ( ) ; getDocumentRequest . setDocumentId ( getDocument...
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 .
13,320
public UploadDocumentStreamResult uploadDocumentStream ( UploadDocumentStreamRequest uploadDocumentStreamRequest ) { InputStream stream = uploadDocumentStreamRequest . getStream ( ) ; if ( stream == null ) { throw new IllegalArgumentException ( "InputStream must be specified." ) ; } InitiateDocumentVersionUploadRequest...
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 .
13,321
public Waiter < ReadJobRequest > jobComplete ( ) { return new WaiterBuilder < ReadJobRequest , ReadJobResult > ( ) . withSdkFunction ( new ReadJobFunction ( client ) ) . withAcceptors ( new JobComplete . IsCompleteMatcher ( ) , new JobComplete . IsCanceledMatcher ( ) , new JobComplete . IsErrorMatcher ( ) ) . withDefau...
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 .
13,322
private boolean isDownloadParallel ( PresignedUrlDownloadRequest request , Long startByte , Long endByte , long partialObjectMaxSize ) { return ! configuration . isDisableParallelDownloads ( ) && ! ( s3 instanceof AmazonS3Encryption ) && request . getRange ( ) == null && ( startByte != null && endByte != null && endByt...
Returns a boolean value indicating if object can be downloaded in parallel when using presigned url .
13,323
public Download resumeDownload ( PersistableDownload persistableDownload ) { assertParameterNotNull ( persistableDownload , "PausedDownload is mandatory to resume a download." ) ; GetObjectRequest request = new GetObjectRequest ( persistableDownload . getBucketName ( ) , persistableDownload . getKey ( ) , persistableDo...
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 .
13,324
public java . util . concurrent . Future < ChangeMessageVisibilityResult > changeMessageVisibilityAsync ( String queueUrl , String receiptHandle , Integer visibilityTimeout , com . amazonaws . handlers . AsyncHandler < ChangeMessageVisibilityRequest , ChangeMessageVisibilityResult > asyncHandler ) { return changeMessag...
Simplified method form for invoking the ChangeMessageVisibility operation with an AsyncHandler .
13,325
public java . util . concurrent . Future < ChangeMessageVisibilityBatchResult > changeMessageVisibilityBatchAsync ( String queueUrl , java . util . List < ChangeMessageVisibilityBatchRequestEntry > entries , com . amazonaws . handlers . AsyncHandler < ChangeMessageVisibilityBatchRequest , ChangeMessageVisibilityBatchRe...
Simplified method form for invoking the ChangeMessageVisibilityBatch operation with an AsyncHandler .
13,326
public java . util . concurrent . Future < CreateQueueResult > createQueueAsync ( String queueName ) { return createQueueAsync ( new CreateQueueRequest ( ) . withQueueName ( queueName ) ) ; }
Simplified method form for invoking the CreateQueue operation .
13,327
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 .
13,328
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 .
13,329
public java . util . concurrent . Future < DeleteMessageResult > deleteMessageAsync ( String queueUrl , String receiptHandle , com . amazonaws . handlers . AsyncHandler < DeleteMessageRequest , DeleteMessageResult > asyncHandler ) { return deleteMessageAsync ( new DeleteMessageRequest ( ) . withQueueUrl ( queueUrl ) . ...
Simplified method form for invoking the DeleteMessage operation with an AsyncHandler .
13,330
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 .
13,331
public java . util . concurrent . Future < DeleteMessageBatchResult > deleteMessageBatchAsync ( String queueUrl , java . util . List < DeleteMessageBatchRequestEntry > entries , com . amazonaws . handlers . AsyncHandler < DeleteMessageBatchRequest , DeleteMessageBatchResult > asyncHandler ) { return deleteMessageBatchA...
Simplified method form for invoking the DeleteMessageBatch operation with an AsyncHandler .
13,332
public java . util . concurrent . Future < DeleteQueueResult > deleteQueueAsync ( String queueUrl ) { return deleteQueueAsync ( new DeleteQueueRequest ( ) . withQueueUrl ( queueUrl ) ) ; }
Simplified method form for invoking the DeleteQueue operation .
13,333
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 .
13,334
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 .
13,335
public java . util . concurrent . Future < GetQueueAttributesResult > getQueueAttributesAsync ( String queueUrl , java . util . List < String > attributeNames , com . amazonaws . handlers . AsyncHandler < GetQueueAttributesRequest , GetQueueAttributesResult > asyncHandler ) { return getQueueAttributesAsync ( new GetQue...
Simplified method form for invoking the GetQueueAttributes operation with an AsyncHandler .
13,336
public java . util . concurrent . Future < GetQueueUrlResult > getQueueUrlAsync ( String queueName ) { return getQueueUrlAsync ( new GetQueueUrlRequest ( ) . withQueueName ( queueName ) ) ; }
Simplified method form for invoking the GetQueueUrl operation .
13,337
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 .
13,338
public java . util . concurrent . Future < ListQueueTagsResult > listQueueTagsAsync ( String queueUrl ) { return listQueueTagsAsync ( new ListQueueTagsRequest ( ) . withQueueUrl ( queueUrl ) ) ; }
Simplified method form for invoking the ListQueueTags operation .
13,339
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 .
13,340
public java . util . concurrent . Future < ListQueuesResult > listQueuesAsync ( String queueNamePrefix ) { return listQueuesAsync ( new ListQueuesRequest ( ) . withQueueNamePrefix ( queueNamePrefix ) ) ; }
Simplified method form for invoking the ListQueues operation .
13,341
public java . util . concurrent . Future < ReceiveMessageResult > receiveMessageAsync ( String queueUrl ) { return receiveMessageAsync ( new ReceiveMessageRequest ( ) . withQueueUrl ( queueUrl ) ) ; }
Simplified method form for invoking the ReceiveMessage operation .
13,342
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 .
13,343
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 .
13,344
public java . util . concurrent . Future < SendMessageResult > sendMessageAsync ( String queueUrl , String messageBody , com . amazonaws . handlers . AsyncHandler < SendMessageRequest , SendMessageResult > asyncHandler ) { return sendMessageAsync ( new SendMessageRequest ( ) . withQueueUrl ( queueUrl ) . withMessageBod...
Simplified method form for invoking the SendMessage operation with an AsyncHandler .
13,345
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 .
13,346
public java . util . concurrent . Future < SendMessageBatchResult > sendMessageBatchAsync ( String queueUrl , java . util . List < SendMessageBatchRequestEntry > entries , com . amazonaws . handlers . AsyncHandler < SendMessageBatchRequest , SendMessageBatchResult > asyncHandler ) { return sendMessageBatchAsync ( new S...
Simplified method form for invoking the SendMessageBatch operation with an AsyncHandler .
13,347
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 .
13,348
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 Se...
Simplified method form for invoking the SetQueueAttributes operation with an AsyncHandler .
13,349
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 .
13,350
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...
Simplified method form for invoking the TagQueue operation with an AsyncHandler .
13,351
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 .
13,352
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 ) . w...
Simplified method form for invoking the UntagQueue operation with an AsyncHandler .
13,353
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 : memberM...
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 .
13,354
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 .
13,355
public boolean removeMemberByC2jName ( String memberC2jName , boolean ignoreCase ) { 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 .
13,356
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 .
13,357
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
13,358
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 ....
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 .
13,359
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 Pr...
Used to specify multiple hash - only primary keys .
13,360
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 ke...
Used to specify multiple hash - and - range primary keys .
13,361
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 .
13,362
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 .
13,363
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 .
13,364
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 ;...
Adds multiple hash - and - range primary keys to be included in the batch get - item operation .
13,365
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 .
13,366
public Waiter < DescribeAppsRequest > appExists ( ) { return new WaiterBuilder < DescribeAppsRequest , DescribeAppsResult > ( ) . withSdkFunction ( new DescribeAppsFunction ( client ) ) . withAcceptors ( new HttpSuccessStatusAcceptor ( WaiterState . SUCCESS ) , new HttpFailureStatusAcceptor ( 400 , WaiterState . FAILUR...
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 .
13,367
public Waiter < DescribeInstancesRequest > instanceOnline ( ) { return new WaiterBuilder < DescribeInstancesRequest , DescribeInstancesResult > ( ) . withSdkFunction ( new DescribeInstancesFunction ( client ) ) . withAcceptors ( new InstanceOnline . IsOnlineMatcher ( ) , new InstanceOnline . IsSetup_failedMatcher ( ) ,...
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 .
13,368
public Waiter < DescribeInstancesRequest > instanceRegistered ( ) { return new WaiterBuilder < DescribeInstancesRequest , DescribeInstancesResult > ( ) . withSdkFunction ( new DescribeInstancesFunction ( client ) ) . withAcceptors ( new InstanceRegistered . IsRegisteredMatcher ( ) , new InstanceRegistered . IsSetup_fai...
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 ...
13,369
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 ( Progr...
This method is also responsible for firing COMPLETED signal to the listeners .
13,370
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 .
13,371
private void addHeadersToRequest ( HttpRequestBase httpRequest , Request < ? > request ) { httpRequest . addHeader ( HttpHeaders . HOST , getHostHeaderValue ( request . getEndpoint ( ) ) ) ; for ( Entry < String , String > entry : request . getHeaders ( ) . entrySet ( ) ) { if ( ! ( ignoreHeaders . contains ( entry . g...
Configures the headers in the specified Apache HTTP request .
13,372
private void addProxyConfig ( RequestConfig . Builder requestConfigBuilder , HttpClientSettings settings ) { if ( settings . isProxyEnabled ( ) && settings . isAuthenticatedProxy ( ) && settings . getProxyAuthenticationMethods ( ) != null ) { List < String > apacheAuthenticationSchemes = new ArrayList < String > ( ) ; ...
Update the provided request configuration builder to specify the proxy authentication schemes that should be used when authenticating against the HTTP proxy .
13,373
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 BA...
Convert the customer - facing authentication method into an apache - specific authentication method .
13,374
public Future < SendMessageResult > sendMessage ( SendMessageRequest request , AsyncHandler < SendMessageRequest , SendMessageResult > handler ) { QueueBufferCallback < SendMessageRequest , SendMessageResult > callback = null ; if ( handler != null ) { callback = new QueueBufferCallback < SendMessageRequest , SendMessa...
asynchronously enqueues a message to SQS .
13,375
public SendMessageResult sendMessageSync ( SendMessageRequest request ) { Future < SendMessageResult > future = sendMessage ( request , null ) ; return waitForFuture ( future ) ; }
Sends a message to SQS and returns the SQS reply .
13,376
public Future < DeleteMessageResult > deleteMessage ( DeleteMessageRequest request , AsyncHandler < DeleteMessageRequest , DeleteMessageResult > handler ) { QueueBufferCallback < DeleteMessageRequest , DeleteMessageResult > callback = null ; if ( handler != null ) { callback = new QueueBufferCallback < DeleteMessageReq...
Asynchronously deletes a message from SQS .
13,377
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
13,378
public Future < ChangeMessageVisibilityResult > changeMessageVisibility ( ChangeMessageVisibilityRequest request , AsyncHandler < ChangeMessageVisibilityRequest , ChangeMessageVisibilityResult > handler ) { QueueBufferCallback < ChangeMessageVisibilityRequest , ChangeMessageVisibilityResult > callback = null ; if ( han...
asynchronously adjust a message s visibility timeout to SQS .
13,379
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 .
13,380
public Future < ReceiveMessageResult > receiveMessage ( ReceiveMessageRequest rq , AsyncHandler < ReceiveMessageRequest , ReceiveMessageResult > handler ) { if ( canBeRetrievedFromQueueBuffer ( rq ) ) { QueueBufferCallback < ReceiveMessageRequest , ReceiveMessageResult > callback = null ; if ( handler != null ) { callb...
Submits a request to receive some messages from SQS .
13,381
public ReceiveMessageResult receiveMessageSync ( ReceiveMessageRequest rq ) { Future < ReceiveMessageResult > future = receiveMessage ( rq , null ) ; return waitForFuture ( future ) ; }
Retrieves messages from an SQS queue .
13,382
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 ...
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
13,383
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 .
13,384
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 ) ...
Creates and initializes an HttpResponse object suitable to be passed to an HTTP response handler object .
13,385
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 .
13,386
public static HttpEntity newBufferedHttpEntity ( HttpEntity entity ) throws FakeIOException { try { return new BufferedHttpEntity ( entity ) ; } catch ( FakeIOException e ) { 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 .
13,387
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 (...
Returns a new HttpClientContext used for request execution .
13,388
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 .
13,389
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 .
13,390
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 ( deliveryStre...
Method to create delivery stream for S3 destination configuration .
13,391
private static void updateDeliveryStream ( ) throws Exception { DeliveryStreamDescription deliveryStreamDescription = describeDeliveryStream ( deliveryStreamName ) ; LOG . info ( "Updating DeliveryStream Destination: " + deliveryStreamName + " with new configuration options" ) ; UpdateDestinationRequest updateDestinati...
Method to update s3 destination with updated s3Prefix and buffering hints values .
13,392
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 .
13,393
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 ( "...
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 .
13,394
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" ...
Wait for the table to reach the desired status and returns the table description
13,395
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 ...
Creates the table and ignores any errors if it already exists .
13,396
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 ...
Deletes the table and ignores any errors if it doesn t exist .
13,397
public void setDefinitions ( java . util . Collection < DefinitionInformation > definitions ) { if ( definitions == null ) { this . definitions = null ; return ; } this . definitions = new java . util . ArrayList < DefinitionInformation > ( definitions ) ; }
Information about a definition .
13,398
public void shutdown ( ) { clientExecutionTimer . shutdown ( ) ; httpRequestTimer . shutdown ( ) ; IdleConnectionReaper . removeConnectionManager ( httpClient . getHttpClientConnectionManager ( ) ) ; httpClient . getHttpClientConnectionManager ( ) . shutdown ( ) ; }
Shuts down this HTTP client object releasing any resources that might be held open . This is an optional method and callers are not expected to call it but can if they want to explicitly release any open resources . Once a client has been shutdown it cannot be used to make more requests .
13,399
private < T > HttpResponseHandler < T > getNonNullResponseHandler ( HttpResponseHandler < T > responseHandler ) { if ( responseHandler != null ) { return responseHandler ; } else { return new HttpResponseHandler < T > ( ) { public T handle ( HttpResponse response ) throws Exception { return null ; } public boolean need...
Ensures the response handler is not null . If it is this method returns a dummy response handler .