/** * The collection of message recipients. * @return Collection of message recipients. */ public NHINDAddressCollection getRecipients() { if (this.recipients == null) { this.collectRecipients(); } return recipients; }
/** * Constructs an envelope from a message. * @param message The mime message. */ public DefaultMessageEnvelope(Message message) { if (message == null) throw new IllegalArgumentException(); this.message = message; this.setRecipients(this.collectRecipients()); try { if (message.getFrom() == null || message.getFrom().length == 0) throw new AgentException(AgentError.MissingFrom); this.setSender(new NHINDAddress((InternetAddress)message.getFrom()[0], AddressSource.From)); } catch (MessagingException e) { throw new AgentException(AgentError.MissingFrom, e); } }