01: package org.claros.commons.mail.models;
02:
03: import java.util.HashMap;
04:
05: import org.apache.commons.logging.Log;
06: import org.apache.commons.logging.LogFactory;
07:
08: /**
09: * @author Umut Gokbayrak
10: */
11: public class ConnectionProfileList {
12: private static Log log = LogFactory
13: .getLog(ConnectionProfileList.class);
14: public static HashMap conList = new HashMap();
15:
16: /**
17: *
18: */
19: public ConnectionProfileList() {
20: super ();
21: }
22:
23: public void addConnectionProfile(ConnectionProfile con) {
24: if (con == null)
25: return;
26: conList.put(con.getShortName(), con);
27: }
28:
29: public static HashMap getConList() {
30: return conList;
31: }
32:
33: public static ConnectionProfile getProfileByShortName(
34: String shortName) {
35: ConnectionProfile con = (ConnectionProfile) conList
36: .get(shortName);
37: if (con == null) {
38: log
39: .warn("The Shortname searched at the ConnectionProfileList does not correspond to a ConnectionProfile");
40: return null;
41: }
42: return con;
43: }
44: }
|