You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@portals.apache.org by ta...@apache.org on 2015/07/13 18:40:01 UTC
svn commit: r1690750 [5/6] - in
/portals/portlet-spec/trunk/portlet-api_2.1.0_spec: ./ src/ src/main/
src/main/appended-resources/ src/main/appended-resources/META-INF/
src/main/java/ src/main/java/META-INF/ src/main/java/javax/
src/main/java/javax/por...
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/UnavailableException.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/UnavailableException.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/UnavailableException.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/UnavailableException.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,135 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+/**
+ * The portlet should throw the <CODE>UnavailableException</CODE> when
+ * the portlet is either temporarily or permanently unavailable to handle requests.
+ *
+ **/
+
+public class UnavailableException extends PortletException
+{
+
+ private boolean permanent; // needs admin action?
+ private int seconds; // unavailability estimate
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ * Constructs a new exception with a descriptive
+ * message indicating that the portlet is permanently
+ * unavailable.
+ *
+ * @param text a <code>String</code> specifying the
+ * descriptive message
+ *
+ */
+
+ public UnavailableException(String text) {
+ super(text);
+
+ permanent = true;
+ }
+
+ /**
+ * Constructs a new exception with a descriptive message
+ * indicating that the portlet is temporarily unavailable
+ * and giving an estimate of how long it will be unavailable.
+ *
+ * <p>In some cases, the portlet cannot make an estimate. For
+ * example, the portlet might know that a server it needs is
+ * not running, but it might not be able to report how long it will take
+ * to be restored to functionality. This can be indicated with
+ * a negative or zero value for the <code>seconds</code> argument.
+ *
+ * @param text a <code>String</code> specifying the
+ * descriptive message. This message can be written
+ * to a log file or displayed for the user.
+ *
+ * @param seconds an integer specifying the number of seconds
+ * for which the portlet expects to be unavailable; if
+ * this is zero or negative, it indicates that the portlet
+ * cannot make an estimate.
+ *
+ */
+
+ public UnavailableException(String text, int seconds) {
+ super(text);
+
+ if (seconds <= 0)
+ this.seconds = -1;
+ else
+ this.seconds = seconds;
+
+ permanent = false;
+ }
+
+ /**
+ *
+ * Returns a <code>boolean</code> indicating
+ * whether the portlet is permanently unavailable.
+ * If so, something is wrong with the portlet, and the
+ * system administrator must take some corrective action.
+ *
+ * @return <code>true</code> if the portlet is
+ * permanently unavailable; <code>false</code>
+ * if the portlet is temporarily
+ * unavailable.
+ *
+ */
+
+ public boolean isPermanent() {
+ return permanent;
+ }
+
+
+ /**
+ * Returns the time in seconds for which the portlet can be expected to
+ * be unavailable.
+ * <p>
+ * If the portlet is called again while it is still unavailable, it
+ * indicates the same time estimate. No effort is
+ * made to correct for the time elapsed since the exception was
+ * first reported.
+ * <p>
+ * If this method returns zero or a negative number, the portlet
+ * is permanently unavailable or cannot provide an estimate of
+ * how long it will be unavailable.
+ *
+ * @return an integer specifying the number of seconds
+ * the portlet will be temporarily unavailable,
+ * or zero or a negative number if the portlet is permanently
+ * unavailable or cannot make an estimate.
+ *
+ */
+
+ public int getUnavailableSeconds() {
+ return permanent ? -1 : seconds;
+ }
+
+
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/ValidatorException.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/ValidatorException.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/ValidatorException.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/ValidatorException.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,133 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+
+/**
+ * The <CODE>ValidatorException</CODE> is thrown by the
+ * <CODE>validate</CODE> method of a PreferencesValidator when
+ * the validation of a preference failed.
+ */
+
+public class ValidatorException extends PortletException
+{
+
+ private transient ArrayList<String> failedKeyVector = new ArrayList<String>();
+ private static final long serialVersionUID = 1L;
+
+ private ValidatorException ()
+ {
+ }
+
+ /**
+ * Constructs a new validator exception with the given text. The
+ * portlet container may use the text write it to a log.
+ * <p>
+ * The collection of failed keys may contain all failed keys, only the
+ * first key that failed validation, or may be <code>null</code>.
+ *
+ * @param text
+ * the exception text
+ * @param failedKeys
+ * keys that failed the validation; may be <code>null</code>
+ */
+
+ public ValidatorException (String text, Collection<String> failedKeys)
+ {
+ super (text);
+ if ( failedKeys != null )
+ failedKeyVector.addAll(failedKeys);
+ }
+
+ /**
+ * Constructs a new portlet validator exception.
+ * Used, when the portlet needs to do one of the following:
+ * <ul>
+ * <li>throw an exception
+ * <li>include a message about the "root cause" that interfered
+ * with its normal operation
+ * <li>include a description message
+ * </ul>
+ * <p>
+ * The Collection of failed keys may contain all failed keys, only the
+ * first key that failed validation, or may be <code>null</code>.
+ *
+ * @param text
+ * the exception text
+ * @param cause
+ * the root cause
+ * @param failedKeys
+ * keys that failed the validation; may be <code>null</code>
+ */
+
+ public ValidatorException (String text, Throwable cause, Collection<String> failedKeys)
+ {
+ super(text, cause);
+ if ( failedKeys != null )
+ failedKeyVector.addAll(failedKeys);
+ }
+
+ /**
+ * Constructs a new portlet validator exception when the portlet needs to throw an
+ * exception. The exception message is based on the localized message
+ * of the underlying exception.
+ * <p>
+ * The Collection of failed keys may contain all failed keys, only the
+ * first key that failed validation, or may be <code>null</code>.
+ *
+ * @param cause
+ * the root cause
+ * @param failedKeys
+ * keys that failed the validation; may be <code>null</code>
+ */
+
+ public ValidatorException (Throwable cause, Collection<String> failedKeys)
+ {
+ super(cause);
+ if ( failedKeys != null )
+ failedKeyVector.addAll(failedKeys);
+ }
+
+
+ /**
+ * Returns the keys that failed the validation.
+ * <p>
+ * The Enumeration of failed keys may contain all failed keys, only the
+ * first key that failed validation, or an empty
+ * <code>Enumeration</code> if no failed keys are available.
+ *
+ * @return the keys that failed validation, or an empty
+ * <code>Enumeration</code> if no failed keys are available.
+ */
+
+ public Enumeration<String> getFailedKeys()
+ {
+ return Collections.enumeration(failedKeyVector);
+ }
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/WindowState.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/WindowState.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/WindowState.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/WindowState.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,137 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+import java.util.Locale;
+
+
+/**
+ * The <CODE>WindowState</CODE> class represents
+ * the possible window states that a portlet window can assume.
+ * <P>
+ * This class defines a standard set of the most basic portlet window states.
+ * Additional window states may be defined by calling the constructor of
+ * this class. If a portal/portlet-container does not support a
+ * custom window state defined in the portlet application deployment descriptor,
+ * the custom window state will be ignored by the portal/portlet container.
+ */
+
+public class WindowState
+{
+
+ /**
+ * The <code>NORMAL</code> window state indicates that a portlet
+ * may be sharing the page with other portlets. It may also
+ * indicate that the target device has limited display capabilities.
+ * Therefore, a portlet should restrict the size of its rendered
+ * output in this window state.
+ * <p>
+ * The string value for this state is <code>"normal"</code>.
+ */
+ public final static WindowState NORMAL = new WindowState ("normal");
+
+ /**
+ * The <code>MAXIMIZED</code> window state is an indication
+ * that a portlet may be the only portlet being rendered in the
+ * portal page, or that the portlet has more space compared to other portlets
+ * in the portal page. A portlet may generate richer content
+ * when its window state is <code>MAXIMIZED</code>.
+ * <p>
+ * The string value for this state is <code>"maximized"</code>.
+ */
+ public final static WindowState MAXIMIZED = new WindowState ("maximized");
+
+ /**
+ * When a portlet is in <code>MINIMIZED</code> window state,
+ * the portlet should only render minimal output or no output at all.
+ * <p>
+ * The string value for this state is <code>"minimized"</code>.
+ */
+ public final static WindowState MINIMIZED = new WindowState ("minimized");
+
+
+
+ private String _name;
+
+
+ /**
+ * Creates a new window state with the given name.
+ * <p>
+ * Upper case letters in the name are converted to
+ * lower case letters.
+ *
+ * @param name The name of the window state
+ */
+ public WindowState(String name) {
+ if (name==null) {
+ throw new IllegalArgumentException("WindowState name can not be NULL");
+ }
+ _name = name.toLowerCase(Locale.ENGLISH);
+ }
+
+ /**
+ * Returns a String representation of this window state.
+ * Window state names are always lower case names.
+ *
+ * @return String representation of this window state.
+ */
+
+ public String toString() {
+ return _name;
+ }
+
+
+ /**
+ * Returns the hash code value for this window state.
+ * The hash code is constructed by producing the
+ * hash value of the String value of this window state.
+ *
+ * @return hash code value for this window state
+ */
+
+ public int hashCode() {
+ return _name.hashCode();
+ }
+
+
+ /**
+ * Compares the specified object with this window state
+ * for equality. Returns <code>true</code> if the
+ * Strings <code>equals</code> method for the String
+ * representing the two window states returns <code>true</code>.
+ *
+ * @param object the window state to compare this window state with.
+ *
+ * @return true, if the specified object is equal with this window state.
+ */
+
+ public boolean equals(Object object) {
+ if ( object instanceof WindowState )
+ return _name.equals(((WindowState) object)._name);
+ else
+ return false;
+ }
+}
+
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/WindowStateException.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/WindowStateException.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/WindowStateException.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/WindowStateException.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,106 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet;
+
+/**
+ ** The <CODE>WindowStateException</CODE> is thrown when a portlet
+ ** tries to use a window state that is not supported by the current
+ ** runtime environment or the portlet.
+ **/
+
+public class WindowStateException extends PortletException
+{
+
+ private transient WindowState _state = null;
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructs a new portlet state exception with the given text. The
+ * portlet container may use the text write it to a log.
+ *
+ * @param text
+ * the exception text
+ * @param state
+ * the state causing the exception
+ */
+
+ public WindowStateException (String text, WindowState state)
+ {
+ super (text);
+ _state = state;
+ }
+
+ /**
+ * Constructs a new portlet state exception when the portlet needs to do
+ * the following:
+ * <ul>
+ * <il>throw an exception
+ * <li>include a message about the "root cause" that interfered
+ * with its normal operation
+ * <li>include a description message
+ * </ul>
+ *
+ * @param text
+ * the exception text
+ * @param cause
+ * the root cause
+ * @param state
+ * the state causing the exception
+ */
+
+ public WindowStateException (String text, Throwable cause, WindowState state)
+ {
+ super(text, cause);
+ _state = state;
+ }
+
+ /**
+ * Constructs a new portlet state exception when the portlet needs to throw an
+ * exception. The exception message is based on the localized message
+ * of the underlying exception.
+ *
+ * @param cause
+ * the root cause
+ * @param state
+ * the state causing the exception
+ */
+
+ public WindowStateException (Throwable cause, WindowState state)
+ {
+ super(cause);
+ _state = state;
+ }
+
+ /**
+ * Returns the portlet state causing this exception.
+ *
+ * @return the window state causing this exception
+ */
+
+ public WindowState getState()
+ {
+ return _state;
+ }
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionFilter.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionFilter.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionFilter.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionFilter.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,113 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+
+/**
+ * The <code>ActionFilter</code> is an object that performs filtering
+ * tasks on either the action request to a portlet, or on the action response from
+ * a portlet, or both.
+ * <p>
+ * Filters perform filtering in the <code>doFilter</code> method. Every Filter has
+ * access to a <code>FilterConfig</code> object from which it can obtain
+ * its initialization parameters, a reference to the PortletContext
+ * which it can use, for example, to load resources needed for filtering tasks.
+ * <p>
+ * Filters are configured in the portlet deployment descriptor of a
+ * portlet application.
+ *
+ * @since 2.0
+ */
+public interface ActionFilter extends PortletFilter {
+
+
+ /**
+ * The <code>doFilter</code> method of the Filter is called by the
+ * portlet container each time a action request/response pair is passed
+ * through the chain due to a client request for a portlet method
+ * at the end of the chain.
+ * <p>
+ * The <code>FilterChain</code> passed in to this method allows
+ * the Filter to pass on the action request and response to the next
+ * component in the chain.
+ * <p>
+ * The <code>doFilter</code> method of a filter will typically be implemented
+ * following this or some subset of the following pattern:
+ * <ul>
+ * <li>The method examines the request information.</li>
+ * <li>The method may wrap the request object passed in to
+ * its doFilter method with a customized implementation
+ * the request wrapper <code>ActionRequestWrapper</code>
+ * in order to modify request data.</li>
+ * <li>The method may wrap the response object passed in to its
+ * <code>doFilter</code> method with a customized implementation
+ * of the response wrapper <code>ActionResponseWrapper</code>
+ * to modify response data.</li>
+ * <li>The filter may invoke the next component in the filter chain.
+ * The next component may be another filter, or if the filter
+ * making the invocation is the last filter configured in the
+ * deployment descriptor for this chain, the next component
+ * is the target method of the portlet. The invocation of the
+ * next component is effected by calling the <code>doFilter</code>
+ * method on the <code>FilterChain</code> object, and passing in
+ * the request and response with which it was called or passing
+ * in wrapped versions it may have created.
+ * The filter chain's implementation of the <code>doFilter</code>
+ * method, provided by the portlet container, must locate the
+ * next component in the filter chain and invoke its <code>doFilter</code>
+ * method, passing in the appropriate request and response objects.
+ * Alternatively, the filter chain can block the request by not
+ * making the call to invoke the next component, leaving the filter
+ * responsible for filling out the response object.</li>
+ * <li>After invocation of the next filter in the chain, the filter
+ * may examine the response data.</li>
+ * <li>Alternatively, the filter may have thrown an exception to
+ * indicate an error in processing. If the filter throws an
+ * <code>UnavailableException</code> during its <code>doFilter</code>
+ * processing, the portlet container must not attempt continued
+ * processing down the filter chain. It may choose to retry the
+ * whole chain at a later time if the exception is not marked permanent.</li>
+ * <li>When the last filter in the chain has been invoked, the next
+ * component accessed is the target method on the portlet at
+ * the end of the chain.</li>
+ * </ul>
+ *
+ * @param request the current action request
+ * @param response the current action response
+ * @param chain the remaining filter chain
+ * @throws IOException if an IO error occurred in the filter processing
+ * @throws PortletException if a portlet exception occurred in the filter processing
+ */
+ public void doFilter(ActionRequest request, ActionResponse response,
+ FilterChain chain)
+ throws IOException, PortletException;
+
+
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionRequestWrapper.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionRequestWrapper.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionRequestWrapper.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,142 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import javax.portlet.ActionRequest;
+
+/**
+ * The <code>ActionRequestWrapper</code> provides a convenient
+ * implementation of the <code>ActionRequest</code> interface
+ * that can be subclassed by developers wishing to adapt the request.
+ * This class implements the Wrapper or Decorator pattern.
+ * Methods default to calling through to the wrapped request object.
+ *
+ * @since 2.0
+ * @see ActionRequest
+ */
+public class ActionRequestWrapper extends PortletRequestWrapper implements ActionRequest {
+
+ ActionRequest request;
+
+ /**
+ * Creates an <code>ActionRequest</code> adaptor
+ * wrapping the given request object.
+ *
+ * @param request the action request to wrap
+ * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+ */
+ public ActionRequestWrapper(ActionRequest request) {
+ super(request);
+ this.request = request;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getCharacterEncoding()</code> on the wrapped request object.
+ */
+ public String getCharacterEncoding() {
+ return request.getCharacterEncoding();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getContentLength()</code> on the wrapped request object.
+ */
+ public int getContentLength() {
+ return request.getContentLength();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getContentType()</code> on the wrapped request object.
+ */
+ public String getContentType() {
+ return request.getContentType();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletInputStream()</code> on the wrapped request object.
+ */
+ public InputStream getPortletInputStream() throws IOException {
+ return request.getPortletInputStream();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getReader()</code> on the wrapped request object.
+ */
+ public BufferedReader getReader() throws UnsupportedEncodingException,
+ IOException {
+ return request.getReader();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setCharacterEncoding(String enc)</code>
+ * on the wrapped request object.
+ */
+ public void setCharacterEncoding(String enc)
+ throws UnsupportedEncodingException {
+ request.setCharacterEncoding(enc);
+ }
+
+
+ /**
+ * Return the wrapped request object.
+ *
+ * @return the wrapped request
+ */
+ public ActionRequest getRequest() {
+ return request;
+ }
+
+ /**
+ * Sets the request object being wrapped.
+ *
+ * @param request the request to set
+ * @throws java.lang.IllegalArgumentException if the request is null.
+ */
+ public void setRequest(ActionRequest request) {
+ if ( request == null)
+ throw new java.lang.IllegalArgumentException("Request is null");
+
+ this.request = request;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getMethod()</code> on the wrapped request object.
+ */
+ public String getMethod() {
+ return request.getMethod();
+ }
+
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionResponseWrapper.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionResponseWrapper.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/ActionResponseWrapper.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,191 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.xml.namespace.QName;
+
+/**
+ * The <code>ActionResponseWrapper</code> provides a convenient
+ * implementation of the <code>ActionResponse</code> interface
+ * that can be subclassed by developers wishing to adapt the response.
+ * This class implements the Wrapper or Decorator pattern.
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see ActionResponse
+ */
+public class ActionResponseWrapper extends PortletResponseWrapper implements ActionResponse {
+
+ ActionResponse response;
+
+ /**
+ * Creates an <code>ActionResponse</code> adaptor
+ * wrapping the given response object.
+ *
+ * @param response the action response to wrap
+ * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+ */
+ public ActionResponseWrapper(ActionResponse response) {
+ super(response);
+ this.response = response;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>sendRedirect(location)</code> on the wrapped response object.
+ */
+ public void sendRedirect(String location) throws IOException {
+ response.sendRedirect(location);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>sendRedirect(location, renderUrlParamName)</code> on the wrapped response object.
+ */
+ public void sendRedirect(String location, String renderUrlParamName) throws IOException {
+ response.sendRedirect(location, renderUrlParamName);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setEvent(name, value)</code> on the wrapped response object.
+ */
+ public void setEvent(QName name, java.io.Serializable value) {
+ response.setEvent(name, value);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setPortletMode(portletMode)</code> on the wrapped response object.
+ */
+ public void setPortletMode(PortletMode portletMode)
+ throws PortletModeException {
+ response.setPortletMode(portletMode);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameter(key, value)</code> on the wrapped response object.
+ */
+ public void setRenderParameter(String key, String value) {
+ response.setRenderParameter(key, value);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameter(key, value)</code> on the wrapped response object.
+ */
+ public void setRenderParameter(String key, String[] values) {
+ response.setRenderParameter(key, values);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameters(parameters)</code> on the wrapped response object.
+ */
+ public void setRenderParameters(Map<String, String[]> parameters) {
+ response.setRenderParameters(parameters);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setWindowState(windowState)</code> on the wrapped response object.
+ */
+ public void setWindowState(WindowState windowState)
+ throws WindowStateException {
+ response.setWindowState(windowState);
+ }
+
+ /**
+ * Return the wrapped response object.
+ *
+ * @return the wrapped response
+ */
+ public ActionResponse getResponse() {
+ return response;
+ }
+
+ /**
+ * Sets the response object being wrapped.
+ *
+ * @param response the response to set
+ * @throws java.lang.IllegalArgumentException if the response is null.
+ */
+ public void setResponse(ActionResponse response) {
+ if ( response == null)
+ throw new java.lang.IllegalArgumentException("Response is null");
+
+ this.response = response;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletMode()</code> on the wrapped response object.
+ */
+ public PortletMode getPortletMode() {
+ return response.getPortletMode();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getRenderParameterMap()</code> on the wrapped response object.
+ */
+ public Map<String, String[]> getRenderParameterMap() {
+ return response.getRenderParameterMap();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getWindowState()</code> on the wrapped response object.
+ */
+ public WindowState getWindowState() {
+ return response.getWindowState();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setEvent()</code> on the wrapped response object.
+ */
+ public void setEvent(String name, java.io.Serializable value) {
+ response.setEvent(name, value);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>removePublicRenderParameter()</code> on the wrapped response object.
+ */
+ public void removePublicRenderParameter(String name) {
+ response.removePublicRenderParameter(name);
+ }
+
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventFilter.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventFilter.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventFilter.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventFilter.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,112 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.io.IOException;
+
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.PortletException;
+
+/**
+ * The <code>EventFilter</code> is an object that performs filtering
+ * tasks on either the event request to a portlet, or on the event response from
+ * a portlet, or both.
+ * <p>
+ * Filters perform filtering in the <code>doFilter</code> method. Every Filter has
+ * access to a <code>FilterConfig</code> object from which it can obtain
+ * its initialization parameters, a reference to the PortletContext
+ * which it can use, for example, to load resources needed for filtering tasks.
+ * <p>
+ * Filters are configured in the portlet deployment descriptor of a
+ * portlet application.
+ *
+ * @since 2.0
+ */
+public interface EventFilter extends PortletFilter {
+
+
+ /**
+ * The <code>doFilter</code> method of the Filter is called by the
+ * portlet container each time a event request/response pair is passed
+ * through the chain due to a client request for a portlet method
+ * at the end of the chain.
+ * <p>
+ * The <code>FilterChain</code> passed in to this method allows
+ * the Filter to pass on the event request and response to the next
+ * component in the chain.
+ * <p>
+ * The <code>doFilter</code> method of a filter will typically be implemented
+ * following this or some subset of the following pattern:
+ * <ul>
+ * <li>The method examines the request information.</li>
+ * <li>The method may wrap the request object passed in to
+ * its doFilter method with a customized implementation
+ * the request wrapper <code>ActionRequestWrapper</code>
+ * in order to modify request data.</li>
+ * <li>The method may wrap the response object passed in to its
+ * <code>doFilter</code> method with a customized implementation
+ * of the response wrapper <code>ActionResponseWrapper</code>
+ * to modify response data.</li>
+ * <li>The filter may invoke the next component in the filter chain.
+ * The next component may be another filter, or if the filter
+ * making the invocation is the last filter configured in the
+ * deployment descriptor for this chain, the next component
+ * is the target method of the portlet. The invocation of the
+ * next component is effected by calling the <code>doFilter</code>
+ * method on the <code>FilterChain</code> object, and passing in
+ * the request and response with which it was called or passing
+ * in wrapped versions it may have created.
+ * The filter chain's implementation of the <code>doFilter</code>
+ * method, provided by the portlet container, must locate the
+ * next component in the filter chain and invoke its <code>doFilter</code>
+ * method, passing in the appropriate request and response objects.
+ * Alternatively, the filter chain can block the request by not
+ * making the call to invoke the next component, leaving the filter
+ * responsible for filling out the response object.</li>
+ * <li>After invocation of the next filter in the chain, the filter
+ * may examine the response data.</li>
+ * <li>Alternatively, the filter may have thrown an exception to
+ * indicate an error in processing. If the filter throws an
+ * <code>UnavailableException</code> during its <code>doFilter</code>
+ * processing, the portlet container must not attempt continued
+ * processing down the filter chain. It may choose to retry the
+ * whole chain at a later time if the exception is not marked permanent.</li>
+ * <li>When the last filter in the chain has been invoked, the next
+ * component accessed is the target method on the portlet at
+ * the end of the chain.</li>
+ * </ul>
+ *
+ * @param request the current event request
+ * @param response the current event response
+ * @param chain the remaining filter chain
+ * @throws IOException if an IO error occurred in the filter processing
+ * @throws PortletException if a portlet exception occurred in the filter processing
+ */
+ public void doFilter(EventRequest request, EventResponse response,
+ FilterChain chain)
+ throws IOException, PortletException;
+
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventRequestWrapper.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventRequestWrapper.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventRequestWrapper.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,96 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import javax.portlet.Event;
+import javax.portlet.EventRequest;
+
+/**
+ * The <code>EventRequestWrapper</code> provides a convenient
+ * implementation of the <code>EventRequest</code> interface
+ * that can be subclassed by developers wishing to adapt the request.
+ * This class implements the Wrapper or Decorator pattern.
+ * Methods default to calling through to the wrapped request object.
+ *
+ * @since 2.0
+ * @see EventRequest
+ */
+public class EventRequestWrapper extends PortletRequestWrapper implements EventRequest {
+
+ EventRequest request;
+
+
+ /**
+ * Creates an <code>EventRequest</code> adaptor
+ * wrapping the given request object.
+ *
+ * @param request the event request to wrap
+ * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+ */
+ public EventRequestWrapper(EventRequest request) {
+ super(request);
+ this.request = request;
+ }
+
+ /**
+ * Return the wrapped request object.
+ *
+ * @return the wrapped request
+ */
+ public EventRequest getRequest() {
+ return request;
+ }
+
+ /**
+ * Sets the request object being wrapped.
+ *
+ * @param request the request to set
+ * @throws java.lang.IllegalArgumentException if the request is null.
+ */
+ public void setRequest(EventRequest request) {
+ if ( request == null)
+ throw new java.lang.IllegalArgumentException("Request is null");
+
+ this.request = request;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getEvent()</code> on the wrapped request object.
+ */
+ public Event getEvent() {
+ return request.getEvent();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getMethod()</code> on the wrapped request object.
+ */
+ public String getMethod() {
+ return request.getMethod();
+ }
+
+
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventResponseWrapper.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventResponseWrapper.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/EventResponseWrapper.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,184 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.util.Map;
+
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.xml.namespace.QName;
+
+/**
+ * The <code>EventResponseWrapper</code> provides a convenient
+ * implementation of the <code>EventResponse</code> interface
+ * that can be subclassed by developers wishing to adapt the response.
+ * This class implements the Wrapper or Decorator pattern.
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see EventResponse
+ */
+
+public class EventResponseWrapper extends PortletResponseWrapper implements EventResponse {
+
+ EventResponse response;
+
+ /**
+ * Creates an <code>EventResponse</code> adaptor
+ * wrapping the given response object.
+ *
+ * @param response the event response to wrap
+ * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+ */
+ public EventResponseWrapper(EventResponse response) {
+ super(response);
+ this.response = response;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setEvent(name, value)</code> on the wrapped response object.
+ */
+ public void setEvent(QName name, java.io.Serializable value) {
+ response.setEvent(name, value);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setPortletMode(portletMode)</code> on the wrapped response object.
+ */
+ public void setPortletMode(PortletMode portletMode)
+ throws PortletModeException {
+ response.setPortletMode(portletMode);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameter(key, value)</code> on the wrapped response object.
+ */
+ public void setRenderParameter(String key, String value) {
+ response.setRenderParameter(key, value);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameter(key, value)</code> on the wrapped response object.
+ */
+ public void setRenderParameter(String key, String[] values) {
+ response.setRenderParameter(key, values);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameters(parameters)</code> on the wrapped response object.
+ */
+ public void setRenderParameters(Map<String, String[]> parameters) {
+ response.setRenderParameters(parameters);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setWindowState(windowState)</code> on the wrapped response object.
+ */
+ public void setWindowState(WindowState windowState)
+ throws WindowStateException {
+ response.setWindowState(windowState);
+ }
+
+ /**
+ * Return the wrapped response object.
+ *
+ * @return the wrapped response
+ */
+ public EventResponse getResponse() {
+ return response;
+ }
+
+ /**
+ * Sets the response object being wrapped.
+ *
+ * @param response the response to set
+ * @throws java.lang.IllegalArgumentException if the response is null.
+ */
+ public void setResponse(EventResponse response) {
+ if ( response == null)
+ throw new java.lang.IllegalArgumentException("Response is null");
+
+ this.response = response;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletMode()</code> on the wrapped response object.
+ */
+ public PortletMode getPortletMode() {
+ return response.getPortletMode();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getRenderParameterMap()</code> on the wrapped response object.
+ */
+ public Map<String, String[]> getRenderParameterMap() {
+ return response.getRenderParameterMap();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getWindowState()</code> on the wrapped response object.
+ */
+ public WindowState getWindowState() {
+ return response.getWindowState();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setRenderParameters()</code> on the wrapped response object.
+ */
+ public void setRenderParameters(EventRequest request) {
+ response.setRenderParameters(request);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setEvent()</code> on the wrapped response object.
+ */
+ public void setEvent(String name, java.io.Serializable value) {
+ response.setEvent(name, value);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>removePublicRenderParameter()</code> on the wrapped response object.
+ */
+ public void removePublicRenderParameter(String name) {
+ response.removePublicRenderParameter(name);
+ }
+
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/FilterChain.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/FilterChain.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/FilterChain.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/FilterChain.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,108 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+
+/**
+ * A <code>FilterChain</code> is an object provided by the portlet container
+ * to the developer giving a view into the invocation chain of a
+ * filtered request for a portlet. Filters use the <code>FilterChain</code>
+ * to invoke the next filter in the chain, or if the calling filter is the
+ * last filter in the chain, to invoke the portlet at the end of the chain.
+ *
+ * @since 2.0
+ */
+public interface FilterChain {
+
+ /**
+ * Causes the next filter in the chain to be invoked,
+ * or if the calling filter is the last filter in the chain,
+ * causes the portlet at the end of the chain to be invoked.
+ *
+ * @param request the current action request.
+ * @param response the current action response
+ *
+ * @throws IOException if an IO error occurred in the filter processing
+ * @throws PortletException if a portlet exception occurred in the filter processing
+ */
+ public void doFilter(ActionRequest request, ActionResponse response)
+ throws IOException, PortletException;
+
+ /**
+ * Causes the next filter in the chain to be invoked,
+ * or if the calling filter is the last filter in the chain,
+ * causes the portlet at the end of the chain to be invoked.
+ *
+ * @param request the current event request.
+ * @param response the current event response.
+ *
+ * @throws IOException if an IO error occured in the filter processing
+ * @throws PortletException if a portlet exception occured in the filter processing
+ */
+ public void doFilter(EventRequest request, EventResponse response)
+ throws IOException, PortletException;
+
+ /**
+ * Causes the next filter in the chain to be invoked,
+ * or if the calling filter is the last filter in the chain,
+ * causes the portlet at the end of the chain to be invoked.
+ *
+ * @param request the current render request.
+ *
+ * @param response the current render response.
+ *
+ * @throws IOException if an IO error occurred in the filter processing
+ * @throws PortletException if a portlet exception occurred in the filter processing
+ */
+ public void doFilter(RenderRequest request, RenderResponse response)
+ throws IOException, PortletException;
+
+ /**
+ * Causes the next filter in the chain to be invoked,
+ * or if the calling filter is the last filter in the chain,
+ * causes the portlet at the end of the chain to be invoked.
+ *
+ * @param request the current resource request.
+ * @param response the current resource response.
+ *
+ * @throws IOException if an IO error occurred in the filter processing
+ * @throws PortletException if a portlet exception occurred in the filter processing
+ */
+ public void doFilter(ResourceRequest request, ResourceResponse response)
+ throws IOException, PortletException;
+
+
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/FilterConfig.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/FilterConfig.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/FilterConfig.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/FilterConfig.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,78 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+
+
+import java.util.Enumeration;
+
+import javax.portlet.PortletContext;
+
+/**
+ * A filter configuration object used by a portlet container
+ * to pass information to a filter during initialization.
+ *
+ * @since 2.0
+ */
+public interface FilterConfig {
+
+ /**
+ * Returns the filter-name of this filter as defined in the
+ * portlet deployment descriptor.
+ *
+ * @return the filter name
+ */
+ public String getFilterName();
+
+ /**
+ * Returns a reference to the <code>PortletContext</code> in which the caller is executing.
+ *
+ * @return the portlet context
+ */
+ public PortletContext getPortletContext();
+
+ /**
+ * Returns a String containing the value of the named
+ * initialization parameter, or <code>null</code> if the parameter does not exist.
+ * <p>
+ * Initialization parameters are defined in the portlet deployment descriptor.
+ *
+ * @param name the name of the initialization parameter to return
+ * @return initialization parameter, or <code>null</code> if the parameter does not exist.
+ */
+ public String getInitParameter(String name);
+
+ /**
+ * Returns the names of the filter's initialization parameters
+ * as an Enumeration of String objects, or an empty Enumeration
+ * if the filter has no initialization parameters.
+ * <p>
+ * Initialization parameters are defined in the portlet deployment descriptor.
+ *
+ * @return the names of the filter's initialization parameters,
+ * or an empty Enumeration if the filter has no initialization parameters.
+ */
+ public Enumeration<String> getInitParameterNames();
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletFilter.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletFilter.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletFilter.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletFilter.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,74 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import javax.portlet.PortletException;
+
+/**
+ * The <code>PortletFilter</code> is the base interface for all portlet filters.
+ * It provides the lifecycle methods <code>init</code> and <code>destroy</code>
+ * for putting a portlet filter into and out of service.
+ *
+ * @since 2.0
+ */
+public interface PortletFilter {
+
+ /**
+ * Called by the portlet container to indicate to a filter
+ * that it is being placed into service. The portlet container
+ * calls the init method exactly once after instantiating the filter.
+ * The init method must complete successfully before the filter
+ * is asked to do any filtering work.
+ * <p>
+ * The portlet container cannot place the filter into service if the init method either
+ * <ul>
+ * <li>throws a PortletException</li>
+ * <li>does not return within a time period defined by the portlet container</li>
+ * </ul>
+ *
+ * @param filterConfig the filter configuration data defined
+ * in the portlet deployment descriptor
+ * @throws PortletException if an error occurs in the filter initialization
+ */
+ public void init(FilterConfig filterConfig) throws PortletException;
+
+
+ /**
+ * Called by the portlet container to indicate to a filter that it is
+ * being taken out of service. This method is only called once all threads
+ * within the filter's <code>doFilter</code> method have exited or
+ * after a timeout period has passed.
+ * <p>
+ * After the portlet container calls this method, it will not call the
+ * <code>doFilter</code> method again on this instance of the filter.
+ * <p>
+ * This method gives the filter an opportunity to clean up any resources
+ * that are being held (for example, memory, file handles, threads) and
+ * make sure that any persistent state is synchronized with the
+ * filter's current state in memory.
+ */
+ public void destroy();
+
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletRequestWrapper.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletRequestWrapper.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletRequestWrapper.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletRequestWrapper.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,402 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.portlet.PortalContext;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+import javax.portlet.WindowState;
+import javax.servlet.http.Cookie;
+
+/**
+ * The <code>PortletRequestWrapper</code> provides a convenient
+ * implementation of the <code>PortletRequest</code> interface
+ * and is extended by other request wrappers.
+ * This class implements the Wrapper or Decorator pattern.
+ * Methods default to calling through to the wrapped request object.
+ *
+ * @since 2.0
+ * @see PortletRequest
+ */
+public class PortletRequestWrapper implements PortletRequest {
+
+ PortletRequest request;
+
+ /**
+ * Require having a request for constructing
+ * the wrapper.
+ *
+ */
+ private PortletRequestWrapper() {
+ }
+
+
+ /**
+ * Creates an <code>PortletRequest</code> adaptor
+ * wrapping the given request object.
+ *
+ * @param request the portlet request to wrap
+ * @throws java.lang.IllegalArgumentException if the request is <code>null</code>
+ */
+ public PortletRequestWrapper(PortletRequest request) {
+ if ( request == null)
+ throw new java.lang.IllegalArgumentException("Request is null");
+
+ this.request = request;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getAttribute(String name)</code> on the wrapped request object.
+ */
+ public Object getAttribute(String name) {
+ return request.getAttribute(name);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getAttributeNames()</code> on the wrapped request object.
+ */
+ public Enumeration<String> getAttributeNames() {
+ return request.getAttributeNames();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getAuthType()</code> on the wrapped request object.
+ */
+ public String getAuthType() {
+ return request.getAuthType();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getContextPath()</code> on the wrapped request object.
+ */
+ public String getContextPath() {
+ return request.getContextPath();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getLocale()</code> on the wrapped request object.
+ */
+ public Locale getLocale() {
+ return request.getLocale();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getLocales()</code> on the wrapped request object.
+ */
+ public Enumeration<Locale> getLocales() {
+ return request.getLocales();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getParameter(String name)</code> on the wrapped request object.
+ */
+ public String getParameter(String name) {
+ return request.getParameter(name);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getParameterMap()</code> on the wrapped request object.
+ */
+ public Map<String, String[]> getParameterMap() {
+ return request.getParameterMap();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getParameterNames()</code> on the wrapped request object.
+ */
+ public Enumeration<String> getParameterNames() {
+ return request.getParameterNames();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getParameterValues(name)</code> on the wrapped request object.
+ */
+ public String[] getParameterValues(String name) {
+ return request.getParameterValues(name);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortalContext()</code> on the wrapped request object.
+ */
+ public PortalContext getPortalContext() {
+ return request.getPortalContext();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletMode()</code> on the wrapped request object.
+ */
+ public PortletMode getPortletMode() {
+ return request.getPortletMode();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletSession()</code> on the wrapped request object.
+ */
+ public PortletSession getPortletSession() {
+ return request.getPortletSession();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPortletSession(create)</code> on the wrapped request object.
+ */
+ public PortletSession getPortletSession(boolean create) {
+ return request.getPortletSession(create);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPreferences()</code> on the wrapped request object.
+ */
+ public PortletPreferences getPreferences() {
+ return request.getPreferences();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getProperteis(name)</code> on the wrapped request object.
+ */
+ public Enumeration<String> getProperties(String name) {
+ return request.getProperties(name);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getProperty(name)</code> on the wrapped request object.
+ */
+ public String getProperty(String name) {
+ return request.getProperty(name);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPropertyNames()</code> on the wrapped request object.
+ */
+ public Enumeration<String> getPropertyNames() {
+ return request.getPropertyNames();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getRemoteUser()</code> on the wrapped request object.
+ */
+ public String getRemoteUser() {
+ return request.getRemoteUser();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getRequestedSessionId()</code> on the wrapped request object.
+ */
+ public String getRequestedSessionId() {
+ return request.getRequestedSessionId();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getResponseContentType()</code> on the wrapped request object.
+ */
+ public String getResponseContentType() {
+ return request.getResponseContentType();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getResponseContentTypes()</code> on the wrapped request object.
+ */
+ public Enumeration<String> getResponseContentTypes() {
+ return request.getResponseContentTypes();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getScheme()</code> on the wrapped request object.
+ */
+ public String getScheme() {
+ return request.getScheme();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getServerName()</code> on the wrapped request object.
+ */
+ public String getServerName() {
+ return request.getServerName();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getServerPort()</code> on the wrapped request object.
+ */
+ public int getServerPort() {
+ return request.getServerPort();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getUserPrincipal()</code> on the wrapped request object.
+ */
+ public Principal getUserPrincipal() {
+ return request.getUserPrincipal();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getWindowId()</code> on the wrapped request object.
+ */
+ public String getWindowID() {
+ return request.getWindowID();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getWindowState()</code> on the wrapped request object.
+ */
+ public WindowState getWindowState() {
+ return request.getWindowState();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>isPortletModeAllowed(mode)</code> on the wrapped request object.
+ */
+ public boolean isPortletModeAllowed(PortletMode mode) {
+ return request.isPortletModeAllowed(mode);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>isRequestedSessionIdValid()</code> on the wrapped request object.
+ */
+ public boolean isRequestedSessionIdValid() {
+ return request.isRequestedSessionIdValid();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>isSecure()</code> on the wrapped request object.
+ */
+ public boolean isSecure() {
+ return request.isSecure();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>isUserInRole(role)</code> on the wrapped request object.
+ */
+ public boolean isUserInRole(String role) {
+ return request.isUserInRole(role);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>isWindowStateAllowed(state)</code> on the wrapped request object.
+ */
+ public boolean isWindowStateAllowed(WindowState state) {
+ return request.isWindowStateAllowed(state);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>removeAttribute(name)</code> on the wrapped request object.
+ */
+ public void removeAttribute(String name) {
+ request.removeAttribute(name);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setAttribute(name, o)</code> on the wrapped request object.
+ */
+ public void setAttribute(String name, Object o) {
+ request.setAttribute(name, o);
+ }
+
+ /**
+ * Return the wrapped request object.
+ *
+ * @return the wrapped request
+ */
+ public PortletRequest getRequest() {
+ return request;
+ }
+
+ /**
+ * Sets the request object being wrapped.
+ *
+ * @param request the request to set
+ * @throws java.lang.IllegalArgumentException if the request is null.
+ */
+ public void setRequest(PortletRequest request) {
+ if ( request == null)
+ throw new java.lang.IllegalArgumentException("Request is null");
+
+ this.request = request;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getCookies()</code> on the wrapped request object.
+ */
+ public Cookie[] getCookies() {
+ return request.getCookies();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPrivateParameterMap()</code> on the wrapped request object.
+ */
+ public Map<String, String[]> getPrivateParameterMap() {
+ return request.getPrivateParameterMap();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getPublicParameterMap()</code> on the wrapped request object.
+ */
+ public Map<String, String[]> getPublicParameterMap() {
+ return request.getPublicParameterMap();
+ }
+}
Added: portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletResponseWrapper.java
URL: http://svn.apache.org/viewvc/portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletResponseWrapper.java?rev=1690750&view=auto
==============================================================================
--- portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletResponseWrapper.java (added)
+++ portals/portlet-spec/trunk/portlet-api_2.1.0_spec/src/main/java/javax/portlet/filter/PortletResponseWrapper.java Mon Jul 13 16:39:59 2015
@@ -0,0 +1,144 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*
+ * This source code implements specifications defined by the Java
+ * Community Process. In order to remain compliant with the specification
+ * DO NOT add / change / or delete method signatures!
+ */
+
+package javax.portlet.filter;
+
+import javax.portlet.PortletResponse;
+import javax.servlet.http.Cookie;
+
+/**
+ * The <code>PortletResponseWrapper</code> provides a convenient
+ * implementation of the <code>PortletResponse</code> interface
+ * and is extended by other response wrappers.
+ * This class implements the Wrapper or Decorator pattern.
+ * Methods default to calling through to the wrapped response object.
+ *
+ * @since 2.0
+ * @see PortletResponse
+ */
+public class PortletResponseWrapper implements PortletResponse {
+
+ PortletResponse response;
+
+ /**
+ * Require having a response for constructing
+ * the wrapper.
+ *
+ */
+ private PortletResponseWrapper() {
+ }
+
+ /**
+ * Creates an <code>ActionResponse</code> adaptor
+ * wrapping the given response object.
+ *
+ * @param response the action response to wrap
+ * @throws java.lang.IllegalArgumentException if the response is <code>null</code>
+ */
+ public PortletResponseWrapper(PortletResponse response) {
+ if ( response == null)
+ throw new java.lang.IllegalArgumentException("Response is null");
+
+ this.response = response;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>addProperty(key, value)</code> on the wrapped response object.
+ */
+ public void addProperty(String key, String value) {
+ response.addProperty(key, value);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>encodeURL(path)</code> on the wrapped response object.
+ */
+ public String encodeURL(String path) {
+ return response.encodeURL(path);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>getNamespace()</code> on the wrapped response object.
+ */
+ public String getNamespace() {
+ return response.getNamespace();
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>setProperty(key, value)</code> on the wrapped response object.
+ */
+ public void setProperty(String key, String value) {
+ response.setProperty(key, value);
+ }
+
+ /**
+ * Return the wrapped response object.
+ *
+ * @return the wrapped response
+ */
+ public PortletResponse getResponse() {
+ return response;
+ }
+
+ /**
+ * Sets the response object being wrapped.
+ *
+ * @param response the response to set
+ * @throws java.lang.IllegalArgumentException if the response is null.
+ */
+ public void setResponse(PortletResponse response) {
+ if ( response == null)
+ throw new java.lang.IllegalArgumentException("Response is null");
+
+ this.response = response;
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>addProperty()</code> on the wrapped response object.
+ */
+ public void addProperty(String key, org.w3c.dom.Element element) {
+ response.addProperty(key, element);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>createElement()</code> on the wrapped response object.
+ */
+ public org.w3c.dom.Element createElement(String tagName) {
+ return response.createElement(tagName);
+ }
+
+ /**
+ * The default behavior of this method is to call
+ * <code>addProperty()</code> on the wrapped response object.
+ */
+ public void addProperty(Cookie cookie) {
+ response.addProperty(cookie);
+ }
+
+}