Package org.apache.james.services

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


     *
     * @return the POP3 inbox for the user
     */
    public synchronized MailRepository getUserInbox( String userName )
    {
        MailRepository userInbox = ( MailRepository ) null;

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

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

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

        try
        {
            String type = repConf.getAttribute("type");
            String repID = destination + type;
            MailRepository reply = (MailRepository) repositories.get(repID);
            StringBuffer logBuffer = null;
            if (reply != null) {
                if (getLogger().isDebugEnabled()) {
                    logBuffer =
                        new StringBuffer(128)
                                .append("obtained repository: ")
                                .append(repID)
                                .append(",")
                                .append(reply.getClass());
                    getLogger().debug(logBuffer.toString());
                }
                return (Component)reply;
            } else {
                String key = protocol + type;
View Full Code Here

        try
        {
            String type = repConf.getAttribute("type");
            String repID = destination + type;
            MailRepository reply = (MailRepository) repositories.get(repID);
            StringBuffer logBuffer = null;
            if (reply != null) {
                if (getLogger().isDebugEnabled()) {
                    logBuffer =
                        new StringBuffer(128)
                                .append("obtained repository: ")
                                .append(repID)
                                .append(",")
                                .append(reply.getClass());
                    getLogger().debug(logBuffer.toString());
                }
                return (Component)reply;
            } else {
                String key = protocol + type;
View Full Code Here

     *
     * @return the POP3 inbox for the user
     */
    public synchronized MailRepository getUserInbox( String userName )
    {
        MailRepository userInbox = ( MailRepository ) null;

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

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

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

     *
     * @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

     *
     * @return the POP3 inbox for the user
     */
    public synchronized MailRepository getUserInbox( String userName )
    {
        MailRepository userInbox = ( MailRepository ) null;

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

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

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

TOP

Related Classes of org.apache.james.services.MailRepository

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.