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 Sun ONE
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.portletcontainercommon;
15:
16: import javax.servlet.http.HttpServletResponse;
17: import java.util.List;
18: import java.util.HashMap;
19: import java.net.URL;
20:
21: import com.sun.portal.container.ContainerResponse;
22: import com.sun.portal.container.WindowState;
23: import com.sun.portal.container.ChannelMode;
24:
25: /**
26: * <code>PortletContainerResponse</code> encapsulates the response from the
27: * PAE back to the portlet container. PAE is responsible to use the set
28: * methods to set the results that it wants to return back to the portlet
29: * container. Portlet container can then use the get methods to get the
30: * response back.
31: **/
32: public class PortletContainerResponse {
33:
34: // key for PortletContainerResponse object in http request attribute
35: public static final String PORTLET_CONTAINER_RESPONSE = "portlet_container_response";
36:
37: private ContainerResponse _res = null;
38: private int _cacheType = 0;
39: private PortletContainerErrorCode _errorCode = PortletContainerErrorCode.NO_ERROR;
40: private boolean _isCacheValid = false;
41:
42: public PortletContainerResponse(ContainerResponse res) {
43: _res = res;
44: }
45:
46: /**
47: * Returns the code of the error that occured during the current operation.
48: *
49: * @return <code>PortletContainerErrorCode.NO_ERROR</code> if there is no
50: * error, otherwise code defined in PortletContainerErrorCode.
51: **/
52: public PortletContainerErrorCode getErrorCode() {
53: return _errorCode;
54: }
55:
56: /**
57: * Sets the code of the error that occured during the current operation.
58: *
59: * @param errorCode <code>PortletContainerErrorCode.NO_ERROR</code> if
60: * there is no error, otherwise code defined in PortletContainerErrorCode.
61: */
62: public void setErrorCode(PortletContainerErrorCode errorCode) {
63: _errorCode = errorCode;
64: }
65:
66: /**
67: * Returns the HttpServletResponse.
68: *
69: * @return the HttpServletResponse
70: **/
71: public HttpServletResponse getHttpServletResponse() {
72: return _res.getHttpServletResponse();
73: }
74:
75: }
|