[jboss-cvs] jboss-portal/wsrp/src/main/org/jboss/portal/wsrp ...
Chris Laprun
chris.laprun at jboss.com
Wed Aug 2 19:48:23 EDT 2006
User: claprun
Date: 06/08/02 19:48:23
Modified: wsrp/src/main/org/jboss/portal/wsrp WSRPConstants.java
WSRPTypeFactory.java
Log:
- Implemented producer-side support for sending caching information to consumers.
- Added caching support tests.
- Improved tests.
Revision Changes Path
1.11 +12 -1 jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/WSRPConstants.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: WSRPConstants.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/WSRPConstants.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- WSRPConstants.java 13 May 2006 00:15:24 -0000 1.10
+++ WSRPConstants.java 2 Aug 2006 23:48:23 -0000 1.11
@@ -28,7 +28,7 @@
/**
* @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
* @since 2.4
*/
public final class WSRPConstants
@@ -125,6 +125,17 @@
/** The String identifying the portal consumer agent */
public static final String CONSUMER_AGENT = "JBoss Portal.2.4";
+ // User scopes
+
+ /**
+ * The markup is specific to the userContext for which it was generated. Changes to the data of the UserContext MUST
+ * invalidate the cached markup.
+ */
+ public static final String CACHE_PER_USER = "wsrp:perUser";
+
+ /** The markup is not specific to the UserContext and therefore may be supplied to all users of the Consumer. */
+ public static final String CACHE_FOR_ALL = "wsrp:forAll";
+
static
{
InetAddress localhost = null;
1.22 +22 -1 jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: WSRPTypeFactory.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- WSRPTypeFactory.java 31 Jul 2006 19:29:59 -0000 1.21
+++ WSRPTypeFactory.java 2 Aug 2006 23:48:23 -0000 1.22
@@ -32,6 +32,7 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.spi.InvocationContext;
import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
+import org.jboss.portal.wsrp.core.CacheControl;
import org.jboss.portal.wsrp.core.ClientData;
import org.jboss.portal.wsrp.core.GetMarkup;
import org.jboss.portal.wsrp.core.GetServiceDescription;
@@ -61,7 +62,7 @@
* information.
*
* @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision: 1.21 $
+ * @version $Revision: 1.22 $
* @since 2.4
*/
public class WSRPTypeFactory
@@ -543,4 +544,24 @@
ParameterValidation.checkStringValidity(userAgent, "user agent", "ClientData");
return new ClientData(userAgent, null);
}
+
+ /**
+ * expires(xsd:int), userScope(xsd:string), validateTag(xsd:string)?, extensions(Extension)*
+ *
+ * @param expires Number of seconds the markup fragment referenced by this cache control entry remains valid. A
+ * value of -1 indicates that the markup fragment will never expire.
+ * @param userScope
+ * @return
+ */
+ public static CacheControl createCacheControl(int expires, String userScope)
+ {
+ ParameterValidation.checkStringValidity(userScope, "user scope", "CacheControl");
+ if (expires < -1)
+ {
+ throw new IllegalArgumentException("Cache expiration time must be greater than -1, " +
+ "-1 indicating that the cache will never expire.");
+ }
+
+ return new CacheControl(expires, userScope, null, null);
+ }
}
More information about the jboss-cvs-commits
mailing list