List of usage examples for com.amazonaws.services.sqs.model GetQueueAttributesRequest GetQueueAttributesRequest
public GetQueueAttributesRequest(String queueUrl)
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public Long getQueueMessageRetentionPeriod(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest.withAttributeNames(Constant.SQS.Attribute.MESSAGE_RETENTION_PERIOD); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; }// www. ja v a 2s . c om Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.MESSAGE_RETENTION_PERIOD); if (StringUtil.isEmpty(value)) { return null; } if (!value.matches("^\\d+$")) { return null; } return Long.valueOf(value); }
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public Long getQueueMaximumMessageSize(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest.withAttributeNames(Constant.SQS.Attribute.MAXIMUM_MESSAGE_SIZE); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; }/* w ww.j av a 2 s. com*/ Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.MAXIMUM_MESSAGE_SIZE); if (StringUtil.isEmpty(value)) { return null; } if (!value.matches("^\\d+$")) { return null; } return Long.valueOf(value); }
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public Long getQueueReceiveMessageWaitTimeSeconds(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest.withAttributeNames(Constant.SQS.Attribute.RECEIVE_MESSAGE_WAIT_TIME_SECONDS); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; }/* w ww . ja v a 2 s .co m*/ Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.RECEIVE_MESSAGE_WAIT_TIME_SECONDS); if (StringUtil.isEmpty(value)) { return null; } if (!value.matches("^\\d+$")) { return null; } return Long.valueOf(value); }
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public Long getQueueLastModifiedTimestamp(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest.withAttributeNames(Constant.SQS.Attribute.LAST_MODIFIED_TIMESTAMP); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; }/*ww w . j a v a 2s. co m*/ Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.LAST_MODIFIED_TIMESTAMP); if (StringUtil.isEmpty(value)) { return null; } if (!value.matches("^\\d+$")) { return null; } return Long.valueOf(value); }
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public Long getQueueCreatedTimestamp(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest.withAttributeNames(Constant.SQS.Attribute.CREATED_TIMESTAMP); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; }/*from w ww .j av a 2s .c om*/ Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.CREATED_TIMESTAMP); if (StringUtil.isEmpty(value)) { return null; } if (!value.matches("^\\d+$")) { return null; } return Long.valueOf(value); }
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public Long getQueueVisibilityTimeout(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest.withAttributeNames(Constant.SQS.Attribute.VISIBILITY_TIMEOUT); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; }/* w w w. j a v a 2s. c om*/ Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.VISIBILITY_TIMEOUT); if (StringUtil.isEmpty(value)) { return null; } if (!value.matches("^\\d+$")) { return null; } return Long.valueOf(value); }
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public Long getQueueApproximateNumberOfMessages(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest.withAttributeNames(Constant.SQS.Attribute.APPROXIMATE_NUMBER_OF_MESSAGES); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; }/*ww w . j av a 2 s. c o m*/ Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.APPROXIMATE_NUMBER_OF_MESSAGES); if (StringUtil.isEmpty(value)) { return null; } if (!value.matches("^\\d+$")) { return null; } return Long.valueOf(value); }
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public Long getQueueApproximateNumberOfMessagesNotVisible(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest/* www . j a v a2s .c om*/ .withAttributeNames(Constant.SQS.Attribute.APPROXIMATE_NUMBER_OF_MESSAGES_NOT_VISIBLE); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; } Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.APPROXIMATE_NUMBER_OF_MESSAGES_NOT_VISIBLE); if (StringUtil.isEmpty(value)) { return null; } if (!value.matches("^\\d+$")) { return null; } return Long.valueOf(value); }
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public String getQueueQueueArn(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest.withAttributeNames(Constant.SQS.Attribute.QUEUE_ARN); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; }/* w w w. jav a2 s.co m*/ Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.QUEUE_ARN); return value; }
From source file:com.easarrive.aws.plugins.common.service.impl.SQSService.java
License:Open Source License
@Override public Long getQueueApproximateNumberOfMessagesDelayed(AmazonSQS client, String queueUrl) { GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(queueUrl); getQueueAttributesRequest.withAttributeNames(Constant.SQS.Attribute.APPROXIMATE_NUMBER_OF_MESSAGES_DELAYED); GetQueueAttributesResult result = client.getQueueAttributes(getQueueAttributesRequest); if (result == null) { return null; }/*from w w w.j a v a2 s . c o m*/ Map<String, String> attributeMap = result.getAttributes(); if (attributeMap == null) { return null; } String value = attributeMap.get(Constant.SQS.Attribute.APPROXIMATE_NUMBER_OF_MESSAGES_DELAYED); if (StringUtil.isEmpty(value)) { return null; } if (!value.matches("^\\d+$")) { return null; } return Long.valueOf(value); }