Package org.oasis.wsrp.v1

Examples of org.oasis.wsrp.v1.V1ModelDescription


   {
      if (redirectURL == null || redirectURL.length() == 0)
      {
         throw new IllegalArgumentException("BlockingInteractionResponse requires either an UpdateResponse or a redirect URL.");
      }
      V1BlockingInteractionResponse interactionResponse = new V1BlockingInteractionResponse();
      interactionResponse.setRedirectURL(redirectURL);
      return interactionResponse;
   }
View Full Code Here


   public static V1BlockingInteractionResponse toV1BlockingInteractionResponse(BlockingInteractionResponse blockingInteractionResponse)
   {
      if (blockingInteractionResponse != null)
      {
         V1BlockingInteractionResponse result;
         V1UpdateResponse updateResponse = toV1UpdateResponse(blockingInteractionResponse.getUpdateResponse());
         String redirectURL = blockingInteractionResponse.getRedirectURL();
         if (redirectURL != null)
         {
            result = WSRP1TypeFactory.createBlockingInteractionResponse(redirectURL);
         }
         else
         {
            result = WSRP1TypeFactory.createBlockingInteractionResponse(updateResponse);
         }

         List<V1Extension> extensions = WSRPUtils.transform(blockingInteractionResponse.getExtensions(), EXTENSION);
         if (extensions != null)
         {
            result.getExtensions().addAll(extensions);
         }

         return result;
      }
      else
View Full Code Here

      {
         throw new IllegalArgumentException("Cache expiration time must be greater than -1, " +
            "-1 indicating that the cache will never expire.");
      }

      V1CacheControl cacheControl = new V1CacheControl();
      cacheControl.setExpires(expires);
      cacheControl.setUserScope(userScope);
      return cacheControl;
   }
View Full Code Here

   public static V1CacheControl toV1CacheControl(CacheControl cacheControl)
   {
      if (cacheControl != null)
      {
         V1CacheControl v1CacheControl = WSRP1TypeFactory.createCacheControl(cacheControl.getExpires(), cacheControl.getUserScope());
         v1CacheControl.setValidateTag(cacheControl.getValidateTag());

         List<Extension> extensions = cacheControl.getExtensions();
         if (extensions != null)
         {
            v1CacheControl.getExtensions().addAll(WSRPUtils.transform(extensions, EXTENSION));
         }

         return v1CacheControl;
      }
      else
View Full Code Here

    * @return
    */
   public static V1ClientData createClientData(String userAgent)
   {
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(userAgent, "user agent", "ClientData");
      V1ClientData clientData = new V1ClientData();
      clientData.setUserAgent(userAgent);
      return clientData;
   }
View Full Code Here

   private static V1ClientData toV1ClientData(ClientData clientData)
   {
      if (clientData != null)
      {
         V1ClientData v1ClientData = WSRP1TypeFactory.createClientData(clientData.getUserAgent());

         List<Extension> extensions = clientData.getExtensions();
         if (extensions != null)
         {
            v1ClientData.getExtensions().addAll(Lists.transform(extensions, EXTENSION));
         }

         return v1ClientData;
      }
      else
View Full Code Here

    * @since 2.6
    */
   public static V1ClonePortlet createClonePortlet(V1RegistrationContext registrationContext, V1PortletContext portletContext, V1UserContext userContext)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
      V1ClonePortlet clonePortlet = new V1ClonePortlet();
      clonePortlet.setPortletContext(portletContext);
      clonePortlet.setRegistrationContext(registrationContext);
      clonePortlet.setUserContext(userContext);
      return clonePortlet;
   }
View Full Code Here

   public static V1Contact toV1Context(Contact contact)
   {
      if (contact != null)
      {
         V1Contact v1Contact = new V1Contact();
         v1Contact.setOnline(toV1Online(contact.getOnline()));
         v1Contact.setPostal(toV1Postal(contact.getPostal()));
         v1Contact.setTelecom(toV1Telecom(contact.getTelecom()));

         List<Extension> extensions = contact.getExtensions();
         if (extensions != null)
         {
            v1Contact.getExtensions().addAll(WSRPUtils.transform(extensions, EXTENSION));
         }

         return v1Contact;
      }
      else
View Full Code Here

   public static V1DestroyFailed createDestroyFailed(String portletHandle, String reason)
   {
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle, "Portlet handle", "DestroyFailed");
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(reason, "Reason for failure", "DestroyFailed");
      // todo: check reason should be a fault code from Section 13 of spec but this is not clear...
      V1DestroyFailed destroyFailed = new V1DestroyFailed();
      destroyFailed.setPortletHandle(portletHandle);
      destroyFailed.setReason(reason);
      return destroyFailed;
   }
View Full Code Here

               v1Reason = errorCode.toString();
            }
           
            for (String handle : failedPortlets.getPortletHandles())
            {
               V1DestroyFailed destroyFailed = WSRP1TypeFactory.createDestroyFailed(handle, v1Reason);
               result.add(destroyFailed);
            }
         }

         return result;
View Full Code Here

TOP

Related Classes of org.oasis.wsrp.v1.V1ModelDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.