This is an automated email from the ASF dual-hosted git repository. aduprat pushed a commit to branch 3.3.x in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 8d69a8305680e8aedaa8984603523223afa7b653 Author: Gautier DI FOLCO <[email protected]> AuthorDate: Mon Mar 25 13:27:13 2019 +0100 JAMES-2699 Add documentation for Mailet API deprecation --- mailet/api/src/main/java/org/apache/mailet/Mail.java | 8 ++++++++ upgrade-instructions.md | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/mailet/api/src/main/java/org/apache/mailet/Mail.java b/mailet/api/src/main/java/org/apache/mailet/Mail.java index 34b4e19..fc4d757 100644 --- a/mailet/api/src/main/java/org/apache/mailet/Mail.java +++ b/mailet/api/src/main/java/org/apache/mailet/Mail.java @@ -87,9 +87,17 @@ public interface Mail extends Serializable, Cloneable { AttributeName SMTP_AUTH_USER = AttributeName.of("org.apache.james.SMTPAuthUser"); AttributeName MAILET_ERROR = AttributeName.of("org.apache.james.MailetError"); + /** + * Attribute name used for keeping the AUTH_USER of SMTP + * @deprecated @see {@link #SMTP_AUTH_USER} + */ @Deprecated String SMTP_AUTH_USER_ATTRIBUTE_NAME = SMTP_AUTH_USER.asString(); + /** + * Attribute name used for mailet-associated errors + * @deprecated @see {@link #MAILET_ERROR} + */ @Deprecated String MAILET_ERROR_ATTRIBUTE_NAME = MAILET_ERROR.asString(); diff --git a/upgrade-instructions.md b/upgrade-instructions.md index 12b2a9b..228848e 100644 --- a/upgrade-instructions.md +++ b/upgrade-instructions.md @@ -17,6 +17,7 @@ Change list: - [Changes to the MailboxListener API](#changes-to-the-mailboxlistener-api) - [Changes in WebAdmin reIndexing API](#changes-in-webadmin-reindexing-api) - [Rename KEY column in JAMES_MAILBOX_ANNOTATION table](#james-mailbox-annotation) + - [Mailet API changes](#mailet-api-changes) ### Changes to the MailboxListener API @@ -85,6 +86,23 @@ ALTER TABLE JAMES_MAILBOX_ANNOTATION CHANGE COLUMN KEY ANNOTATION_KEY varchar(20 _or the syntax corresponding to your database._ +### Mailet API changes +In order to allow safe serialization and strong typing `org.apache.mailet.Mail` have changed. + +These methods have been deprecated and replaced: + + * `getSender()` in favor of `getMaybeSender()` + * `getAttribute(String)` in favor of `getAttribute(AttributeName)` + * `setAttribute(String, Serializable)` in favor of `setAttribute(Attribute)` + * `removeAttribute(String)` in favor of `removeAttribute(AttributeName)` + * `getAttributeNames()` in favor of `attributeNames()` and `attributesMap()` + +Some plain-string `AttributeName` have also been replaced: + + * `SMTP_AUTH_USER_ATTRIBUTE_NAME` in favor of `SMTP_AUTH_USER` + * `MAILET_ERROR_ATTRIBUTE_NAME` in favor of `MAILET_ERROR` + * `SENT_BY_MAILET` in favor of `SENT_BY_MAILET_ATTRIBUTE`'s name, it is recommended to directly set the `Attribute`. + ## 3.2.0 version Changes to apply between 3.1.0 and 3.2.0 had been reported here. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
