All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jpattern.service.mail.MailRecipients Maven / Gradle / Ivy

There is a newer version: 3.6.2
Show newest version
package com.jpattern.service.mail;

import java.util.ArrayList;

import com.jpattern.service.mail.message.IMessageAddress;
import com.jpattern.service.mail.message.IRecipient;
import com.jpattern.service.mail.message.IRecipients;
import com.jpattern.service.mail.message.Recipients;

/**
 * 
 * @author Claudio Quaresima - [email protected] - 01/set/09 22:38:57
 *
 * @version $Id$
 */
public class MailRecipients implements IRecipients {

    private static final long serialVersionUID = 1L;
    private IRecipients _recipients;
    private ArrayList _ccrecipients;
    private ArrayList _bccrecipients;

    public MailRecipients() {
        _recipients = new Recipients();
        _ccrecipients = new ArrayList();
        _bccrecipients = new ArrayList();        
    }
    
    public void from(IRecipient aRecipient) {
        _recipients.from( aRecipient );
    }
    
    public void addRecipient(IRecipient aRecipient) {
        _recipients.addRecipient(aRecipient);
    }
    
 
    public void addRecipient(CCRecipient aRecipient) {
        _ccrecipients.add(aRecipient);
    }

    public void addRecipient(BCCRecipient aRecipient) {
        _bccrecipients.add(aRecipient);
        
    }

    public void writeOnMessage(MailMessageAddress aMessageAddress) {
       
    	aMessageAddress.cc(  _ccrecipients);
    	
        aMessageAddress.bcc(  _bccrecipients);
        
        writeOn(aMessageAddress);
    }
    
    public void writeOn(IMessageAddress aMessageAddress) {
   
    	_recipients.writeOn(aMessageAddress);
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy