You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2003/12/02 18:06:16 UTC
cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request JetspeedRequestContext.java RequestContext.java
taylor 2003/12/02 09:06:16
Modified: portal/src/java/org/apache/jetspeed/request
JetspeedRequestContext.java RequestContext.java
Log:
Enhanced RequestContext to support security subjects, localization, and generalized request properties
Revision Changes Path
1.5 +58 -2 jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java
Index: JetspeedRequestContext.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/JetspeedRequestContext.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JetspeedRequestContext.java 23 Oct 2003 01:45:24 -0000 1.4
+++ JetspeedRequestContext.java 2 Dec 2003 17:06:16 -0000 1.5
@@ -53,6 +53,10 @@
*/
package org.apache.jetspeed.request;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.security.auth.Subject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletConfig;
@@ -86,7 +90,9 @@
private ServletConfig config;
private Profile profile;
private PortletDefinition portletDefinition;
-
+ private Subject subject;
+ private Locale locale;
+
private CapabilityMap capabilityMap;
private String mimeType;
private String mediaType;
@@ -310,4 +316,54 @@
return wrappedResponse;
}
+ /* (non-Javadoc)
+ * @see org.apache.jetspeed.request.RequestContext#getSubject()
+ */
+ public Subject getSubject()
+ {
+ return this.subject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.jetspeed.request.RequestContext#setSubject(javax.security.auth.Subject)
+ */
+ public void setSubject(Subject subject)
+ {
+ this.subject = subject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.jetspeed.request.RequestContext#getLocale()
+ */
+ public Locale getLocale()
+ {
+ return this.locale;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.jetspeed.request.RequestContext#setLocale(java.util.Locale)
+ */
+ public void setLocale(Locale locale)
+ {
+ this.locale = locale;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.jetspeed.request.RequestContext#getRequestParameter(java.lang.String)
+ */
+ public String getRequestParameter(String key)
+ {
+ return request.getParameter(key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.jetspeed.request.RequestContext#getParameterMap()
+ */
+ public Map getParameterMap()
+ {
+ return request.getParameterMap();
+ }
+
}
+
+
1.4 +56 -1 jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/RequestContext.java
Index: RequestContext.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/request/RequestContext.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RequestContext.java 20 Oct 2003 03:52:53 -0000 1.3
+++ RequestContext.java 2 Dec 2003 17:06:16 -0000 1.4
@@ -53,6 +53,10 @@
*/
package org.apache.jetspeed.request;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.security.auth.Subject;
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -236,5 +240,56 @@
*
*/
HttpServletResponse getResponseForWindow(PortletWindow window);
+
+ /**
+ * Gets the subject associated with the authorized entity.
+ * This subject can be used to provide credentials and principals.
+ *
+ * @return The JAAS subject on this request.
+ */
+ Subject getSubject();
+
+ /**
+ * Sets the subject associated with the authorized entity.
+ * This subject can be used to provide credentials and principals.
+ *
+ * @param subject The JAAS subject on this request.
+ */
+ void setSubject(Subject subject);
+
+ /**
+ * Gets the locale associated with this request.
+ *
+ * @return The locale associated with this request.
+ */
+ Locale getLocale();
+ /**
+ * Sets the locale associated with this request.
+ *
+ * @param The locale associated with this request.
+ */
+ void setLocale(Locale locale);
+
+ /**
+ * Use this method to get a request parameter on the generalized request,
+ * decoupling request parameter manipulation from servlet API.
+ * This parameter could be on the Http Servlet request,
+ * in that case it simply passes through to the servlet request.
+ *
+ * @param key The parameter unique key
+ * @return The object associated with the uniqu
+ */
+ String getRequestParameter(String key);
+
+ /**
+ * Use this method to get a map of request parameters on the generalized request,
+ * decoupling request parameter manipulation from servlet API.
+ * The parameters returned could be on the Http Servlet request,
+ * in that case it simply passes through to the servlet request.
+ *
+ * @return
+ */
+ Map getParameterMap();
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org