Package org.oasis.wsrp.v2

Examples of org.oasis.wsrp.v2.Lifetime


                // Set the TokenType of the response. To make clients happy we'll return a token of the type they requested
                tokenResponse.setTokenType(tokenRequest.getTokenType());
       
                // Add a Lifetime element to indicate to clients the lifetime of the token we're sending
                // In this case, we're giving the client the lifetime they asked for
                Lifetime lifetime = tokenRequest.getLifetime();
                tokenResponse.setLifetime(lifetime);

                // Check if the request included a custom element named <TestElement>
                // Note that a list of custom elements can be obtained by calling getCustomElements();
                if (tokenRequest.getCustomElement("http://testElementNs.testElementNs", "TestElement") != null) {
View Full Code Here


        // Set the desired Lifetime of the token being requested in this case to 250 seconds
        Date start = new Date();
        Date end = new Date();
        end.setTime(start.getTime() + 250 * 1000);
        tokenRequest.setLifetime(new Lifetime(wssConfig, doc, start, end));

        // Add a custom element of our own creation
        tokenRequest.addCustomElementNS("http://testElementNs.testElementNs", "te:TestElement");

        // Create a SOAP body and set the XML element of the token request (a <RequestSecurityToken> element)
View Full Code Here

        // Set the desired Lifetime of the token being requested in this case to 250 seconds
        Date start = new Date();
        Date end = new Date();
        end.setTime(start.getTime() + 250 * 1000);
        tokenRequest.setLifetime(new Lifetime(wssConfig, doc, start, end));

        // Add a custom element of our own creation
        tokenRequest.addCustomElementNS("http://testElementNs.testElementNs", "te:TestElement");

        // Create a SOAP body and set the XML element of the token request (a <RequestSecurityToken> element)
View Full Code Here

                // Set the TokenType of the response. To make clients happy we'll return a token of the type they requested
                tokenResponse.setTokenType(tokenRequest.getTokenType());
       
                // Add a Lifetime element to indicate to clients the lifetime of the token we're sending
                // In this case, we're giving the client the lifetime they asked for
                Lifetime lifetime = tokenRequest.getLifetime();
                tokenResponse.setLifetime(lifetime);

                // Check if the request included a custom element named <TestElement>
                // Note that a list of custom elements can be obtained by calling getCustomElements();
                if (tokenRequest.getCustomElement("http://testElementNs.testElementNs", "TestElement") != null) {
View Full Code Here

               RegistrationLocal.setRegistration(toRegistration);
               org.gatein.pc.api.PortletContext copiedPortletContext = producer.getPortletInvoker().importPortlet(PortletStateType.OPAQUE, exportedPortletContext);

               PortletContext wsrpClonedPC = WSRPUtils.convertToWSRPPortletContext(copiedPortletContext);

               CopiedPortlet copiedPortlet = WSRPTypeFactory.createCopiedPortlet(wsrpClonedPC, portletContext.getPortletHandle());
               copiedPortlets.add(copiedPortlet);
            }
            catch (Exception e)
            {
               if (log.isWarnEnabled())
View Full Code Here

      {
         throw new NotYetImplemented("Need to support multiple events at once...");
      }

      // since we currently don't support sending multiple events to process at once, assume there's only one
      Event event = events.get(0);

      eventInvocation.setName(event.getName());
      eventInvocation.setPayload(PayloadUtils.getPayloadAsSerializable(event));

      // Extensions
      processExtensionsFrom(eventParams.getClass(), eventParams.getExtensions());
View Full Code Here

      }

      // events
      QName name = invocation.getName();
      Serializable payload = invocation.getPayload();
      Event event = WSRPTypeFactory.createEvent(name, payload);
      EventParams eventParams = WSRPTypeFactory.createEventParams(Collections.singletonList(event), WSRPUtils.getStateChangeFromAccessMode(accessMode));

      return WSRPTypeFactory.createHandleEvents(requestPrecursor.getRegistrationContext(), portletContext,
         requestPrecursor.getRuntimeContext(), requestPrecursor.getUserContext(), requestPrecursor.getMarkupParams(), eventParams);
   }
View Full Code Here

      private void addEventInfo(EventInfo info, Locale locale)
      {
         QName name = info.getName();
         if (!eventDescriptions.containsKey(name))
         {
            EventDescription desc = WSRPTypeFactory.createEventDescription(name);
            desc.setDescription(Utils.convertToWSRPLocalizedString(info.getDescription(), locale));
            desc.setLabel(Utils.convertToWSRPLocalizedString(info.getDisplayName(), locale));
            Collection<QName> aliases = info.getAliases();
            if (ParameterValidation.existsAndIsNotEmpty(aliases))
            {
               desc.getAliases().addAll(aliases);
            }
            // todo: deal with type info...
            eventDescriptions.put(name, desc);
            eventReferenceCount.put(name, 1);
         }
View Full Code Here

   }

   @Override
   protected void checkRequest(HandleEvents handleEvents) throws MissingParameters, OperationFailed, OperationNotSupported
   {
      EventParams eventParams = handleEvents.getEventParams();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(eventParams, "event params", "HandleEvents");
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(eventParams.getPortletStateChange(), "portletStateChange", "EventParams");
      List<Event> events = eventParams.getEvents();
      if (!ParameterValidation.existsAndIsNotEmpty(events))
      {
         throw WSRP2ExceptionFactory.createWSException(MissingParameters.class,
            "EventParams must provide at least one event to process", null);
      }
View Full Code Here

   @Override
   PortletInvocation initInvocation(WSRPPortletInvocationContext context)
   {
      EventInvocation eventInvocation = new EventInvocation(context);

      final EventParams eventParams = request.getEventParams();
      List<Event> events = eventParams.getEvents();

      if (events.size() > 1)
      {
         throw new NotYetImplemented("Need to support multiple events at once...");
      }

      // since we currently don't support sending multiple events to process at once, assume there's only one
      Event event = events.get(0);

      eventInvocation.setName(event.getName());
      eventInvocation.setPayload(PayloadUtils.getPayloadAsSerializable(event));

      // Extensions
      processExtensionsFrom(eventParams.getClass(), eventParams.getExtensions());

      return eventInvocation;
   }
View Full Code Here

TOP

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

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.