Package org.gatein.registration

Examples of org.gatein.registration.Registration


      if (!ParameterValidation.existsAndIsNotEmpty(portletContexts) || WSRPUtils.isSingletonListWithNullOrEmptyElement(portletContexts))
      {
         throw WSRP2ExceptionFactory.createWSException(MissingParameters.class, "Missing required list of portlets to export in ExportPortlets.", null);
      }

      Registration registration = producer.getRegistrationOrFailIfInvalid(exportPortlets.getRegistrationContext());

      UserContext userContext = exportPortlets.getUserContext();
      checkUserAuthorization(userContext);

      boolean exportByValueRequired;
View Full Code Here


      if (!ParameterValidation.existsAndIsNotEmpty(importPortletList) || WSRPUtils.isSingletonListWithNullOrEmptyElement(importPortletList))
      {
         throw WSRP2ExceptionFactory.createWSException(MissingParameters.class, "Missing required list of portlets to import in ImportPortlets.", null);
      }

      Registration registration = producer.getRegistrationOrFailIfInvalid(importPortlets.getRegistrationContext());

      // check if we have a valid userContext or not
      UserContext userContext = importPortlets.getUserContext();
      checkUserAuthorization(userContext);
View Full Code Here

      if (exportContextBytes == null)
      {
         WSRPExceptionFactory.throwWSException(OperationFailed.class, "Cannot call setExportLifetime with an empty ExportContext.", null);
      }

      Registration registration = producer.getRegistrationOrFailIfInvalid(setExportLifetime.getRegistrationContext());

      // check if we have a valid userContext or not
      UserContext userContext = setExportLifetime.getUserContext();
      checkUserAuthorization(userContext);
View Full Code Here

   protected RegistrationSPI internalRemoveRegistration(String registrationId) throws RegistrationException
   {
      // can't use remove method as we get id directly instead of name
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(registrationId, "identifier", null);

      final Registration reg = getRegistration(registrationId);
      if (reg != null)
      {
         try
         {
            final ChromatticSession session = persister.getSession();
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

      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(consumerName, "consumer name", "RegistrationData");

      String consumerAgent = registrationData.getConsumerAgent();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(consumerAgent, "consumer agent", "RegistrationData");

      Registration registration;
      try
      {
         log.debug("Attempting to register consumer named '" + consumerName + "', agent '" + consumerAgent + "'.");

         // check that the consumer agent is valid before trying to register
         RegistrationUtils.validateConsumerAgent(consumerAgent);

         registration = producer.getRegistrationManager().addRegistrationTo(consumerName, createRegistrationProperties(registrationData), registrationRequirements.getRegistrationProperties(), true);
         updateRegistrationInformation(registration, registrationData);
      }
      catch (Exception e)
      {
         String msg = "Could not register consumer named '" + consumerName + "'";
         log.debug(msg, e);
         throw WSRP2ExceptionFactory.throwWSException(OperationFailed.class, msg, e);
      }

      RegistrationContext registrationContext = WSRPTypeFactory.createRegistrationContext(registration.getRegistrationHandle());
      log.debug("Registration completed without error.");
      return registrationContext;
   }
View Full Code Here

         log.debug("Attempting to modify registration with handle '" + registrationHandle + "'");
         String msg = "Could not modify registration with handle '" + registrationHandle + "'";
         try
         {
            Registration registration = producer.getRegistrationManager().getRegistration(registrationHandle);

            Map<QName, Object> properties = createRegistrationProperties(registrationData);

            // check that the given registration properties are acceptable according to expectations and policy
            ProducerRegistrationRequirements req = producer.getProducerRegistrationRequirements();
            req.getPolicy().validateRegistrationDataFor(properties, consumerName, req.getRegistrationProperties(), producer.getRegistrationManager());

            registration.updateProperties(properties);
            updateRegistrationInformation(registration, registrationData);
         }
         catch (NoSuchRegistrationException e)
         {
            log.debug(msg, e);
View Full Code Here

            throwInvalidRegistrationFault("registration handle is missing but registration is required");
         }

         try
         {
            Registration registration = producer.getRegistrationManager().getRegistration(regHandle);
            if (registration == null)
            {
               throwInvalidRegistrationFault("provided registration handle '" + regHandle + "' is not registered with this producer");
            }
            return registration;
         }
         catch (RegistrationException e)
         {
            throwOperationFailedFault("Failed to retrieve registration information associated with handle " + regHandle, e);
            return null;
         }
      }
      else
      {
         try
         {
            Registration registration = producer.getRegistrationManager().getNonRegisteredRegistration();
            if (registration == null)
            {
               throwInvalidRegistrationFault("Could not acquire the nonregistered registration from the RegistrationManager");
            }
            return registration;
View Full Code Here

   private PortletInvocationResponse invoke(RequestProcessor requestProcessor, RegistrationContext registrationContext, String invocationType, String handle)
      throws PortletInvokerException, OperationFailed, ModifyRegistrationRequired, InvalidRegistration
   {
      log.debug(invocationType + " on portlet '" + handle + "'");

      Registration registration = producer.getRegistrationOrFailIfInvalid(registrationContext);
      RegistrationLocal.setRegistration(registration);
      final PortletInvocation invocation = requestProcessor.getInvocation();

      final InvocationHandlerDelegate delegate = InvocationHandlerDelegate.producerDelegate();
      if (delegate != null)
View Full Code Here

   public PortletDescriptionResponse getPortletDescription(GetPortletDescription getPortletDescription)
      throws AccessDenied, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory,
      MissingParameters, ModifyRegistrationRequired, OperationFailed, OperationNotSupported, ResourceSuspended
   {
      WSRP2ExceptionFactory.throwOperationFailedIfValueIsMissing(getPortletDescription, GET_PORTLET_DESCRIPTION);
      Registration registration = producer.getRegistrationOrFailIfInvalid(getPortletDescription.getRegistrationContext());

      PortletContext portletContext = getPortletDescription.getPortletContext();
      WSRP2ExceptionFactory.throwMissingParametersIfValueIsMissing(portletContext, PORTLET_CONTEXT, GET_PORTLET_DESCRIPTION);

      UserContext userContext = getPortletDescription.getUserContext();
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.