01: package org.gridsphere.services.core.filter.impl.descriptor;
02:
03: import org.gridsphere.portlet.service.spi.impl.descriptor.ConfigParam;
04: import org.gridsphere.portlet.service.spi.impl.descriptor.Description;
05:
06: import java.util.Iterator;
07: import java.util.List;
08: import java.util.Properties;
09: import java.util.Vector;
10:
11: /**
12: * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>
13: * @version $Id: PortalFilterDefinition.java 6385 2007-10-25 14:02:26Z wehrens $
14: */
15: public class PortalFilterDefinition {
16:
17: private String name = "";
18: private List<Description> descriptions = new Vector<Description>();
19: private String implementation = "";
20: private List<ConfigParam> configParamList = new Vector<ConfigParam>();
21: private Properties configProps;
22:
23: public String getName() {
24: return name;
25: }
26:
27: public void setName(String name) {
28: this .name = name;
29: }
30:
31: public List<Description> getDescriptions() {
32: return descriptions;
33: }
34:
35: public void setDescriptions(List<Description> descriptions) {
36: this .descriptions = descriptions;
37: }
38:
39: public String getImplementation() {
40: return implementation;
41: }
42:
43: public void setImplementation(String implementation) {
44: this .implementation = implementation;
45: }
46:
47: public List<ConfigParam> getConfigParamList() {
48: return configParamList;
49: }
50:
51: public void setConfigParamList(List<ConfigParam> configParamList) {
52: this .configParamList = configParamList;
53: }
54:
55: /**
56: * Creates a properties from the ConfigParamList
57: *
58: * @see #getConfigParamList
59: */
60: private void createProperties() {
61: configProps = new Properties();
62: Iterator it = this .configParamList.iterator();
63: ConfigParam param;
64: while (it.hasNext()) {
65: param = (ConfigParam) it.next();
66: configProps.setProperty(param.getParamName(), param
67: .getParamValue());
68: }
69: }
70:
71: /**
72: * Return the configuration properties
73: *
74: * @return the configuration properties
75: */
76: public Properties getConfigProperties() {
77: if (configProps == null)
78: createProperties();
79: return configProps;
80: }
81:
82: }
|