You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/04/11 00:33:49 UTC
[james-project] 18/24: JAMES-2731 Deprecate MailboxPath::getFullName
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 45659c6376445db774641bcd43289232aa733328
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Apr 9 17:48:36 2019 +0700
JAMES-2731 Deprecate MailboxPath::getFullName
This is used only in logging and made it harder as the user part is missing
---
.../src/main/java/org/apache/james/mailbox/model/MailboxPath.java | 2 ++
.../org/apache/james/imap/processor/AbstractMailboxProcessor.java | 3 ++-
.../org/apache/james/imap/processor/AbstractSelectionProcessor.java | 6 +++---
.../main/java/org/apache/james/imap/processor/StoreProcessor.java | 2 +-
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxPath.java b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxPath.java
index 2675d7c..ec6a2ee 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxPath.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/MailboxPath.java
@@ -183,7 +183,9 @@ public class MailboxPath {
*
* @param delimiter
* @return fullName
+ * @deprecated Use {@link MailboxPath#asString()} instead.
*/
+ @Deprecated
public String getFullName(char delimiter) {
return namespace + delimiter + name;
}
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
index 08bef66..22d7e17 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
@@ -24,6 +24,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Set;
+
import javax.mail.Flags;
import org.apache.james.imap.api.ImapCommand;
@@ -245,7 +246,7 @@ public abstract class AbstractMailboxProcessor<M extends ImapRequest> extends Ab
final MessageUid uid = mr.getUid();
int msn = selected.msn(uid);
if (msn == SelectedMailbox.NO_SUCH_MESSAGE) {
- LOGGER.debug("No message found with uid {} in the uid<->msn mapping for mailbox {}. This may be because it was deleted by a concurrent session. So skip it..", uid, selected.getPath().getFullName(mailboxSession.getPathDelimiter()));
+ LOGGER.debug("No message found with uid {} in the uid<->msn mapping for mailbox {}. This may be because it was deleted by a concurrent session. So skip it..", uid, selected.getPath().asString());
// skip this as it was not found in the mapping
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
index 3abf4e7..d7f0197 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
@@ -132,7 +132,7 @@ abstract class AbstractSelectionProcessor<M extends AbstractMailboxSelectionRequ
//
// See IMAP-345
int retryCount = 0;
- while (unseen(responder, firstUnseen, selected, ImapSessionUtils.getMailboxSession(session)) == false) {
+ while (unseen(responder, firstUnseen, selected) == false) {
// if we not was able to get find the unseen within 5 retries we should just not send it
if (retryCount == 5) {
LOGGER.info("Unable to uid for unseen message {} in mailbox {}", firstUnseen, selected.getPath());
@@ -355,13 +355,13 @@ abstract class AbstractSelectionProcessor<M extends AbstractMailboxSelectionRequ
responder.respond(taggedOk);
}
- private boolean unseen(Responder responder, MessageUid firstUnseen, SelectedMailbox selected, MailboxSession session) throws MailboxException {
+ private boolean unseen(Responder responder, MessageUid firstUnseen, SelectedMailbox selected) throws MailboxException {
if (firstUnseen != null) {
final MessageUid unseenUid = firstUnseen;
int msn = selected.msn(unseenUid);
if (msn == SelectedMailbox.NO_SUCH_MESSAGE) {
- LOGGER.debug("No message found with uid {} in mailbox {}", unseenUid, selected.getPath().getFullName(session.getPathDelimiter()));
+ LOGGER.debug("No message found with uid {} in mailbox {}", unseenUid, selected.getPath().asString());
return false;
}
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/StoreProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
index 27e86d5..119f42b 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
@@ -286,7 +286,7 @@ public class StoreProcessor extends AbstractMailboxProcessor<StoreRequest> {
final int msn = selected.msn(uid);
if (msn == SelectedMailbox.NO_SUCH_MESSAGE) {
- LOGGER.debug("No message found with uid {} in the uid<->msn mapping for mailbox {}. This may be because it was deleted by a concurrent session. So skip it..", uid, selected.getPath().getFullName(mailboxSession.getPathDelimiter()));
+ LOGGER.debug("No message found with uid {} in the uid<->msn mapping for mailbox {}. This may be because it was deleted by a concurrent session. So skip it..", uid, selected.getPath().asString());
// skip this as it was not found in the mapping
//
// See IMAP-346
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org