}
}
public ConsumerSPI toModel(ConsumerSPI initial, JCRRegistrationPersistenceManager persistenceManager)
{
ConsumerSPI consumer = (initial != null ? initial : persistenceManager.newConsumerSPI(getId(), getName()));
consumer.setConsumerAgent(getConsumerAgent());
consumer.setPersistentKey(getPersistentKey());
consumer.setCapabilities(getCapabilities().toConsumerCapabilities());
try
{
ConsumerGroupMapping cgm = getGroup();
if (cgm != null)
{
consumer.setGroup(persistenceManager.getConsumerGroup(cgm.getName()));
}
for (RegistrationMapping rm : getRegistrations())
{
consumer.addRegistration(rm.toRegistration(consumer, persistenceManager));
}
}
catch (RegistrationException e)
{
throw new RuntimeException(e);