idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
13,200 | public void setCaptionDescriptionNames ( java . util . Collection < String > captionDescriptionNames ) { if ( captionDescriptionNames == null ) { this . captionDescriptionNames = null ; return ; } this . captionDescriptionNames = new java . util . ArrayList < String > ( captionDescriptionNames ) ; } | The names of the CaptionDescriptions used as caption sources for this output . |
13,201 | public java . util . concurrent . Future < DescribeTrailsResult > describeTrailsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeTrailsRequest , DescribeTrailsResult > asyncHandler ) { return describeTrailsAsync ( new DescribeTrailsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeTrails operation with an AsyncHandler . |
13,202 | public java . util . concurrent . Future < ListPublicKeysResult > listPublicKeysAsync ( com . amazonaws . handlers . AsyncHandler < ListPublicKeysRequest , ListPublicKeysResult > asyncHandler ) { return listPublicKeysAsync ( new ListPublicKeysRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListPublicKeys operation with an AsyncHandler . |
13,203 | public synchronized void setSuccess ( Res paramResult ) { if ( done ) return ; result = paramResult ; done = true ; notifyAll ( ) ; if ( callback != null ) { QueueBuffer . executor . submit ( new Callable < Void > ( ) { public Void call ( ) throws Exception { callback . onSuccess ( result ) ; return null ; } } ) ; } } | Report that the task this future represents has succeeded . |
13,204 | public synchronized void setFailure ( Exception paramE ) { if ( done ) return ; e = paramE ; done = true ; notifyAll ( ) ; if ( callback != null ) { QueueBuffer . executor . submit ( new Callable < Void > ( ) { public Void call ( ) throws Exception { callback . onError ( e ) ; return null ; } } ) ; } } | Report that the task this future represents has failed . |
13,205 | private void preprocess_RenameMemberShapes ( String shapeName , Shape shape ) { if ( shape . getListMember ( ) != null ) { preprocess_RenameMemberShape ( shape . getListMember ( ) ) ; } if ( shape . getMapKeyType ( ) != null ) { preprocess_RenameMemberShape ( shape . getMapKeyType ( ) ) ; } if ( shape . getMapValueType ( ) != null ) { preprocess_RenameMemberShape ( shape . getMapValueType ( ) ) ; } if ( shape . getMembers ( ) != null ) { for ( Entry < String , Member > entry : shape . getMembers ( ) . entrySet ( ) ) { preprocess_RenameMemberShape ( entry . getValue ( ) ) ; } } } | Rename all the member shapes within this shape |
13,206 | public java . util . concurrent . Future < DescribeClustersResult > describeClustersAsync ( com . amazonaws . handlers . AsyncHandler < DescribeClustersRequest , DescribeClustersResult > asyncHandler ) { return describeClustersAsync ( new DescribeClustersRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeClusters operation with an AsyncHandler . |
13,207 | public java . util . concurrent . Future < ListContainerInstancesResult > listContainerInstancesAsync ( com . amazonaws . handlers . AsyncHandler < ListContainerInstancesRequest , ListContainerInstancesResult > asyncHandler ) { return listContainerInstancesAsync ( new ListContainerInstancesRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListContainerInstances operation with an AsyncHandler . |
13,208 | public java . util . concurrent . Future < ListTaskDefinitionFamiliesResult > listTaskDefinitionFamiliesAsync ( com . amazonaws . handlers . AsyncHandler < ListTaskDefinitionFamiliesRequest , ListTaskDefinitionFamiliesResult > asyncHandler ) { return listTaskDefinitionFamiliesAsync ( new ListTaskDefinitionFamiliesRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListTaskDefinitionFamilies operation with an AsyncHandler . |
13,209 | public java . util . concurrent . Future < ListTaskDefinitionsResult > listTaskDefinitionsAsync ( com . amazonaws . handlers . AsyncHandler < ListTaskDefinitionsRequest , ListTaskDefinitionsResult > asyncHandler ) { return listTaskDefinitionsAsync ( new ListTaskDefinitionsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListTaskDefinitions operation with an AsyncHandler . |
13,210 | public java . util . concurrent . Future < ListTasksResult > listTasksAsync ( com . amazonaws . handlers . AsyncHandler < ListTasksRequest , ListTasksResult > asyncHandler ) { return listTasksAsync ( new ListTasksRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListTasks operation with an AsyncHandler . |
13,211 | public java . util . concurrent . Future < SubmitContainerStateChangeResult > submitContainerStateChangeAsync ( com . amazonaws . handlers . AsyncHandler < SubmitContainerStateChangeRequest , SubmitContainerStateChangeResult > asyncHandler ) { return submitContainerStateChangeAsync ( new SubmitContainerStateChangeRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the SubmitContainerStateChange operation with an AsyncHandler . |
13,212 | public static RegionMetadata load ( final File file ) throws IOException { return RegionMetadataParser . parse ( new BufferedInputStream ( new FileInputStream ( file ) ) ) ; } | Loads a set of region metadata by parsing the given file . |
13,213 | private void addMetrics ( List < MetricDatum > list , MetricValues metricValues , StandardUnit unit ) { List < MachineMetric > machineMetrics = metricValues . getMetrics ( ) ; List < Long > values = metricValues . getValues ( ) ; for ( int i = 0 ; i < machineMetrics . size ( ) ; i ++ ) { MachineMetric metric = machineMetrics . get ( i ) ; long val = values . get ( i ) . longValue ( ) ; if ( val != 0 || metric . includeZeroValue ( ) ) { MetricDatum datum = new MetricDatum ( ) . withMetricName ( metric . getMetricName ( ) ) . withDimensions ( new Dimension ( ) . withName ( metric . getDimensionName ( ) ) . withValue ( metric . name ( ) ) ) . withUnit ( unit ) . withValue ( ( double ) val ) ; list . add ( datum ) ; } } } | Add the given list of metrics and corresponding values specified in metricValues to the given list of metric datum . |
13,214 | private Set < MachineMetric > customMachineMetrics ( ) { Set < MachineMetric > customized = new HashSet < MachineMetric > ( ) ; for ( MetricType m : AwsSdkMetrics . getPredefinedMetrics ( ) ) { if ( m instanceof MachineMetric ) customized . add ( ( MachineMetric ) m ) ; } return customized ; } | Returns the set of custom machine metrics specified in the SDK metrics registry ; or an empty set if there is none . Note any machine metrics found in the registry must have been custom specified as the default behavior is to include all machine metrics when enabled . |
13,215 | private MetricValues memoryMetricValues ( Set < MachineMetric > customSet , List < Long > values ) { return metricValues ( customSet , MachineMetricFactory . memoryMetrics , values ) ; } | Returns the set of memory metrics and the corresponding values based on the default and the customized set of metrics if any . |
13,216 | private MetricValues fdMetricValues ( Set < MachineMetric > customSet , List < Long > values ) { return metricValues ( customSet , MachineMetricFactory . fdMetrics , values ) ; } | Returns the set of file - descriptor metrics and the corresponding values based on the default and the customized set of metrics if any . |
13,217 | private MetricValues threadMetricValues ( Set < MachineMetric > customSet , List < Long > values ) { return metricValues ( customSet , MachineMetricFactory . threadMetrics , values ) ; } | Returns the set of thread metrics and the corresponding values based on the default and the customized set of metrics if any . |
13,218 | public Waiter < DescribeInstanceHealthRequest > anyInstanceInService ( ) { return new WaiterBuilder < DescribeInstanceHealthRequest , DescribeInstanceHealthResult > ( ) . withSdkFunction ( new DescribeInstanceHealthFunction ( client ) ) . withAcceptors ( new AnyInstanceInService . IsInServiceMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a AnyInstanceInService 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,219 | public Waiter < DescribeInstanceHealthRequest > instanceDeregistered ( ) { return new WaiterBuilder < DescribeInstanceHealthRequest , DescribeInstanceHealthResult > ( ) . withSdkFunction ( new DescribeInstanceHealthFunction ( client ) ) . withAcceptors ( new InstanceDeregistered . IsOutOfServiceMatcher ( ) , new InstanceDeregistered . IsInvalidInstanceMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a InstanceDeregistered 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,220 | public Waiter < DescribeInstanceHealthRequest > instanceInService ( ) { return new WaiterBuilder < DescribeInstanceHealthRequest , DescribeInstanceHealthResult > ( ) . withSdkFunction ( new DescribeInstanceHealthFunction ( client ) ) . withAcceptors ( new InstanceInService . IsInServiceMatcher ( ) , new InstanceInService . IsInvalidInstanceMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a InstanceInService 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,221 | public java . util . concurrent . Future < BatchGetItemResult > batchGetItemAsync ( java . util . Map < String , KeysAndAttributes > requestItems , String returnConsumedCapacity ) { return batchGetItemAsync ( new BatchGetItemRequest ( ) . withRequestItems ( requestItems ) . withReturnConsumedCapacity ( returnConsumedCapacity ) ) ; } | Simplified method form for invoking the BatchGetItem operation . |
13,222 | public java . util . concurrent . Future < BatchGetItemResult > batchGetItemAsync ( java . util . Map < String , KeysAndAttributes > requestItems , String returnConsumedCapacity , com . amazonaws . handlers . AsyncHandler < BatchGetItemRequest , BatchGetItemResult > asyncHandler ) { return batchGetItemAsync ( new BatchGetItemRequest ( ) . withRequestItems ( requestItems ) . withReturnConsumedCapacity ( returnConsumedCapacity ) , asyncHandler ) ; } | Simplified method form for invoking the BatchGetItem operation with an AsyncHandler . |
13,223 | public java . util . concurrent . Future < BatchWriteItemResult > batchWriteItemAsync ( java . util . Map < String , java . util . List < WriteRequest > > requestItems ) { return batchWriteItemAsync ( new BatchWriteItemRequest ( ) . withRequestItems ( requestItems ) ) ; } | Simplified method form for invoking the BatchWriteItem operation . |
13,224 | public java . util . concurrent . Future < BatchWriteItemResult > batchWriteItemAsync ( java . util . Map < String , java . util . List < WriteRequest > > requestItems , com . amazonaws . handlers . AsyncHandler < BatchWriteItemRequest , BatchWriteItemResult > asyncHandler ) { return batchWriteItemAsync ( new BatchWriteItemRequest ( ) . withRequestItems ( requestItems ) , asyncHandler ) ; } | Simplified method form for invoking the BatchWriteItem operation with an AsyncHandler . |
13,225 | public java . util . concurrent . Future < CreateTableResult > createTableAsync ( java . util . List < AttributeDefinition > attributeDefinitions , String tableName , java . util . List < KeySchemaElement > keySchema , ProvisionedThroughput provisionedThroughput ) { return createTableAsync ( new CreateTableRequest ( ) . withAttributeDefinitions ( attributeDefinitions ) . withTableName ( tableName ) . withKeySchema ( keySchema ) . withProvisionedThroughput ( provisionedThroughput ) ) ; } | Simplified method form for invoking the CreateTable operation . |
13,226 | public java . util . concurrent . Future < DeleteItemResult > deleteItemAsync ( String tableName , java . util . Map < String , AttributeValue > key ) { return deleteItemAsync ( new DeleteItemRequest ( ) . withTableName ( tableName ) . withKey ( key ) ) ; } | Simplified method form for invoking the DeleteItem operation . |
13,227 | public java . util . concurrent . Future < DeleteItemResult > deleteItemAsync ( String tableName , java . util . Map < String , AttributeValue > key , com . amazonaws . handlers . AsyncHandler < DeleteItemRequest , DeleteItemResult > asyncHandler ) { return deleteItemAsync ( new DeleteItemRequest ( ) . withTableName ( tableName ) . withKey ( key ) , asyncHandler ) ; } | Simplified method form for invoking the DeleteItem operation with an AsyncHandler . |
13,228 | public java . util . concurrent . Future < DeleteTableResult > deleteTableAsync ( String tableName ) { return deleteTableAsync ( new DeleteTableRequest ( ) . withTableName ( tableName ) ) ; } | Simplified method form for invoking the DeleteTable operation . |
13,229 | public java . util . concurrent . Future < DeleteTableResult > deleteTableAsync ( String tableName , com . amazonaws . handlers . AsyncHandler < DeleteTableRequest , DeleteTableResult > asyncHandler ) { return deleteTableAsync ( new DeleteTableRequest ( ) . withTableName ( tableName ) , asyncHandler ) ; } | Simplified method form for invoking the DeleteTable operation with an AsyncHandler . |
13,230 | public java . util . concurrent . Future < DescribeTableResult > describeTableAsync ( String tableName ) { return describeTableAsync ( new DescribeTableRequest ( ) . withTableName ( tableName ) ) ; } | Simplified method form for invoking the DescribeTable operation . |
13,231 | public java . util . concurrent . Future < DescribeTableResult > describeTableAsync ( String tableName , com . amazonaws . handlers . AsyncHandler < DescribeTableRequest , DescribeTableResult > asyncHandler ) { return describeTableAsync ( new DescribeTableRequest ( ) . withTableName ( tableName ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeTable operation with an AsyncHandler . |
13,232 | public java . util . concurrent . Future < GetItemResult > getItemAsync ( String tableName , java . util . Map < String , AttributeValue > key ) { return getItemAsync ( new GetItemRequest ( ) . withTableName ( tableName ) . withKey ( key ) ) ; } | Simplified method form for invoking the GetItem operation . |
13,233 | public java . util . concurrent . Future < GetItemResult > getItemAsync ( String tableName , java . util . Map < String , AttributeValue > key , com . amazonaws . handlers . AsyncHandler < GetItemRequest , GetItemResult > asyncHandler ) { return getItemAsync ( new GetItemRequest ( ) . withTableName ( tableName ) . withKey ( key ) , asyncHandler ) ; } | Simplified method form for invoking the GetItem operation with an AsyncHandler . |
13,234 | public java . util . concurrent . Future < PutItemResult > putItemAsync ( String tableName , java . util . Map < String , AttributeValue > item ) { return putItemAsync ( new PutItemRequest ( ) . withTableName ( tableName ) . withItem ( item ) ) ; } | Simplified method form for invoking the PutItem operation . |
13,235 | public java . util . concurrent . Future < PutItemResult > putItemAsync ( String tableName , java . util . Map < String , AttributeValue > item , com . amazonaws . handlers . AsyncHandler < PutItemRequest , PutItemResult > asyncHandler ) { return putItemAsync ( new PutItemRequest ( ) . withTableName ( tableName ) . withItem ( item ) , asyncHandler ) ; } | Simplified method form for invoking the PutItem operation with an AsyncHandler . |
13,236 | public java . util . concurrent . Future < ScanResult > scanAsync ( String tableName , java . util . Map < String , Condition > scanFilter , com . amazonaws . handlers . AsyncHandler < ScanRequest , ScanResult > asyncHandler ) { return scanAsync ( new ScanRequest ( ) . withTableName ( tableName ) . withScanFilter ( scanFilter ) , asyncHandler ) ; } | Simplified method form for invoking the Scan operation with an AsyncHandler . |
13,237 | public java . util . concurrent . Future < UpdateTableResult > updateTableAsync ( String tableName , ProvisionedThroughput provisionedThroughput ) { return updateTableAsync ( new UpdateTableRequest ( ) . withTableName ( tableName ) . withProvisionedThroughput ( provisionedThroughput ) ) ; } | Simplified method form for invoking the UpdateTable operation . |
13,238 | public java . util . concurrent . Future < UpdateTableResult > updateTableAsync ( String tableName , ProvisionedThroughput provisionedThroughput , com . amazonaws . handlers . AsyncHandler < UpdateTableRequest , UpdateTableResult > asyncHandler ) { return updateTableAsync ( new UpdateTableRequest ( ) . withTableName ( tableName ) . withProvisionedThroughput ( provisionedThroughput ) , asyncHandler ) ; } | Simplified method form for invoking the UpdateTable operation with an AsyncHandler . |
13,239 | public Waiter < DescribeAlarmsRequest > alarmExists ( ) { return new WaiterBuilder < DescribeAlarmsRequest , DescribeAlarmsResult > ( ) . withSdkFunction ( new DescribeAlarmsFunction ( client ) ) . withAcceptors ( new AlarmExists . IsTrueMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 5 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a AlarmExists 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,240 | public java . util . concurrent . Future < DescribeDestinationsResult > describeDestinationsAsync ( com . amazonaws . handlers . AsyncHandler < DescribeDestinationsRequest , DescribeDestinationsResult > asyncHandler ) { return describeDestinationsAsync ( new DescribeDestinationsRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeDestinations operation with an AsyncHandler . |
13,241 | public PrimaryKey addComponents ( KeyAttribute ... components ) { if ( components != null ) { for ( KeyAttribute ka : components ) { InternalUtils . rejectNullInput ( ka ) ; this . components . put ( ka . getName ( ) , ka ) ; } } return this ; } | Add one or multiple key components to this primary key . |
13,242 | public PrimaryKey addComponent ( String keyAttributeName , Object keyAttributeValue ) { components . put ( keyAttributeName , new KeyAttribute ( keyAttributeName , keyAttributeValue ) ) ; return this ; } | Add a key component to this primary key . |
13,243 | public static Condition newUserAgentCondition ( StringComparisonType comparisonType , String value ) { return new StringCondition ( comparisonType , USER_AGENT_CONDITION_KEY , value ) ; } | Constructs a new access control policy condition that tests the incoming request s user agent field against the specified value using the specified comparison type . This condition can be used to allow or deny access to a resource based on what user agent is specified in the request . |
13,244 | public static Condition newRefererCondition ( StringComparisonType comparisonType , String value ) { return new StringCondition ( comparisonType , REFERER_CONDITION_KEY , value ) ; } | Constructs a new access control policy condition that tests the incoming request s referer field against the specified value using the specified comparison type . |
13,245 | public Waiter < DescribeLoadBalancersRequest > loadBalancerAvailable ( ) { return new WaiterBuilder < DescribeLoadBalancersRequest , DescribeLoadBalancersResult > ( ) . withSdkFunction ( new DescribeLoadBalancersFunction ( client ) ) . withAcceptors ( new LoadBalancerAvailable . IsActiveMatcher ( ) , new LoadBalancerAvailable . IsProvisioningMatcher ( ) , new LoadBalancerAvailable . IsLoadBalancerNotFoundMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a LoadBalancerAvailable 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,246 | public Waiter < DescribeTargetHealthRequest > targetDeregistered ( ) { return new WaiterBuilder < DescribeTargetHealthRequest , DescribeTargetHealthResult > ( ) . withSdkFunction ( new DescribeTargetHealthFunction ( client ) ) . withAcceptors ( new TargetDeregistered . IsInvalidTargetMatcher ( ) , new TargetDeregistered . IsUnusedMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a TargetDeregistered 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,247 | public Waiter < DescribeTargetHealthRequest > targetInService ( ) { return new WaiterBuilder < DescribeTargetHealthRequest , DescribeTargetHealthResult > ( ) . withSdkFunction ( new DescribeTargetHealthFunction ( client ) ) . withAcceptors ( new TargetInService . IsHealthyMatcher ( ) , new TargetInService . IsInvalidInstanceMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a TargetInService 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,248 | public Waiter < DescribeLoadBalancersRequest > loadBalancerExists ( ) { return new WaiterBuilder < DescribeLoadBalancersRequest , DescribeLoadBalancersResult > ( ) . withSdkFunction ( new DescribeLoadBalancersFunction ( client ) ) . withAcceptors ( new HttpSuccessStatusAcceptor ( WaiterState . SUCCESS ) , new LoadBalancerExists . IsLoadBalancerNotFoundMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a LoadBalancerExists 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,249 | public Waiter < DescribeLoadBalancersRequest > loadBalancersDeleted ( ) { return new WaiterBuilder < DescribeLoadBalancersRequest , DescribeLoadBalancersResult > ( ) . withSdkFunction ( new DescribeLoadBalancersFunction ( client ) ) . withAcceptors ( new LoadBalancersDeleted . IsActiveMatcher ( ) , new LoadBalancersDeleted . IsLoadBalancerNotFoundMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 15 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a LoadBalancersDeleted 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,250 | private void digestPart ( ) { if ( byteOffset >= MB ) { byteOffset = 0 ; checksums . add ( digestInputStream . getMessageDigest ( ) . digest ( ) ) ; digestInputStream . getMessageDigest ( ) . reset ( ) ; } } | Digests the current part of the message if necessary and resets digest state . |
13,251 | private int onException ( Exception e ) throws IOException { eofReached = true ; if ( e instanceof IOException ) { throw ( IOException ) e ; } else if ( e instanceof RuntimeException ) { throw ( RuntimeException ) e ; } else { throw Throwables . failure ( e ) ; } } | Marks the input stream as EOF since no further reads should be done . |
13,252 | private void doRelease ( ) { try { in . close ( ) ; } catch ( Exception ex ) { if ( log . isDebugEnabled ( ) ) log . debug ( "FYI" , ex ) ; } if ( in instanceof Releasable ) { Releasable r = ( Releasable ) in ; r . release ( ) ; } abortIfNeeded ( ) ; } | Used to truly release the underlying resources . |
13,253 | public java . util . concurrent . Future < ListTagsForResourceResult > listTagsForResourceAsync ( com . amazonaws . handlers . AsyncHandler < ListTagsForResourceRequest , ListTagsForResourceResult > asyncHandler ) { return listTagsForResourceAsync ( new ListTagsForResourceRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListTagsForResource operation with an AsyncHandler . |
13,254 | public java . util . concurrent . Future < RemoveTagsFromResourceResult > removeTagsFromResourceAsync ( com . amazonaws . handlers . AsyncHandler < RemoveTagsFromResourceRequest , RemoveTagsFromResourceResult > asyncHandler ) { return removeTagsFromResourceAsync ( new RemoveTagsFromResourceRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the RemoveTagsFromResource operation with an AsyncHandler . |
13,255 | public void setInputChannels ( java . util . Collection < Integer > inputChannels ) { if ( inputChannels == null ) { this . inputChannels = null ; return ; } this . inputChannels = new java . util . ArrayList < Integer > ( inputChannels ) ; } | List of input channels |
13,256 | public java . util . concurrent . Future < GetSessionTokenResult > getSessionTokenAsync ( com . amazonaws . handlers . AsyncHandler < GetSessionTokenRequest , GetSessionTokenResult > asyncHandler ) { return getSessionTokenAsync ( new GetSessionTokenRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the GetSessionToken operation with an AsyncHandler . |
13,257 | private synchronized boolean loadNextResults ( ) { if ( atEndOfResults ( ) ) return false ; do { nextResults . addAll ( fetchNextPage ( ) ) ; } while ( ! atEndOfResults ( ) && nextResults . isEmpty ( ) ) ; return ! nextResults . isEmpty ( ) ; } | Attempts to load the next batch of results if there are any into the nextResults buffer . Returns whether there were any results to load . A return value of true guarantees that nextResults had items added to it . |
13,258 | private void moveNextResults ( boolean clearPreviousResults ) { if ( clearPreviousResults ) { allResults . clear ( ) ; } allResults . addAll ( nextResults ) ; nextResults . clear ( ) ; } | Moves the contents of the nextResults buffer into allResults and resets the buffer . |
13,259 | private static URI convertToVirtualHostEndpoint ( URI endpoint , String bucketName ) { try { return new URI ( String . format ( "%s://%s.%s" , endpoint . getScheme ( ) , bucketName , endpoint . getAuthority ( ) ) ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( "Invalid bucket name: " + bucketName , e ) ; } } | Converts the current endpoint set for this client into virtual addressing style by placing the name of the specified bucket before the S3 service endpoint . |
13,260 | public void resolveRequestEndpoint ( Request < ? > request , String regionString ) { if ( regionString != null ) { final Region r = RegionUtils . getRegion ( regionString ) ; if ( r == null ) { throw new SdkClientException ( "Not able to determine region" + " for " + regionString + ".Please upgrade to a newer " + "version of the SDK" ) ; } endpointBuilder . withRegion ( r ) ; } final URI endpoint = endpointBuilder . getServiceEndpoint ( ) ; if ( shouldUseVirtualAddressing ( endpoint ) ) { request . setEndpoint ( convertToVirtualHostEndpoint ( endpoint , bucketName ) ) ; request . setResourcePath ( SdkHttpUtils . urlEncode ( getHostStyleResourcePath ( ) , true ) ) ; } else { request . setEndpoint ( endpoint ) ; if ( bucketName != null ) { request . setResourcePath ( SdkHttpUtils . urlEncode ( getPathStyleResourcePath ( ) , true ) ) ; } } } | Set the request s endpoint and resource path with the new region provided |
13,261 | public void setOutputChannels ( java . util . Collection < OutputChannelMapping > outputChannels ) { if ( outputChannels == null ) { this . outputChannels = null ; return ; } this . outputChannels = new java . util . ArrayList < OutputChannelMapping > ( outputChannels ) ; } | List of output channels |
13,262 | String nameTokenFor ( String name ) { Integer token = nameToToken . get ( name ) ; if ( token == null ) { token = nameToToken . size ( ) ; nameToToken . put ( name , token ) ; } return "#" + token ; } | Returns the name token for the given name creating a new token as necessary . |
13,263 | String valueTokenFor ( Object value ) { Integer token = valueToToken . get ( value ) ; if ( token == null ) { token = valueToToken . size ( ) ; valueToToken . put ( value , token ) ; } return ":" + token ; } | Returns the value token for the given value creating a new token as necessary . |
13,264 | public SendUsersMessageRequest withContext ( java . util . Map < String , String > context ) { setContext ( context ) ; return this ; } | A map of custom attribute - value pairs . Amazon Pinpoint adds these attributes to the data . pinpoint object in the body of the push notification payload . Amazon Pinpoint also provides these attributes in the events that it generates for users - messages deliveries . |
13,265 | public SendUsersMessageRequest withUsers ( java . util . Map < String , EndpointSendConfiguration > users ) { setUsers ( users ) ; return this ; } | A map that associates user IDs with EndpointSendConfiguration objects . Within an EndpointSendConfiguration object you can tailor the message for a user by specifying message overrides or substitutions . |
13,266 | public SseKmsEncryptedObjects withStatus ( SseKmsEncryptedObjectsStatus status ) { setStatus ( status == null ? null : status . toString ( ) ) ; return this ; } | Sets the replication status for KMS encrypted objects . KMS encrypted S3 objects are not replicated if status is Disabled . |
13,267 | protected AmazonS3 build ( AwsSyncClientParams clientParams ) { return clientFactory . apply ( new AmazonS3ClientParamsWrapper ( clientParams , resolveS3ClientOptions ( ) ) ) ; } | Construct a synchronous implementation of AmazonS3 using the current builder configuration . |
13,268 | public void setObjectContent ( InputStream objectContent ) { setObjectContent ( new S3ObjectInputStream ( objectContent , this . objectContent != null ? this . objectContent . getHttpRequest ( ) : null ) ) ; } | Sets the input stream containing this object s contents . |
13,269 | public void close ( ) throws IOException { InputStream is = getObjectContent ( ) ; if ( is != null ) is . close ( ) ; } | Releases any underlying system resources . If the resources are already released then invoking this method has no effect . |
13,270 | public void setBlacklist ( java . util . Collection < String > blacklist ) { if ( blacklist == null ) { this . blacklist = null ; return ; } this . blacklist = new java . util . ArrayList < String > ( blacklist ) ; } | The GLOB wildcard for removing the attributes in the application |
13,271 | public static < T extends PersistableTransfer > T deserializeFrom ( String serialized ) { if ( serialized == null ) return null ; ByteArrayInputStream byteStream = new ByteArrayInputStream ( serialized . getBytes ( UTF8 ) ) ; try { return deserializeFrom ( byteStream ) ; } finally { try { byteStream . close ( ) ; } catch ( IOException ioe ) { } ; } } | Returns the deserialized transfer state of the given serialized representation . |
13,272 | public void setItem ( java . util . Collection < SegmentResponse > item ) { if ( item == null ) { this . item = null ; return ; } this . item = new java . util . ArrayList < SegmentResponse > ( item ) ; } | The list of segments . |
13,273 | public void setDimensions ( java . util . Collection < SegmentDimensions > dimensions ) { if ( dimensions == null ) { this . dimensions = null ; return ; } this . dimensions = new java . util . ArrayList < SegmentDimensions > ( dimensions ) ; } | List of dimensions to include or exclude . |
13,274 | public void setCaptionDescriptions ( java . util . Collection < CaptionDescription > captionDescriptions ) { if ( captionDescriptions == null ) { this . captionDescriptions = null ; return ; } this . captionDescriptions = new java . util . ArrayList < CaptionDescription > ( captionDescriptions ) ; } | Settings for caption decriptions |
13,275 | public ValueMap withList ( String key , Object ... vals ) { super . put ( key , vals == null ? null : new ArrayList < Object > ( Arrays . asList ( vals ) ) ) ; return this ; } | Sets the value of the specified key in the current ValueMap to the given values as a list . |
13,276 | public ValueMap withBoolean ( String key , boolean val ) { super . put ( key , Boolean . valueOf ( val ) ) ; return this ; } | Sets the value of the specified key in the current ValueMap to the boolean value . |
13,277 | public ValueMap withJSON ( String key , String jsonValue ) { super . put ( key , valueConformer . transform ( Jackson . fromJsonString ( jsonValue , Object . class ) ) ) ; return this ; } | Sets the value of the specified key to an object represented by the JSON structure passed . |
13,278 | public < T > HttpResponseHandler < AmazonWebServiceResponse < T > > createResponseHandler ( JsonOperationMetadata operationMetadata , Unmarshaller < T , JsonUnmarshallerContext > responseUnmarshaller ) { return getSdkFactory ( ) . createResponseHandler ( operationMetadata , responseUnmarshaller ) ; } | Returns the response handler to be used for handling a successful response . |
13,279 | public void setCores ( java . util . Collection < Core > cores ) { if ( cores == null ) { this . cores = null ; return ; } this . cores = new java . util . ArrayList < Core > ( cores ) ; } | A list of cores in the core definition version . |
13,280 | private boolean isExceptionAffected ( final String exceptionMessage ) { if ( exceptionMessage != null ) { for ( String affectedMessage : EXCEPTION_MESSAGE_WHITELIST ) { if ( exceptionMessage . contains ( affectedMessage ) ) { return true ; } } } return false ; } | Restrict the workaround to only certain types of SSLExceptions that indicate the bug may have been encountered . |
13,281 | public void unsubscribeFromTopic ( ) { try { HttpGet request = new HttpGet ( unsubscribeUrl . toURI ( ) ) ; HttpResponse response = httpClient . execute ( request ) ; if ( ! ApacheUtils . isRequestSuccessful ( response ) ) { throw new SdkClientException ( String . format ( "Could not unsubscribe from %s: %d %s.%n%s" , getTopicArn ( ) , response . getStatusLine ( ) . getStatusCode ( ) , response . getStatusLine ( ) . getReasonPhrase ( ) , IOUtils . toString ( response . getEntity ( ) . getContent ( ) ) ) ) ; } } catch ( Exception e ) { throw new SdkClientException ( e ) ; } } | Unsubscribes this endpoint from the topic . |
13,282 | public static String removeQuotes ( String s ) { if ( s == null ) return null ; s = s . trim ( ) ; if ( s . startsWith ( "\"" ) ) s = s . substring ( 1 ) ; if ( s . endsWith ( "\"" ) ) s = s . substring ( 0 , s . length ( ) - 1 ) ; return s ; } | Removes any surrounding quotes from the specified string and returns a new string . |
13,283 | public static String join ( List < String > strings ) { StringBuilder result = new StringBuilder ( ) ; boolean first = true ; for ( String s : strings ) { if ( ! first ) result . append ( ", " ) ; result . append ( s ) ; first = false ; } return result . toString ( ) ; } | Returns a new string created by joining each of the strings in the specified list together with a comma between them . |
13,284 | public static void createParentDirectoryIfNecessary ( final File file ) { final File parentDirectory = file . getParentFile ( ) ; if ( parentDirectory == null || parentDirectory . mkdirs ( ) || parentDirectory . exists ( ) ) { return ; } throw new SdkClientException ( "Unable to create directory in the path: " + parentDirectory . getAbsolutePath ( ) ) ; } | Creates the parent directory for a file if it doesn t already exist . |
13,285 | public static void appendFile ( File sourceFile , File destinationFile ) { ValidationUtils . assertNotNull ( destinationFile , "destFile" ) ; ValidationUtils . assertNotNull ( sourceFile , "sourceFile" ) ; if ( ! FileLocks . lock ( sourceFile ) ) { throw new FileLockException ( "Fail to lock " + sourceFile ) ; } if ( ! FileLocks . lock ( destinationFile ) ) { throw new FileLockException ( "Fail to lock " + destinationFile ) ; } FileChannel in = null ; FileChannel out = null ; try { in = new FileInputStream ( sourceFile ) . getChannel ( ) ; out = new FileOutputStream ( destinationFile , true ) . getChannel ( ) ; final long size = in . size ( ) ; final long count = 32 * MB ; long position = 0 ; while ( position < size ) { position += in . transferTo ( position , count , out ) ; } } catch ( IOException e ) { throw new SdkClientException ( "Unable to append file " + sourceFile . getAbsolutePath ( ) + "to destination file " + destinationFile . getAbsolutePath ( ) + "\n" + e . getMessage ( ) , e ) ; } finally { closeQuietly ( out , LOG ) ; closeQuietly ( in , LOG ) ; FileLocks . unlock ( sourceFile ) ; FileLocks . unlock ( destinationFile ) ; try { if ( ! sourceFile . delete ( ) ) { LOG . warn ( "Failed to delete file " + sourceFile . getAbsolutePath ( ) ) ; } } catch ( SecurityException exception ) { LOG . warn ( "Security manager denied delete access to file " + sourceFile . getAbsolutePath ( ) ) ; } } } | Append the data in sourceFile to destinationFile . |
13,286 | public static Integer getPartCount ( GetObjectRequest getObjectRequest , AmazonS3 s3 ) { ValidationUtils . assertNotNull ( s3 , "S3 client" ) ; ValidationUtils . assertNotNull ( getObjectRequest , "GetObjectRequest" ) ; GetObjectMetadataRequest getObjectMetadataRequest = RequestCopyUtils . createGetObjectMetadataRequestFrom ( getObjectRequest ) . withPartNumber ( 1 ) ; return s3 . getObjectMetadata ( getObjectMetadataRequest ) . getPartCount ( ) ; } | Returns the part count of the object represented by the getObjectRequest . |
13,287 | public static long getPartSize ( GetObjectRequest getObjectRequest , AmazonS3 s3 , int partNumber ) { ValidationUtils . assertNotNull ( s3 , "S3 client" ) ; ValidationUtils . assertNotNull ( getObjectRequest , "GetObjectRequest" ) ; GetObjectMetadataRequest getObjectMetadataRequest = RequestCopyUtils . createGetObjectMetadataRequestFrom ( getObjectRequest ) . withPartNumber ( partNumber ) ; return s3 . getObjectMetadata ( getObjectMetadataRequest ) . getContentLength ( ) ; } | Returns the part size of the part |
13,288 | public byte [ ] convertToXmlByteArray ( AccessControlList acl ) throws SdkClientException { Owner owner = acl . getOwner ( ) ; if ( owner == null ) { throw new SdkClientException ( "Invalid AccessControlList: missing an S3Owner" ) ; } XmlWriter xml = new XmlWriter ( ) ; xml . start ( "AccessControlPolicy" , "xmlns" , Constants . XML_NAMESPACE ) ; xml . start ( "Owner" ) ; if ( owner . getId ( ) != null ) { xml . start ( "ID" ) . value ( owner . getId ( ) ) . end ( ) ; } if ( owner . getDisplayName ( ) != null ) { xml . start ( "DisplayName" ) . value ( owner . getDisplayName ( ) ) . end ( ) ; } xml . end ( ) ; xml . start ( "AccessControlList" ) ; for ( Grant grant : acl . getGrantsAsList ( ) ) { xml . start ( "Grant" ) ; convertToXml ( grant . getGrantee ( ) , xml ) ; xml . start ( "Permission" ) . value ( grant . getPermission ( ) . toString ( ) ) . end ( ) ; xml . end ( ) ; } xml . end ( ) ; xml . end ( ) ; return xml . getBytes ( ) ; } | Converts the specified AccessControlList object to an XML fragment that can be sent to Amazon S3 . |
13,289 | protected XmlWriter convertToXml ( Grantee grantee , XmlWriter xml ) throws SdkClientException { if ( grantee instanceof CanonicalGrantee ) { return convertToXml ( ( CanonicalGrantee ) grantee , xml ) ; } else if ( grantee instanceof EmailAddressGrantee ) { return convertToXml ( ( EmailAddressGrantee ) grantee , xml ) ; } else if ( grantee instanceof GroupGrantee ) { return convertToXml ( ( GroupGrantee ) grantee , xml ) ; } else { throw new SdkClientException ( "Unknown Grantee type: " + grantee . getClass ( ) . getName ( ) ) ; } } | Returns an XML fragment representing the specified Grantee . |
13,290 | protected XmlWriter convertToXml ( EmailAddressGrantee grantee , XmlWriter xml ) { xml . start ( "Grantee" , new String [ ] { "xmlns:xsi" , "xsi:type" } , new String [ ] { "http://www.w3.org/2001/XMLSchema-instance" , "AmazonCustomerByEmail" } ) ; xml . start ( "EmailAddress" ) . value ( grantee . getIdentifier ( ) ) . end ( ) ; xml . end ( ) ; return xml ; } | Returns an XML fragment representing the specified email address grantee . |
13,291 | public Future < GetDocumentStreamResult > getDocumentStreamAsync ( final GetDocumentStreamRequest getDocumentStreamRequest ) { Callable < GetDocumentStreamResult > task = new Callable < GetDocumentStreamResult > ( ) { public GetDocumentStreamResult call ( ) { return getDocumentStream ( getDocumentStreamRequest ) ; } } ; return executorService . submit ( task ) ; } | Asynchronously gets document stream of latest version of given document and version ID . If version ID is null it retrieves latest version of requested document ID . Clients must close the stream once content is read . |
13,292 | public Future < UploadDocumentStreamResult > uploadDocumentStreamAsync ( final UploadDocumentStreamRequest uploadDocumentStreamRequest ) throws IllegalArgumentException { Callable < UploadDocumentStreamResult > task = new Callable < UploadDocumentStreamResult > ( ) { public UploadDocumentStreamResult call ( ) { return uploadDocumentStream ( uploadDocumentStreamRequest ) ; } } ; return executorService . submit ( task ) ; } | Asynchronously uploads stream to given folder and document name . Client must close the input stream once upload operation is complete . |
13,293 | public void setOverrideDate ( Date overriddenDate ) { if ( overriddenDate != null ) { this . overriddenDate = new Date ( overriddenDate . getTime ( ) ) ; } else { this . overriddenDate = null ; } } | Sets the date that overrides the signing date in the request . This method is internal and should be used only for testing purposes . |
13,294 | private final String computeSigningCacheKeyName ( AWSCredentials credentials , AWS4SignerRequestParams signerRequestParams ) { final StringBuilder hashKeyBuilder = new StringBuilder ( credentials . getAWSSecretKey ( ) ) ; return hashKeyBuilder . append ( "-" ) . append ( signerRequestParams . getRegionName ( ) ) . append ( "-" ) . append ( signerRequestParams . getServiceName ( ) ) . toString ( ) ; } | Computes the name to be used to reference the signing key in the cache . |
13,295 | private String buildAuthorizationHeader ( SignableRequest < ? > request , byte [ ] signature , AWSCredentials credentials , AWS4SignerRequestParams signerParams ) { final String signingCredentials = credentials . getAWSAccessKeyId ( ) + "/" + signerParams . getScope ( ) ; final String credential = "Credential=" + signingCredentials ; final String signerHeaders = "SignedHeaders=" + getSignedHeadersString ( request ) ; final String signatureHeader = "Signature=" + BinaryUtils . toHex ( signature ) ; final StringBuilder authHeaderBuilder = new StringBuilder ( ) ; authHeaderBuilder . append ( AWS4_SIGNING_ALGORITHM ) . append ( " " ) . append ( credential ) . append ( ", " ) . append ( signerHeaders ) . append ( ", " ) . append ( signatureHeader ) ; return authHeaderBuilder . toString ( ) ; } | Creates the authorization header to be included in the request . |
13,296 | private void addPreSignInformationToRequest ( SignableRequest < ? > request , AWSCredentials credentials , AWS4SignerRequestParams signerParams , String timeStamp , long expirationInSeconds ) { String signingCredentials = credentials . getAWSAccessKeyId ( ) + "/" + signerParams . getScope ( ) ; request . addParameter ( X_AMZ_ALGORITHM , AWS4_SIGNING_ALGORITHM ) ; request . addParameter ( X_AMZ_DATE , timeStamp ) ; request . addParameter ( X_AMZ_SIGNED_HEADER , getSignedHeadersString ( request ) ) ; request . addParameter ( X_AMZ_EXPIRES , Long . toString ( expirationInSeconds ) ) ; request . addParameter ( X_AMZ_CREDENTIAL , signingCredentials ) ; } | Includes all the signing headers as request parameters for pre - signing . |
13,297 | private long generateExpirationDate ( Date expirationDate ) { long expirationInSeconds = expirationDate != null ? ( ( expirationDate . getTime ( ) - clock . currentTimeMillis ( ) ) / 1000L ) : PRESIGN_URL_MAX_EXPIRATION_SECONDS ; if ( expirationInSeconds > PRESIGN_URL_MAX_EXPIRATION_SECONDS ) { throw new SdkClientException ( "Requests that are pre-signed by SigV4 algorithm are valid for at most 7 days. " + "The expiration date set on the current request [" + AWS4SignerUtils . formatTimestamp ( expirationDate . getTime ( ) ) + "] has exceeded this limit." ) ; } return expirationInSeconds ; } | Generates an expiration date for the presigned url . If user has specified an expiration date check if it is in the given limit . |
13,298 | protected byte [ ] newSigningKey ( AWSCredentials credentials , String dateStamp , String regionName , String serviceName ) { byte [ ] kSecret = ( "AWS4" + credentials . getAWSSecretKey ( ) ) . getBytes ( Charset . forName ( "UTF-8" ) ) ; byte [ ] kDate = sign ( dateStamp , kSecret , SigningAlgorithm . HmacSHA256 ) ; byte [ ] kRegion = sign ( regionName , kDate , SigningAlgorithm . HmacSHA256 ) ; byte [ ] kService = sign ( serviceName , kRegion , SigningAlgorithm . HmacSHA256 ) ; return sign ( AWS4_TERMINATOR , kService , SigningAlgorithm . HmacSHA256 ) ; } | Generates a new signing key from the given parameters and returns it . |
13,299 | public final List < String > globalSecondaryIndexNames ( final KeyType keyType ) { if ( properties . globalSecondaryIndexNames ( ) . containsKey ( keyType ) ) { return properties . globalSecondaryIndexNames ( ) . get ( keyType ) ; } return Collections . emptyList ( ) ; } | Gets the global secondary indexes . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.