PortletContainerResponse.java :  » Portal » Open-Portal » com » sun » portal » portletcontainercommon » Java Open Source

Java Open Source » Portal » Open Portal 
Open Portal » com » sun » portal » portletcontainercommon » PortletContainerResponse.java
/*
 * Copyright 2002 Sun Microsystems, Inc. All
 * rights reserved. Use of this product is subject
 * to license terms. Federal Acquisitions:
 * Commercial Software -- Government Users
 * Subject to Standard License Terms and
 * Conditions.
 *
 * Sun, Sun Microsystems, the Sun logo, and Sun ONE
 * are trademarks or registered trademarks of Sun Microsystems,
 * Inc. in the United States and other countries.
 */

package com.sun.portal.portletcontainercommon;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.HashMap;
import java.net.URL;

import com.sun.portal.container.ContainerResponse;
import com.sun.portal.container.WindowState;
import com.sun.portal.container.ChannelMode;

/**
 * <code>PortletContainerResponse</code> encapsulates the response from the
 * PAE back to the portlet container.  PAE is responsible to use the set
 * methods to set the results that it wants to return back to the portlet
 * container.  Portlet container can then use the get methods to get the
 * response back.
 **/
public class PortletContainerResponse {

  // key for PortletContainerResponse object in http request attribute
  public static final String PORTLET_CONTAINER_RESPONSE = "portlet_container_response";

  private ContainerResponse _res = null;
  private int _cacheType = 0;
  private PortletContainerErrorCode _errorCode = PortletContainerErrorCode.NO_ERROR;
  private boolean _isCacheValid = false;

  public PortletContainerResponse( ContainerResponse res ) {
      _res = res;
  }

  /**
   * Returns the code of the error that occured during the current operation.
   *
   * @return  <code>PortletContainerErrorCode.NO_ERROR</code> if there is no
   * error, otherwise code defined in PortletContainerErrorCode.
   **/
  public PortletContainerErrorCode getErrorCode() {
      return _errorCode;
  }

  /**
   * Sets the code of the error that occured during the current operation.
   *
   * @param  errorCode   <code>PortletContainerErrorCode.NO_ERROR</code> if
   * there is no error, otherwise code defined in PortletContainerErrorCode.
   */
  public void setErrorCode( PortletContainerErrorCode errorCode ) {
      _errorCode = errorCode;
  }

  /**
   * Returns the HttpServletResponse.
   *
   * @return  the HttpServletResponse
   **/
  public HttpServletResponse getHttpServletResponse() {
      return _res.getHttpServletResponse();
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.