From: Chris L. <chr...@jb...> - 2006-05-07 23:46:38
|
User: claprun Date: 06/05/07 19:46:36 Modified: wsrp/src/main/org/jboss/portal/wsrp WSRPTypeFactory.java Log: Added createSessionContext method. Revision Changes Path 1.8 +46 -28 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.7 retrieving revision 1.8 diff -u -b -r1.7 -r1.8 --- WSRPTypeFactory.java 6 May 2006 04:13:51 -0000 1.7 +++ WSRPTypeFactory.java 7 May 2006 23:46:36 -0000 1.8 @@ -36,16 +36,17 @@ import org.jboss.portal.wsrp.core.PortletDescription; import org.jboss.portal.wsrp.core.RuntimeContext; import org.jboss.portal.wsrp.core.ServiceDescription; +import org.jboss.portal.wsrp.core.SessionContext; import org.jboss.portal.wsrp.core.StateChange; import org.jboss.portal.wsrp.core.UpdateResponse; /** * Creates minimally valid instances of WSRP types, populated with default values where possible, as per - * wsrp_v1_types.xsd. - * See <a href="http://jira.jboss.com/jira/browse/JBPORTAL-808">JBPORTAL-808</a> for more information. + * wsrp_v1_types.xsd. See <a href="http://jira.jboss.com/jira/browse/JBPORTAL-808">JBPORTAL-808</a> for more + * information. * * @author <a href="mailto:chr...@jb...">Chris Laprun</a> - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * @since 2.4 */ public class WSRPTypeFactory @@ -108,9 +109,10 @@ /** * secureClientCommunication(xsd:boolean), locales(xsd:string)+, mimeTypes(xsd:string)+, mode(xsd:string), - * windowState(xsd:string), clientData({@link org.jboss.portal.wsrp.core.ClientData})?, navigationalState(xsd:string)?, - * markupCharacterSets(xsd:string)*, validateTag(xsd:string)?, validNewModes(xsd:string)*, - * validNewWindowStates(xsd:string)*, extensions({@link org.jboss.portal.wsrp.core.Extension})* + * windowState(xsd:string), clientData({@link org.jboss.portal.wsrp.core.ClientData})?, + * navigationalState(xsd:string)?, markupCharacterSets(xsd:string)*, validateTag(xsd:string)?, + * validNewModes(xsd:string)*, validNewWindowStates(xsd:string)*, extensions({@link + * org.jboss.portal.wsrp.core.Extension})* * * @return */ @@ -145,7 +147,8 @@ } /** - * portletHandle(xsd:string), portletState(xsd:base64Binary)?, extensions({@link org.jboss.portal.wsrp.core.Extension})* + * portletHandle(xsd:string), portletState(xsd:base64Binary)?, extensions({@link + * org.jboss.portal.wsrp.core.Extension})* * * @param portletHandle * @return @@ -158,8 +161,8 @@ } /** - * Same as createPerformBlockingInteraction(portletHandle, {@link #createDefaultRuntimeContext}(), - * {@link #createDefaultMarkupParams}(), {@link #createDefaultInteractionParams}()); + * Same as createPerformBlockingInteraction(portletHandle, {@link #createDefaultRuntimeContext}(), {@link + * #createDefaultMarkupParams}(), {@link #createDefaultInteractionParams}()); * * @param portletHandle * @return @@ -171,8 +174,8 @@ } /** - * {@link org.jboss.portal.wsrp.core.RegistrationContext}?, {@link PortletContext}, {@link RuntimeContext}, - * {@link org.jboss.portal.wsrp.core.UserContext}?, {@link MarkupParams}, {@link InteractionParams} + * {@link org.jboss.portal.wsrp.core.RegistrationContext}?, {@link PortletContext}, {@link RuntimeContext}, {@link + * org.jboss.portal.wsrp.core.UserContext}?, {@link MarkupParams}, {@link InteractionParams} * * @param portletHandle * @param runtimeContext @@ -260,10 +263,9 @@ /** * portletHandle(xsd:string), markupTypes(MarkupType)+, groupID(xsd:string)?, description(LocalizedString)?, - * shortTitle(LocalizedString)?, title(LocalizedString)?, displayName(LocalizedString)?, - * keywords(LocalizedString)*, userCategories(xsd:string)*, userProfileItems(xsd:string)*, - * usesMethodGet(xsd:boolean[false])?, defaultMarkupSecure(xsd:boolean[false])?, - * onlySecure(xsd:boolean[false])?, userContextStoredInSession(xsd:boolean[false])?, + * shortTitle(LocalizedString)?, title(LocalizedString)?, displayName(LocalizedString)?, keywords(LocalizedString)*, + * userCategories(xsd:string)*, userProfileItems(xsd:string)*, usesMethodGet(xsd:boolean[false])?, + * defaultMarkupSecure(xsd:boolean[false])?, onlySecure(xsd:boolean[false])?, userContextStoredInSession(xsd:boolean[false])?, * templatesStoredInSession(xsd:boolean[false])?, hasUserSpecificState(xsd:boolean[false])?, * doesUrlTemplateProcessing(xsd:boolean[false])?, extensions(Extension)* * @@ -299,11 +301,11 @@ } /** - * requiresRegistration(xsd:boolean), offeredPortlets(PortletDescription)*, - * userCategoryDescriptions(ItemDescription)*, customUserProfileItemDescriptions(ItemDescription)*, - * customWindowStateDescriptions(ItemDescription)*, customModeDescriptions(ItemDescription)*, - * requiresInitCookie(CookieProtocol[none])?, registrationPropertyDescription(ModelDescription)?, - * locales(xsd:string)*, resourceList(ResourceList)?, extensions(Extension)* + * requiresRegistration(xsd:boolean), offeredPortlets(PortletDescription)*, userCategoryDescriptions(ItemDescription)*, + * customUserProfileItemDescriptions(ItemDescription)*, customWindowStateDescriptions(ItemDescription)*, + * customModeDescriptions(ItemDescription)*, requiresInitCookie(CookieProtocol[none])?, + * registrationPropertyDescription(ModelDescription)?, locales(xsd:string)*, resourceList(ResourceList)?, + * extensions(Extension)* * * @return */ @@ -334,10 +336,9 @@ * textual mime types using the syntax specified in RFC1522[14] (e.g. "text/html; charset=UTF-8"). In this particular * case this character set MAY be different than the response message. * <p/> - * useCachedMarkup(xsd:boolean[false])?, mimeType(xsd:string)?, - * (markupString(xsd:string) | markupBinary(xsd:base64Binary)), locale(xsd:string)?, - * requiresUrlRewriting(xsd:boolean[false])?, cacheControl(CacheControl)?, preferredTitle(xsd:string)?, - * extensions(Extension)* + * useCachedMarkup(xsd:boolean[false])?, mimeType(xsd:string)?, (markupString(xsd:string) | + * markupBinary(xsd:base64Binary)), locale(xsd:string)?, requiresUrlRewriting(xsd:boolean[false])?, + * cacheControl(CacheControl)?, preferredTitle(xsd:string)?, extensions(Extension)* * * @return */ @@ -360,10 +361,9 @@ * textual mime types using the syntax specified in RFC1522[14] (e.g. "text/html; charset=UTF-8"). In this particular * case this character set MAY be different than the response message. * <p/> - * useCachedMarkup(xsd:boolean[false])?, mimeType(xsd:string)?, - * (markupString(xsd:string) | markupBinary(xsd:base64Binary)), locale(xsd:string)?, - * requiresUrlRewriting(xsd:boolean[false])?, cacheControl(CacheControl)?, preferredTitle(xsd:string)?, - * extensions(Extension)* + * useCachedMarkup(xsd:boolean[false])?, mimeType(xsd:string)?, (markupString(xsd:string) | + * markupBinary(xsd:base64Binary)), locale(xsd:string)?, requiresUrlRewriting(xsd:boolean[false])?, + * cacheControl(CacheControl)?, preferredTitle(xsd:string)?, extensions(Extension)* * * @return */ @@ -379,4 +379,22 @@ } return new MarkupContext(Boolean.FALSE, mimeType, null, markupBinary, null, Boolean.FALSE, null, null, null); } + + /** + * sessionID(xsd:string), expires(xsd:int), extensions(Extension)* + * + * @return + */ + public static SessionContext createSessionContext(String sessionID, int expires) + { + if (sessionID == null || sessionID.length() == 0) + { + throw new IllegalArgumentException("SessionContext requires a non-null, non-empty session Id."); + } + if (expires < 0) + { + throw new IllegalArgumentException("SessionContext requires a positive expiration time."); + } + return new SessionContext(sessionID, expires, null); + } } |