项目:awslocal
文件:DirectorySQS.java
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest) throws AmazonClientException {
DirectorySQSQueue queue = getQueueFromUrl(changeMessageVisibilityBatchRequest.getQueueUrl(),false);
//lists for reporting
List<BatchResultErrorEntry> batchResultErrorEntries = new ArrayList<>();
List<ChangeMessageVisibilityBatchResultEntry> batchResultEntries = new ArrayList<>();
//attempt to change the visibility on each
for (ChangeMessageVisibilityBatchRequestEntry batchRequestEntry : changeMessageVisibilityBatchRequest.getEntries()) {
try {
queue.changeVisibility(batchRequestEntry.getReceiptHandle(),batchRequestEntry.getVisibilityTimeout());
batchResultEntries.add(new ChangeMessageVisibilityBatchResultEntry().withId(batchRequestEntry.getId()));
} catch (Exception e) {
BatchResultErrorEntry batchResultErrorEntry = new BatchResultErrorEntry().
withSenderFault(true).
withId(batchRequestEntry.getId()).
withMessage(e.getMessage());
batchResultErrorEntries.add(batchResultErrorEntry);
}
}
return new ChangeMessageVisibilityBatchResult().withFailed(batchResultErrorEntries).withSuccessful(batchResultEntries);
}
项目:amazon-sqs-java-extended-client-lib
文件:AmazonSQSExtendedClient.java
/**
* 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);
}
项目:aws-sdk-java-resources
文件:QueueImpl.java
@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();
}
项目:aws-sdk-java-resources
文件:QueueImpl.java
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
List<ChangeMessageVisibilityBatchRequestEntry> entries) {
return changeMessageVisibilityBatch(entries,(ResultCapture<ChangeMessageVisibilityBatchResult>)null);
}
项目:aws-sdk-java-resources
文件:QueueImpl.java
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
List<ChangeMessageVisibilityBatchRequestEntry> entries,ResultCapture<ChangeMessageVisibilityBatchResult> extractor) {
ChangeMessageVisibilityBatchRequest request = new
ChangeMessageVisibilityBatchRequest()
.withEntries(entries);
return changeMessageVisibilityBatch(request,extractor);
}
项目:reactive-sqs-client
文件:ReactiveSqsClient.java
public Observable<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatchAsync(ChangeMessageVisibilityBatchRequest request) {
return Observable.from(sqsClient.changeMessageVisibilityBatchAsync(request));
}
项目:reactive-sqs-client
文件:ReactiveSqsClient.java
public Observable<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatchAsync(String queueUrl,List<ChangeMessageVisibilityBatchRequestEntry> entries) {
return Observable.from(sqsClient.changeMessageVisibilityBatchAsync(queueUrl,entries));
}
项目:aws-sdk-java-resources
文件:QueueImpl.java
@Override
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
ChangeMessageVisibilityBatchRequest request) {
return changeMessageVisibilityBatch(request,null);
}
项目:amazon-sqs-java-extended-client-lib
文件:AmazonSQSExtendedClientBase.java
/**
* <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);
}
项目:amazon-sqs-java-extended-client-lib
文件:AmazonSQSExtendedClientBase.java
/**
* <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,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,or a server
* side issue.
*/
public ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(String queueUrl,List<ChangeMessageVisibilityBatchRequestEntry> entries) throws AmazonServiceException,AmazonClientException {
return amazonSqsToBeExtended.changeMessageVisibilityBatch(queueUrl,entries);
}
项目:amazon-sqs-java-extended-client-lib
文件:AmazonSQSExtendedClient.java
/**
* <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,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,AmazonClientException {
for (ChangeMessageVisibilityBatchRequestEntry entry : changeMessageVisibilityBatchRequest.getEntries()) {
if (isS3ReceiptHandle(entry.getReceiptHandle())) {
entry.setReceiptHandle(getOrigReceiptHandle(entry.getReceiptHandle()));
}
}
return amazonSqsToBeExtended.changeMessageVisibilityBatch(changeMessageVisibilityBatchRequest);
}
项目:amazon-sqs-java-messaging-lib
文件:AmazonSQSMessagingClientWrapper.java
/**
* 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");
}
}
项目:aws-sdk-java-resources
文件:Queue.java
/**
* 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);
项目:aws-sdk-java-resources
文件:Queue.java
/**
* 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);
项目:aws-sdk-java-resources
文件:Queue.java
/**
* The convenient method form for the
* <code>ChangeMessageVisibilityBatch</code> action.
*
* @see #changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest)
*/
ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
List<ChangeMessageVisibilityBatchRequestEntry> entries);
项目:aws-sdk-java-resources
文件:Queue.java
/**
* The convenient method form for the
* <code>ChangeMessageVisibilityBatch</code> action.
*
* @see #changeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest,* ResultCapture)
*/
ChangeMessageVisibilityBatchResult changeMessageVisibilityBatch(
List<ChangeMessageVisibilityBatchRequestEntry> entries,ResultCapture<ChangeMessageVisibilityBatchResult> extractor);