001: /**
002: * EasyBeans
003: * Copyright (C) 2007 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: AbsMail.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.component.mail;
025:
026: import java.util.List;
027: import java.util.Properties;
028:
029: import org.ow2.easybeans.component.util.Property;
030:
031: /**
032: * Default stuff common to common objects.
033: * @author Florent BENOIT
034: */
035: public class AbsMail implements MailItf {
036:
037: /**
038: * Properties for the factories.
039: */
040: private List<Property> mailProperties = null;
041:
042: /**
043: * Name of the factory.
044: */
045: private String name = null;
046:
047: /**
048: * JNDI name of the factory.
049: */
050: private String jndiName = null;
051:
052: /**
053: * Auth properties for this factory.
054: */
055: private Auth auth = null;
056:
057: /**
058: * @return the mail properties.
059: */
060: public Properties getMailSessionProperties() {
061: // Get properties
062: Properties mailSessionProperties = new Properties();
063: if (mailProperties != null) {
064: for (Property property : mailProperties) {
065: mailSessionProperties.put(property.getName(), property
066: .getValue());
067: }
068: }
069: return mailSessionProperties;
070: }
071:
072: /**
073: * @return the name of the factory.
074: */
075: public String getName() {
076: return name;
077: }
078:
079: /**
080: * Set the name of this factory.
081: * @param name the name of this factory
082: */
083: public void setName(final String name) {
084: this .name = name;
085: }
086:
087: /**
088: * @return the JNDI name of the factory.
089: */
090: public String getJNDIName() {
091: return jndiName;
092: }
093:
094: /**
095: * Set the JNDI name of this factory.
096: * @param jndiName the JNDI name of this factory
097: */
098: public void setJNDIName(final String jndiName) {
099: this .jndiName = jndiName;
100: }
101:
102: /**
103: * Gets the list of properties.
104: * @return the list of properties.
105: */
106: public List<Property> getProperties() {
107: return this .mailProperties;
108: }
109:
110: /**
111: * Set the list of properties.
112: * @param mailProperties the list of properties.
113: */
114: public void setProperties(final List<Property> mailProperties) {
115: this .mailProperties = mailProperties;
116: }
117:
118: /**
119: * Set the authenticator.
120: * @param auth the given authenticator
121: */
122: public void setAuth(final Auth auth) {
123: this .auth = auth;
124: }
125:
126: /**
127: * @return the authenticator.
128: */
129: public Auth getAuth() {
130: return this.auth;
131: }
132: }
|