KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > core > theme > strategy > impl > StrategyResponseImpl


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.portal.core.theme.strategy.impl;
9
10 import org.jboss.portal.server.plugins.windowstate.WindowState;
11 import org.jboss.portal.server.theme.strategy.PortletContext;
12 import org.jboss.portal.server.theme.strategy.StrategyResponse;
13
14 import java.util.ArrayList JavaDoc;
15 import java.util.Collections JavaDoc;
16 import java.util.HashMap JavaDoc;
17 import java.util.List JavaDoc;
18 import java.util.Map JavaDoc;
19
20 /**
21  * Implementation of the strategy response.
22  *
23  * @author <a HREF="mailto:mholzner@novell.com">Martin Holzner</a>.
24  * @version <tt>$Revision: 1.7 $</tt>
25  * @see StrategyResponse
26  */

27 public class StrategyResponseImpl implements StrategyResponse
28 {
29    private String JavaDoc state;
30    private String JavaDoc layoutURI;
31    private Map JavaDoc stateChangeMap;
32    private List JavaDoc noRenderList;
33    private List JavaDoc modifiedPortletList;
34
35    /**
36     * Create a new instance of a response.
37     */

38    public StrategyResponseImpl()
39    {
40       this.stateChangeMap = new HashMap JavaDoc(5);
41       this.noRenderList = new ArrayList JavaDoc(5);
42       this.modifiedPortletList = new ArrayList JavaDoc(5);
43    }
44
45    /**
46     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#getLayoutURI()
47     */

48    public String JavaDoc getLayoutURI()
49    {
50       return layoutURI;
51    }
52
53    /**
54     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#getWindowStateChangeMap()
55     */

56    public Map JavaDoc getWindowStateChangeMap()
57    {
58       return Collections.unmodifiableMap(stateChangeMap);
59    }
60
61    /**
62     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#getExcludedList()
63     */

64    public List JavaDoc getExcludedList()
65    {
66       return Collections.unmodifiableList(noRenderList);
67    }
68
69    /**
70     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#getModifiedPortletContextList()
71     */

72    public List JavaDoc getModifiedPortletContextList()
73    {
74       return Collections.unmodifiableList(modifiedPortletList);
75    }
76
77    /**
78     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#addNoRender(org.jboss.portal.server.theme.strategy.PortletContext)
79     */

80    public void addNoRender(PortletContext portlet)
81    {
82       if (portlet == null)
83       {
84          throw new NullPointerException JavaDoc("portlet reference is null");
85       }
86       noRenderList.add(portlet);
87    }
88
89    /**
90     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#addModified(org.jboss.portal.server.theme.strategy.PortletContext)
91     */

92    public void addModified(PortletContext portlet)
93    {
94       throw new UnsupportedOperationException JavaDoc("Currently not implemented");
95    }
96
97    /**
98     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#addWindowStateChange
99     */

100    public void addWindowStateChange(PortletContext portlet, WindowState state)
101    {
102       if (portlet == null || state == null)
103       {
104          throw new NullPointerException JavaDoc("portlet reference and/or state is null");
105       }
106       stateChangeMap.put(portlet, state);
107    }
108
109    /**
110     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#reset
111     */

112    public void reset()
113    {
114       stateChangeMap.clear();
115       noRenderList.clear();
116       modifiedPortletList.clear();
117       layoutURI = null;
118       state = null;
119    }
120
121    /**
122     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#setURI
123     */

124    public void setURI(String JavaDoc layoutURI)
125    {
126       this.layoutURI = layoutURI;
127    }
128
129    /**
130     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#setState
131     */

132    public void setState(String JavaDoc state)
133    {
134       this.state = state;
135    }
136
137    /**
138     * @see org.jboss.portal.server.theme.strategy.StrategyResponse#getState
139     */

140    public String JavaDoc getState()
141    {
142       return state;
143    }
144 }
145
Popular Tags