Package org.apache.james.mailbox.model

Examples of org.apache.james.mailbox.model.MailboxPath


        pop3Client = new POP3Client();
        pop3Client.connect("127.0.0.1", pop3Port);

        usersRepository.addUser("foo2", "bar2");

        MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, "foo2", "INBOX");
        MailboxSession session = mailboxManager.login("foo2", "bar2", LoggerFactory.getLogger("Test"));

        if (!mailboxManager.mailboxExists(mailboxPath, session)) {
            mailboxManager.createMailbox(mailboxPath, session);
        }
View Full Code Here


        pop3Client = new POP3Client();
        pop3Client.connect("127.0.0.1", pop3Port);

        usersRepository.addUser("foo2", "bar2");

        MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, "foo2", "INBOX");
        MailboxSession session = mailboxManager.login("foo2", "bar2", LoggerFactory.getLogger("Test"));

        if (!mailboxManager.mailboxExists(mailboxPath, session)) {
            mailboxManager.createMailbox(mailboxPath, session);
        }
View Full Code Here

        pop3Client = new POP3Client();
        pop3Client.connect("127.0.0.1", pop3Port);

        usersRepository.addUser("foo2", "bar2");

        MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, "foo2", "INBOX");
        MailboxSession session = mailboxManager.login("foo2", "bar2", LoggerFactory.getLogger("Test"));

        if (!mailboxManager.mailboxExists(mailboxPath, session)) {
            mailboxManager.createMailbox(mailboxPath, session);
        }
View Full Code Here

        pop3Client.connect("127.0.0.1", pop3Port);

        usersRepository.addUser("foo6", "bar6");
        MailboxSession session = mailboxManager.login("foo6", "bar6", LoggerFactory.getLogger("Test"));

        MailboxPath mailboxPath = MailboxPath.inbox(session);

        mailboxManager.startProcessingRequest(session);
        if (!mailboxManager.mailboxExists(mailboxPath, session)) {
            mailboxManager.createMailbox(mailboxPath, session);
        }
View Full Code Here

            throw new MessagingException("Can not access mailbox", e);
        }

        mailboxManager.startProcessingRequest(session);

        final MailboxPath path = new MailboxPath(MailboxConstants.USER_NAMESPACE, username, this.folder);
       
        try {
       
            if (this.folder.equalsIgnoreCase(folder) && !(mailboxManager.mailboxExists(path, session))) {
                mailboxManager.createMailbox(path, session);
View Full Code Here

            String userName30 = convert23UserTo30(userName23);


            MailboxSession mailboxSession = mailboxManager.createSystemSession(userName30, log);
            MailboxPath mailboxPath = MailboxPath.inbox(mailboxSession);

            mailboxManager.startProcessingRequest(mailboxSession);
            try {
                mailboxManager.createMailbox(mailboxPath, mailboxSession);
            } catch (MailboxExistsException e) {
View Full Code Here

            } else {
                username = recipient.getLocalPart();
            }

            MailboxSession mailboxSession = mailboxManager.createSystemSession(username, new Slf4jLoggerAdapter(session.getLogger()));
            MailboxPath inbox = MailboxPath.inbox(mailboxSession);

            mailboxManager.startProcessingRequest(mailboxSession);

            // create inbox if not exist
            if (!mailboxManager.mailboxExists(inbox, mailboxSession)) {
View Full Code Here

    protected Mailbox auth(POP3Session session, String username, String password) throws Exception {
        MailboxSession mSession = null;
        try {
            mSession = manager.login(session.getUser(), password, new Slf4jLoggerAdapter(session.getLogger()));
            manager.startProcessingRequest(mSession);
            MailboxPath inbox = MailboxPath.inbox(mSession);
           
            // check if the mailbox exists, if not create it
            if (!manager.mailboxExists(inbox, mSession)) {
                manager.createMailbox(inbox, mSession);
            }
View Full Code Here

     * @throws MailboxException
     * @throws UnsupportedEncodingException
     */
    private void feedMockMailboxManager() throws MailboxException, UnsupportedEncodingException {

        MailboxPath mailboxPath = null;
       
        for (int i=0; i < DOMAIN_COUNT; i++) {

            for (int j=0; j < USER_COUNT; j++) {
               
                String user = "user" + j + "@localhost" + i;
               
                String folderName = "INBOX";

                MailboxSession mailboxSession = getMockMailboxManager().createSystemSession(user, LoggerFactory.getLogger("mailboxmanager-test"));
                mailboxPath = new MailboxPath("#private", user, folderName);
                createMailbox(mailboxSession, mailboxPath);
               
                for (int k=0; k < SUB_MAILBOXES_COUNT; k++) {
                   
                    String subFolderName = folderName + ".SUB_FOLDER_" + k;
                    mailboxPath = new MailboxPath("#private", user, subFolderName);
                    createMailbox(mailboxSession, mailboxPath);
                   
                    for (int l=0; l < SUB_SUB_MAILBOXES_COUNT; l++) {

                        String subSubfolderName = subFolderName + ".SUBSUB_FOLDER_" + l;
                        mailboxPath = new MailboxPath("#private", user, subSubfolderName);
                        createMailbox(mailboxSession, mailboxPath);

                    }
                       
                }
View Full Code Here

     * @see org.apache.james.mailbox.store.mail.MailboxMapper#findMailboxByPath(org.apache.james.mailbox.model.MailboxPath)
     */
    public synchronized Mailbox<Long> findMailboxByPath(MailboxPath path) throws MailboxException, MailboxNotFoundException {
        Mailbox<Long> result = null;
        for (final Mailbox<Long> mailbox:mailboxesById.values()) {
            MailboxPath mp = new MailboxPath(mailbox.getNamespace(), mailbox.getUser(), mailbox.getName());
            if (mp.equals(path)) {
                result = mailbox;
                break;
            }
        }
        if (result == null) {
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.model.MailboxPath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.