@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SendEmailResult == false) return false; SendEmailResult other = (SendEmailResult) obj; if (other.getMessageId() == null ^ this.getMessageId() == null) return false; if (other.getMessageId() != null && other.getMessageId().equals(this.getMessageId()) == false) return false; return true; }
/** * <p> * The unique message identifier returned from the <code>SendEmail</code> action. * </p> * * @param messageId * The unique message identifier returned from the <code>SendEmail</code> action. * @return Returns a reference to this object so that method calls can be chained together. */ public SendEmailResult withMessageId(String messageId) { setMessageId(messageId); return this; }
public SendEmailResult unmarshall(StaxUnmarshallerContext context) throws Exception { SendEmailResult sendEmailResult = new SendEmailResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return sendEmailResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("MessageId", targetDepth)) { sendEmailResult.setMessageId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return sendEmailResult; } } } }
public SendEmailResult unmarshall(StaxUnmarshallerContext context) throws Exception { SendEmailResult sendEmailResult = new SendEmailResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("MessageId", targetDepth)) { sendEmailResult.setMessageId(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return sendEmailResult; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode()); return hashCode; }
public SendEmailResult unmarshall(StaxUnmarshallerContext context) throws Exception { SendEmailResult sendEmailResult = new SendEmailResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return sendEmailResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("MessageId", targetDepth)) { sendEmailResult.setMessageId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return sendEmailResult; } } } }
/** * <p> * The unique message identifier returned from the <code>SendEmail</code> action. * </p> * * @param messageId * The unique message identifier returned from the <code>SendEmail</code> action. * @return Returns a reference to this object so that method calls can be chained together. */ public SendEmailResult withMessageId(String messageId) { setMessageId(messageId); return this; }
/** * 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()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SendEmailResult == false) return false; SendEmailResult other = (SendEmailResult) obj; if (other.getMessageId() == null ^ this.getMessageId() == null) return false; if (other.getMessageId() != null && other.getMessageId().equals(this.getMessageId()) == false) return false; return true; } }
/** * 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()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SendEmailResult == false) return false; SendEmailResult other = (SendEmailResult) obj; if (other.getMessageId() == null ^ this.getMessageId() == null) return false; if (other.getMessageId() != null && other.getMessageId().equals(this.getMessageId()) == false) return false; return true; }
/** * 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()); sb.append("}"); return sb.toString(); }
@SuppressWarnings("OverloadedVarargsMethod") @Override public void send(SimpleMailMessage... simpleMailMessages) throws MailException { Map<Object, Exception> failedMessages = new HashMap<>(); for (SimpleMailMessage simpleMessage : simpleMailMessages) { try { SendEmailResult sendEmailResult = getEmailService().sendEmail(prepareMessage(simpleMessage)); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Message with id: {} successfully send", sendEmailResult.getMessageId()); } } catch (AmazonClientException e) { //Ignore Exception because we are collecting and throwing all if any //noinspection ThrowableResultOfMethodCallIgnored failedMessages.put(simpleMessage, e); } } if (!failedMessages.isEmpty()) { throw new MailSendException(failedMessages); } }
@SuppressWarnings("OverloadedVarargsMethod") @Override public void send(SimpleMailMessage... simpleMailMessages) throws MailException { Map<Object, Exception> failedMessages = new HashMap<>(); for (SimpleMailMessage simpleMessage : simpleMailMessages) { try { SendEmailResult sendEmailResult = getEmailService().sendEmail(prepareMessage(simpleMessage)); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Message with id: {} successfully send", sendEmailResult.getMessageId()); } } catch (AmazonClientException e) { //Ignore Exception because we are collecting and throwing all if any //noinspection ThrowableResultOfMethodCallIgnored failedMessages.put(simpleMessage, e); } } if (!failedMessages.isEmpty()) { throw new MailSendException(failedMessages); } }
logger.debug("sent mail messageId:{}, body:\n{}", emailResult.getMessageId(), mailMessage); } else { logger.info("sent mail to {}, messageId:{}", destination, emailResult.getMessageId());