001: /**
002: * $Id: PopConfigBean.java,v 1.4 2005/09/21 10:51:57 dg154973 Exp $
003: * Copyright 2002 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and iPlanet
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.wireless.taglibs.commprefs;
014:
015: import com.sun.portal.log.common.PortalLogger;
016: import com.sun.portal.wireless.util.AppConfigConstants;
017: import com.sun.ssoadapter.config.Configuration;
018:
019: import javax.servlet.jsp.PageContext;
020: import java.util.logging.Level;
021: import java.util.logging.Logger;
022:
023: /**
024: * Config Bean - Config bean corresponding to a mail configuration in
025: * DSAME service (POP Configuration)
026: *
027: * @version 1.0
028: * @see
029: */
030:
031: public class PopConfigBean extends SSOConfigurationBean {
032:
033: private static Logger logger = PortalLogger
034: .getLogger(PopConfigBean.class);
035:
036: /*
037: * Construct a ConfigBean from a <mail:config> tag.
038: * No associated configuration or name yet.
039: */
040: public PopConfigBean(PageContext pageContext) {
041: super ();
042: configuration
043: .setConfigurationDescription(AppConfigConstants.POP_COLLECTIONS_TEMPLATE_NAME);
044: // Get mail context & add new bean
045: MailPrefsContext context = null;
046: try {
047: context = MailPrefsContext.getPrefsContext(pageContext);
048: context.addConfig(this );
049: } catch (Exception e) {
050: logger.log(Level.WARNING, "PSMA_CSPWTP0009", e);
051: }
052: // defaults
053: setProtocol("pop3");
054: setPort("110");
055: }
056:
057: /**
058: * Construct a ConfigBean, given a configuration (called from MailPrefsContext).
059: * @param name
060: * @param configuration
061: */
062: public PopConfigBean(String name, Configuration configuration) {
063: super (name, configuration);
064: setProtocol("pop3");
065: }
066:
067: /**
068: * Properties backed by the Configuration
069: */
070:
071: /**
072: * Get configName (a.k.a name).
073: *
074: * @return configName String
075: */
076: public String getConfigName() {
077: return getName();
078: }
079:
080: public void setConfigName(String name) {
081: setName(name);
082: }
083:
084: public String getProtocol() {
085: return getProperty("protocol");
086: }
087:
088: public void setProtocol(String protocol) {
089: setProperty("protocol", protocol);
090: }
091:
092: public String getHost() {
093: return getProperty("host");
094: }
095:
096: public void setHost(String host) {
097: setProperty("host", host);
098: }
099:
100: public String getPort() {
101: return getProperty("port");
102: }
103:
104: public void setPort(String port) {
105: setProperty("port", port);
106: }
107:
108: public String getUid() {
109: return getProperty("uid");
110: }
111:
112: public void setUid(String uid) {
113: setProperty("uid", uid);
114: }
115:
116: public String getPassword() {
117: return getProperty("password");
118: }
119:
120: public void setPassword(String password) {
121: setProperty("password", password);
122: }
123:
124: public String getPopDelete() {
125: return getProperty("popDelete");
126: }
127:
128: public void setPopDelete(String popDelete) {
129: setProperty("popDelete", popDelete);
130: }
131:
132: }
|