[ 
https://issues.apache.org/jira/browse/IMAP-164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim-Christian Mundt updated IMAP-164:
-------------------------------------

    Attachment: existsViaFindByName.patch

After implementing the suggestion above, I figured it would be better to leave 
the mailboxExists() method in the MailboxManager because

a) it IS used in other places and 
b) all that is wrong about it is the usage of 
MailboxMapper.countMailboxesWithName()

Basically an "exists" is done by trying to get an item and realizing it's there 
or not. That's already done by MailboxMapper.findMailboxByName(). The attached 
patch changes the implementation in StoreMailboxManager to use it and removes 
countMailboxesWithName().

> Move mailboxExists to MailboxMapper interface
> ---------------------------------------------
>
>                 Key: IMAP-164
>                 URL: https://issues.apache.org/jira/browse/IMAP-164
>             Project: JAMES Imap
>          Issue Type: Improvement
>          Components: Mailbox
>            Reporter: Tim-Christian Mundt
>            Priority: Minor
>         Attachments: existsViaFindByName.patch
>
>
> The method MailboxMapper.countMailboxesWithName(mailboxName) is
> only ever used in StoreMailboxManager.mailboxExists(mailboxName,
> session). There the result is checked for duplicates. Duplicates should
> be detected before writing and not when reading, for some stores (e.g.
> maildir) it is not even possible to have more than one mailbox with the
> same name. So this is superfluous and should should be moved to
> MailboxMapper.existsMailbox(mailboxName) which can provide a more
> efficient existence test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to