本文整理汇总了Java中com.amazonaws.services.sqs.model.DeleteQueueRequest类的典型用法代码示例。如果您正苦于以下问题:Java DeleteQueueRequest类的具体用法?Java DeleteQueueRequest怎么用?Java DeleteQueueRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeleteQueueRequest类属于com.amazonaws.services.sqs.model包,在下文中一共展示了DeleteQueueRequest类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreateGetUrlListQueue_shouldCreateReturnUrlAndListQueue
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
@Test
public void testCreateGetUrlListQueue_shouldCreateReturnUrlAndListQueue() {
// create first queue
CreateQueueResult createdQueue = sqs.createQueue(new CreateQueueRequest().withQueueName("tea-earl-grey-queue"));
assertNotNull("verify that, on creation, queue url was returned",createdQueue.getQueueUrl());
// create other queues
CreateQueueResult secondTeaQueue = sqs.createQueue(new CreateQueueRequest().withQueueName("tea-mate-queue"));
CreateQueueResult anotherQueue = sqs.createQueue(new CreateQueueRequest().withQueueName("coffee-queue"));
// get queue url
GetQueueUrlResult queueUrlResult = sqs.getQueueUrl(new GetQueueUrlRequest()
.withQueueName("tea-earl-grey-queue").withQueueOwnerAWSAccountId("some owner"));
assertNotNull("verify that, on fetch, queue url was returned", queueUrlResult.getQueueUrl());
// get all queues
ListQueuesResult allQueues = sqs.listQueues();
assertEquals("verify all queues are returned", 3, allQueues.getQueueUrls().size());
assertTrue("verify that all queues contain first queue", allQueues.getQueueUrls().contains(createdQueue.getQueueUrl()));
assertTrue("verify that all queues contain second tea queue", allQueues.getQueueUrls().contains(secondTeaQueue.getQueueUrl()));
assertTrue("verify that all queues contain coffee queue", allQueues.getQueueUrls().contains(anotherQueue.getQueueUrl()));
// get only queues that start with 'tea'
ListQueuesResult teaQueues = sqs.listQueues(new ListQueuesRequest("tea"));
assertEquals("verify only tea queues are returned", 2, teaQueues.getQueueUrls().size());
assertTrue("verify that tea queues contain first queue", teaQueues.getQueueUrls().contains(createdQueue.getQueueUrl()));
assertTrue("verify that tea queues contain second tea queue", teaQueues.getQueueUrls().contains(secondTeaQueue.getQueueUrl()));
assertNotNull("verify that delete queue returned ok", sqs.deleteQueue(new DeleteQueueRequest().withQueueUrl(queueUrlResult.getQueueUrl())));
assertFalse("verify that the queue was removed", sqs.listQueues().getQueueUrls().stream()
.anyMatch( queueUrl -> StringUtils.equals(queueUrl,queueUrlResult.getQueueUrl()) ));
// cleanup
getQueues().remove("tea-earl-grey-queue");
getQueues().remove("tea-mate-queue");
getQueues().remove("coffee-queue");
}
示例2: removeClusterInfrastructure
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
@Override
public void removeClusterInfrastructure() {
autoScaling.deletePolicy(new DeletePolicyRequest().withAutoScalingGroupName(getAutoScalingGroup().getAutoScalingGroupName()).withPolicyName(SCALE_UP_POLICY));
autoScaling.deletePolicy(new DeletePolicyRequest().withAutoScalingGroupName(getAutoScalingGroup().getAutoScalingGroupName()).withPolicyName(SCALE_DOWN_POLICY));
cloudWatch.deleteAlarms(new DeleteAlarmsRequest().withAlarmNames(ESS_OVERLOAD_ALARM, ESS_IDLE_ALARM));
// CloudWatch metrics are stored for two weeks. Old data will be removed automatically.
amazonSQS.deleteQueue(new DeleteQueueRequest().withQueueUrl(ESS_QUEUE_NAME));
cloudFormation.deleteStack(new DeleteStackRequest().withStackName(SystemUtils.getCloudFormationStackName()));
}
示例3: deleteQueue
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
/**
* Deletes an SQS queue on AWS.
* @param queueURL URL of the SQS queue
*/
public static void deleteQueue(String queueURL) {
if (!StringUtils.isBlank(queueURL)) {
try {
getClient().deleteQueue(new DeleteQueueRequest(queueURL));
} catch (AmazonServiceException ase) {
logException(ase);
} catch (AmazonClientException ace) {
logger.error("Could not reach SQS. {0}", ace.toString());
}
}
}
示例4: deleteQueue
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
@Override
public DeleteQueueResult deleteQueue(DeleteQueueRequest deleteQueueRequest) throws AmazonClientException {
final DirectorySQSQueue queue = getQueueFromUrl(deleteQueueRequest.getQueueUrl(), true);
try {
Files.delete(queue.getQueuePath());
return new DeleteQueueResult();
} catch (IOException e) {
throw new AmazonServiceException("Could not delete queue: " + queue.getQueuePath());
}
}
示例5: cannotDeleteNonExistentQueue
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
@Test(expectedExceptions = QueueDoesNotExistException.class)
public void cannotDeleteNonExistentQueue()
throws IOException {
_amazonSQS.deleteQueue(new DeleteQueueRequest(new File(TestUtils.createTempDirectory(), someQueueName()).toURI().toString()));
}
示例6: deletedQueueNoLongerExists
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
@Test(expectedExceptions = AmazonServiceException.class)
public void deletedQueueNoLongerExists() {
final String queueUrl = someNewQueue();
_amazonSQS.deleteQueue(new DeleteQueueRequest(queueUrl));
// this should fail
_amazonSQS.receiveMessage(new ReceiveMessageRequest(queueUrl));
}
示例7: testDeleteQueue_withEmptyRequestParams_shouldWork
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
@Test
public void testDeleteQueue_withEmptyRequestParams_shouldWork() {
assertNotNull(sqs.deleteQueue(new DeleteQueueRequest()));
}
示例8: deleteQueueAsync
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
public Observable<DeleteQueueResult> deleteQueueAsync(DeleteQueueRequest request) {
return Observable.from(sqsClient.deleteQueueAsync(request));
}
示例9: deleteQueue
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
public void deleteQueue () {
logger.info("Deleting queue: " + _queueName);
_sqs.deleteQueue(new DeleteQueueRequest(_queueURL));
_sqs = null;
}
示例10: deleteQueue
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
protected void deleteQueue() {
getQueue().deleteQueue(new DeleteQueueRequest(getQueueUrl()));
// set the url to null so the queue can be re-created
queueUrl = null;
}
示例11: delete
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
@Override
public void delete(DeleteQueueRequest request) {
delete(request, null);
}
示例12: deleteQueue
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
public void deleteQueue(String name){
DeleteQueueRequest request = new DeleteQueueRequest(name);
sqsClient.deleteQueue(request);
}
示例13: deleteQueue
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
/**
* <p>
* Deletes the queue specified by the <b>queue URL</b> , regardless of
* whether the queue is empty. If the specified queue does not exist, Amazon
* SQS returns a successful response.
* </p>
* <p>
* <b>IMPORTANT:</b> Use DeleteQueue with care; once you delete your queue,
* any messages in the queue are no longer available.
* </p>
* <p>
* When you delete a queue, the deletion process takes up to 60 seconds.
* Requests you send involving that queue during the 60 seconds might
* succeed. For example, a SendMessage request might succeed, but after the
* 60 seconds, the queue and that message you sent no longer exist. Also,
* when you delete a queue, you must wait at least 60 seconds before
* creating a queue with the same name.
* </p>
* <p>
* We reserve the right to delete queues that have had no activity for more
* than 30 days. For more information, see <a href=
* "http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSConcepts.html"
* > How Amazon SQS Queues Work </a> in the <i>Amazon SQS Developer
* Guide</i> .
* </p>
*
* @param deleteQueueRequest
* Container for the necessary parameters to execute the
* DeleteQueue service method on AmazonSQS.
*
*
*
* @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 DeleteQueueResult deleteQueue(DeleteQueueRequest deleteQueueRequest)
throws AmazonServiceException, AmazonClientException {
return amazonSqsToBeExtended.deleteQueue(deleteQueueRequest);
}
开发者ID:awslabs,项目名称:amazon-sqs-java-extended-client-lib,代码行数:47,代码来源:AmazonSQSExtendedClientBase.java
示例14: delete
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
/**
* Performs the <code>Delete</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>
*
* @see DeleteQueueRequest
*/
void delete(DeleteQueueRequest request);