/** * @return True if request has been configured to return queue attributes. False otherwise */ private boolean hasRequestedQueueAttributes(ReceiveMessageRequest rq) { return rq.getAttributeNames() != null && !rq.getAttributeNames().isEmpty(); }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getQueueUrl() != null) sb.append("QueueUrl: ").append(getQueueUrl()).append(","); if (getAttributeNames() != null) sb.append("AttributeNames: ").append(getAttributeNames()).append(","); if (getMessageAttributeNames() != null) sb.append("MessageAttributeNames: ").append(getMessageAttributeNames()).append(","); if (getMaxNumberOfMessages() != null) sb.append("MaxNumberOfMessages: ").append(getMaxNumberOfMessages()).append(","); if (getVisibilityTimeout() != null) sb.append("VisibilityTimeout: ").append(getVisibilityTimeout()).append(","); if (getWaitTimeSeconds() != null) sb.append("WaitTimeSeconds: ").append(getWaitTimeSeconds()).append(","); if (getReceiveRequestAttemptId() != null) sb.append("ReceiveRequestAttemptId: ").append(getReceiveRequestAttemptId()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getQueueUrl() == null) ? 0 : getQueueUrl().hashCode()); hashCode = prime * hashCode + ((getAttributeNames() == null) ? 0 : getAttributeNames().hashCode()); hashCode = prime * hashCode + ((getMessageAttributeNames() == null) ? 0 : getMessageAttributeNames().hashCode()); hashCode = prime * hashCode + ((getMaxNumberOfMessages() == null) ? 0 : getMaxNumberOfMessages().hashCode()); hashCode = prime * hashCode + ((getVisibilityTimeout() == null) ? 0 : getVisibilityTimeout().hashCode()); hashCode = prime * hashCode + ((getWaitTimeSeconds() == null) ? 0 : getWaitTimeSeconds().hashCode()); hashCode = prime * hashCode + ((getReceiveRequestAttemptId() == null) ? 0 : getReceiveRequestAttemptId().hashCode()); return hashCode; }
attributeNamesCopy.add(value.toString()); if (getAttributeNames() == null) { setAttributeNames(attributeNamesCopy); } else { getAttributeNames().addAll(attributeNamesCopy);
if (other.getQueueUrl() != null && other.getQueueUrl().equals(this.getQueueUrl()) == false) return false; if (other.getAttributeNames() == null ^ this.getAttributeNames() == null) return false; if (other.getAttributeNames() != null && other.getAttributeNames().equals(this.getAttributeNames()) == false) return false; if (other.getMessageAttributeNames() == null ^ this.getMessageAttributeNames() == null)
if (!receiveMessageRequest.getAttributeNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) receiveMessageRequest.getAttributeNames()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> attributeNamesList = (com.amazonaws.internal.SdkInternalList<String>) receiveMessageRequest .getAttributeNames(); int attributeNamesListIndex = 1;
if (getAttributeNames() == null) { this.attributeNames = new java.util.ArrayList<String>(attributeNames.length);
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getQueueUrl() != null) sb.append("QueueUrl: " + getQueueUrl() + ","); if (getAttributeNames() != null) sb.append("AttributeNames: " + getAttributeNames() + ","); if (getMessageAttributeNames() != null) sb.append("MessageAttributeNames: " + getMessageAttributeNames() + ","); if (getMaxNumberOfMessages() != null) sb.append("MaxNumberOfMessages: " + getMaxNumberOfMessages() + ","); if (getVisibilityTimeout() != null) sb.append("VisibilityTimeout: " + getVisibilityTimeout() + ","); if (getWaitTimeSeconds() != null) sb.append("WaitTimeSeconds: " + getWaitTimeSeconds() + ","); if (getReceiveRequestAttemptId() != null) sb.append("ReceiveRequestAttemptId: " + getReceiveRequestAttemptId()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getQueueUrl() == null) ? 0 : getQueueUrl().hashCode()); hashCode = prime * hashCode + ((getAttributeNames() == null) ? 0 : getAttributeNames().hashCode()); hashCode = prime * hashCode + ((getMessageAttributeNames() == null) ? 0 : getMessageAttributeNames().hashCode()); hashCode = prime * hashCode + ((getMaxNumberOfMessages() == null) ? 0 : getMaxNumberOfMessages().hashCode()); hashCode = prime * hashCode + ((getVisibilityTimeout() == null) ? 0 : getVisibilityTimeout().hashCode()); hashCode = prime * hashCode + ((getWaitTimeSeconds() == null) ? 0 : getWaitTimeSeconds().hashCode()); hashCode = prime * hashCode + ((getReceiveRequestAttemptId() == null) ? 0 : getReceiveRequestAttemptId() .hashCode()); return hashCode; }
/** * Submits a request to receive some messages from SQS. * * @return a Future object that will be notified when the operation is * completed; never null; */ public Future<ReceiveMessageResult> receiveMessage(ReceiveMessageRequest rq, AsyncHandler<ReceiveMessageRequest, ReceiveMessageResult> handler) { // only handle simple requests, because these are the settings we // pre-fetch with boolean noAttributes = (rq.getAttributeNames() == null) || rq.getAttributeNames().isEmpty(); boolean noMessageAttributesToRetrieve = (rq.getMessageAttributeNames() == null) || rq.getMessageAttributeNames().isEmpty(); boolean bufferngEnabled = (config.getMaxInflightReceiveBatches() > 0) && (config.getMaxDoneReceiveBatches() > 0); if (noMessageAttributesToRetrieve && noAttributes && bufferngEnabled && (rq.getVisibilityTimeout() == null)) { QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback = null; if (handler != null) { callback = new QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult>( handler, rq); } QueueBufferFuture<ReceiveMessageRequest, ReceiveMessageResult> future = receiveBuffer .receiveMessageAsync(rq, callback); future.setBuffer(this); return future; } else { return realSqs.receiveMessageAsync(rq); } }
if (other.getQueueUrl() != null && other.getQueueUrl().equals(this.getQueueUrl()) == false) return false; if (other.getAttributeNames() == null ^ this.getAttributeNames() == null) return false; if (other.getAttributeNames() != null && other.getAttributeNames().equals(this.getAttributeNames()) == false) return false; if (other.getMessageAttributeNames() == null ^ this.getMessageAttributeNames() == null)
/** * @return True if request has been configured to return queue attributes. False otherwise */ private boolean hasRequestedQueueAttributes(ReceiveMessageRequest rq) { return rq.getAttributeNames() != null && !rq.getAttributeNames().isEmpty(); }
request.addParameter(prefix, StringUtils.fromString(queueUrl)); if (receiveMessageRequest.getAttributeNames() != null) { prefix = "AttributeName"; java.util.List<String> attributeNames = receiveMessageRequest.getAttributeNames(); int attributeNamesIndex = 1; String attributeNamesPrefix = prefix;
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getQueueUrl() != null) sb.append("QueueUrl: ").append(getQueueUrl()).append(","); if (getAttributeNames() != null) sb.append("AttributeNames: ").append(getAttributeNames()).append(","); if (getMessageAttributeNames() != null) sb.append("MessageAttributeNames: ").append(getMessageAttributeNames()).append(","); if (getMaxNumberOfMessages() != null) sb.append("MaxNumberOfMessages: ").append(getMaxNumberOfMessages()).append(","); if (getVisibilityTimeout() != null) sb.append("VisibilityTimeout: ").append(getVisibilityTimeout()).append(","); if (getWaitTimeSeconds() != null) sb.append("WaitTimeSeconds: ").append(getWaitTimeSeconds()).append(","); if (getReceiveRequestAttemptId() != null) sb.append("ReceiveRequestAttemptId: ").append(getReceiveRequestAttemptId()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getQueueUrl() == null) ? 0 : getQueueUrl().hashCode()); hashCode = prime * hashCode + ((getAttributeNames() == null) ? 0 : getAttributeNames().hashCode()); hashCode = prime * hashCode + ((getMessageAttributeNames() == null) ? 0 : getMessageAttributeNames().hashCode()); hashCode = prime * hashCode + ((getMaxNumberOfMessages() == null) ? 0 : getMaxNumberOfMessages().hashCode()); hashCode = prime * hashCode + ((getVisibilityTimeout() == null) ? 0 : getVisibilityTimeout().hashCode()); hashCode = prime * hashCode + ((getWaitTimeSeconds() == null) ? 0 : getWaitTimeSeconds().hashCode()); hashCode = prime * hashCode + ((getReceiveRequestAttemptId() == null) ? 0 : getReceiveRequestAttemptId().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getQueueUrl() == null) ? 0 : getQueueUrl().hashCode()); hashCode = prime * hashCode + ((getAttributeNames() == null) ? 0 : getAttributeNames().hashCode()); hashCode = prime * hashCode + ((getMessageAttributeNames() == null) ? 0 : getMessageAttributeNames().hashCode()); hashCode = prime * hashCode + ((getMaxNumberOfMessages() == null) ? 0 : getMaxNumberOfMessages().hashCode()); hashCode = prime * hashCode + ((getVisibilityTimeout() == null) ? 0 : getVisibilityTimeout().hashCode()); hashCode = prime * hashCode + ((getWaitTimeSeconds() == null) ? 0 : getWaitTimeSeconds().hashCode()); hashCode = prime * hashCode + ((getReceiveRequestAttemptId() == null) ? 0 : getReceiveRequestAttemptId() .hashCode()); return hashCode; }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getQueueUrl() != null) sb.append("QueueUrl: " + getQueueUrl() + ","); if (getAttributeNames() != null) sb.append("AttributeNames: " + getAttributeNames() + ","); if (getMessageAttributeNames() != null) sb.append("MessageAttributeNames: " + getMessageAttributeNames() + ","); if (getMaxNumberOfMessages() != null) sb.append("MaxNumberOfMessages: " + getMaxNumberOfMessages() + ","); if (getVisibilityTimeout() != null) sb.append("VisibilityTimeout: " + getVisibilityTimeout() + ","); if (getWaitTimeSeconds() != null) sb.append("WaitTimeSeconds: " + getWaitTimeSeconds() + ","); if (getReceiveRequestAttemptId() != null) sb.append("ReceiveRequestAttemptId: " + getReceiveRequestAttemptId()); sb.append("}"); return sb.toString(); }
/** * Submits a request to receive some messages from SQS. * * @return a Future object that will be notified when the operation is * completed; never null; */ public Future<ReceiveMessageResult> receiveMessage(ReceiveMessageRequest rq, AsyncHandler<ReceiveMessageRequest, ReceiveMessageResult> handler) { // only handle simple requests, because these are the settings we // pre-fetch with boolean noAttributes = (rq.getAttributeNames() == null) || rq.getAttributeNames().isEmpty(); boolean noMessageAttributesToRetrieve = (rq.getMessageAttributeNames() == null) || rq.getMessageAttributeNames().isEmpty(); boolean bufferngEnabled = (config.getMaxInflightReceiveBatches() > 0) && (config.getMaxDoneReceiveBatches() > 0); if (noMessageAttributesToRetrieve && noAttributes && bufferngEnabled && (rq.getVisibilityTimeout() == null)) { QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult> callback = null; if (handler != null) { callback = new QueueBufferCallback<ReceiveMessageRequest, ReceiveMessageResult>( handler, rq); } QueueBufferFuture<ReceiveMessageRequest, ReceiveMessageResult> future = receiveBuffer .receiveMessageAsync(rq, callback); future.setBuffer(this); return future; } else { return realSqs.receiveMessageAsync(rq); } }
if (other.getQueueUrl() != null && other.getQueueUrl().equals(this.getQueueUrl()) == false) return false; if (other.getAttributeNames() == null ^ this.getAttributeNames() == null) return false; if (other.getAttributeNames() != null && other.getAttributeNames().equals(this.getAttributeNames()) == false) return false; if (other.getMessageAttributeNames() == null ^ this.getMessageAttributeNames() == null)
if (!receiveMessageRequest.getAttributeNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) receiveMessageRequest.getAttributeNames()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> attributeNamesList = (com.amazonaws.internal.SdkInternalList<String>) receiveMessageRequest .getAttributeNames(); int attributeNamesListIndex = 1;