Package org.gatein.registration

Examples of org.gatein.registration.ConsumerGroup


   @Override
   protected ConsumerGroupSPI internalRemoveConsumerGroup(String name)
   {
      try
      {
         ConsumerGroup group = getConsumerGroup(name);
         remove(group.getPersistentKey(), ConsumerGroupMapping.class);
      }
      catch (RegistrationException e)
      {
         throw new IllegalArgumentException("Couldn't remove ConsumerGroup '" + name + "'", e);
      }
View Full Code Here


   {
      setName(consumer.getName());
      setId(consumer.getId());
      setConsumerAgent(consumer.getConsumerAgent());

      ConsumerGroup group = consumer.getGroup();
      if (group != null)
      {
         ConsumerGroupMapping cgm = findGroupById(group.getPersistentKey());
         setGroup(cgm);
      }

      ConsumerCapabilitiesMapping ccm = getCapabilities();
      ccm.initFrom(consumer.getCapabilities());
View Full Code Here

      if (createConsumerIfNeeded)
      {
         policy.validateConsumerName(consumerName, this);
      }

      ConsumerGroup group = getConsumerGroup(groupName);
      boolean justCreatedGroup = false;
      if (group == null)
      {
         if (createGroupIfNeeded)
         {
View Full Code Here

   public void removeConsumer(String identity) throws RegistrationException, NoSuchRegistrationException
   {
      Consumer consumer = getOrCreateConsumer(identity, false, null);

      ConsumerGroup group = consumer.getGroup();
      if (group != null)
      {
         group.removeConsumer(consumer);
      }

      // cascade delete the registrations
      ArrayList<Registration> registrations = new ArrayList<Registration>(consumer.getRegistrations());
      for (Registration reg : registrations)
View Full Code Here

   public Consumer addConsumerToGroupNamed(String consumerId, String groupName) throws RegistrationException
   {
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerId, "Consumer identity", null);
      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(groupName, "ConsumerGroup name", null);

      ConsumerGroup group = getConsumerGroup(groupName);
      if (group == null)
      {
         throw new NoSuchRegistrationException("There is no ConsumerGroup named '" + groupName
            + "' to add a Consumer to...");
      }

      ConsumerSPI consumer = getConsumerSPIById(consumerId);
      if (consumer == null)
      {
         throw new NoSuchRegistrationException("There is no Consumer with identity '" + consumerId
            + "' to add to ConsumerGroup named '" + groupName + "'. Did you create it?");
      }

      group.addConsumer(consumer);

      return consumer;
   }
View Full Code Here

   {
      setName(consumer.getName());
      setId(consumer.getId());
      setConsumerAgent(consumer.getConsumerAgent());

      ConsumerGroup group = consumer.getGroup();
      if (group != null)
      {
         ConsumerGroupMapping cgm = findGroupById(group.getPersistentKey());
         setGroup(cgm);
      }

      ConsumerCapabilitiesMapping ccm = getCapabilities();
      ccm.initFrom(consumer.getCapabilities());
View Full Code Here

TOP

Related Classes of org.gatein.registration.ConsumerGroup

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.