本文整理汇总了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");
}
开发者ID:daflockinger,项目名称:unitstack,代码行数:35,代码来源:MockSqsTest.java
示例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()));
}
开发者ID:SungardAS,项目名称:enhanced-snapshots,代码行数:11,代码来源:ClusterConfigurationServiceImpl.java
示例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());
}
}
}
开发者ID:Erudika,项目名称:para,代码行数:16,代码来源:AWSQueueUtils.java
示例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());
}
}
开发者ID:bazaarvoice,项目名称:awslocal,代码行数:11,代码来源:DirectorySQS.java
示例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()));
}
开发者ID:bazaarvoice,项目名称:awslocal,代码行数:6,代码来源:TestSQSClient.java
示例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));
}
开发者ID:bazaarvoice,项目名称:awslocal,代码行数:10,代码来源:TestSQSClient.java
示例7: testDeleteQueue_withEmptyRequestParams_shouldWork
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
@Test
public void testDeleteQueue_withEmptyRequestParams_shouldWork() {
assertNotNull(sqs.deleteQueue(new DeleteQueueRequest()));
}
开发者ID:daflockinger,项目名称:unitstack,代码行数:5,代码来源:MockSqsTest.java
示例8: deleteQueueAsync
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
public Observable<DeleteQueueResult> deleteQueueAsync(DeleteQueueRequest request) {
return Observable.from(sqsClient.deleteQueueAsync(request));
}
开发者ID:gregwhitaker,项目名称:reactive-sqs-client,代码行数:4,代码来源:ReactiveSqsClient.java
示例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;
}
开发者ID:apelyos,项目名称:distributed-image-classification,代码行数:6,代码来源:Queue.java
示例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;
}
开发者ID:JulianEberius,项目名称:dwtc-extractor,代码行数:6,代码来源:ProcessingNode.java
示例11: delete
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
@Override
public void delete(DeleteQueueRequest request) {
delete(request, null);
}
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:5,代码来源:QueueImpl.java
示例12: deleteQueue
import com.amazonaws.services.sqs.model.DeleteQueueRequest; //导入依赖的package包/类
public void deleteQueue(String name){
DeleteQueueRequest request = new DeleteQueueRequest(name);
sqsClient.deleteQueue(request);
}
开发者ID:SINTEF-9012,项目名称:cloudml,代码行数:5,代码来源:BeanstalkConnector.java
示例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);
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:20,代码来源:Queue.java
注:本文中的com.amazonaws.services.sqs.model.DeleteQueueRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论