本文整理了Java中com.amazonaws.services.sqs.model.Message.getMD5OfBody()
方法的一些代码示例,展示了Message.getMD5OfBody()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getMD5OfBody()
方法的具体详情如下:
包路径:com.amazonaws.services.sqs.model.Message
类名称:Message
方法名:getMD5OfBody
[英]An MD5 digest of the non-URL-encoded message body string.
[中]非URL编码的消息正文字符串的MD5摘要。
代码示例来源:origin: aws/aws-sdk-java
/**
* 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 (getMessageId() != null)
sb.append("MessageId: ").append(getMessageId()).append(",");
if (getReceiptHandle() != null)
sb.append("ReceiptHandle: ").append(getReceiptHandle()).append(",");
if (getMD5OfBody() != null)
sb.append("MD5OfBody: ").append(getMD5OfBody()).append(",");
if (getBody() != null)
sb.append("Body: ").append(getBody()).append(",");
if (getAttributes() != null)
sb.append("Attributes: ").append(getAttributes()).append(",");
if (getMD5OfMessageAttributes() != null)
sb.append("MD5OfMessageAttributes: ").append(getMD5OfMessageAttributes()).append(",");
if (getMessageAttributes() != null)
sb.append("MessageAttributes: ").append(getMessageAttributes());
sb.append("}");
return sb.toString();
}
代码示例来源:origin: aws/aws-sdk-java
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode());
hashCode = prime * hashCode + ((getReceiptHandle() == null) ? 0 : getReceiptHandle().hashCode());
hashCode = prime * hashCode + ((getMD5OfBody() == null) ? 0 : getMD5OfBody().hashCode());
hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode());
hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode());
hashCode = prime * hashCode + ((getMD5OfMessageAttributes() == null) ? 0 : getMD5OfMessageAttributes().hashCode());
hashCode = prime * hashCode + ((getMessageAttributes() == null) ? 0 : getMessageAttributes().hashCode());
return hashCode;
}
代码示例来源:origin: aws/aws-sdk-java
/**
* Throw an exception if the MD5 checksums included in the ReceiveMessageResult do not match the
* client-side calculation on the received messages.
*/
private static void receiveMessageResultMd5Check(ReceiveMessageResult receiveMessageResult) {
if (receiveMessageResult.getMessages() != null) {
for (Message messageReceived : receiveMessageResult.getMessages()) {
String messageBody = messageReceived.getBody();
String bodyMd5Returned = messageReceived.getMD5OfBody();
String clientSideBodyMd5 = calculateMessageBodyMd5(messageBody);
if (!clientSideBodyMd5.equals(bodyMd5Returned)) {
throw new AmazonClientException(String.format(MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_BODY,
clientSideBodyMd5, bodyMd5Returned));
}
Map<String, MessageAttributeValue> messageAttr = messageReceived.getMessageAttributes();
if (messageAttr != null && !messageAttr.isEmpty()) {
String attrMd5Returned = messageReceived.getMD5OfMessageAttributes();
String clientSideAttrMd5 = calculateMessageAttributesMd5(messageAttr);
if (!clientSideAttrMd5.equals(attrMd5Returned)) {
throw new AmazonClientException(String.format(MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_ATTRIBUTES,
clientSideAttrMd5, attrMd5Returned));
}
}
}
}
}
代码示例来源:origin: aws/aws-sdk-java
if (other.getReceiptHandle() != null && other.getReceiptHandle().equals(this.getReceiptHandle()) == false)
return false;
if (other.getMD5OfBody() == null ^ this.getMD5OfBody() == null)
return false;
if (other.getMD5OfBody() != null && other.getMD5OfBody().equals(this.getMD5OfBody()) == false)
return false;
if (other.getBody() == null ^ this.getBody() == null)
代码示例来源:origin: apache/nifi
attributes.put("hash.value", message.getMD5OfBody());
attributes.put("hash.algorithm", "md5");
attributes.put("sqs.message.id", message.getMessageId());
代码示例来源:origin: aws-amplify/aws-sdk-android
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode());
hashCode = prime * hashCode
+ ((getReceiptHandle() == null) ? 0 : getReceiptHandle().hashCode());
hashCode = prime * hashCode + ((getMD5OfBody() == null) ? 0 : getMD5OfBody().hashCode());
hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode());
hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode());
hashCode = prime
* hashCode
+ ((getMD5OfMessageAttributes() == null) ? 0 : getMD5OfMessageAttributes()
.hashCode());
hashCode = prime * hashCode
+ ((getMessageAttributes() == null) ? 0 : getMessageAttributes().hashCode());
return hashCode;
}
代码示例来源:origin: aws-amplify/aws-sdk-android
/**
* 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 (getMessageId() != null)
sb.append("MessageId: " + getMessageId() + ",");
if (getReceiptHandle() != null)
sb.append("ReceiptHandle: " + getReceiptHandle() + ",");
if (getMD5OfBody() != null)
sb.append("MD5OfBody: " + getMD5OfBody() + ",");
if (getBody() != null)
sb.append("Body: " + getBody() + ",");
if (getAttributes() != null)
sb.append("Attributes: " + getAttributes() + ",");
if (getMD5OfMessageAttributes() != null)
sb.append("MD5OfMessageAttributes: " + getMD5OfMessageAttributes() + ",");
if (getMessageAttributes() != null)
sb.append("MessageAttributes: " + getMessageAttributes());
sb.append("}");
return sb.toString();
}
代码示例来源:origin: aws-amplify/aws-sdk-android
/**
* Throw an exception if the MD5 checksums included in the
* ReceiveMessageResult do not match the client-side calculation on the
* received messages.
*/
private static void receiveMessageResultMd5Check(ReceiveMessageResult receiveMessageResult) {
if (receiveMessageResult.getMessages() != null) {
for (Message messageReceived : receiveMessageResult.getMessages()) {
String messageBody = messageReceived.getBody();
String bodyMd5Returned = messageReceived.getMD5OfBody();
String clientSideBodyMd5 = calculateMessageBodyMd5(messageBody);
if (!clientSideBodyMd5.equals(bodyMd5Returned)) {
throw new AmazonClientException(String.format(
MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_BODY,
clientSideBodyMd5, bodyMd5Returned));
}
Map<String, MessageAttributeValue> messageAttr = messageReceived
.getMessageAttributes();
if (messageAttr != null && !messageAttr.isEmpty()) {
String attrMd5Returned = messageReceived.getMD5OfMessageAttributes();
String clientSideAttrMd5 = calculateMessageAttributesMd5(messageAttr);
if (!clientSideAttrMd5.equals(attrMd5Returned)) {
throw new AmazonClientException(String.format(
MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_ATTRIBUTES,
clientSideAttrMd5, attrMd5Returned));
}
}
}
}
}
代码示例来源:origin: aws-amplify/aws-sdk-android
&& other.getReceiptHandle().equals(this.getReceiptHandle()) == false)
return false;
if (other.getMD5OfBody() == null ^ this.getMD5OfBody() == null)
return false;
if (other.getMD5OfBody() != null
&& other.getMD5OfBody().equals(this.getMD5OfBody()) == false)
return false;
if (other.getBody() == null ^ this.getBody() == null)
代码示例来源:origin: aws-amplify/aws-sdk-android
request.addParameter(prefix, StringUtils.fromString(receiptHandle));
if (_message.getMD5OfBody() != null) {
prefix = _prefix + "MD5OfBody";
String mD5OfBody = _message.getMD5OfBody();
request.addParameter(prefix, StringUtils.fromString(mD5OfBody));
代码示例来源:origin: com.amazonaws/aws-java-sdk-sqs
/**
* 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 (getMessageId() != null)
sb.append("MessageId: ").append(getMessageId()).append(",");
if (getReceiptHandle() != null)
sb.append("ReceiptHandle: ").append(getReceiptHandle()).append(",");
if (getMD5OfBody() != null)
sb.append("MD5OfBody: ").append(getMD5OfBody()).append(",");
if (getBody() != null)
sb.append("Body: ").append(getBody()).append(",");
if (getAttributes() != null)
sb.append("Attributes: ").append(getAttributes()).append(",");
if (getMD5OfMessageAttributes() != null)
sb.append("MD5OfMessageAttributes: ").append(getMD5OfMessageAttributes()).append(",");
if (getMessageAttributes() != null)
sb.append("MessageAttributes: ").append(getMessageAttributes());
sb.append("}");
return sb.toString();
}
代码示例来源:origin: com.amazonaws/aws-java-sdk-sqs
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode());
hashCode = prime * hashCode + ((getReceiptHandle() == null) ? 0 : getReceiptHandle().hashCode());
hashCode = prime * hashCode + ((getMD5OfBody() == null) ? 0 : getMD5OfBody().hashCode());
hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode());
hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode());
hashCode = prime * hashCode + ((getMD5OfMessageAttributes() == null) ? 0 : getMD5OfMessageAttributes().hashCode());
hashCode = prime * hashCode + ((getMessageAttributes() == null) ? 0 : getMessageAttributes().hashCode());
return hashCode;
}
代码示例来源:origin: com.amazonaws/aws-android-sdk-sqs
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode());
hashCode = prime * hashCode
+ ((getReceiptHandle() == null) ? 0 : getReceiptHandle().hashCode());
hashCode = prime * hashCode + ((getMD5OfBody() == null) ? 0 : getMD5OfBody().hashCode());
hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode());
hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode());
hashCode = prime
* hashCode
+ ((getMD5OfMessageAttributes() == null) ? 0 : getMD5OfMessageAttributes()
.hashCode());
hashCode = prime * hashCode
+ ((getMessageAttributes() == null) ? 0 : getMessageAttributes().hashCode());
return hashCode;
}
代码示例来源:origin: com.amazonaws/aws-android-sdk-sqs
/**
* 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 (getMessageId() != null)
sb.append("MessageId: " + getMessageId() + ",");
if (getReceiptHandle() != null)
sb.append("ReceiptHandle: " + getReceiptHandle() + ",");
if (getMD5OfBody() != null)
sb.append("MD5OfBody: " + getMD5OfBody() + ",");
if (getBody() != null)
sb.append("Body: " + getBody() + ",");
if (getAttributes() != null)
sb.append("Attributes: " + getAttributes() + ",");
if (getMD5OfMessageAttributes() != null)
sb.append("MD5OfMessageAttributes: " + getMD5OfMessageAttributes() + ",");
if (getMessageAttributes() != null)
sb.append("MessageAttributes: " + getMessageAttributes());
sb.append("}");
return sb.toString();
}
代码示例来源:origin: Comcast/cmb
public CQSMessage(Message message) {
this.messageId = message.getMessageId();
this.receiptHandle = message.getReceiptHandle();
this.body = message.getBody();
this.mD5OfBody = message.getMD5OfBody();
this.messageAttributes = new HashMap<String, CQSMessageAttribute>();
for (String messageAttributeName : message.getMessageAttributes().keySet()) {
MessageAttributeValue messageAttributeValue = message.getMessageAttributes().get(messageAttributeName);
CQSMessageAttribute ma = new CQSMessageAttribute(messageAttributeValue.getStringValue(), messageAttributeValue.getDataType());
this.messageAttributes.put(messageAttributeName, ma);
}
this.md5OfMessageAttributes = message.getMD5OfMessageAttributes();
}
代码示例来源:origin: com.amazonaws/aws-java-sdk-sqs
/**
* Throw an exception if the MD5 checksums included in the ReceiveMessageResult do not match the
* client-side calculation on the received messages.
*/
private static void receiveMessageResultMd5Check(ReceiveMessageResult receiveMessageResult) {
if (receiveMessageResult.getMessages() != null) {
for (Message messageReceived : receiveMessageResult.getMessages()) {
String messageBody = messageReceived.getBody();
String bodyMd5Returned = messageReceived.getMD5OfBody();
String clientSideBodyMd5 = calculateMessageBodyMd5(messageBody);
if (!clientSideBodyMd5.equals(bodyMd5Returned)) {
throw new AmazonClientException(String.format(MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_BODY,
clientSideBodyMd5, bodyMd5Returned));
}
Map<String, MessageAttributeValue> messageAttr = messageReceived.getMessageAttributes();
if (messageAttr != null && !messageAttr.isEmpty()) {
String attrMd5Returned = messageReceived.getMD5OfMessageAttributes();
String clientSideAttrMd5 = calculateMessageAttributesMd5(messageAttr);
if (!clientSideAttrMd5.equals(attrMd5Returned)) {
throw new AmazonClientException(String.format(MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_ATTRIBUTES,
clientSideAttrMd5, attrMd5Returned));
}
}
}
}
}
代码示例来源:origin: com.amazonaws/aws-android-sdk-sqs
/**
* Throw an exception if the MD5 checksums included in the
* ReceiveMessageResult do not match the client-side calculation on the
* received messages.
*/
private static void receiveMessageResultMd5Check(ReceiveMessageResult receiveMessageResult) {
if (receiveMessageResult.getMessages() != null) {
for (Message messageReceived : receiveMessageResult.getMessages()) {
String messageBody = messageReceived.getBody();
String bodyMd5Returned = messageReceived.getMD5OfBody();
String clientSideBodyMd5 = calculateMessageBodyMd5(messageBody);
if (!clientSideBodyMd5.equals(bodyMd5Returned)) {
throw new AmazonClientException(String.format(
MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_BODY,
clientSideBodyMd5, bodyMd5Returned));
}
Map<String, MessageAttributeValue> messageAttr = messageReceived
.getMessageAttributes();
if (messageAttr != null && !messageAttr.isEmpty()) {
String attrMd5Returned = messageReceived.getMD5OfMessageAttributes();
String clientSideAttrMd5 = calculateMessageAttributesMd5(messageAttr);
if (!clientSideAttrMd5.equals(attrMd5Returned)) {
throw new AmazonClientException(String.format(
MD5_MISMATCH_ERROR_MESSAGE, MESSAGE_ATTRIBUTES,
clientSideAttrMd5, attrMd5Returned));
}
}
}
}
}
代码示例来源:origin: com.amazonaws/aws-java-sdk-sqs
if (other.getReceiptHandle() != null && other.getReceiptHandle().equals(this.getReceiptHandle()) == false)
return false;
if (other.getMD5OfBody() == null ^ this.getMD5OfBody() == null)
return false;
if (other.getMD5OfBody() != null && other.getMD5OfBody().equals(this.getMD5OfBody()) == false)
return false;
if (other.getBody() == null ^ this.getBody() == null)
代码示例来源:origin: com.amazonaws/aws-android-sdk-sqs
&& other.getReceiptHandle().equals(this.getReceiptHandle()) == false)
return false;
if (other.getMD5OfBody() == null ^ this.getMD5OfBody() == null)
return false;
if (other.getMD5OfBody() != null
&& other.getMD5OfBody().equals(this.getMD5OfBody()) == false)
return false;
if (other.getBody() == null ^ this.getBody() == null)
代码示例来源:origin: org.apache.nifi/nifi-aws-processors
attributes.put("hash.value", message.getMD5OfBody());
attributes.put("hash.algorithm", "md5");
attributes.put("sqs.message.id", message.getMessageId());
内容来源于网络,如有侵权,请联系作者删除!