com.amazonaws.services.sqs.model.ChangeMessageVisibilityBatchResult Java Examples

The following examples show how to use com.amazonaws.services.sqs.model.ChangeMessageVisibilityBatchResult. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AmazonSQSIdleQueueDeletingClient.java    From amazon-sqs-java-temporary-queues-client with Apache License 2.0 5 votes vote down vote up
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest request) {
    // If the queue is deleted, there's no way to change the message visibility.
    try {
        return super.changeMessageVisibilityBatch(request);
    } catch (QueueDoesNotExistException|ReceiptHandleIsInvalidException e) {
        // Try on the alternate queue
        ChangeMessageVisibilityBatchRequest alternateRequest = request.clone().withQueueUrl(alternateQueueName(request.getQueueUrl()));
        return super.changeMessageVisibilityBatch(alternateRequest);
    }
}
 
Example #2
Source File: AmazonSQSExtendedClient.java    From amazon-sqs-java-extended-client-lib with Apache License 2.0 5 votes vote down vote up
/**
 * Simplified method form for invoking the ChangeMessageVisibilityBatch
 * operation.
 *
 * @see #changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest)
 */
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
		String queueUrl,
		java.util.List<ChangeMessageVisibilityBatchRequestEntry> entries) {
	ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest =
			new ChangeMessageVisibilityBatchRequest(queueUrl, entries);
	return changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest);
}
 
Example #3
Source File: QueueImpl.java    From aws-sdk-java-resources with Apache License 2.0 5 votes vote down vote up
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
        ChangeMessageVisibilityBatchRequest request,
        ResultCapture<ChangeMessageVisibilityBatchResult> extractor) {

    ActionResult result =
            resource.performAction("ChangeMessageVisibilityBatch", request,
            extractor);

    if (result == null) return null;
    return (ChangeMessageVisibilityBatchResult) result.getData();
}
 
Example #4
Source File: QueueImpl.java    From aws-sdk-java-resources with Apache License 2.0 5 votes vote down vote up
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
        List<ChangeMessageVisibilityBatchRequestEntry> entries) {

    return changeMessageVisibilityBatch(entries,
            (ResultCapture<ChangeMessageVisibilityBatchResult>)null);
}
 
Example #5
Source File: QueueImpl.java    From aws-sdk-java-resources with Apache License 2.0 5 votes vote down vote up
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
        List<ChangeMessageVisibilityBatchRequestEntry> entries,
        ResultCapture<ChangeMessageVisibilityBatchResult> extractor) {

    ChangeMessageVisibilityBatchRequest request = new
            ChangeMessageVisibilityBatchRequest()

        .withEntries(entries);
    return changeMessageVisibilityBatch(request, extractor);
}
 
Example #6
Source File: AbstractAmazonSQSClientWrapper.java    From amazon-sqs-java-temporary-queues-client with Apache License 2.0 4 votes vote down vote up
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest request) {
    request.getRequestClientOptions().appendUserAgent(userAgent);
    return amazonSqsToBeExtended.changeMessageVisibilityBatch(request);
}
 
Example #7
Source File: QueueImpl.java    From aws-sdk-java-resources with Apache License 2.0 4 votes vote down vote up
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
        ChangeMessageVisibilityBatchRequest request) {

    return changeMessageVisibilityBatch(request, null);
}
 
