@Override
 public void storeDestination(final PersistedDestination destination) throws Exception {
   deleteDestination(destination.getType(), destination.getName());
   long id = idGenerator.generateID();
   destination.setId(id);
   jmsJournal.appendAddRecord(id, DESTINATION_RECORD, destination, true);
   destinations.put(new Pair<>(destination.getType(), destination.getName()), destination);
 }
 @Override
 public void storeConnectionFactory(final PersistedConnectionFactory connectionFactory)
     throws Exception {
   deleteConnectionFactory(connectionFactory.getName());
   long id = idGenerator.generateID();
   connectionFactory.setId(id);
   jmsJournal.appendAddRecord(id, CF_RECORD, connectionFactory, true);
   mapFactories.put(connectionFactory.getName(), connectionFactory);
 }
 /**
  * @param packet
  * @throws Exception
  */
 private void handleAppendAddRecord(final ReplicationAddMessage packet) throws Exception {
   Journal journalToUse = getJournal(packet.getJournalID());
   if (packet.getRecord() == ADD_OPERATION_TYPE.UPDATE) {
     if (ReplicationEndpoint.trace) {
       ActiveMQServerLogger.LOGGER.trace("Endpoint appendUpdate id = " + packet.getId());
     }
     journalToUse.appendUpdateRecord(
         packet.getId(), packet.getJournalRecordType(), packet.getRecordData(), noSync);
   } else {
     if (ReplicationEndpoint.trace) {
       ActiveMQServerLogger.LOGGER.trace("Endpoint append id = " + packet.getId());
     }
     journalToUse.appendAddRecord(
         packet.getId(), packet.getJournalRecordType(), packet.getRecordData(), noSync);
   }
 }