Examples of MailRepository


Examples of org.apache.james.services.MailRepository

        Collection recipients = new HashSet();
        recipients.add(recipient);
        MailImpl mail = new MailImpl(getId(), sender, recipients, message);
        try {
            MailRepository userInbox = getRepository(username);
            if (userInbox == null) {
                StringBuffer errorBuffer = new StringBuffer(128).append(
                        "The repository for user ").append(username).append(
                        " was not found on this server.");
                throw new MessagingException(errorBuffer.toString());
            }
            userInbox.store(mail);
        } finally {
            mail.dispose();
        }
    }
View Full Code Here

Examples of org.apache.james.services.MailRepository

     *  
     * @param userName
     * @return
     */
    private MailRepository getRepository(String userName) {
        MailRepository userInbox;
        if (repositoryUrl == null) {
            userInbox = mailServer.getUserInbox(userName);
        } else {
            StringBuffer destinationBuffer = new StringBuffer(192).append(
                    repositoryUrl).append(userName).append("/");
View Full Code Here

Examples of org.apache.james.services.MailRepository

     * @param userName the name of the user whose inbox is to be retrieved
     *
     * @return the POP3 inbox for the user
     */
    public synchronized MailRepository getUserInbox(String userName) {
        MailRepository userInbox = null;

        userInbox = (MailRepository) mailboxes.get(userName);

        if (userInbox != null) {
            return userInbox;
View Full Code Here

Examples of org.apache.james.services.MailRepository

     *
     * @param recipient the recipient to check
     */   
    protected long getUsed(MailAddress recipient, Mail _) throws MessagingException {
        long size = 0;
        MailRepository userInbox = mailServer.getUserInbox(getPrimaryName(recipient.getUser()));
        for (Iterator it = userInbox.list(); it.hasNext(); ) {
            String key = (String) it.next();
            Mail mc = userInbox.retrieve(key);
            // Retrieve can return null if the mail is no longer in the store.
            if (mc != null) try {
                size += mc.getMessageSize();
            } catch (Throwable e) {
                // MailRepository.retrieve() does NOT lock the message.
View Full Code Here

Examples of org.apache.james.services.MailRepository

     *
     * @param recipient the recipient to check
     */   
    protected long getUsed(MailAddress recipient, Mail _) throws MessagingException {
        long size = 0;
        MailRepository userInbox = mailServer.getUserInbox(getPrimaryName(recipient.getUser()));
        for (Iterator it = userInbox.list(); it.hasNext(); ) {
            String key = (String) it.next();
            Mail mc = userInbox.retrieve(key);
            // Retrieve can return null if the mail is no longer in the store.
            if (mc != null) try {
                size += mc.getMessageSize();
            } catch (Throwable e) {
                // MailRepository.retrieve() does NOT lock the message.
View Full Code Here

Examples of org.apache.james.services.MailRepository

        Collection recipients = new HashSet();
        recipients.add(recipient);
        MailImpl mail = new MailImpl(getId(), sender, recipients, message);
        try {
            MailRepository userInbox = getRepository(username);
            if (userInbox == null) {
                StringBuffer errorBuffer = new StringBuffer(128).append(
                        "The repository for user ").append(username).append(
                        " was not found on this server.");
                throw new MessagingException(errorBuffer.toString());
            }
            userInbox.store(mail);
        } finally {
            mail.dispose();
        }
    }
View Full Code Here

Examples of org.apache.james.services.MailRepository

     *  
     * @param userName
     * @return
     */
    private MailRepository getRepository(String userName) {
        MailRepository userInbox;
        if (repositoryUrl == null) {
            userInbox = mailServer.getUserInbox(userName);
        } else {
            StringBuffer destinationBuffer = new StringBuffer(192).append(
                    repositoryUrl).append(userName).append("/");
View Full Code Here

Examples of org.apache.james.services.MailRepository

        try
        {
            String type = repConf.getAttribute("type");
            String repID = destination + type;
            MailRepository reply = (MailRepository) repositories.get(repID);
            if (reply != null) {
                getLogger().debug("obtained repository: " + repID
                                  + "," + reply.getClass());
                return (Component)reply;
            } else {
                String repClass = (String) classes.get( protocol + type );

                getLogger().debug( "Need instance of " + repClass +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.