diff options
Diffstat (limited to 'java/broker-core/src')
2 files changed, 21 insertions, 9 deletions
diff --git a/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java b/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java index 11e92fcff9..d5f7b3a317 100644 --- a/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java +++ b/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ConfigurationEntryStore.java @@ -26,14 +26,6 @@ public interface ConfigurationEntryStore extends DurableConfigurationStore { /** - * Copies the store into the given location - * - * @param target location to copy store into - * @throws IllegalConfigurationException if store cannot be copied into given location - */ - void copyTo(String copyLocation); - - /** * Return the store location for the opened store or null if store has not been opened. * * @return store location for the opened store or null if store has not been opened diff --git a/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java b/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java index d733c351c4..7a0f57bd33 100644 --- a/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java +++ b/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java @@ -356,7 +356,7 @@ public class JsonFileConfigStore implements DurableConfigurationStore } else { - + record = new ConfiguredObjectRecordImpl(record); _objectsById.put(record.getId(), record); List<UUID> idsForType = _idsByType.get(record.getType()); if(idsForType == null) @@ -537,6 +537,7 @@ public class JsonFileConfigStore implements DurableConfigurationStore } for(ConfiguredObjectRecord record : records) { + record = new ConfiguredObjectRecordImpl(record); final UUID id = record.getId(); final String type = record.getType(); if(_objectsById.put(id, record) == null) @@ -623,6 +624,11 @@ public class JsonFileConfigStore implements DurableConfigurationStore private final Map<String, Object> _attributes; private final Map<String, UUID> _parents; + private ConfiguredObjectRecordImpl(ConfiguredObjectRecord record) + { + this(record.getId(), record.getType(), record.getAttributes(), convertParents(record.getParents())); + } + private ConfiguredObjectRecordImpl(final UUID id, final String type, final Map<String, Object> attributes, final Map<String, UUID> parents) { @@ -678,5 +684,19 @@ public class JsonFileConfigStore implements DurableConfigurationStore } + private static Map<String, UUID> convertParents(final Map<String, ConfiguredObjectRecord> parents) + { + if(parents == null || parents.isEmpty()) + { + return Collections.emptyMap(); + } + Map<String,UUID> parentMap = new HashMap<>(); + for(Map.Entry<String,ConfiguredObjectRecord> entry : parents.entrySet()) + { + parentMap.put(entry.getKey(), entry.getValue().getId()); + } + return parentMap; + } + } |