private CommonRecord createCommonRecord(GenericRecord avroRecord) { GenericFixed uuidFixed = (GenericFixed) avroRecord.get(UUID); if (uuidFixed != null) { UUID uuid = AvroGenericUtils.createUuidFromFixed(uuidFixed); CommonRecord newRecord = commonFactory.createCommonRecord(uuid, avroRecord.getSchema()); records.put(uuid, newRecord); return newRecord; } else { return commonFactory.createCommonRecord(avroRecord.getSchema()); } }
@Override public synchronized CommonRecord getConfiguration() { if (rootRecord != null) { return commonFactory.createCommonRecord(rootRecord); } return null; }
@Override public void onConfigurationProcessed() { CommonRecord copyRecord = commonFactory.createCommonRecord(rootRecord); synchronized (subscribers) { for (ConfigurationReceiver receiver : subscribers) { receiver.onConfigurationUpdated(copyRecord); } } }