Example #8
Source File: AmazonSQSExtendedClientBase.java    From amazon-sqs-java-extended-client-lib with Apache License 2.0 3 votes vote down vote up
/**
 * <p>
 * Changes the visibility timeout of multiple messages. This is a batch
 * version of ChangeMessageVisibility. The result of the action on each
 * message is reported individually in the response. You can send up to 10
 * ChangeMessageVisibility requests with each
 * <code>ChangeMessageVisibilityBatch</code> action.
 * </p>
 * <p>
 * <b>IMPORTANT:</b>Because the batch request can result in a combination of
 * successful and unsuccessful actions, you should check for batch errors
 * even when the call returns an HTTP status code of 200.
 * </p>
 * <p>
 * <b>NOTE:</b>Some API actions take lists of parameters. These lists are
 * specified using the param.n notation. Values of n are integers starting
 * from 1. For example, a parameter list with two elements looks like this:
 * </p>
 * <p>
 * <code>&Attribute.1=this</code>
 * </p>
 * <p>
 * <code>&Attribute.2=that</code>
 * </p>
 *
 * @param changeMessageVisibilityBatchRequest
 *            Container for the necessary parameters to execute the
 *            ChangeMessageVisibilityBatch service method on AmazonSQS.
 * 
 * @return The response from the ChangeMessageVisibilityBatch service
 *         method, as returned by AmazonSQS.
 * 
 * @throws BatchEntryIdsNotDistinctException
 * @throws TooManyEntriesInBatchRequestException
 * @throws InvalidBatchEntryIdException
 * @throws EmptyBatchRequestException
 *
 * @throws AmazonClientException
 *             If any internal errors are encountered inside the client
 *             while attempting to make the request or handle the response.
 *             For example if a network connection is not available.
 * @throws AmazonServiceException
 *             If an error response is returned by AmazonSQS indicating
 *             either a problem with the data in the request, or a server
 *             side issue.
 */
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
		ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest) throws AmazonServiceException,
		AmazonClientException {

	return amazonSqsToBeExtended.changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest);
}
 
Example #9
Source File: AmazonSQSExtendedClientBase.java    From amazon-sqs-java-extended-client-lib with Apache License 2.0 3 votes vote down vote up
/**
 * <p>
 * Changes the visibility timeout of multiple messages. This is a batch
 * version of ChangeMessageVisibility. The result of the action on each
 * message is reported individually in the response. You can send up to 10
 * ChangeMessageVisibility requests with each
 * <code>ChangeMessageVisibilityBatch</code> action.
 * </p>
 * <p>
 * <b>IMPORTANT:</b>Because the batch request can result in a combination of
 * successful and unsuccessful actions, you should check for batch errors
 * even when the call returns an HTTP status code of 200.
 * </p>
 * <p>
 * <b>NOTE:</b>Some API actions take lists of parameters. These lists are
 * specified using the param.n notation. Values of n are integers starting
 * from 1. For example, a parameter list with two elements looks like this:
 * </p>
 * <p>
 * <code>&Attribute.1=this</code>
 * </p>
 * <p>
 * <code>&Attribute.2=that</code>
 * </p>
 * 
 * @param queueUrl
 *            The URL of the Amazon SQS queue to take action on.
 * @param entries
 *            A list of receipt handles of the messages for which the
 *            visibility timeout must be changed.
 * 
 * @return The response from the ChangeMessageVisibilityBatch service
 *         method, as returned by AmazonSQS.
 * 
 * @throws BatchEntryIdsNotDistinctException
 * @throws TooManyEntriesInBatchRequestException
 * @throws InvalidBatchEntryIdException
 * @throws EmptyBatchRequestException
 *
 * @throws AmazonClientException
 *             If any internal errors are encountered inside the client
 *             while attempting to make the request or handle the response.
 *             For example if a network connection is not available.
 * @throws AmazonServiceException
 *             If an error response is returned by AmazonSQS indicating
 *             either a problem with the data in the request, or a server
 *             side issue.
 */
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(String queueUrl,
		List<ChangeMessageVisibilityBatchRequestEntry> entries) throws AmazonServiceException,
		AmazonClientException {

	return amazonSqsToBeExtended.changeMessageVisibilityBatch(queueUrl, entries);
}
 
