}
}
public ConsumerGroupSPI toModel(ConsumerGroupSPI initial, JCRRegistrationPersistenceManager persistenceManager)
{
ConsumerGroupSPI group = (initial != null ? initial : persistenceManager.newConsumerGroupSPI(getName()));
group.setPersistentKey(getPersistentKey());
RegistrationStatus status = getStatus();
if (status == null)
{
status = RegistrationStatus.PENDING;
}
group.setStatus(status);
try
{
for (ConsumerMapping cm : getConsumers())
{
Consumer consumer = persistenceManager.getConsumerById(cm.getPersistentKey());
if (consumer == null)
{
consumer = cm.toModel((ConsumerSPI)consumer, persistenceManager);
}
group.addConsumer(consumer);
}
return group;
}
catch (RegistrationException e)