idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
13,400 | private Integer getHttpStatusCode ( ErrorMap error , Shape shape ) { final Integer httpStatusCode = getHttpStatusCode ( error . getErrorTrait ( ) ) ; return httpStatusCode == null ? getHttpStatusCode ( shape . getErrorTrait ( ) ) : httpStatusCode ; } | Get HTTP status code either from error trait on the operation reference or the error trait on the shape . |
13,401 | public ResourceTags withTags ( java . util . Map < String , String > tags ) { setTags ( tags ) ; return this ; } | The tags for the resource . |
13,402 | public byte [ ] convertToXmlByteArray ( BucketVersioningConfiguration versioningConfiguration ) { XmlWriter xml = new XmlWriter ( ) ; xml . start ( "VersioningConfiguration" , "xmlns" , Constants . XML_NAMESPACE ) ; xml . start ( "Status" ) . value ( versioningConfiguration . getStatus ( ) ) . end ( ) ; Boolean mfaDeleteEnabled = versioningConfiguration . isMfaDeleteEnabled ( ) ; if ( mfaDeleteEnabled != null ) { if ( mfaDeleteEnabled ) { xml . start ( "MfaDelete" ) . value ( "Enabled" ) . end ( ) ; } else { xml . start ( "MfaDelete" ) . value ( "Disabled" ) . end ( ) ; } } xml . end ( ) ; return xml . getBytes ( ) ; } | Converts the specified versioning configuration into an XML byte array . |
13,403 | public byte [ ] convertToXmlByteArray ( BucketAccelerateConfiguration accelerateConfiguration ) { XmlWriter xml = new XmlWriter ( ) ; xml . start ( "AccelerateConfiguration" , "xmlns" , Constants . XML_NAMESPACE ) ; xml . start ( "Status" ) . value ( accelerateConfiguration . getStatus ( ) ) . end ( ) ; xml . end ( ) ; return xml . getBytes ( ) ; } | Converts the specified accelerate configuration into an XML byte array . |
13,404 | public byte [ ] convertToXmlByteArray ( BucketLoggingConfiguration loggingConfiguration ) { String logFilePrefix = loggingConfiguration . getLogFilePrefix ( ) ; if ( logFilePrefix == null ) logFilePrefix = "" ; XmlWriter xml = new XmlWriter ( ) ; xml . start ( "BucketLoggingStatus" , "xmlns" , Constants . XML_NAMESPACE ) ; if ( loggingConfiguration . isLoggingEnabled ( ) ) { xml . start ( "LoggingEnabled" ) ; xml . start ( "TargetBucket" ) . value ( loggingConfiguration . getDestinationBucketName ( ) ) . end ( ) ; xml . start ( "TargetPrefix" ) . value ( loggingConfiguration . getLogFilePrefix ( ) ) . end ( ) ; xml . end ( ) ; } xml . end ( ) ; return xml . getBytes ( ) ; } | Converts the specified logging configuration into an XML byte array . |
13,405 | public byte [ ] convertToXmlByteArray ( BucketNotificationConfiguration notificationConfiguration ) { XmlWriter xml = new XmlWriter ( ) ; xml . start ( "NotificationConfiguration" , "xmlns" , Constants . XML_NAMESPACE ) ; Map < String , NotificationConfiguration > configurations = notificationConfiguration . getConfigurations ( ) ; for ( Map . Entry < String , NotificationConfiguration > entry : configurations . entrySet ( ) ) { String configName = entry . getKey ( ) ; NotificationConfiguration config = entry . getValue ( ) ; if ( config instanceof TopicConfiguration ) { xml . start ( "TopicConfiguration" ) ; xml . start ( "Id" ) . value ( configName ) . end ( ) ; xml . start ( "Topic" ) . value ( ( ( TopicConfiguration ) config ) . getTopicARN ( ) ) . end ( ) ; addEventsAndFilterCriteria ( xml , config ) ; xml . end ( ) ; } else if ( config instanceof QueueConfiguration ) { xml . start ( "QueueConfiguration" ) ; xml . start ( "Id" ) . value ( configName ) . end ( ) ; xml . start ( "Queue" ) . value ( ( ( QueueConfiguration ) config ) . getQueueARN ( ) ) . end ( ) ; addEventsAndFilterCriteria ( xml , config ) ; xml . end ( ) ; } else if ( config instanceof CloudFunctionConfiguration ) { xml . start ( "CloudFunctionConfiguration" ) ; xml . start ( "Id" ) . value ( configName ) . end ( ) ; xml . start ( "InvocationRole" ) . value ( ( ( CloudFunctionConfiguration ) config ) . getInvocationRoleARN ( ) ) . end ( ) ; xml . start ( "CloudFunction" ) . value ( ( ( CloudFunctionConfiguration ) config ) . getCloudFunctionARN ( ) ) . end ( ) ; addEventsAndFilterCriteria ( xml , config ) ; xml . end ( ) ; } else if ( config instanceof LambdaConfiguration ) { xml . start ( "CloudFunctionConfiguration" ) ; xml . start ( "Id" ) . value ( configName ) . end ( ) ; xml . start ( "CloudFunction" ) . value ( ( ( LambdaConfiguration ) config ) . getFunctionARN ( ) ) . end ( ) ; addEventsAndFilterCriteria ( xml , config ) ; xml . end ( ) ; } } xml . end ( ) ; return xml . getBytes ( ) ; } | Converts the specified notification configuration into an XML byte array . |
13,406 | public byte [ ] convertToXmlByteArray ( BucketWebsiteConfiguration websiteConfiguration ) { XmlWriter xml = new XmlWriter ( ) ; xml . start ( "WebsiteConfiguration" , "xmlns" , Constants . XML_NAMESPACE ) ; if ( websiteConfiguration . getIndexDocumentSuffix ( ) != null ) { XmlWriter indexDocumentElement = xml . start ( "IndexDocument" ) ; indexDocumentElement . start ( "Suffix" ) . value ( websiteConfiguration . getIndexDocumentSuffix ( ) ) . end ( ) ; indexDocumentElement . end ( ) ; } if ( websiteConfiguration . getErrorDocument ( ) != null ) { XmlWriter errorDocumentElement = xml . start ( "ErrorDocument" ) ; errorDocumentElement . start ( "Key" ) . value ( websiteConfiguration . getErrorDocument ( ) ) . end ( ) ; errorDocumentElement . end ( ) ; } RedirectRule redirectAllRequestsTo = websiteConfiguration . getRedirectAllRequestsTo ( ) ; if ( redirectAllRequestsTo != null ) { XmlWriter redirectAllRequestsElement = xml . start ( "RedirectAllRequestsTo" ) ; if ( redirectAllRequestsTo . getprotocol ( ) != null ) { xml . start ( "Protocol" ) . value ( redirectAllRequestsTo . getprotocol ( ) ) . end ( ) ; } if ( redirectAllRequestsTo . getHostName ( ) != null ) { xml . start ( "HostName" ) . value ( redirectAllRequestsTo . getHostName ( ) ) . end ( ) ; } if ( redirectAllRequestsTo . getReplaceKeyPrefixWith ( ) != null ) { xml . start ( "ReplaceKeyPrefixWith" ) . value ( redirectAllRequestsTo . getReplaceKeyPrefixWith ( ) ) . end ( ) ; } if ( redirectAllRequestsTo . getReplaceKeyWith ( ) != null ) { xml . start ( "ReplaceKeyWith" ) . value ( redirectAllRequestsTo . getReplaceKeyWith ( ) ) . end ( ) ; } redirectAllRequestsElement . end ( ) ; } if ( websiteConfiguration . getRoutingRules ( ) != null && websiteConfiguration . getRoutingRules ( ) . size ( ) > 0 ) { XmlWriter routingRules = xml . start ( "RoutingRules" ) ; for ( RoutingRule rule : websiteConfiguration . getRoutingRules ( ) ) { writeRule ( routingRules , rule ) ; } routingRules . end ( ) ; } xml . end ( ) ; return xml . getBytes ( ) ; } | Converts the specified website configuration into an XML byte array to send to S3 . |
13,407 | public java . util . concurrent . Future < DescribeCacheEngineVersionsResult > describeCacheEngineVersionsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeCacheEngineVersionsRequest , DescribeCacheEngineVersionsResult > asyncHandler ) { return describeCacheEngineVersionsAsync ( new DescribeCacheEngineVersionsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeCacheEngineVersions operation with an AsyncHandler . |
13,408 | public java . util . concurrent . Future < DescribeCacheSecurityGroupsResult > describeCacheSecurityGroupsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeCacheSecurityGroupsRequest , DescribeCacheSecurityGroupsResult > asyncHandler ) { return describeCacheSecurityGroupsAsync ( new DescribeCacheSecurityGroupsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeCacheSecurityGroups operation with an AsyncHandler . |
13,409 | public java . util . concurrent . Future < DescribeReplicationGroupsResult > describeReplicationGroupsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeReplicationGroupsRequest , DescribeReplicationGroupsResult > asyncHandler ) { return describeReplicationGroupsAsync ( new DescribeReplicationGroupsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeReplicationGroups operation with an AsyncHandler . |
13,410 | public java . util . concurrent . Future < DescribeReservedCacheNodesOfferingsResult > describeReservedCacheNodesOfferingsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeReservedCacheNodesOfferingsRequest , DescribeReservedCacheNodesOfferingsResult > asyncHandler ) { return describeReservedCacheNodesOfferingsAsync ( new DescribeReservedCacheNodesOfferingsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeReservedCacheNodesOfferings operation with an AsyncHandler . |
13,411 | public java . util . concurrent . Future < ListAllowedNodeTypeModificationsResult > listAllowedNodeTypeModificationsAsync ( com . amazonaws . handlers . AsyncHandler < ListAllowedNodeTypeModificationsRequest , ListAllowedNodeTypeModificationsResult > asyncHandler ) { return listAllowedNodeTypeModificationsAsync ( new ListAllowedNodeTypeModificationsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListAllowedNodeTypeModifications operation with an AsyncHandler . |
13,412 | public Waiter < DescribeReplicationInstancesRequest > replicationInstanceAvailable ( ) { return new WaiterBuilder < DescribeReplicationInstancesRequest , DescribeReplicationInstancesResult > ( ) . withSdkFunction ( new DescribeReplicationInstancesFunction ( client ) ) . withAcceptors ( new ReplicationInstanceAvailable . IsAvailableMatcher ( ) , new ReplicationInstanceAvailable . IsDeletingMatcher ( ) , new ReplicationInstanceAvailable . IsIncompatiblecredentialsMatcher ( ) , new ReplicationInstanceAvailable . IsIncompatiblenetworkMatcher ( ) , new ReplicationInstanceAvailable . IsInaccessibleencryptioncredentialsMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 60 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a ReplicationInstanceAvailable 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,413 | public Waiter < DescribeReplicationTasksRequest > replicationTaskReady ( ) { return new WaiterBuilder < DescribeReplicationTasksRequest , DescribeReplicationTasksResult > ( ) . withSdkFunction ( new DescribeReplicationTasksFunction ( client ) ) . withAcceptors ( new ReplicationTaskReady . IsReadyMatcher ( ) , new ReplicationTaskReady . IsStartingMatcher ( ) , new ReplicationTaskReady . IsRunningMatcher ( ) , new ReplicationTaskReady . IsStoppingMatcher ( ) , new ReplicationTaskReady . IsStoppedMatcher ( ) , new ReplicationTaskReady . IsFailedMatcher ( ) , new ReplicationTaskReady . IsModifyingMatcher ( ) , new ReplicationTaskReady . IsTestingMatcher ( ) , new ReplicationTaskReady . IsDeletingMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a ReplicationTaskReady 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,414 | public Waiter < DescribeReplicationTasksRequest > replicationTaskDeleted ( ) { return new WaiterBuilder < DescribeReplicationTasksRequest , DescribeReplicationTasksResult > ( ) . withSdkFunction ( new DescribeReplicationTasksFunction ( client ) ) . withAcceptors ( new ReplicationTaskDeleted . IsReadyMatcher ( ) , new ReplicationTaskDeleted . IsCreatingMatcher ( ) , new ReplicationTaskDeleted . IsStoppedMatcher ( ) , new ReplicationTaskDeleted . IsRunningMatcher ( ) , new ReplicationTaskDeleted . IsFailedMatcher ( ) , new ReplicationTaskDeleted . IsResourceNotFoundFaultMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a ReplicationTaskDeleted 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,415 | public Waiter < DescribeReplicationTasksRequest > replicationTaskStopped ( ) { return new WaiterBuilder < DescribeReplicationTasksRequest , DescribeReplicationTasksResult > ( ) . withSdkFunction ( new DescribeReplicationTasksFunction ( client ) ) . withAcceptors ( new ReplicationTaskStopped . IsStoppedMatcher ( ) , new ReplicationTaskStopped . IsReadyMatcher ( ) , new ReplicationTaskStopped . IsCreatingMatcher ( ) , new ReplicationTaskStopped . IsStartingMatcher ( ) , new ReplicationTaskStopped . IsRunningMatcher ( ) , new ReplicationTaskStopped . IsFailedMatcher ( ) , new ReplicationTaskStopped . IsModifyingMatcher ( ) , new ReplicationTaskStopped . IsTestingMatcher ( ) , new ReplicationTaskStopped . IsDeletingMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a ReplicationTaskStopped 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,416 | public Waiter < DescribeReplicationTasksRequest > replicationTaskRunning ( ) { return new WaiterBuilder < DescribeReplicationTasksRequest , DescribeReplicationTasksResult > ( ) . withSdkFunction ( new DescribeReplicationTasksFunction ( client ) ) . withAcceptors ( new ReplicationTaskRunning . IsRunningMatcher ( ) , new ReplicationTaskRunning . IsReadyMatcher ( ) , new ReplicationTaskRunning . IsCreatingMatcher ( ) , new ReplicationTaskRunning . IsStoppingMatcher ( ) , new ReplicationTaskRunning . IsStoppedMatcher ( ) , new ReplicationTaskRunning . IsFailedMatcher ( ) , new ReplicationTaskRunning . IsModifyingMatcher ( ) , new ReplicationTaskRunning . IsTestingMatcher ( ) , new ReplicationTaskRunning . IsDeletingMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a ReplicationTaskRunning 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,417 | public Waiter < DescribeReplicationInstancesRequest > replicationInstanceDeleted ( ) { return new WaiterBuilder < DescribeReplicationInstancesRequest , DescribeReplicationInstancesResult > ( ) . withSdkFunction ( new DescribeReplicationInstancesFunction ( client ) ) . withAcceptors ( new ReplicationInstanceDeleted . IsAvailableMatcher ( ) , new ReplicationInstanceDeleted . IsResourceNotFoundFaultMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a ReplicationInstanceDeleted 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,418 | public void setAccountDetails ( java . util . Collection < AccountDetail > accountDetails ) { if ( accountDetails == null ) { this . accountDetails = null ; return ; } this . accountDetails = new java . util . ArrayList < AccountDetail > ( accountDetails ) ; } | A list of account ID and email address pairs of the accounts that you want to associate with the master GuardDuty account . |
13,419 | public CreateConfigurationRequest withTags ( java . util . Map < String , String > tags ) { setTags ( tags ) ; return this ; } | Create tags when creating the configuration . |
13,420 | public java . util . concurrent . Future < CreateStreamResult > createStreamAsync ( String streamName , Integer shardCount ) { return createStreamAsync ( new CreateStreamRequest ( ) . withStreamName ( streamName ) . withShardCount ( shardCount ) ) ; } | Simplified method form for invoking the CreateStream operation . |
13,421 | public java . util . concurrent . Future < CreateStreamResult > createStreamAsync ( String streamName , Integer shardCount , com . amazonaws . handlers . AsyncHandler < CreateStreamRequest , CreateStreamResult > asyncHandler ) { return createStreamAsync ( new CreateStreamRequest ( ) . withStreamName ( streamName ) . withShardCount ( shardCount ) , asyncHandler ) ; } | Simplified method form for invoking the CreateStream operation with an AsyncHandler . |
13,422 | public java . util . concurrent . Future < DeleteStreamResult > deleteStreamAsync ( String streamName ) { return deleteStreamAsync ( new DeleteStreamRequest ( ) . withStreamName ( streamName ) ) ; } | Simplified method form for invoking the DeleteStream operation . |
13,423 | public java . util . concurrent . Future < DeleteStreamResult > deleteStreamAsync ( String streamName , com . amazonaws . handlers . AsyncHandler < DeleteStreamRequest , DeleteStreamResult > asyncHandler ) { return deleteStreamAsync ( new DeleteStreamRequest ( ) . withStreamName ( streamName ) , asyncHandler ) ; } | Simplified method form for invoking the DeleteStream operation with an AsyncHandler . |
13,424 | public java . util . concurrent . Future < DescribeStreamResult > describeStreamAsync ( String streamName , Integer limit , String exclusiveStartShardId ) { return describeStreamAsync ( new DescribeStreamRequest ( ) . withStreamName ( streamName ) . withLimit ( limit ) . withExclusiveStartShardId ( exclusiveStartShardId ) ) ; } | Simplified method form for invoking the DescribeStream operation . |
13,425 | public java . util . concurrent . Future < DescribeStreamResult > describeStreamAsync ( String streamName , Integer limit , String exclusiveStartShardId , com . amazonaws . handlers . AsyncHandler < DescribeStreamRequest , DescribeStreamResult > asyncHandler ) { return describeStreamAsync ( new DescribeStreamRequest ( ) . withStreamName ( streamName ) . withLimit ( limit ) . withExclusiveStartShardId ( exclusiveStartShardId ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeStream operation with an AsyncHandler . |
13,426 | public java . util . concurrent . Future < GetShardIteratorResult > getShardIteratorAsync ( String streamName , String shardId , String shardIteratorType , String startingSequenceNumber ) { return getShardIteratorAsync ( new GetShardIteratorRequest ( ) . withStreamName ( streamName ) . withShardId ( shardId ) . withShardIteratorType ( shardIteratorType ) . withStartingSequenceNumber ( startingSequenceNumber ) ) ; } | Simplified method form for invoking the GetShardIterator operation . |
13,427 | public java . util . concurrent . Future < GetShardIteratorResult > getShardIteratorAsync ( String streamName , String shardId , String shardIteratorType , String startingSequenceNumber , com . amazonaws . handlers . AsyncHandler < GetShardIteratorRequest , GetShardIteratorResult > asyncHandler ) { return getShardIteratorAsync ( new GetShardIteratorRequest ( ) . withStreamName ( streamName ) . withShardId ( shardId ) . withShardIteratorType ( shardIteratorType ) . withStartingSequenceNumber ( startingSequenceNumber ) , asyncHandler ) ; } | Simplified method form for invoking the GetShardIterator operation with an AsyncHandler . |
13,428 | public java . util . concurrent . Future < ListStreamsResult > listStreamsAsync ( com . amazonaws . handlers . AsyncHandler < ListStreamsRequest , ListStreamsResult > asyncHandler ) { return listStreamsAsync ( new ListStreamsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListStreams operation with an AsyncHandler . |
13,429 | public java . util . concurrent . Future < MergeShardsResult > mergeShardsAsync ( String streamName , String shardToMerge , String adjacentShardToMerge ) { return mergeShardsAsync ( new MergeShardsRequest ( ) . withStreamName ( streamName ) . withShardToMerge ( shardToMerge ) . withAdjacentShardToMerge ( adjacentShardToMerge ) ) ; } | Simplified method form for invoking the MergeShards operation . |
13,430 | public java . util . concurrent . Future < MergeShardsResult > mergeShardsAsync ( String streamName , String shardToMerge , String adjacentShardToMerge , com . amazonaws . handlers . AsyncHandler < MergeShardsRequest , MergeShardsResult > asyncHandler ) { return mergeShardsAsync ( new MergeShardsRequest ( ) . withStreamName ( streamName ) . withShardToMerge ( shardToMerge ) . withAdjacentShardToMerge ( adjacentShardToMerge ) , asyncHandler ) ; } | Simplified method form for invoking the MergeShards operation with an AsyncHandler . |
13,431 | public java . util . concurrent . Future < PutRecordResult > putRecordAsync ( String streamName , java . nio . ByteBuffer data , String partitionKey , String sequenceNumberForOrdering ) { return putRecordAsync ( new PutRecordRequest ( ) . withStreamName ( streamName ) . withData ( data ) . withPartitionKey ( partitionKey ) . withSequenceNumberForOrdering ( sequenceNumberForOrdering ) ) ; } | Simplified method form for invoking the PutRecord operation . |
13,432 | public java . util . concurrent . Future < PutRecordResult > putRecordAsync ( String streamName , java . nio . ByteBuffer data , String partitionKey , String sequenceNumberForOrdering , com . amazonaws . handlers . AsyncHandler < PutRecordRequest , PutRecordResult > asyncHandler ) { return putRecordAsync ( new PutRecordRequest ( ) . withStreamName ( streamName ) . withData ( data ) . withPartitionKey ( partitionKey ) . withSequenceNumberForOrdering ( sequenceNumberForOrdering ) , asyncHandler ) ; } | Simplified method form for invoking the PutRecord operation with an AsyncHandler . |
13,433 | public java . util . concurrent . Future < SplitShardResult > splitShardAsync ( String streamName , String shardToSplit , String newStartingHashKey ) { return splitShardAsync ( new SplitShardRequest ( ) . withStreamName ( streamName ) . withShardToSplit ( shardToSplit ) . withNewStartingHashKey ( newStartingHashKey ) ) ; } | Simplified method form for invoking the SplitShard operation . |
13,434 | public java . util . concurrent . Future < SplitShardResult > splitShardAsync ( String streamName , String shardToSplit , String newStartingHashKey , com . amazonaws . handlers . AsyncHandler < SplitShardRequest , SplitShardResult > asyncHandler ) { return splitShardAsync ( new SplitShardRequest ( ) . withStreamName ( streamName ) . withShardToSplit ( shardToSplit ) . withNewStartingHashKey ( newStartingHashKey ) , asyncHandler ) ; } | Simplified method form for invoking the SplitShard operation with an AsyncHandler . |
13,435 | public static boolean pathAll ( JsonNode expectedResult , JsonNode finalResult ) { if ( finalResult . isNull ( ) ) { return false ; } if ( ! finalResult . isArray ( ) ) { throw new RuntimeException ( "Expected an array" ) ; } for ( JsonNode element : finalResult ) { if ( ! element . equals ( expectedResult ) ) { return false ; } } return true ; } | PathAll matcher that checks if each element of the final result matches the expected result |
13,436 | protected final void abortIfNeeded ( ) { if ( shouldAbort ( ) ) { try { abort ( ) ; } catch ( IOException e ) { LogFactory . getLog ( getClass ( ) ) . debug ( "FYI" , e ) ; } throw new AbortedException ( ) ; } } | Aborts with subclass specific abortion logic executed if needed . Note the interrupted status of the thread is cleared by this method . |
13,437 | private static AWSSecurityTokenService buildStsClient ( Builder builder ) throws IllegalArgumentException { if ( builder . longLivedCredentials != null && builder . longLivedCredentialsProvider != null ) { throw new IllegalArgumentException ( "It is illegal to set both an AWSCredentials and an AWSCredentialsProvider for an " + STSAssumeRoleSessionCredentialsProvider . class . getName ( ) ) ; } AWSCredentialsProvider longLivedCredentialsProvider = null ; if ( builder . longLivedCredentials != null ) { longLivedCredentialsProvider = new StaticCredentialsProvider ( builder . longLivedCredentials ) ; } else if ( builder . longLivedCredentialsProvider != null ) { longLivedCredentialsProvider = builder . longLivedCredentialsProvider ; } if ( longLivedCredentialsProvider == null ) { if ( builder . clientConfiguration == null ) { return new AWSSecurityTokenServiceClient ( ) ; } else { return new AWSSecurityTokenServiceClient ( builder . clientConfiguration ) ; } } else { if ( builder . clientConfiguration == null ) { return new AWSSecurityTokenServiceClient ( longLivedCredentialsProvider ) ; } else { return new AWSSecurityTokenServiceClient ( longLivedCredentialsProvider , builder . clientConfiguration ) ; } } } | Construct a new STS client from the settings in the builder . |
13,438 | public static byte [ ] computeMD5Hash ( InputStream is ) throws IOException { BufferedInputStream bis = new BufferedInputStream ( is ) ; try { MessageDigest messageDigest = MessageDigest . getInstance ( "MD5" ) ; byte [ ] buffer = new byte [ SIXTEEN_K ] ; int bytesRead ; while ( ( bytesRead = bis . read ( buffer , 0 , buffer . length ) ) != - 1 ) { messageDigest . update ( buffer , 0 , bytesRead ) ; } return messageDigest . digest ( ) ; } catch ( NoSuchAlgorithmException e ) { throw new IllegalStateException ( e ) ; } finally { try { bis . close ( ) ; } catch ( Exception e ) { LogFactory . getLog ( Md5Utils . class ) . debug ( "Unable to close input stream of hash candidate: " + e ) ; } } } | Computes the MD5 hash of the data in the given input stream and returns it as an array of bytes . Note this method closes the given input stream upon completion . |
13,439 | public static byte [ ] computeMD5Hash ( byte [ ] input ) { try { MessageDigest md = MessageDigest . getInstance ( "MD5" ) ; return md . digest ( input ) ; } catch ( NoSuchAlgorithmException e ) { throw new IllegalStateException ( e ) ; } } | Computes the MD5 hash of the given data and returns it as an array of bytes . |
13,440 | public static String md5AsBase64 ( File file ) throws FileNotFoundException , IOException { return Base64 . encodeAsString ( computeMD5Hash ( file ) ) ; } | Returns the MD5 in base64 for the given file . |
13,441 | private UploadResult uploadInOneChunk ( ) { PutObjectResult putObjectResult = s3 . putObject ( origReq ) ; UploadResult uploadResult = new UploadResult ( ) ; uploadResult . setBucketName ( origReq . getBucketName ( ) ) ; uploadResult . setKey ( origReq . getKey ( ) ) ; uploadResult . setETag ( putObjectResult . getETag ( ) ) ; uploadResult . setVersionId ( putObjectResult . getVersionId ( ) ) ; return uploadResult ; } | Uploads the given request in a single chunk and returns the result . |
13,442 | private void captureUploadStateIfPossible ( ) { if ( origReq . getSSECustomerKey ( ) == null ) { persistableUpload = new PersistableUpload ( origReq . getBucketName ( ) , origReq . getKey ( ) , origReq . getFile ( ) . getAbsolutePath ( ) , multipartUploadId , configuration . getMinimumUploadPartSize ( ) , configuration . getMultipartUploadThreshold ( ) ) ; notifyPersistableTransferAvailability ( ) ; } } | Captures the state of the upload . |
13,443 | private UploadResult uploadInParts ( ) throws Exception { boolean isUsingEncryption = s3 instanceof AmazonS3Encryption ; long optimalPartSize = getOptimalPartSize ( isUsingEncryption ) ; try { if ( multipartUploadId == null ) { multipartUploadId = initiateMultipartUpload ( origReq , isUsingEncryption ) ; } UploadPartRequestFactory requestFactory = new UploadPartRequestFactory ( origReq , multipartUploadId , optimalPartSize ) ; if ( TransferManagerUtils . isUploadParallelizable ( origReq , isUsingEncryption ) ) { captureUploadStateIfPossible ( ) ; uploadPartsInParallel ( requestFactory , multipartUploadId ) ; return null ; } else { return uploadPartsInSeries ( requestFactory ) ; } } catch ( Exception e ) { publishProgress ( listener , ProgressEventType . TRANSFER_FAILED_EVENT ) ; performAbortMultipartUpload ( ) ; throw e ; } finally { if ( origReq . getInputStream ( ) != null ) { try { origReq . getInputStream ( ) . close ( ) ; } catch ( Exception e ) { log . warn ( "Unable to cleanly close input stream: " + e . getMessage ( ) , e ) ; } } } } | Uploads the request in multiple chunks submitting each upload chunk task to the thread pool and recording its corresponding Future object as well as the multipart upload id . |
13,444 | private long getOptimalPartSize ( boolean isUsingEncryption ) { long optimalPartSize = TransferManagerUtils . calculateOptimalPartSize ( origReq , configuration ) ; if ( isUsingEncryption && optimalPartSize % 32 > 0 ) { optimalPartSize = optimalPartSize - ( optimalPartSize % 32 ) + 32 ; } log . debug ( "Calculated optimal part size: " + optimalPartSize ) ; return optimalPartSize ; } | Computes and returns the optimal part size for the upload . |
13,445 | private UploadResult uploadPartsInSeries ( UploadPartRequestFactory requestFactory ) { final List < PartETag > partETags = new ArrayList < PartETag > ( ) ; while ( requestFactory . hasMoreRequests ( ) ) { if ( threadPool . isShutdown ( ) ) throw new CancellationException ( "TransferManager has been shutdown" ) ; UploadPartRequest uploadPartRequest = requestFactory . getNextUploadPartRequest ( ) ; InputStream inputStream = uploadPartRequest . getInputStream ( ) ; if ( inputStream != null && inputStream . markSupported ( ) ) { if ( uploadPartRequest . getPartSize ( ) >= Integer . MAX_VALUE ) { inputStream . mark ( Integer . MAX_VALUE ) ; } else { inputStream . mark ( ( int ) uploadPartRequest . getPartSize ( ) ) ; } } partETags . add ( s3 . uploadPart ( uploadPartRequest ) . getPartETag ( ) ) ; } CompleteMultipartUploadRequest req = new CompleteMultipartUploadRequest ( origReq . getBucketName ( ) , origReq . getKey ( ) , multipartUploadId , partETags ) . withRequesterPays ( origReq . isRequesterPays ( ) ) . withGeneralProgressListener ( origReq . getGeneralProgressListener ( ) ) . withRequestMetricCollector ( origReq . getRequestMetricCollector ( ) ) ; CompleteMultipartUploadResult res = s3 . completeMultipartUpload ( req ) ; UploadResult uploadResult = new UploadResult ( ) ; uploadResult . setBucketName ( res . getBucketName ( ) ) ; uploadResult . setKey ( res . getKey ( ) ) ; uploadResult . setETag ( res . getETag ( ) ) ; uploadResult . setVersionId ( res . getVersionId ( ) ) ; return uploadResult ; } | Uploads all parts in the request in serial in this thread then completes the upload and returns the result . |
13,446 | private void uploadPartsInParallel ( UploadPartRequestFactory requestFactory , String uploadId ) { Map < Integer , PartSummary > partNumbers = identifyExistingPartsForResume ( uploadId ) ; while ( requestFactory . hasMoreRequests ( ) ) { if ( threadPool . isShutdown ( ) ) throw new CancellationException ( "TransferManager has been shutdown" ) ; UploadPartRequest request = requestFactory . getNextUploadPartRequest ( ) ; if ( partNumbers . containsKey ( request . getPartNumber ( ) ) ) { PartSummary summary = partNumbers . get ( request . getPartNumber ( ) ) ; eTagsToSkip . add ( new PartETag ( request . getPartNumber ( ) , summary . getETag ( ) ) ) ; transferProgress . updateProgress ( summary . getSize ( ) ) ; continue ; } futures . add ( threadPool . submit ( new UploadPartCallable ( s3 , request , shouldCalculatePartMd5 ( ) ) ) ) ; } } | Submits a callable for each part to upload to our thread pool and records its corresponding Future . |
13,447 | public void setBulkDeployments ( java . util . Collection < BulkDeployment > bulkDeployments ) { if ( bulkDeployments == null ) { this . bulkDeployments = null ; return ; } this . bulkDeployments = new java . util . ArrayList < BulkDeployment > ( bulkDeployments ) ; } | A list of bulk deployments . |
13,448 | public java . util . concurrent . Future < ListEventSourceMappingsResult > listEventSourceMappingsAsync ( com . amazonaws . handlers . AsyncHandler < ListEventSourceMappingsRequest , ListEventSourceMappingsResult > asyncHandler ) { return listEventSourceMappingsAsync ( new ListEventSourceMappingsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListEventSourceMappings operation with an AsyncHandler . |
13,449 | public boolean isMasterSecretValid ( final Socket socket ) { return AccessController . doPrivileged ( new PrivilegedAction < Boolean > ( ) { public Boolean run ( ) { return privilegedIsMasterSecretValid ( socket ) ; } } ) ; } | Double check the master secret of an SSL session is not null |
13,450 | private boolean privilegedIsMasterSecretValid ( final Socket socket ) { if ( socket instanceof SSLSocket ) { SSLSession session = getSslSession ( socket ) ; if ( session != null ) { String className = session . getClass ( ) . getName ( ) ; if ( "sun.security.ssl.SSLSessionImpl" . equals ( className ) ) { try { Object masterSecret = getMasterSecret ( session , className ) ; if ( masterSecret == null ) { session . invalidate ( ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Invalidated session " + session ) ; } return false ; } } catch ( Exception e ) { failedToVerifyMasterSecret ( e ) ; } } } } return true ; } | Checks the validity of an SSLSession s master secret . Should be run within a doPrivileged block |
13,451 | public java . util . concurrent . Future < DescribeDBSecurityGroupsResult > describeDBSecurityGroupsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeDBSecurityGroupsRequest , DescribeDBSecurityGroupsResult > asyncHandler ) { return describeDBSecurityGroupsAsync ( new DescribeDBSecurityGroupsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeDBSecurityGroups operation with an AsyncHandler . |
13,452 | public java . util . concurrent . Future < DescribeDBSnapshotsResult > describeDBSnapshotsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeDBSnapshotsRequest , DescribeDBSnapshotsResult > asyncHandler ) { return describeDBSnapshotsAsync ( new DescribeDBSnapshotsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeDBSnapshots operation with an AsyncHandler . |
13,453 | public java . util . concurrent . Future < DescribeEventSubscriptionsResult > describeEventSubscriptionsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeEventSubscriptionsRequest , DescribeEventSubscriptionsResult > asyncHandler ) { return describeEventSubscriptionsAsync ( new DescribeEventSubscriptionsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeEventSubscriptions operation with an AsyncHandler . |
13,454 | public java . util . concurrent . Future < DescribeOptionGroupsResult > describeOptionGroupsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeOptionGroupsRequest , DescribeOptionGroupsResult > asyncHandler ) { return describeOptionGroupsAsync ( new DescribeOptionGroupsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeOptionGroups operation with an AsyncHandler . |
13,455 | public java . util . concurrent . Future < DBCluster > failoverDBClusterAsync ( com . amazonaws . handlers . AsyncHandler < FailoverDBClusterRequest , DBCluster > asyncHandler ) { return failoverDBClusterAsync ( new FailoverDBClusterRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the FailoverDBCluster operation with an AsyncHandler . |
13,456 | final DynamoDBMapperConfig merge ( final DynamoDBMapperConfig overrides ) { return overrides == null || this == overrides ? this : builder ( ) . merge ( this ) . merge ( overrides ) . build ( ) ; } | Merges these configuration values with the specified overrides ; may simply return this instance if overrides are the same or null . |
13,457 | public static < T > T assertNotNull ( T object , String fieldName ) throws IllegalArgumentException { if ( object == null ) { throw new IllegalArgumentException ( String . format ( "%s cannot be null" , fieldName ) ) ; } return object ; } | Asserts that the given object is non - null and returns it . |
13,458 | public static void assertAllAreNull ( String messageIfNull , Object ... objects ) throws IllegalArgumentException { for ( Object object : objects ) { if ( object != null ) { throw new IllegalArgumentException ( messageIfNull ) ; } } } | Asserts that all of the objects are null . |
13,459 | public DeleteObjectsRequest withKeys ( String ... keys ) { List < KeyVersion > keyVersions = new ArrayList < KeyVersion > ( keys . length ) ; for ( String key : keys ) { keyVersions . add ( new KeyVersion ( key ) ) ; } setKeys ( keyVersions ) ; return this ; } | Convenience method to specify a set of keys without versions . |
13,460 | public void setStorageClass ( StorageClass storageClass ) { setStorageClass ( storageClass == null ? ( String ) null : storageClass . toString ( ) ) ; } | Sets the storage class for the replication destination . If not specified Amazon S3 uses the storage class of the source object to create object replica . |
13,461 | public ReplicationDestinationConfig withStorageClass ( StorageClass storageClass ) { setStorageClass ( storageClass == null ? ( String ) null : storageClass . toString ( ) ) ; return this ; } | Sets the storage class for the replication destination . If not specified Amazon S3 uses the storage class of the source object to create object replica . Returns the updated object . |
13,462 | public void sign ( SignableRequest < ? > request , AWSCredentials credentials ) throws SdkClientException { if ( credentials instanceof AnonymousAWSCredentials ) { return ; } AWSCredentials sanitizedCredentials = sanitizeCredentials ( credentials ) ; SigningAlgorithm algorithm = SigningAlgorithm . HmacSHA256 ; String nonce = UUID . randomUUID ( ) . toString ( ) ; int timeOffset = request . getTimeOffset ( ) ; Date dateValue = getSignatureDate ( timeOffset ) ; String date = DateUtils . formatRFC822Date ( dateValue ) ; boolean isHttps = false ; if ( overriddenDate != null ) date = overriddenDate ; request . addHeader ( "Date" , date ) ; request . addHeader ( "X-Amz-Date" , date ) ; String hostHeader = request . getEndpoint ( ) . getHost ( ) ; if ( SdkHttpUtils . isUsingNonDefaultPort ( request . getEndpoint ( ) ) ) { hostHeader += ":" + request . getEndpoint ( ) . getPort ( ) ; } request . addHeader ( "Host" , hostHeader ) ; if ( sanitizedCredentials instanceof AWSSessionCredentials ) { addSessionCredentials ( request , ( AWSSessionCredentials ) sanitizedCredentials ) ; } byte [ ] bytesToSign ; String stringToSign ; if ( isHttps ) { request . addHeader ( NONCE_HEADER , nonce ) ; stringToSign = date + nonce ; bytesToSign = stringToSign . getBytes ( UTF8 ) ; } else { String path = SdkHttpUtils . appendUri ( request . getEndpoint ( ) . getPath ( ) , request . getResourcePath ( ) ) ; stringToSign = request . getHttpMethod ( ) . toString ( ) + "\n" + getCanonicalizedResourcePath ( path ) + "\n" + getCanonicalizedQueryString ( request . getParameters ( ) ) + "\n" + getCanonicalizedHeadersForStringToSign ( request ) + "\n" + getRequestPayloadWithoutQueryParams ( request ) ; bytesToSign = hash ( stringToSign ) ; } if ( log . isDebugEnabled ( ) ) log . debug ( "Calculated StringToSign: " + stringToSign ) ; String signature = signAndBase64Encode ( bytesToSign , sanitizedCredentials . getAWSSecretKey ( ) , algorithm ) ; StringBuilder builder = new StringBuilder ( ) ; builder . append ( isHttps ? HTTPS_SCHEME : HTTP_SCHEME ) . append ( " " ) ; builder . append ( "AWSAccessKeyId=" + sanitizedCredentials . getAWSAccessKeyId ( ) + "," ) ; builder . append ( "Algorithm=" + algorithm . toString ( ) + "," ) ; if ( ! isHttps ) { builder . append ( getSignedHeadersComponent ( request ) + "," ) ; } builder . append ( "Signature=" + signature ) ; request . addHeader ( AUTHORIZATION_HEADER , builder . toString ( ) ) ; } | Signs the specified request with the AWS3 signing protocol by using the AWS account credentials specified when this object was constructed and adding the required AWS3 headers to the request . |
13,463 | public LowLevelResultListener < R > registerLowLevelResultListener ( LowLevelResultListener < R > listener ) { LowLevelResultListener < R > prev = this . listener ; if ( listener == null ) this . listener = LowLevelResultListener . none ( ) ; else this . listener = listener ; return prev ; } | Used to register a listener for the event of receiving a low - level result from the server side . |
13,464 | protected String getDefaultTimeFormatIfNull ( Member c2jMemberDefinition , Map < String , Shape > allC2jShapes , String protocolString , Shape parentShape ) { validateTimestampProtocol ( protocolString , c2jMemberDefinition . getTimestampFormat ( ) , c2jMemberDefinition . getShape ( ) ) ; String shapeName = c2jMemberDefinition . getShape ( ) ; Shape shape = allC2jShapes . get ( shapeName ) ; validateTimestampProtocol ( protocolString , shape . getTimestampFormat ( ) , shapeName ) ; return super . getDefaultTimeFormatIfNull ( c2jMemberDefinition , allC2jShapes , protocolString , parentShape ) ; } | Throw exception if timestamp format is provided for non - json protocol . |
13,465 | private void validateTimestampProtocol ( String protocolString , String timestampFormat , String shape2 ) { if ( ! StringUtils . isNullOrEmpty ( timestampFormat ) && isNonJsonProtocol ( protocolString ) ) { throw new IllegalArgumentException ( String . format ( "Shape %s has timestamp format provided. Timestamp format for requests is not supported for xml, query or ec2 " + "protocol" , shape2 ) ) ; } } | Throw exception if timestamp is provided for non - json protocol |
13,466 | public Waiter < DescribeDBInstancesRequest > dBInstanceAvailable ( ) { return new WaiterBuilder < DescribeDBInstancesRequest , DescribeDBInstancesResult > ( ) . withSdkFunction ( new DescribeDBInstancesFunction ( client ) ) . withAcceptors ( new DBInstanceAvailable . IsAvailableMatcher ( ) , new DBInstanceAvailable . IsDeletedMatcher ( ) , new DBInstanceAvailable . IsDeletingMatcher ( ) , new DBInstanceAvailable . IsFailedMatcher ( ) , new DBInstanceAvailable . IsIncompatiblerestoreMatcher ( ) , new DBInstanceAvailable . IsIncompatibleparametersMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 30 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a DBInstanceAvailable 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,467 | public Waiter < DescribeDBInstancesRequest > dBInstanceDeleted ( ) { return new WaiterBuilder < DescribeDBInstancesRequest , DescribeDBInstancesResult > ( ) . withSdkFunction ( new DescribeDBInstancesFunction ( client ) ) . withAcceptors ( new DBInstanceDeleted . IsDeletedMatcher ( ) , new DBInstanceDeleted . IsDBInstanceNotFoundMatcher ( ) , new DBInstanceDeleted . IsCreatingMatcher ( ) , new DBInstanceDeleted . IsModifyingMatcher ( ) , new DBInstanceDeleted . IsRebootingMatcher ( ) , new DBInstanceDeleted . IsResettingmastercredentialsMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 30 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a DBInstanceDeleted 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,468 | public Waiter < DescribeAutoScalingGroupsRequest > groupExists ( ) { return new WaiterBuilder < DescribeAutoScalingGroupsRequest , DescribeAutoScalingGroupsResult > ( ) . withSdkFunction ( new DescribeAutoScalingGroupsFunction ( client ) ) . withAcceptors ( new GroupExists . IsTrueMatcher ( ) , new GroupExists . IsFalseMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 10 ) , new FixedDelayStrategy ( 5 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a GroupExists 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,469 | public void setItem ( java . util . Collection < ApplicationResponse > item ) { if ( item == null ) { this . item = null ; return ; } this . item = new java . util . ArrayList < ApplicationResponse > ( item ) ; } | List of applications returned in this page . |
13,470 | public String readResource ( String resourcePath ) throws IOException , SdkClientException { URL url = getEc2MetadataServiceUrlForResource ( resourcePath ) ; log . debug ( "Connecting to EC2 instance metadata service at URL: " + url . toString ( ) ) ; HttpURLConnection connection = ( HttpURLConnection ) url . openConnection ( ) ; connection . setConnectTimeout ( 1000 * 2 ) ; connection . setReadTimeout ( 1000 * 5 ) ; connection . setRequestMethod ( "GET" ) ; connection . setDoOutput ( true ) ; connection . addRequestProperty ( "User-Agent" , USER_AGENT ) ; connection . connect ( ) ; return readResponse ( connection ) ; } | Connects to the metadata service to read the specified resource and returns the text contents . |
13,471 | private String readResponse ( HttpURLConnection connection ) throws IOException { if ( connection . getResponseCode ( ) == HttpURLConnection . HTTP_NOT_FOUND ) throw new SdkClientException ( "The requested metadata is not found at " + connection . getURL ( ) ) ; InputStream inputStream = connection . getInputStream ( ) ; try { StringBuilder buffer = new StringBuilder ( ) ; while ( true ) { int c = inputStream . read ( ) ; if ( c == - 1 ) break ; buffer . append ( ( char ) c ) ; } return buffer . toString ( ) ; } finally { inputStream . close ( ) ; } } | Reads a response from the Amazon EC2 Instance Metadata Service and returns the content as a string . |
13,472 | private URL getEc2MetadataServiceUrlForResource ( String resourcePath ) throws IOException { String endpoint = EC2_METADATA_SERVICE_URL ; if ( System . getProperty ( EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY ) != null ) { endpoint = System . getProperty ( EC2_METADATA_SERVICE_OVERRIDE_SYSTEM_PROPERTY ) ; } return new URL ( endpoint + resourcePath ) ; } | Constructs a URL to the EC2 metadata service for the specified resource path . |
13,473 | private void downloadInParallel ( int partCount ) throws Exception { if ( lastFullyMergedPartNumber == null ) { lastFullyMergedPartNumber = 0 ; } if ( lastFullyMergedPartPosition == null ) { lastFullyMergedPartPosition = 0L ; } long previousPartLength = 0L ; long filePositionToWrite = lastFullyMergedPartPosition ; createParentDirectoryIfNecessary ( dstfile ) ; truncateDestinationFileIfNecessary ( ) ; if ( ! FileLocks . lock ( dstfile ) ) { throw new FileLockException ( "Fail to lock " + dstfile ) ; } for ( int i = lastFullyMergedPartNumber + 1 ; i <= partCount ; i ++ ) { filePositionToWrite += previousPartLength ; GetObjectRequest getPartRequest = new GetObjectRequest ( req . getBucketName ( ) , req . getKey ( ) , req . getVersionId ( ) ) . withUnmodifiedSinceConstraint ( req . getUnmodifiedSinceConstraint ( ) ) . withModifiedSinceConstraint ( req . getModifiedSinceConstraint ( ) ) . withResponseHeaders ( req . getResponseHeaders ( ) ) . withSSECustomerKey ( req . getSSECustomerKey ( ) ) . withGeneralProgressListener ( req . getGeneralProgressListener ( ) ) ; getPartRequest . setMatchingETagConstraints ( req . getMatchingETagConstraints ( ) ) ; getPartRequest . setNonmatchingETagConstraints ( req . getNonmatchingETagConstraints ( ) ) ; getPartRequest . setRequesterPays ( req . isRequesterPays ( ) ) ; getPartRequest . setPartNumber ( i ) ; futures . add ( executor . submit ( new DownloadS3ObjectCallable ( serviceCall ( getPartRequest ) , dstfile , filePositionToWrite ) ) ) ; previousPartLength = ServiceUtils . getPartSize ( req , s3 , i ) ; } Future < File > future = executor . submit ( new CompleteMultipartDownload ( futures , dstfile , download , ++ lastFullyMergedPartNumber ) ) ; ( ( DownloadMonitor ) download . getMonitor ( ) ) . setFuture ( future ) ; } | Downloads each part of the object into the different parts of the destination file in parallel . |
13,474 | private void adjustRequest ( GetObjectRequest req ) { long [ ] range = req . getRange ( ) ; long lastByte = range [ 1 ] ; long totalBytesToDownload = lastByte - this . origStartingByte + 1 ; if ( dstfile . exists ( ) ) { if ( ! FileLocks . lock ( dstfile ) ) { throw new FileLockException ( "Fail to lock " + dstfile + " for range adjustment" ) ; } try { expectedFileLength = dstfile . length ( ) ; long startingByte = this . origStartingByte + expectedFileLength ; LOG . info ( "Adjusting request range from " + Arrays . toString ( range ) + " to " + Arrays . toString ( new long [ ] { startingByte , lastByte } ) + " for file " + dstfile ) ; req . setRange ( startingByte , lastByte ) ; totalBytesToDownload = lastByte - startingByte + 1 ; } finally { FileLocks . unlock ( dstfile ) ; } } if ( totalBytesToDownload < 0 ) { throw new IllegalArgumentException ( "Unable to determine the range for download operation. lastByte=" + lastByte + ", origStartingByte=" + origStartingByte + ", expectedFileLength=" + expectedFileLength + ", totalBytesToDownload=" + totalBytesToDownload ) ; } } | This method is called only if it is a resumed download . |
13,475 | public java . util . concurrent . Future < DescribeAlarmsResult > describeAlarmsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeAlarmsRequest , DescribeAlarmsResult > asyncHandler ) { return describeAlarmsAsync ( new DescribeAlarmsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeAlarms operation with an AsyncHandler . |
13,476 | public EventsRequest withBatchItem ( java . util . Map < String , EventsBatch > batchItem ) { setBatchItem ( batchItem ) ; return this ; } | A batch of events to process . Each BatchItem consists of an endpoint ID as the key and an EventsBatch object as the value . |
13,477 | public java . util . concurrent . Future < GetSendQuotaResult > getSendQuotaAsync ( com . amazonaws . handlers . AsyncHandler < GetSendQuotaRequest , GetSendQuotaResult > asyncHandler ) { return getSendQuotaAsync ( new GetSendQuotaRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the GetSendQuota operation with an AsyncHandler . |
13,478 | public java . util . concurrent . Future < ListVerifiedEmailAddressesResult > listVerifiedEmailAddressesAsync ( com . amazonaws . handlers . AsyncHandler < ListVerifiedEmailAddressesRequest , ListVerifiedEmailAddressesResult > asyncHandler ) { return listVerifiedEmailAddressesAsync ( new ListVerifiedEmailAddressesRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListVerifiedEmailAddresses operation with an AsyncHandler . |
13,479 | public String getAuthToken ( GetIamAuthTokenRequest request ) throws AmazonClientException { DefaultRequest < Void > signableRequest = new DefaultRequest < Void > ( SERVICE_NAME ) ; signableRequest . setResourcePath ( "/" ) ; setEndpoint ( signableRequest , request ) ; setParameters ( signableRequest , request ) ; signableRequest . setHttpMethod ( HttpMethodName . GET ) ; return presignerFacade . presign ( signableRequest , getExpirationDate ( ) ) . toExternalForm ( ) . replaceFirst ( "http://" , "" ) ; } | Create an authorization token used to connect to a database that uses RDS IAM authentication . |
13,480 | public CreateChannelResult createChannel ( CreateChannelRequest request ) { request = beforeClientExecution ( request ) ; return executeCreateChannel ( request ) ; } | Creates a new Channel . |
13,481 | public CreateOriginEndpointResult createOriginEndpoint ( CreateOriginEndpointRequest request ) { request = beforeClientExecution ( request ) ; return executeCreateOriginEndpoint ( request ) ; } | Creates a new OriginEndpoint record . |
13,482 | public DeleteChannelResult deleteChannel ( DeleteChannelRequest request ) { request = beforeClientExecution ( request ) ; return executeDeleteChannel ( request ) ; } | Deletes an existing Channel . |
13,483 | public DeleteOriginEndpointResult deleteOriginEndpoint ( DeleteOriginEndpointRequest request ) { request = beforeClientExecution ( request ) ; return executeDeleteOriginEndpoint ( request ) ; } | Deletes an existing OriginEndpoint . |
13,484 | public DescribeChannelResult describeChannel ( DescribeChannelRequest request ) { request = beforeClientExecution ( request ) ; return executeDescribeChannel ( request ) ; } | Gets details about a Channel . |
13,485 | public DescribeOriginEndpointResult describeOriginEndpoint ( DescribeOriginEndpointRequest request ) { request = beforeClientExecution ( request ) ; return executeDescribeOriginEndpoint ( request ) ; } | Gets details about an existing OriginEndpoint . |
13,486 | public ListChannelsResult listChannels ( ListChannelsRequest request ) { request = beforeClientExecution ( request ) ; return executeListChannels ( request ) ; } | Returns a collection of Channels . |
13,487 | public ListOriginEndpointsResult listOriginEndpoints ( ListOriginEndpointsRequest request ) { request = beforeClientExecution ( request ) ; return executeListOriginEndpoints ( request ) ; } | Returns a collection of OriginEndpoint records . |
13,488 | public RotateChannelCredentialsResult rotateChannelCredentials ( RotateChannelCredentialsRequest request ) { request = beforeClientExecution ( request ) ; return executeRotateChannelCredentials ( request ) ; } | Changes the Channel s first IngestEndpoint s username and password . WARNING - This API is deprecated . Please use RotateIngestEndpointCredentials instead |
13,489 | public RotateIngestEndpointCredentialsResult rotateIngestEndpointCredentials ( RotateIngestEndpointCredentialsRequest request ) { request = beforeClientExecution ( request ) ; return executeRotateIngestEndpointCredentials ( request ) ; } | Rotate the IngestEndpoint s username and password as specified by the IngestEndpoint s id . |
13,490 | public UpdateChannelResult updateChannel ( UpdateChannelRequest request ) { request = beforeClientExecution ( request ) ; return executeUpdateChannel ( request ) ; } | Updates an existing Channel . |
13,491 | public UpdateOriginEndpointResult updateOriginEndpoint ( UpdateOriginEndpointRequest request ) { request = beforeClientExecution ( request ) ; return executeUpdateOriginEndpoint ( request ) ; } | Updates an existing OriginEndpoint . |
13,492 | public EventsBatch withEvents ( java . util . Map < String , Event > events ) { setEvents ( events ) ; return this ; } | An object that contains a set of events associated with the endpoint . |
13,493 | public void setJobTemplates ( java . util . Collection < JobTemplate > jobTemplates ) { if ( jobTemplates == null ) { this . jobTemplates = null ; return ; } this . jobTemplates = new java . util . ArrayList < JobTemplate > ( jobTemplates ) ; } | List of Job templates . |
13,494 | public void reset ( ) throws IOException { abortIfNeeded ( ) ; if ( bytesReadPastMark <= bufferSize ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Reset after reading " + bytesReadPastMark + " bytes." ) ; } bufferOffset = 0 ; } else { throw new IOException ( "Input stream cannot be reset as " + this . bytesReadPastMark + " bytes have been written, exceeding the available buffer size of " + this . bufferSize ) ; } } | Resets the input stream to the beginning by pointing the buffer offset to the beginning of the available data buffer . |
13,495 | public void mark ( int readlimit ) { abortIfNeeded ( ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Input stream marked at " + bytesReadPastMark + " bytes" ) ; } if ( bytesReadPastMark <= bufferSize && buffer != null ) { byte [ ] newBuffer = new byte [ this . bufferSize ] ; System . arraycopy ( buffer , bufferOffset , newBuffer , 0 , ( int ) ( bytesReadPastMark - bufferOffset ) ) ; this . buffer = newBuffer ; this . bytesReadPastMark -= bufferOffset ; this . bufferOffset = 0 ; } else { this . bufferOffset = 0 ; this . bytesReadPastMark = 0 ; this . buffer = new byte [ this . bufferSize ] ; } } | This method can only be used while less data has been read from the input stream than fits into the buffer . The readLimit parameter is ignored entirely . |
13,496 | public Waiter < DescribeCacheClustersRequest > cacheClusterDeleted ( ) { return new WaiterBuilder < DescribeCacheClustersRequest , DescribeCacheClustersResult > ( ) . withSdkFunction ( new DescribeCacheClustersFunction ( client ) ) . withAcceptors ( new CacheClusterDeleted . IsDeletedMatcher ( ) , new CacheClusterDeleted . IsCacheClusterNotFoundMatcher ( ) , new CacheClusterDeleted . IsAvailableMatcher ( ) , new CacheClusterDeleted . IsCreatingMatcher ( ) , new CacheClusterDeleted . IsIncompatiblenetworkMatcher ( ) , new CacheClusterDeleted . IsModifyingMatcher ( ) , new CacheClusterDeleted . IsRestorefailedMatcher ( ) , new CacheClusterDeleted . IsSnapshottingMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a CacheClusterDeleted 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,497 | public Waiter < DescribeReplicationGroupsRequest > replicationGroupAvailable ( ) { return new WaiterBuilder < DescribeReplicationGroupsRequest , DescribeReplicationGroupsResult > ( ) . withSdkFunction ( new DescribeReplicationGroupsFunction ( client ) ) . withAcceptors ( new ReplicationGroupAvailable . IsAvailableMatcher ( ) , new ReplicationGroupAvailable . IsDeletedMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a ReplicationGroupAvailable 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,498 | public Waiter < DescribeCacheClustersRequest > cacheClusterAvailable ( ) { return new WaiterBuilder < DescribeCacheClustersRequest , DescribeCacheClustersResult > ( ) . withSdkFunction ( new DescribeCacheClustersFunction ( client ) ) . withAcceptors ( new CacheClusterAvailable . IsAvailableMatcher ( ) , new CacheClusterAvailable . IsDeletedMatcher ( ) , new CacheClusterAvailable . IsDeletingMatcher ( ) , new CacheClusterAvailable . IsIncompatiblenetworkMatcher ( ) , new CacheClusterAvailable . IsRestorefailedMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a CacheClusterAvailable 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,499 | public Waiter < DescribeReplicationGroupsRequest > replicationGroupDeleted ( ) { return new WaiterBuilder < DescribeReplicationGroupsRequest , DescribeReplicationGroupsResult > ( ) . withSdkFunction ( new DescribeReplicationGroupsFunction ( client ) ) . withAcceptors ( new ReplicationGroupDeleted . IsDeletedMatcher ( ) , new ReplicationGroupDeleted . IsAvailableMatcher ( ) , new ReplicationGroupDeleted . IsReplicationGroupNotFoundFaultMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a ReplicationGroupDeleted 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 . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.