idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
30,900 | private int pruneHeadTasks ( Predicate < ReceiveMessageBatchTask > pruneCondition ) { int numberPruned = 0 ; while ( ! finishedTasks . isEmpty ( ) ) { if ( pruneCondition . test ( finishedTasks . getFirst ( ) ) ) { finishedTasks . removeFirst ( ) ; numberPruned ++ ; } else { break ; } } return numberPruned ; } | Prune all tasks at the beginning of the finishedTasks list that meet the given condition . Once a task is found that does not meet the given condition the pruning stops . This method assumes that you are holding the finishedTasks lock when invoking it . |
30,901 | private void spawnMoreReceiveTasks ( ) { if ( shutDown ) { return ; } int desiredBatches = config . getMaxDoneReceiveBatches ( ) ; desiredBatches = desiredBatches < 1 ? 1 : desiredBatches ; synchronized ( finishedTasks ) { if ( finishedTasks . size ( ) >= desiredBatches ) return ; if ( finishedTasks . size ( ) > 0 && ( finishedTasks . size ( ) + inflightReceiveMessageBatches ) >= desiredBatches ) { return ; } } synchronized ( taskSpawnSyncPoint ) { if ( visibilityTimeoutNanos == - 1 ) { GetQueueAttributesRequest request = new GetQueueAttributesRequest ( ) . withQueueUrl ( qUrl ) . withAttributeNames ( "VisibilityTimeout" ) ; ResultConverter . appendUserAgent ( request , AmazonSQSBufferedAsyncClient . USER_AGENT ) ; long visibilityTimeoutSeconds = Long . parseLong ( sqsClient . getQueueAttributes ( request ) . getAttributes ( ) . get ( "VisibilityTimeout" ) ) ; visibilityTimeoutNanos = TimeUnit . NANOSECONDS . convert ( visibilityTimeoutSeconds , TimeUnit . SECONDS ) ; } int max = config . getMaxInflightReceiveBatches ( ) ; max = max > 0 ? max : 1 ; int toSpawn = max - inflightReceiveMessageBatches ; if ( toSpawn > 0 ) { ReceiveMessageBatchTask task = new ReceiveMessageBatchTask ( this ) ; ++ inflightReceiveMessageBatches ; ++ bufferCounter ; if ( log . isTraceEnabled ( ) ) { log . trace ( "Spawned receive batch #" + bufferCounter + " (" + inflightReceiveMessageBatches + " of " + max + " inflight) for queue " + qUrl ) ; } executor . execute ( task ) ; } } } | maybe create more receive tasks . extra receive tasks won t be created if we are already at the maximum number of receive tasks or if we are at the maximum number of prefetched buffers |
30,902 | void reportBatchFinished ( ReceiveMessageBatchTask batch ) { synchronized ( finishedTasks ) { finishedTasks . addLast ( batch ) ; if ( log . isTraceEnabled ( ) ) { log . info ( "Queue " + qUrl + " now has " + finishedTasks . size ( ) + " receive results cached " ) ; } } synchronized ( taskSpawnSyncPoint ) { -- inflightReceiveMessageBatches ; } satisfyFuturesFromBuffer ( ) ; spawnMoreReceiveTasks ( ) ; } | This method is called by the batches after they have finished retrieving the messages . |
30,903 | public void clear ( ) { boolean done = false ; while ( ! done ) { ReceiveMessageBatchTask currentBatch = null ; synchronized ( finishedTasks ) { currentBatch = finishedTasks . poll ( ) ; } if ( currentBatch != null ) { currentBatch . clear ( ) ; } else { done = true ; } } } | Clears and nacks any pre - fetched messages in this buffer . |
30,904 | public MarshallerRegistry merge ( MarshallerRegistry . Builder marshallerRegistryOverrides ) { if ( marshallerRegistryOverrides == null ) { return this ; } Builder merged = MarshallerRegistry . builder ( ) ; merged . copyMarshallersFromRegistry ( this . marshallers ) ; merged . copyMarshallersFromRegistry ( marshallerRegistryOverrides . marshallers ) ; return merged . build ( ) ; } | Merge the given overrides with this registry . Overrides are higher precedence than this registry . Both this registry and the override registry are immutable so a new registry object is returned . If the marshallerRegistryOverrides are null then this method just returns the current registry since there is nothing to merge . |
30,905 | public synchronized CopyPartRequest getNextCopyPartRequest ( ) { final long partSize = Math . min ( optimalPartSize , remainingBytes ) ; CopyPartRequest req = new CopyPartRequest ( ) . withSourceBucketName ( origReq . getSourceBucketName ( ) ) . withSourceKey ( origReq . getSourceKey ( ) ) . withUploadId ( uploadId ) . withPartNumber ( partNumber ++ ) . withDestinationBucketName ( origReq . getDestinationBucketName ( ) ) . withDestinationKey ( origReq . getDestinationKey ( ) ) . withSourceVersionId ( origReq . getSourceVersionId ( ) ) . withFirstByte ( Long . valueOf ( offset ) ) . withLastByte ( Long . valueOf ( offset + partSize - 1 ) ) . withSourceSSECustomerKey ( origReq . getSourceSSECustomerKey ( ) ) . withDestinationSSECustomerKey ( origReq . getDestinationSSECustomerKey ( ) ) . withRequesterPays ( origReq . isRequesterPays ( ) ) . withMatchingETagConstraints ( origReq . getMatchingETagConstraints ( ) ) . withModifiedSinceConstraint ( origReq . getModifiedSinceConstraint ( ) ) . withNonmatchingETagConstraints ( origReq . getNonmatchingETagConstraints ( ) ) . withSourceVersionId ( origReq . getSourceVersionId ( ) ) . withUnmodifiedSinceConstraint ( origReq . getUnmodifiedSinceConstraint ( ) ) . withGeneralProgressListener ( origReq . getGeneralProgressListener ( ) ) . withRequestMetricCollector ( origReq . getRequestMetricCollector ( ) ) ; offset += partSize ; remainingBytes -= partSize ; return req ; } | Constructs a copy part requests and returns it . |
30,906 | public BucketNotificationConfiguration withNotificationConfiguration ( Map < String , NotificationConfiguration > notificationConfiguration ) { configurations . clear ( ) ; configurations . putAll ( notificationConfiguration ) ; return this ; } | Sets the given notification configurations and returns this object . |
30,907 | public java . util . concurrent . Future < DescribeWorkspaceDirectoriesResult > describeWorkspaceDirectoriesAsync ( com . amazonaws . handlers . AsyncHandler < DescribeWorkspaceDirectoriesRequest , DescribeWorkspaceDirectoriesResult > asyncHandler ) { return describeWorkspaceDirectoriesAsync ( new DescribeWorkspaceDirectoriesRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the DescribeWorkspaceDirectories operation with an AsyncHandler . |
30,908 | public GetShippingLabelResult getShippingLabel ( GetShippingLabelRequest request ) { request = beforeClientExecution ( request ) ; return executeGetShippingLabel ( request ) ; } | This operation generates a pre - paid UPS shipping label that you will use to ship your device to AWS for processing . |
30,909 | public GetStatusResult getStatus ( GetStatusRequest request ) { request = beforeClientExecution ( request ) ; return executeGetStatus ( request ) ; } | This operation returns information about a job including where the job is in the processing pipeline the status of the results and the signature value associated with the job . You can only return information about jobs you own . |
30,910 | public void addProperty ( String propertyName , Object value ) { List < Object > propertyList = properties . get ( propertyName ) ; if ( propertyList == null ) { propertyList = new ArrayList < Object > ( ) ; properties . put ( propertyName , propertyList ) ; } propertyList . add ( value ) ; } | Add a property . If you add the same property more than once it stores all values a list . |
30,911 | public void setGroups ( java . util . Collection < SegmentGroup > groups ) { if ( groups == null ) { this . groups = null ; return ; } this . groups = new java . util . ArrayList < SegmentGroup > ( groups ) ; } | A set of segment criteria to evaluate . |
30,912 | public static String buildCustomPolicy ( String resourcePath , Date expiresOn , Date activeFrom , String ipAddress ) { return "{\"Statement\": [{" + "\"Resource\":\"" + resourcePath + "\"" + ",\"Condition\":{" + "\"DateLessThan\":{\"AWS:EpochTime\":" + MILLISECONDS . toSeconds ( expiresOn . getTime ( ) ) + "}" + ( ipAddress == null ? "" : ",\"IpAddress\":{\"AWS:SourceIp\":\"" + ipAddress + "\"}" ) + ( activeFrom == null ? "" : ",\"DateGreaterThan\":{\"AWS:EpochTime\":" + MILLISECONDS . toSeconds ( activeFrom . getTime ( ) ) + "}" ) + "}}]}" ; } | Returns a custom policy for the given parameters . |
30,913 | public static String makeBytesUrlSafe ( byte [ ] bytes ) { byte [ ] encoded = Base64 . encode ( bytes ) ; for ( int i = 0 ; i < encoded . length ; i ++ ) { switch ( encoded [ i ] ) { case '+' : encoded [ i ] = '-' ; continue ; case '=' : encoded [ i ] = '_' ; continue ; case '/' : encoded [ i ] = '~' ; continue ; default : continue ; } } return new String ( encoded , UTF8 ) ; } | Converts the given data to be safe for use in signed URLs for a private distribution by using specialized Base64 encoding . |
30,914 | public static String generateResourcePath ( final Protocol protocol , final String distributionDomain , final String resourcePath ) { return protocol == Protocol . http || protocol == Protocol . https ? protocol + "://" + distributionDomain + "/" + resourcePath : resourcePath ; } | Returns the resource path for the given distribution object and protocol . |
30,915 | public static byte [ ] signWithSha1RSA ( byte [ ] dataToSign , PrivateKey privateKey ) throws InvalidKeyException { Signature signature ; try { signature = Signature . getInstance ( "SHA1withRSA" ) ; signature . initSign ( privateKey , srand ) ; signature . update ( dataToSign ) ; return signature . sign ( ) ; } catch ( NoSuchAlgorithmException e ) { throw new IllegalStateException ( e ) ; } catch ( SignatureException e ) { throw new IllegalStateException ( e ) ; } } | Signs the data given with the private key given using the SHA1withRSA algorithm provided by bouncy castle . |
30,916 | public void setUnprocessedAccounts ( java . util . Collection < UnprocessedAccount > unprocessedAccounts ) { if ( unprocessedAccounts == null ) { this . unprocessedAccounts = null ; return ; } this . unprocessedAccounts = new java . util . ArrayList < UnprocessedAccount > ( unprocessedAccounts ) ; } | A list of objects containing the unprocessed account and a result string explaining why it was unprocessed . |
30,917 | public Regions getKmsRegion ( ) { if ( awskmsRegion == null ) return null ; return Regions . fromName ( awskmsRegion . getName ( ) ) ; } | Returns the the KMS region explicitly specified for the AWS KMS client when such client is internally instantiated ; or null if no explicit KMS region is specified . This KMS region parameter is ignored when the AWS KMS client of the S3 encryption client is explicitly passed in by the users instead of being implicitly created . |
30,918 | public void setKmsRegion ( Regions kmsRegion ) { if ( kmsRegion != null ) { setAwsKmsRegion ( Region . getRegion ( kmsRegion ) ) ; } else { setAwsKmsRegion ( null ) ; } } | Sets the KMS region for the AWS KMS client when such client is internally instantiated instead of externally passed in by users ; or null if no explicit KMS region is explicitly configured . This KMS region parameter is ignored when the AWS KMS client of the S3 encryption client is explicitly passed in by the users instead of being implicitly created . |
30,919 | public T add ( String key , T value ) { wlock . lock ( ) ; try { return map . put ( key , value ) ; } finally { wlock . unlock ( ) ; } } | Adds an entry to the cache evicting the earliest entry if necessary . |
30,920 | public T get ( String key ) { rlock . lock ( ) ; try { return map . get ( key ) ; } finally { rlock . unlock ( ) ; } } | Returns the value of the given key ; or null of no such entry exists . |
30,921 | public Encryption withEncryptionType ( SSEAlgorithm encryptionType ) { setEncryptionType ( encryptionType == null ? null : encryptionType . toString ( ) ) ; return this ; } | Sets the encryptionType |
30,922 | public java . util . concurrent . Future < CreateKeyResult > createKeyAsync ( com . amazonaws . handlers . AsyncHandler < CreateKeyRequest , CreateKeyResult > asyncHandler ) { return createKeyAsync ( new CreateKeyRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the CreateKey operation with an AsyncHandler . |
30,923 | public java . util . concurrent . Future < GenerateRandomResult > generateRandomAsync ( com . amazonaws . handlers . AsyncHandler < GenerateRandomRequest , GenerateRandomResult > asyncHandler ) { return generateRandomAsync ( new GenerateRandomRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the GenerateRandom operation with an AsyncHandler . |
30,924 | public java . util . concurrent . Future < ListKeysResult > listKeysAsync ( com . amazonaws . handlers . AsyncHandler < ListKeysRequest , ListKeysResult > asyncHandler ) { return listKeysAsync ( new ListKeysRequest ( ) , asyncHandler ) ; } | Simplified method form for invoking the ListKeys operation with an AsyncHandler . |
30,925 | public static String stripHTMLTags ( String documentation ) { if ( documentation == null ) { return "" ; } if ( documentation . startsWith ( "<" ) ) { int startTagIndex = documentation . indexOf ( ">" ) ; final int closingTagIndex = documentation . lastIndexOf ( "<" ) ; if ( closingTagIndex > startTagIndex ) { documentation = stripHTMLTags ( documentation . substring ( startTagIndex + 1 , closingTagIndex ) ) ; } else { documentation = stripHTMLTags ( documentation . substring ( startTagIndex + 1 ) ) ; } } return documentation . trim ( ) ; } | Returns a documentation with HTML tags prefixed and suffixed removed or returns empty string if the input is empty or null . This method is to be used when constructing documentation for method parameters . |
30,926 | public static String escapeIllegalCharacters ( String documentation ) { if ( documentation == null ) { return "" ; } documentation = documentation . replaceAll ( "\\*\\/" , "*/" ) ; return documentation ; } | Escapes Java comment breaking illegal character sequences . |
30,927 | private BaseException createException ( int httpStatusCode , JsonContent jsonContent ) { return unmarshallers . stream ( ) . filter ( u -> u . matches ( httpStatusCode ) ) . findFirst ( ) . map ( u -> safeUnmarshall ( jsonContent , u ) ) . orElseThrow ( this :: createUnknownException ) ; } | Create an AmazonServiceException using the chain of unmarshallers . This method will never return null it will always return a valid exception . |
30,928 | public void setItem ( java . util . Collection < EndpointResponse > item ) { if ( item == null ) { this . item = null ; return ; } this . item = new java . util . ArrayList < EndpointResponse > ( item ) ; } | The list of endpoints . |
30,929 | private AuthRetryParameters redirectToS3External ( ) { AWSS3V4Signer v4Signer = buildSigV4Signer ( Regions . US_EAST_1 . getName ( ) ) ; try { URI bucketEndpoint = new URI ( String . format ( "https://%s.s3-external-1.amazonaws.com" , endpointResolver . getBucketName ( ) ) ) ; return buildRetryParams ( v4Signer , bucketEndpoint ) ; } catch ( URISyntaxException e ) { throw new SdkClientException ( "Failed to re-send the request to \"s3-external-1.amazonaws.com\". " + V4_REGION_WARNING , e ) ; } } | If the response doesn t have the x - amz - region header we have to resort to sending a request to s3 - external - 1 |
30,930 | public void setRequestCredentials ( AWSCredentials credentials ) { this . credentialsProvider = credentials == null ? null : new StaticCredentialsProvider ( credentials ) ; } | Sets the optional credentials to use for this request overriding the default credentials set at the client level . |
30,931 | public < T extends AmazonWebServiceRequest > T withRequestCredentialsProvider ( final AWSCredentialsProvider credentialsProvider ) { setRequestCredentialsProvider ( credentialsProvider ) ; @ SuppressWarnings ( "unchecked" ) T t = ( T ) this ; return t ; } | Sets the optional credentials provider to use for this request overriding the default credentials provider at the client level . |
30,932 | public < T extends AmazonWebServiceRequest > T withRequestMetricCollector ( RequestMetricCollector metricCollector ) { setRequestMetricCollector ( metricCollector ) ; @ SuppressWarnings ( "unchecked" ) T t = ( T ) this ; return t ; } | Specifies a request level metric collector which takes precedence over the ones at the http client level and AWS SDK level . |
30,933 | public < T extends AmazonWebServiceRequest > T withGeneralProgressListener ( ProgressListener progressListener ) { setGeneralProgressListener ( progressListener ) ; @ SuppressWarnings ( "unchecked" ) T t = ( T ) this ; return t ; } | Sets the optional progress listener for receiving updates about the progress of the request and returns a reference to this object so that method calls can be chained together . |
30,934 | public Map < String , String > getCustomRequestHeaders ( ) { if ( customRequestHeaders == null ) { return null ; } return Collections . unmodifiableMap ( customRequestHeaders ) ; } | Returns an immutable map of custom header names to header values . |
30,935 | protected final < T extends AmazonWebServiceRequest > T copyBaseTo ( T target ) { if ( customRequestHeaders != null ) { for ( Map . Entry < String , String > e : customRequestHeaders . entrySet ( ) ) target . putCustomRequestHeader ( e . getKey ( ) , e . getValue ( ) ) ; } if ( customQueryParameters != null ) { for ( Map . Entry < String , List < String > > e : customQueryParameters . entrySet ( ) ) { if ( e . getValue ( ) != null ) { for ( String value : e . getValue ( ) ) { target . putCustomQueryParameter ( e . getKey ( ) , value ) ; } } } } target . setRequestCredentialsProvider ( credentialsProvider ) ; target . setGeneralProgressListener ( progressListener ) ; target . setRequestMetricCollector ( requestMetricCollector ) ; requestClientOptions . copyTo ( target . getRequestClientOptions ( ) ) ; return target ; } | Copies the internal state of this base class to that of the target request . |
30,936 | public AmazonWebServiceRequest getCloneRoot ( ) { AmazonWebServiceRequest cloneRoot = cloneSource ; if ( cloneRoot != null ) { while ( cloneRoot . getCloneSource ( ) != null ) { cloneRoot = cloneRoot . getCloneSource ( ) ; } } return cloneRoot ; } | Returns the root object from which the current object was cloned ; or null if there isn t one . |
30,937 | private < T > T loadRequiredModel ( Class < T > clzz , String location ) throws MojoExecutionException { return ModelLoaderUtils . loadModel ( clzz , getResourceLocation ( location ) ) ; } | Load required model from the project resources . |
30,938 | private < T > Optional < T > loadOptionalModel ( Class < T > clzz , String location ) { return ModelLoaderUtils . loadOptionalModel ( clzz , getResourceLocation ( location ) ) ; } | Load an optional model from the project resources . |
30,939 | public Waiter < DescribeFleetsRequest > fleetStarted ( ) { return new WaiterBuilder < DescribeFleetsRequest , DescribeFleetsResult > ( ) . withSdkFunction ( new DescribeFleetsFunction ( client ) ) . withAcceptors ( new FleetStarted . IsACTIVEMatcher ( ) , new FleetStarted . IsPENDING_DEACTIVATEMatcher ( ) , new FleetStarted . IsINACTIVEMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 30 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a FleetStarted waiter by using custom parameters waiterParameters and other parameters defined in the waiters specification and then polls until it determines whether the resource entered the desired state or not where polling criteria is bound by either default polling strategy or custom polling strategy . |
30,940 | public Waiter < DescribeFleetsRequest > fleetStopped ( ) { return new WaiterBuilder < DescribeFleetsRequest , DescribeFleetsResult > ( ) . withSdkFunction ( new DescribeFleetsFunction ( client ) ) . withAcceptors ( new FleetStopped . IsINACTIVEMatcher ( ) , new FleetStopped . IsPENDING_ACTIVATEMatcher ( ) , new FleetStopped . IsACTIVEMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 40 ) , new FixedDelayStrategy ( 30 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a FleetStopped waiter by using custom parameters waiterParameters and other parameters defined in the waiters specification and then polls until it determines whether the resource entered the desired state or not where polling criteria is bound by either default polling strategy or custom polling strategy . |
30,941 | private List < RequestHandler2 > resolveRequestHandlers ( ) { return ( requestHandlers == null ) ? new ArrayList < RequestHandler2 > ( ) : new ArrayList < RequestHandler2 > ( requestHandlers ) ; } | Request handlers are copied to a new list to avoid mutation if no request handlers are provided to the builder we supply an empty list . |
30,942 | protected final < T > T getAdvancedConfig ( AdvancedConfig . Key < T > key ) { return advancedConfig . get ( key ) ; } | Get the current value of an advanced config option . |
30,943 | protected final < T > void putAdvancedConfig ( AdvancedConfig . Key < T > key , T value ) { advancedConfig . put ( key , value ) ; } | Sets the value of an advanced config option . |
30,944 | final TypeToBuild configureMutableProperties ( TypeToBuild clientInterface ) { AmazonWebServiceClient client = ( AmazonWebServiceClient ) clientInterface ; setRegion ( client ) ; client . makeImmutable ( ) ; return clientInterface ; } | Region and endpoint logic is tightly coupled to the client class right now so it s easier to set them after client creation and let the normal logic kick in . Ideally this should resolve the endpoint and signer information here and just pass that information as is to the client . |
30,945 | public void setItem ( java . util . Collection < ImportJobResponse > item ) { if ( item == null ) { this . item = null ; return ; } this . item = new java . util . ArrayList < ImportJobResponse > ( item ) ; } | A list of import jobs for the application . |
30,946 | public MessageRequest withAddresses ( java . util . Map < String , AddressConfiguration > addresses ) { setAddresses ( addresses ) ; return this ; } | A map of key - value pairs where each key is an address and each value is an AddressConfiguration object . An address can be a push notification token a phone number or an email address . |
30,947 | public MessageRequest withEndpoints ( java . util . Map < String , EndpointSendConfiguration > endpoints ) { setEndpoints ( endpoints ) ; return this ; } | A map of key - value pairs where each key is an endpoint ID and each value is an EndpointSendConfiguration object . Within an EndpointSendConfiguration object you can tailor the message for an endpoint by specifying message overrides or substitutions . |
30,948 | public void setPrefix ( String prefix ) { if ( prefix == null ) { throw new IllegalArgumentException ( "Prefix cannot be null for a replication rule" ) ; } if ( filter != null ) { throw new IllegalArgumentException ( "You cannot use both prefix and filter at the same time in a replication rule" ) ; } this . prefix = prefix ; } | Sets the Amazon S3 Object prefix for the replication rule . |
30,949 | public void appendUserAgent ( String userAgent ) { String marker = markers . get ( Marker . USER_AGENT ) ; if ( marker == null ) marker = "" ; marker = createUserAgentMarkerString ( marker , userAgent ) ; putClientMarker ( Marker . USER_AGENT , marker ) ; } | Appends a user agent to the USER_AGENT client marker . This method is intended only for internal use by the AWS SDK . |
30,950 | private String createUserAgentMarkerString ( final String marker , String userAgent ) { return marker . contains ( userAgent ) ? marker : marker + " " + userAgent ; } | Appends the given client marker string to the existing one and returns it . |
30,951 | public void setAudioSelectors ( java . util . Collection < AudioSelector > audioSelectors ) { if ( audioSelectors == null ) { this . audioSelectors = null ; return ; } this . audioSelectors = new java . util . ArrayList < AudioSelector > ( audioSelectors ) ; } | Used to select the audio stream to decode for inputs that have multiple available . |
30,952 | public void setCaptionSelectors ( java . util . Collection < CaptionSelector > captionSelectors ) { if ( captionSelectors == null ) { this . captionSelectors = null ; return ; } this . captionSelectors = new java . util . ArrayList < CaptionSelector > ( captionSelectors ) ; } | Used to select the caption input to use for inputs that have multiple available . |
30,953 | @ com . fasterxml . jackson . annotation . JsonProperty ( "RequestID" ) public void setRequestID ( String requestID ) { this . requestID = requestID ; } | The unique message body ID . |
30,954 | private String getSetterGuidanceDoc ( ) { StringBuilder docBuilder = new StringBuilder ( ) ; if ( isJsonValue ( ) ) { docBuilder . append ( "<p>" ) . append ( LINE_SEPARATOR ) . append ( "This field's value must be valid JSON according to RFC 7159, including the opening and closing " ) . append ( "braces. For example: '{\"key\": \"value\"}'." ) . append ( LINE_SEPARATOR ) . append ( "</p>" ) . append ( LINE_SEPARATOR ) ; } boolean isByteBuffer = "java.nio.ByteBuffer" . equals ( this . getGetterModel ( ) . getReturnType ( ) ) ; if ( isByteBuffer || isJsonValue ( ) ) { docBuilder . append ( "<p>" ) . append ( LINE_SEPARATOR ) . append ( "The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the " ) . append ( "AWS service. Users of the SDK should not perform Base64 encoding on this field." ) . append ( LINE_SEPARATOR ) . append ( "</p>" ) . append ( LINE_SEPARATOR ) ; } if ( isByteBuffer ) { docBuilder . append ( "<p>" ) . append ( LINE_SEPARATOR ) . append ( "Warning: ByteBuffers returned by the SDK are mutable. " + "Changes to the content or position of the byte buffer will be " + "seen by all objects that have a reference to this object. " + "It is recommended to call ByteBuffer.duplicate() or " + "ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. " + "This behavior will be changed in a future major version of the SDK." ) . append ( LINE_SEPARATOR ) . append ( "</p>" ) . append ( LINE_SEPARATOR ) ; } return docBuilder . toString ( ) ; } | Get the documentation that should be shared between the with and set - style methods that pertains to the type of data in the message . This usually instructs customers on how to properly format the data that they write to the message based on its type . |
30,955 | public String getMarshallingType ( ) { if ( isList ( ) ) { return "LIST" ; } else if ( isMap ( ) ) { return "MAP" ; } else if ( isJsonValue ( ) ) { return "JSON_VALUE" ; } else if ( ! isSimple ( ) ) { return "STRUCTURED" ; } else { return TypeUtils . getMarshallingType ( variable . getSimpleType ( ) ) ; } } | Currently used only for JSON services . |
30,956 | public BatchUpdateScheduleResult batchUpdateSchedule ( BatchUpdateScheduleRequest request ) { request = beforeClientExecution ( request ) ; return executeBatchUpdateSchedule ( request ) ; } | Update a channel schedule |
30,957 | public CreateInputResult createInput ( CreateInputRequest request ) { request = beforeClientExecution ( request ) ; return executeCreateInput ( request ) ; } | Create an input |
30,958 | public CreateInputSecurityGroupResult createInputSecurityGroup ( CreateInputSecurityGroupRequest request ) { request = beforeClientExecution ( request ) ; return executeCreateInputSecurityGroup ( request ) ; } | Creates a Input Security Group |
30,959 | public DeleteInputResult deleteInput ( DeleteInputRequest request ) { request = beforeClientExecution ( request ) ; return executeDeleteInput ( request ) ; } | Deletes the input end point |
30,960 | public DeleteInputSecurityGroupResult deleteInputSecurityGroup ( DeleteInputSecurityGroupRequest request ) { request = beforeClientExecution ( request ) ; return executeDeleteInputSecurityGroup ( request ) ; } | Deletes an Input Security Group |
30,961 | public DeleteReservationResult deleteReservation ( DeleteReservationRequest request ) { request = beforeClientExecution ( request ) ; return executeDeleteReservation ( request ) ; } | Delete an expired reservation . |
30,962 | public DescribeInputResult describeInput ( DescribeInputRequest request ) { request = beforeClientExecution ( request ) ; return executeDescribeInput ( request ) ; } | Produces details about an input |
30,963 | public DescribeInputSecurityGroupResult describeInputSecurityGroup ( DescribeInputSecurityGroupRequest request ) { request = beforeClientExecution ( request ) ; return executeDescribeInputSecurityGroup ( request ) ; } | Produces a summary of an Input Security Group |
30,964 | public DescribeOfferingResult describeOffering ( DescribeOfferingRequest request ) { request = beforeClientExecution ( request ) ; return executeDescribeOffering ( request ) ; } | Get details for an offering . |
30,965 | public DescribeReservationResult describeReservation ( DescribeReservationRequest request ) { request = beforeClientExecution ( request ) ; return executeDescribeReservation ( request ) ; } | Get details for a reservation . |
30,966 | public DescribeScheduleResult describeSchedule ( DescribeScheduleRequest request ) { request = beforeClientExecution ( request ) ; return executeDescribeSchedule ( request ) ; } | Get a channel schedule |
30,967 | public ListInputSecurityGroupsResult listInputSecurityGroups ( ListInputSecurityGroupsRequest request ) { request = beforeClientExecution ( request ) ; return executeListInputSecurityGroups ( request ) ; } | Produces a list of Input Security Groups for an account |
30,968 | public ListInputsResult listInputs ( ListInputsRequest request ) { request = beforeClientExecution ( request ) ; return executeListInputs ( request ) ; } | Produces list of inputs that have been created |
30,969 | public ListOfferingsResult listOfferings ( ListOfferingsRequest request ) { request = beforeClientExecution ( request ) ; return executeListOfferings ( request ) ; } | List offerings available for purchase . |
30,970 | public ListReservationsResult listReservations ( ListReservationsRequest request ) { request = beforeClientExecution ( request ) ; return executeListReservations ( request ) ; } | List purchased reservations . |
30,971 | public PurchaseOfferingResult purchaseOffering ( PurchaseOfferingRequest request ) { request = beforeClientExecution ( request ) ; return executePurchaseOffering ( request ) ; } | Purchase an offering and create a reservation . |
30,972 | public StartChannelResult startChannel ( StartChannelRequest request ) { request = beforeClientExecution ( request ) ; return executeStartChannel ( request ) ; } | Starts an existing channel |
30,973 | public StopChannelResult stopChannel ( StopChannelRequest request ) { request = beforeClientExecution ( request ) ; return executeStopChannel ( request ) ; } | Stops a running channel |
30,974 | public UpdateInputResult updateInput ( UpdateInputRequest request ) { request = beforeClientExecution ( request ) ; return executeUpdateInput ( request ) ; } | Updates an input . |
30,975 | public UpdateInputSecurityGroupResult updateInputSecurityGroup ( UpdateInputSecurityGroupRequest request ) { request = beforeClientExecution ( request ) ; return executeUpdateInputSecurityGroup ( request ) ; } | Update an Input Security Group s Whilelists . |
30,976 | public UpdateReservationResult updateReservation ( UpdateReservationRequest request ) { request = beforeClientExecution ( request ) ; return executeUpdateReservation ( request ) ; } | Update reservation . |
30,977 | public RestoreObjectRequest withType ( RestoreRequestType restoreRequestType ) { setType ( restoreRequestType == null ? null : restoreRequestType . toString ( ) ) ; return this ; } | Sets the restore request type . |
30,978 | public RestoreObjectRequest withTier ( Tier tier ) { this . tier = tier == null ? null : tier . toString ( ) ; return this ; } | Sets the glacier retrieval tier . |
30,979 | public void addAdditionalDetail ( String key , String detail ) { if ( detail == null || detail . trim ( ) . isEmpty ( ) ) return ; if ( this . additionalDetails == null ) { this . additionalDetails = new HashMap < String , String > ( ) ; } String additionalContent = this . additionalDetails . get ( key ) ; if ( additionalContent != null && ! additionalContent . trim ( ) . isEmpty ( ) ) detail = additionalContent + "-" + detail ; if ( ! detail . isEmpty ( ) ) additionalDetails . put ( key , detail ) ; } | Adds an entry to the additional information map . |
30,980 | public AmazonS3Exception build ( ) { AmazonS3Exception s3Exception = errorResponseXml == null ? new AmazonS3Exception ( errorMessage ) : new AmazonS3Exception ( errorMessage , errorResponseXml ) ; s3Exception . setErrorCode ( errorCode ) ; s3Exception . setExtendedRequestId ( extendedRequestId ) ; s3Exception . setStatusCode ( statusCode ) ; s3Exception . setRequestId ( requestId ) ; s3Exception . setCloudFrontId ( cloudFrontId ) ; s3Exception . setAdditionalDetails ( additionalDetails ) ; s3Exception . setErrorType ( errorTypeOf ( statusCode ) ) ; return s3Exception ; } | Creates a new AmazonS3Exception object with the values set . |
30,981 | public static void validateResourceList ( final List < Resource > resourceList ) { boolean hasNotResource = false ; boolean hasResource = false ; for ( Resource resource : resourceList ) { if ( resource . isNotType ( ) ) { hasNotResource = true ; } else { hasResource = true ; } if ( hasResource && hasNotResource ) { throw new IllegalArgumentException ( PolicyUtils . INVALID_RESOURCE ) ; } } } | Determines if a list of Resource objects is valid containing either all NotResource elements or all Resource elements |
30,982 | public void setActionNames ( java . util . Collection < String > actionNames ) { if ( actionNames == null ) { this . actionNames = null ; return ; } this . actionNames = new java . util . ArrayList < String > ( actionNames ) ; } | A list of schedule actions to delete . |
30,983 | public void setDeployments ( java . util . Collection < BulkDeploymentResult > deployments ) { if ( deployments == null ) { this . deployments = null ; return ; } this . deployments = new java . util . ArrayList < BulkDeploymentResult > ( deployments ) ; } | A list of the individual group deployments in the bulk deployment operation . |
30,984 | public Map < String , List < Item > > getTableItems ( ) { Map < String , List < Map < String , AttributeValue > > > res = result . getResponses ( ) ; Map < String , List < Item > > map = new LinkedHashMap < String , List < Item > > ( res . size ( ) ) ; for ( Map . Entry < String , List < Map < String , AttributeValue > > > e : res . entrySet ( ) ) { String tableName = e . getKey ( ) ; List < Map < String , AttributeValue > > items = e . getValue ( ) ; map . put ( tableName , InternalUtils . toItemList ( items ) ) ; } return map ; } | Returns a map of table name to the list of retrieved items |
30,985 | static final < T > TableMap < T > of ( Class < T > clazz ) { final TableMap < T > annotations = new TableMap < T > ( clazz ) ; annotations . putAll ( clazz ) ; return annotations ; } | Gets all the DynamoDB annotations for a given class . |
30,986 | private static < T > T overrideOf ( Class < T > clazz , Class < ? > targetType , Annotation annotation ) { try { if ( annotation != null ) { try { return clazz . getConstructor ( Class . class , annotation . annotationType ( ) ) . newInstance ( targetType , annotation ) ; } catch ( final NoSuchMethodException no ) { } } try { return clazz . getConstructor ( Class . class ) . newInstance ( targetType ) ; } catch ( final NoSuchMethodException no ) { } return clazz . newInstance ( ) ; } catch ( final Exception e ) { throw new DynamoDBMappingException ( "could not instantiate " + clazz , e ) ; } } | Creates a new instance of the clazz with the target type and annotation as parameters if available . |
30,987 | public Waiter < DescribeDBSnapshotsRequest > dBSnapshotAvailable ( ) { return new WaiterBuilder < DescribeDBSnapshotsRequest , DescribeDBSnapshotsResult > ( ) . withSdkFunction ( new DescribeDBSnapshotsFunction ( client ) ) . withAcceptors ( new DBSnapshotAvailable . IsAvailableMatcher ( ) , new DBSnapshotAvailable . IsDeletedMatcher ( ) , new DBSnapshotAvailable . IsDeletingMatcher ( ) , new DBSnapshotAvailable . IsFailedMatcher ( ) , new DBSnapshotAvailable . IsIncompatiblerestoreMatcher ( ) , new DBSnapshotAvailable . IsIncompatibleparametersMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 30 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a DBSnapshotAvailable 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 . |
30,988 | public Waiter < DescribeDBSnapshotsRequest > dBSnapshotDeleted ( ) { return new WaiterBuilder < DescribeDBSnapshotsRequest , DescribeDBSnapshotsResult > ( ) . withSdkFunction ( new DescribeDBSnapshotsFunction ( client ) ) . withAcceptors ( new DBSnapshotDeleted . IsDeletedMatcher ( ) , new DBSnapshotDeleted . IsDBSnapshotNotFoundMatcher ( ) , new DBSnapshotDeleted . IsCreatingMatcher ( ) , new DBSnapshotDeleted . IsModifyingMatcher ( ) , new DBSnapshotDeleted . IsRebootingMatcher ( ) , new DBSnapshotDeleted . IsResettingmastercredentialsMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryStrategy ( 60 ) , new FixedDelayStrategy ( 30 ) ) ) . withExecutorService ( executorService ) . build ( ) ; } | Builds a DBSnapshotDeleted 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 . |
30,989 | public Signer getSignerByURI ( URI uri ) { return awsClient == null ? null : awsClient . getSignerByURI ( uri ) ; } | Returns the signer for the given uri . Note S3 in particular overrides this method . |
30,990 | public void setOriginEndpoints ( java . util . Collection < OriginEndpoint > originEndpoints ) { if ( originEndpoints == null ) { this . originEndpoints = null ; return ; } this . originEndpoints = new java . util . ArrayList < OriginEndpoint > ( originEndpoints ) ; } | A list of OriginEndpoint records . |
30,991 | public < T extends AmazonWebServiceClient > T createClient ( Class < T > serviceClass , AWSCredentialsProvider credentials , ClientConfiguration config ) { Constructor < T > constructor ; T client ; try { if ( credentials == null && config == null ) { constructor = serviceClass . getConstructor ( ) ; client = constructor . newInstance ( ) ; } else if ( credentials == null ) { constructor = serviceClass . getConstructor ( ClientConfiguration . class ) ; client = constructor . newInstance ( config ) ; } else if ( config == null ) { constructor = serviceClass . getConstructor ( AWSCredentialsProvider . class ) ; client = constructor . newInstance ( credentials ) ; } else { constructor = serviceClass . getConstructor ( AWSCredentialsProvider . class , ClientConfiguration . class ) ; client = constructor . newInstance ( credentials , config ) ; } client . setRegion ( this ) ; return client ; } catch ( Exception e ) { throw new RuntimeException ( "Couldn't instantiate instance of " + serviceClass , e ) ; } } | Creates a new service client of the class given and configures it . If credentials or config are null defaults will be used . |
30,992 | public UpdateInputRequest withMediaConnectFlows ( MediaConnectFlowRequest ... mediaConnectFlows ) { if ( this . mediaConnectFlows == null ) { setMediaConnectFlows ( new java . util . ArrayList < MediaConnectFlowRequest > ( mediaConnectFlows . length ) ) ; } for ( MediaConnectFlowRequest ele : mediaConnectFlows ) { this . mediaConnectFlows . add ( ele ) ; } return this ; } | A list of the MediaConnect Flow ARNs that you want to use as the source of the input . You can specify as few as one Flow and presently as many as two . The only requirement is when you have more than one is that each Flow is in a separate Availability Zone as this ensures your EML input is redundant to AZ issues . |
30,993 | public TableDescription describe ( ) { DescribeTableResult result = client . describeTable ( InternalUtils . applyUserAgent ( new DescribeTableRequest ( tableName ) ) ) ; return tableDescription = result . getTable ( ) ; } | Retrieves the table description from DynamoDB . Involves network calls . Meant to be called as infrequently as possible to avoid throttling exception from the server side . |
30,994 | public static InputStream getRequiredResourceAsStream ( Class < ? > clzz , String location ) { InputStream resourceStream = clzz . getResourceAsStream ( location ) ; if ( resourceStream == null ) { if ( ! location . startsWith ( "/" ) ) { resourceStream = clzz . getResourceAsStream ( "/" + location ) ; } if ( resourceStream == null ) { throw new RuntimeException ( "Resource file was not found at location " + location ) ; } } return resourceStream ; } | Return an InputStream of the specified resource failing if it can t be found . |
30,995 | public static String getRequiredSystemProperty ( String propertyName , String errorMsgIfNotFound ) { String propertyValue = System . getProperty ( propertyName ) ; if ( propertyValue == null ) { throw new RuntimeException ( errorMsgIfNotFound ) ; } return propertyValue ; } | Retrieve system property by name failing if it s not found |
30,996 | public static < T > T assertNotNull ( T argument , String msg ) { if ( argument == null ) throw new IllegalArgumentException ( msg ) ; return argument ; } | Throws IllegalArgumentException with the specified error message if the input is null otherwise return the input as is . |
30,997 | public static ShapeMarshaller createInputShapeMarshaller ( ServiceMetadata service , Operation operation ) { if ( operation == null ) throw new IllegalArgumentException ( "The operation parameter must be specified!" ) ; ShapeMarshaller marshaller = new ShapeMarshaller ( ) . withAction ( operation . getName ( ) ) . withVerb ( operation . getHttp ( ) . getMethod ( ) ) . withRequestUri ( operation . getHttp ( ) . getRequestUri ( ) ) ; Input input = operation . getInput ( ) ; if ( input != null ) { marshaller . setLocationName ( input . getLocationName ( ) ) ; XmlNamespace xmlNamespace = input . getXmlNamespace ( ) ; if ( xmlNamespace != null ) { marshaller . setXmlNameSpaceUri ( xmlNamespace . getUri ( ) ) ; } } if ( ! StringUtils . isNullOrEmpty ( service . getTargetPrefix ( ) ) && Metadata . isNotRestProtocol ( service . getProtocol ( ) ) ) { marshaller . setTarget ( service . getTargetPrefix ( ) + "." + operation . getName ( ) ) ; } return marshaller ; } | Create the ShapeMarshaller to the input shape from the specified Operation . The input shape in the operation could be empty . |
30,998 | private int getPort ( URI endpoint ) { if ( endpoint . getPort ( ) != - 1 ) { return endpoint . getPort ( ) ; } else if ( "https" . equals ( endpoint . getScheme ( ) ) ) { return 443 ; } else { return 80 ; } } | Netty needs an explicit port so resolve that from the endpoint provided . |
30,999 | private AWSCredentials resolveCredentials ( PutMediaRequest request ) { AWSCredentialsProvider resolvedProvider = CredentialUtils . getCredentialsProvider ( request , credentialsProvider ) ; AWSCredentials resolvedCredentials = resolvedProvider == null ? null : resolvedProvider . getCredentials ( ) ; if ( resolvedCredentials == null ) { throw new SdkClientException ( "Credentials must be provided via the builder or present in the environment. " + "See http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html" ) ; } return resolvedCredentials ; } | Resolve credentials which may be overridden at a per request level . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.