01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and iPlanet
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */
13:
14: package com.sun.portal.wireless.taglibs.commprefs;
15:
16: import com.sun.portal.log.common.PortalLogger;
17: import com.sun.ssoadapter.config.Configuration;
18:
19: import javax.servlet.jsp.PageContext;
20: import java.util.logging.Level;
21: import java.util.logging.Logger;
22:
23: public class RuleBean extends SSOConfigurationBean {
24:
25: private static Logger logger = PortalLogger
26: .getLogger(RuleBean.class);
27:
28: /*
29: * Construct a RuleBean from a <mail:rule> tag.
30: * No associated configuration or name yet.
31: */
32: public RuleBean(PageContext pageContext) {
33: super ();
34: // Get mail context & add new bean
35: MailPrefsContext context = null;
36: try {
37: context = MailPrefsContext.getPrefsContext(pageContext);
38: context.addRule(this );
39: } catch (Exception e) {
40: logger.log(Level.WARNING, "PSMA_CSPWTP0009", e);
41: }
42: }
43:
44: /**
45: * Construct a RuleBean, given a configuration (called from MailPrefsContext).
46: * @param name
47: * @param configuration
48: */
49: public RuleBean(String name, Configuration configuration) {
50: super (name, configuration);
51: }
52:
53: public String getTarget() {
54: return getProperty("target");
55: }
56:
57: public void setTarget(String target) {
58: setProperty("target", target);
59: }
60:
61: public String getOp() {
62: return getProperty("op");
63: }
64:
65: public void setOp(String op) {
66: setProperty("op", op);
67: }
68:
69: public String getRuleValue() {
70: return getProperty("ruleValue");
71: }
72:
73: public void setRuleValue(String value) {
74: setProperty("ruleValue", value);
75: }
76:
77: }
|