Example #10
Source File: AmazonSQSExtendedClient.java    From amazon-sqs-java-extended-client-lib with Apache License 2.0 3 votes vote down vote up
/**
 * <p>
 * Changes the visibility timeout of multiple messages. This is a batch
 * version of ChangeMessageVisibility. The result of the action on each
 * message is reported individually in the response. You can send up to 10
 * ChangeMessageVisibility requests with each
 * <code>ChangeMessageVisibilityBatch</code> action.
 * </p>
 * <p>
 * <b>IMPORTANT:</b>Because the batch request can result in a combination of
 * successful and unsuccessful actions, you should check for batch errors
 * even when the call returns an HTTP status code of 200.
 * </p>
 * <p>
 * <b>NOTE:</b>Some API actions take lists of parameters. These lists are
 * specified using the param.n notation. Values of n are integers starting
 * from 1. For example, a parameter list with two elements looks like this:
 * </p>
 * <p>
 * <code>&Attribute.1=this</code>
 * </p>
 * <p>
 * <code>&Attribute.2=that</code>
 * </p>
 *
 * @param changeMessageVisibilityBatchRequest
 *            Container for the necessary parameters to execute the
 *            ChangeMessageVisibilityBatch service method on AmazonSQS.
 *
 * @return The response from the ChangeMessageVisibilityBatch service
 *         method, as returned by AmazonSQS.
 *
 * @throws BatchEntryIdsNotDistinctException
 * @throws TooManyEntriesInBatchRequestException
 * @throws InvalidBatchEntryIdException
 * @throws EmptyBatchRequestException
 *
 * @throws AmazonClientException
 *             If any internal errors are encountered inside the client
 *             while attempting to make the request or handle the response.
 *             For example if a network connection is not available.
 * @throws AmazonServiceException
 *             If an error response is returned by AmazonSQS indicating
 *             either a problem with the data in the request, or a server
 *             side issue.
 */
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
		ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest) throws AmazonServiceException,
		AmazonClientException {

	for (ChangeMessageVisibilityBatchRequestEntry entry : changeMessageVisibilityBatchRequest.getEntries()) {
		if (isS3ReceiptHandle(entry.getReceiptHandle())) {
			entry.setReceiptHandle(getOrigReceiptHandle(entry.getReceiptHandle()));
		}
	}

	return amazonSqsToBeExtended.changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest);
}
 
Example #11
Source File: AmazonSQSMessagingClientWrapper.java    From amazon-sqs-java-messaging-lib with Apache License 2.0 3 votes vote down vote up
/**
 * Calls <code>changeMessageVisibilityBatch</code> and wraps <code>AmazonClientException</code>. This is
 * used to for negative acknowledge of messages in batch, so that messages
 * can be received again without any delay.
 * 
 * @param changeMessageVisibilityBatchRequest
 *            Container for the necessary parameters to execute the
 *            changeMessageVisibilityBatch service method on AmazonSQS.
 * @return The response from the changeMessageVisibilityBatch service
 *         method, as returned by AmazonSQS.
 * @throws JMSException
 */
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest)
        throws JMSException {
    try {
        prepareRequest(changeMessageVisibilityBatchRequest);
        return amazonSQSClient.changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest);
    } catch (AmazonClientException e) {
        throw handleException(e, "changeMessageVisibilityBatch");
    }
}
 
Example #12
Source File: Queue.java    From aws-sdk-java-resources with Apache License 2.0 2 votes vote down vote up
/**
 * Performs the <code>ChangeMessageVisibilityBatch</code> action.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Queue</code> resource, and any conflicting parameter value set in
 * the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>QueueUrl</code></b>
 *         - mapped from the <code>Url</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The response of the low-level client operation associated with
 *         this resource action.
 * @see ChangeMessageVisibilityBatchRequest
 */
ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
        ChangeMessageVisibilityBatchRequest request);
 
Example #13
Source File: Queue.java    From aws-sdk-java-resources with Apache License 2.0 2 votes vote down vote up
/**
 * Performs the <code>ChangeMessageVisibilityBatch</code> action and use a
 * ResultCapture to retrieve the low-level client response.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Queue</code> resource, and any conflicting parameter value set in
 * the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>QueueUrl</code></b>
 *         - mapped from the <code>Url</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The response of the low-level client operation associated with
 *         this resource action.
 * @see ChangeMessageVisibilityBatchRequest
 */
ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
        ChangeMessageVisibilityBatchRequest request,
        ResultCapture<ChangeMessageVisibilityBatchResult> extractor);
 
Example #14
Source File: Queue.java    From aws-sdk-java-resources with Apache License 2.0 2 votes vote down vote up
/**
 * The convenient method form for the
 * <code>ChangeMessageVisibilityBatch</code> action.
 *
 * @see #changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest)
 */
ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
        List<ChangeMessageVisibilityBatchRequestEntry> entries);
 
Example #15
Source File: Queue.java    From aws-sdk-java-resources with Apache License 2.0 2 votes vote down vote up
/**
 * The convenient method form for the
 * <code>ChangeMessageVisibilityBatch</code> action.
 *
 * @see #changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest,
 *         ResultCapture)
 */
ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
        List<ChangeMessageVisibilityBatchRequestEntry> entries,
        ResultCapture<ChangeMessageVisibilityBatchResult> extractor);