Package org.gatein.registration

Examples of org.gatein.registration.Registration


   }

   @Override
   protected RegistrationSPI internalRemoveRegistration(String registrationId)
   {
      Registration registration = getRegistration(registrationId);
      remove(registration.getPersistentKey(), RegistrationMapping.class);

      return super.internalRemoveRegistration(registrationId);
   }
View Full Code Here


      try
      {
         // if a RegistrationContext is provided, we need to validate the registration information
         RegistrationContext registrationContext = gs.getRegistrationContext();
         Registration registration = null;
         if (registrationContext != null)
         {
            registration = producer.getRegistrationOrFailIfInvalid(registrationContext);
            RegistrationLocal.setRegistration(registration);
         }
View Full Code Here

      //TODO: this might be better to place somewhere else and use the RegistrationHandler.register instead of
      // doing basically the same thing below.
      Consumer unregConsumer = getConsumerByIdentity(NON_REGISTERED_CONSUMER);
      if (unregConsumer == null)
      {
         Registration registration = addRegistrationTo(NON_REGISTERED_CONSUMER, new HashMap<QName, Object>(), null, true);
         registration.setStatus(RegistrationStatus.VALID);
         getPersistenceManager().saveChangesTo(registration);
         return registration;
      }
      else
      {
         //The unregistered consumer should only ever have one registration, return that
         final Registration registration = unregConsumer.getRegistrations().iterator().next();

         // but first check that we don't have an improper persisted state due to GTNWSRP-283
         if (registration.getRegistrationHandle() == null || RegistrationStatus.PENDING == registration.getStatus())
         {
            // if we have improper persisted state, correct it
            createAndSetRegistrationHandle((RegistrationSPI)registration);
            registration.setStatus(RegistrationStatus.VALID);
            getPersistenceManager().saveChangesTo(registration);
         }
         return registration;
      }
   }
View Full Code Here

      }
   }

   public void removeRegistration(String registrationHandle) throws RegistrationException, NoSuchRegistrationException
   {
      Registration registration = getRegistration(registrationHandle);
      if (registration == null)
      {
         throw new NoSuchRegistrationException("There is no Registration with handle '" + registrationHandle + "'");
      }
      removeRegistration(registration);
View Full Code Here

   private Object getConsumerOrRegistration(String registrationHandle, boolean getConsumer) throws RegistrationException
   {
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationHandle, "registration handle", null);

      Registration registration = persistenceManager.getRegistration(registrationHandle);
      if (registration == null)
      {
         return null;
      }
      else
      {
         return getConsumer ? registration.getConsumer() : registration;
      }
   }
View Full Code Here

      try
      {
         Collection registrations = persistenceManager.getRegistrations();
         for (Object registration : registrations)
         {
            Registration reg = (Registration)registration;

            // pending instead of invalid as technically, the registration is not yet invalid
            reg.setStatus(RegistrationStatus.PENDING);

            // make changes persistent
            Consumer consumer = reg.getConsumer();
            try
            {
               persistenceManager.saveChangesTo(consumer);
            }
            catch (RegistrationException e)
View Full Code Here

      return serviceDescriptionHandler.getPortletDescription(portletContext, locales, registration);
   }

   public Registration getRegistrationOrFailIfInvalid(RegistrationContext registrationContext) throws InvalidRegistration, OperationFailed, ModifyRegistrationRequired
   {
      Registration registration = registrationHandler.getRegistrationFrom(registrationContext);
      registrationHandler.isRegistrationValid(registration, true);

      return registration;
   }
View Full Code Here

   {
      // the context name for error messages
      final String contextName = request.getClass().getSimpleName();

      // retrieve the registration associated with the request or fail
      Registration registration = producer.getRegistrationOrFailIfInvalid(getRegistrationContext());

      // get session information and deal with it
      final RuntimeContext runtimeContext = getRuntimeContext();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(runtimeContext, "RuntimeContext", contextName);
      checkForSessionIDs(runtimeContext);
View Full Code Here

         // add contextual information to help URL generation
         WSRPPortletURL.URLContext context = new WSRPPortletURL.URLContext(WSRPPortletURL.URLContext.SERVER_ADDRESS,
            URLTools.getServerAddressFrom(request), WSRPPortletURL.URLContext.PORTLET_CONTEXT, instanceContext.getPortletContext());

         Registration registration = RegistrationLocal.getRegistration();
         if (registration != null)
         {
            context.setValueFor(WSRPPortletURL.URLContext.REGISTRATION_HANDLE, registration.getRegistrationHandle());
         }
         context.setValueFor(WSRPPortletURL.URLContext.INSTANCE_KEY, WSRPTypeFactory.getPortletInstanceKey(instanceContext));
         context.setValueFor(WSRPPortletURL.URLContext.NAMESPACE, WSRPTypeFactory.getNamespacePrefix(windowContext, instanceContext.getPortletContext().getId()));
         context.setValueFor(WSRPPortletURL.URLContext.ESCAPE_XML, urlFormat.getWantEscapeXML());
View Full Code Here

      try
      {
         log.debug(invocationType + " on portlet '" + handle + "'");

         // check the registration and make it available to other parts of the code via RegistrationLocal
         Registration registration = producer.getRegistrationOrFailIfInvalid(requestProcessor.getRegistrationContext());
         RegistrationLocal.setRegistration(registration);

         // get the portlet container invocation from the RequestProcessor
         final PortletInvocation invocation = requestProcessor.getInvocation();
View Full Code Here

TOP

Related Classes of org.gatein.registration.Registration

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.