Package org.oasis.wsrp.v2

Examples of org.oasis.wsrp.v2.EventPayload


      return event;
   }

   public static EventPayload createEventPayloadAsAny(Object value)
   {
      EventPayload payload = new EventPayload();
      payload.setAny(value);
      return payload;
   }
View Full Code Here


      return namedString;
   }

   public static EventPayload createEventPayloadAsNamedString(NamedStringArray payload)
   {
      EventPayload result = new EventPayload();
      result.setNamedStringArray(payload);
      return result;
   }
View Full Code Here

      }
   }

   public static Serializable getPayloadAsSerializable(Event event)
   {
      EventPayload payload = event.getPayload();
      if (payload == null)
      {
         return null;
      }

      ParameterValidation.throwIllegalArgExceptionIfNull(event, "Payload expected type");

      Object any = payload.getAny();
      if (any == null)
      {
         NamedStringArray namedStringArray = payload.getNamedStringArray();
         if (namedStringArray != null)
         {
            return new SerializableNamedStringArray(namedStringArray);
         }
         else
View Full Code Here

      }
   }

   public static Serializable getPayloadAsSerializable(Event event)
   {
      EventPayload payload = event.getPayload();
      if (payload == null)
      {
         return null;
      }

      ParameterValidation.throwIllegalArgExceptionIfNull(event, "Payload expected type");

      Object any = payload.getAny();
      if (any == null)
      {
         NamedStringArray namedStringArray = payload.getNamedStringArray();
         if (namedStringArray != null)
         {
            return new SerializableNamedStringArray(namedStringArray);
         }
         else
View Full Code Here

      return event;
   }

   public static EventPayload createEventPayloadAsAny(Object value)
   {
      EventPayload payload = new EventPayload();
      payload.setAny(value);
      return payload;
   }
View Full Code Here

      return namedString;
   }

   public static EventPayload createEventPayloadAsNamedString(NamedStringArray payload)
   {
      EventPayload result = new EventPayload();
      result.setNamedStringArray(payload);
      return result;
   }
View Full Code Here

               //get the exportPortletData
               ExportPortletData exportPortletData = exportManager.createExportPortletData(exportContext, portletHandle, portletState);

               //Create the exportedPortlet
               byte[] exportPortletBytes = exportManager.encodeExportPortletData(exportContext, exportPortletData);
               ExportedPortlet exportedPortlet = WSRPTypeFactory.createExportedPortlet(portletHandle, exportPortletBytes);
               exportedPortlets.add(exportedPortlet);
            }

            catch (Exception e)
            {
View Full Code Here

               if (!failedPortletsMap.containsKey(errorCode.name()))
               {
                  List<String> portletHandles = new ArrayList<String>();
                  portletHandles.add(portletContext.getPortletHandle());

                  FailedPortlets failedPortlets = WSRPTypeFactory.createFailedPortlets(portletHandles, errorCode, reason);
                  failedPortletsMap.put(errorCode.name(), failedPortlets);
               }
               else
               {
                  FailedPortlets failedPortlets = failedPortletsMap.get(errorCode.name());
                  failedPortlets.getPortletHandles().add(portletContext.getPortletHandle());
               }
            }
         }

         List<FailedPortlets> failedPortlets = new ArrayList<FailedPortlets>(failedPortletsMap.values());
View Full Code Here

               if (!failedPortletsMap.containsKey(errorCodeName))
               {
                  List<String> portletHandles = new ArrayList<String>();
                  portletHandles.add(portletContext.getPortletHandle());

                  FailedPortlets failedPortlets = WSRPTypeFactory.createFailedPortlets(portletHandles, errorCode, reason);
                  failedPortletsMap.put(errorCodeName, failedPortlets);
               }
               else
               {
                  FailedPortlets failedPortlets = failedPortletsMap.get(errorCodeName);
                  failedPortlets.getPortletHandles().add(portletContext.getPortletHandle());
               }
            }
         }

         //TODO: handle resourceLists better (should be using for things like errors)
View Full Code Here

   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
   {
      WSRP2Producer producer = ProducerHolder.getProducer();

      GetResource getResource = ResourceServingUtil.decode(req);

      try
      {
         ResourceResponse resource = producer.getResource(getResource);
         ResourceContext resourceContext = resource.getResourceContext();
         byte[] itemBinary = resourceContext.getItemBinary();
         String itemString = resourceContext.getItemString();

         final String mimeType = resourceContext.getMimeType();
         if (!ParameterValidation.isNullOrEmpty(mimeType))
         {
            resp.setContentType(mimeType);
         }

         if (itemBinary != null && itemBinary.length > 0)
         {
            resp.getOutputStream().write(itemBinary);
         }

         if (!ParameterValidation.isNullOrEmpty(itemString))
         {
            resp.getWriter().write(itemString);
         }
      }
      catch (Exception exception)
      {
         throw new ServletException("Couldn't get resource " + getResource.getResourceParams().getResourceID()
            + " for portlet " + getResource.getPortletContext(), exception);
      }
   }
View Full Code Here

TOP

Related Classes of org.oasis.wsrp.v2.EventPayload

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.