qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1751864 [2/2] - in /qpid/java/trunk: bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/ bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkel...
Date Fri, 08 Jul 2016 08:03:43 GMT
Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
Fri Jul  8 08:03:42 2016
@@ -61,6 +61,7 @@ import org.apache.qpid.server.store.Dura
 import org.apache.qpid.server.store.Event;
 import org.apache.qpid.server.store.EventListener;
 import org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler;
+import org.apache.qpid.server.store.preferences.PreferenceStore;
 import org.apache.qpid.server.transport.AMQPConnection;
 import org.apache.qpid.server.transport.AbstractAMQPConnection;
 import org.apache.qpid.server.util.Action;
@@ -108,7 +109,7 @@ public class VirtualHostTest extends Qpi
         when(_virtualHostNode.getModel()).thenReturn(objectFactory.getModel());
         when(_virtualHostNode.getTaskExecutor()).thenReturn(_taskExecutor);
         when(_virtualHostNode.getChildExecutor()).thenReturn(_taskExecutor);
-
+        when(_virtualHostNode.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
     }
 
     @Override

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerAdapterTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerAdapterTest.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerAdapterTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerAdapterTest.java
Fri Jul  8 08:03:42 2016
@@ -37,6 +37,7 @@ import org.apache.qpid.server.model.Virt
 import org.apache.qpid.server.model.VirtualHostNode;
 import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.store.preferences.NoopPreferenceStoreFactoryService;
+import org.apache.qpid.server.store.preferences.PreferenceStore;
 import org.apache.qpid.server.virtualhost.TestMemoryVirtualHost;
 import org.apache.qpid.server.virtualhostnode.TestVirtualHostNode;
 import org.apache.qpid.test.utils.QpidTestCase;
@@ -63,6 +64,7 @@ public class BrokerAdapterTest extends Q
         when(_systemConfig.getModel()).thenReturn(BrokerModel.getInstance());
         when(_systemConfig.getEventLogger()).thenReturn(new EventLogger());
         when(_systemConfig.getCategoryClass()).thenReturn(SystemConfig.class);
+        when(_systemConfig.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
     }
 
     @Override
@@ -183,30 +185,4 @@ public class BrokerAdapterTest extends Q
         };
         vh.create();
     }
-
-    public void testPreferenceStoreDetails()
-    {
-        Map<String, Object> attributes = new HashMap<>();
-        attributes.put("name", "Broker");
-        attributes.put(Broker.MODEL_VERSION, BrokerModel.MODEL_VERSION);
-        attributes.put(Broker.DURABLE, true);
-
-        final Map<String, Object> settings = new HashMap<>();
-        settings.put("type", NoopPreferenceStoreFactoryService.TYPE);
-        Map<String, Object> additionalSettings = new HashMap<>();
-        additionalSettings.put("path", "testPath");
-        settings.put("attributes", additionalSettings);
-
-        attributes.put("preferenceStoreAttributes", settings);
-        _brokerAdapter = new BrokerAdapter(attributes, _systemConfig);
-        _brokerAdapter.open();
-
-        assertEquals("preference store has unexpected type",
-                     NoopPreferenceStoreFactoryService.TYPE,
-                     _brokerAdapter.getPreferenceStoreAttributes().getType());
-        Map<String, Object> retrievedAdditionalSettings =
-                new HashMap<>(_brokerAdapter.getPreferenceStoreAttributes().getAttributes());
-        assertEquals("unexpected additional settings", additionalSettings, retrievedAdditionalSettings);
-        assertEquals("unexpected path", "testPath", retrievedAdditionalSettings.get("path"));
-    }
 }

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingletonImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingletonImpl.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingletonImpl.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/singleton/TestSingletonImpl.java
Fri Jul  8 08:03:42 2016
@@ -44,7 +44,7 @@ public class TestSingletonImpl extends A
     public static final int DERIVED_VALUE = -100;
     private final SecurityManager _securityManager;
     private final PreferenceStore _preferenceStore =
-            new NoopPreferenceStoreFactoryService().createInstance(Collections.<String,
Object>emptyMap());
+            new NoopPreferenceStoreFactoryService().createInstance(null, Collections.<String,
Object>emptyMap());
 
     @ManagedAttributeField
     private String _automatedPersistedValue;

Added: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/preferences/JsonFilePreferenceStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/preferences/JsonFilePreferenceStoreTest.java?rev=1751864&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/preferences/JsonFilePreferenceStoreTest.java
(added)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/preferences/JsonFilePreferenceStoreTest.java
Fri Jul  8 08:03:42 2016
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.qpid.server.store.preferences;
+
+import static org.mockito.Matchers.anyCollection;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import org.apache.qpid.server.model.BrokerModel;
+import org.apache.qpid.server.model.SystemConfig;
+import org.apache.qpid.test.utils.QpidTestCase;
+import org.apache.qpid.util.FileUtils;
+
+public class JsonFilePreferenceStoreTest extends QpidTestCase
+{
+    private File _storeFile;
+    private ObjectMapper _objectMapper;
+    private PreferenceStoreUpdater _updater;
+    private JsonFilePreferenceStore _store;
+
+    @Override
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        _storeFile = new File(TMP_FOLDER, getTestName() + System.currentTimeMillis() + ".preferences.json");
+        _store = new JsonFilePreferenceStore(_storeFile.getPath(), SystemConfig.DEFAULT_POSIX_FILE_PERMISSIONS);
+        _objectMapper = new ObjectMapper();
+        _updater = mock(PreferenceStoreUpdater.class);
+        when(_updater.getLatestVersion()).thenReturn(BrokerModel.MODEL_VERSION);
+    }
+
+    @Override
+    protected void tearDown() throws Exception
+    {
+        try
+        {
+            _store.close();
+            FileUtils.delete(_storeFile, true);
+        }
+        finally
+        {
+            super.tearDown();
+        }
+    }
+
+    public void testOpenAndLoad() throws Exception
+    {
+        UUID prefId = UUID.randomUUID();
+        Map<String, Object> attributes = Collections.<String, Object>singletonMap("test1",
"test2");
+        createSingleEntryTestFile(prefId, attributes);
+
+        Collection<PreferenceRecord> records = _store.openAndLoad(_updater);
+
+        assertEquals("Unexpected size of stored preferences", 1, records.size());
+
+        PreferenceRecord storeRecord = records.iterator().next();
+        assertEquals("Unexpected stored preference id", prefId, storeRecord.getId());
+        assertEquals("Unexpected stored preference attributes", attributes, new HashMap<>(storeRecord.getAttributes()));
+
+        verify(_updater, never()).updatePreferences(anyString(), anyCollection());
+    }
+
+    public void testUpdateOrCreate() throws Exception
+    {
+        final UUID id = UUID.randomUUID();
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put("test1", "test2");
+        final PreferenceRecord record = new PreferenceRecordImpl(id, attributes);
+
+        _store.openAndLoad(_updater);
+        _store.updateOrCreate(Collections.singleton(record));
+
+        assertSinglePreferenceRecordInStore(id, attributes);
+    }
+
+    public void testReplace() throws Exception
+    {
+        UUID prefId = UUID.randomUUID();
+        Map<String, Object> attributes = Collections.<String, Object>singletonMap("test1",
"test2");
+        createSingleEntryTestFile(prefId, attributes);
+
+        final UUID newPrefId = UUID.randomUUID();
+        final Map<String, Object> newAttributes = new HashMap<>();
+        newAttributes.put("test3", "test4");
+        final PreferenceRecord newRecord = new PreferenceRecordImpl(newPrefId, newAttributes);
+
+        _store.openAndLoad(_updater);
+        _store.replace(Collections.singleton(prefId), Collections.singleton(newRecord));
+
+        assertSinglePreferenceRecordInStore(newPrefId, newAttributes);
+    }
+
+    public void testReplaceToDelete() throws Exception
+    {
+        UUID prefId = UUID.randomUUID();
+        Map<String, Object> attributes = Collections.<String, Object>singletonMap("test1",
"test2");
+        createSingleEntryTestFile(prefId, attributes);
+
+        _store.openAndLoad(_updater);
+        _store.replace(Collections.singleton(prefId), Collections.<PreferenceRecord>emptyList());
+
+        assertStoreVersionAndSizeAndGetData(0);
+    }
+
+    public void testUpdateFailIfNotOpened() throws Exception
+    {
+        try
+        {
+            _store.updateOrCreate(Collections.<PreferenceRecord>emptyList());
+            fail("Should not be able to update or create");
+        }
+        catch (IllegalStateException e)
+        {
+            // pass
+        }
+    }
+
+    public void testReplaceFailIfNotOpened() throws Exception
+    {
+        try
+        {
+            _store.replace(Collections.<UUID>emptyList(), Collections.<PreferenceRecord>emptyList());
+            fail("Should not be able to replace");
+        }
+        catch (IllegalStateException e)
+        {
+            // pass
+        }
+    }
+
+    private void createSingleEntryTestFile(final UUID prefId, final Map<String, Object>
attributes) throws IOException
+    {
+        Map<String, Object> content = new HashMap<>();
+        content.put("version", BrokerModel.MODEL_VERSION);
+        Map<String, Object> record = new LinkedHashMap<>();
+        record.put("id", prefId);
+        record.put("attributes", attributes);
+        content.put("preferences", Collections.singleton(record));
+        _objectMapper.writeValue(_storeFile, content);
+    }
+
+    private void assertSinglePreferenceRecordInStore(final UUID id, final Map<String,
Object> attributes)
+            throws java.io.IOException
+    {
+        Collection preferences = assertStoreVersionAndSizeAndGetData(1);
+
+        Map preferenceMap = (Map) preferences.iterator().next();
+        assertEquals("Unexpected id", id.toString(), preferenceMap.get("id"));
+
+        Object storedAttributes = preferenceMap.get("attributes");
+        assertNotNull("Attributes should not be null", storedAttributes);
+        assertEquals("Unexpected attributes", attributes, new HashMap<String, Object>((Map)
storedAttributes));
+    }
+
+    private Collection assertStoreVersionAndSizeAndGetData(final int expectedSize) throws
IOException
+    {
+        Map<String, Object> storedData =
+                _objectMapper.readValue(_storeFile, new TypeReference<HashMap<String,
Object>>()
+                {
+                });
+
+        assertEquals("Unexpected stored version", BrokerModel.MODEL_VERSION, storedData.get("version"));
+        Collection preferences = (Collection) storedData.get("preferences");
+
+        assertEquals("Unexpected size of preference records", expectedSize, preferences.size());
+        return preferences;
+    }
+}
\ No newline at end of file

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
Fri Jul  8 08:03:42 2016
@@ -45,6 +45,7 @@ import org.apache.qpid.server.model.Virt
 import org.apache.qpid.server.protocol.AMQSessionModel;
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.store.DurableConfigurationStore;
+import org.apache.qpid.server.store.preferences.PreferenceStore;
 import org.apache.qpid.server.transport.AMQPConnection;
 import org.apache.qpid.server.virtualhost.AbstractVirtualHost;
 import org.apache.qpid.server.virtualhost.QueueExistsException;
@@ -103,6 +104,7 @@ public class BrokerTestHelper
         when(systemConfig.getTaskExecutor()).thenReturn(TASK_EXECUTOR);
         when(broker.getChildExecutor()).thenReturn(TASK_EXECUTOR);
         when(systemConfig.getChildExecutor()).thenReturn(TASK_EXECUTOR);
+        when(systemConfig.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
 
         return broker;
     }
@@ -149,6 +151,7 @@ public class BrokerTestHelper
         when(virtualHostNode.getCategoryClass()).thenReturn(VirtualHostNode.class);
         when(virtualHostNode.getTaskExecutor()).thenReturn(TASK_EXECUTOR);
         when(virtualHostNode.getChildExecutor()).thenReturn(TASK_EXECUTOR);
+        when(virtualHostNode.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
 
         AbstractVirtualHost
                 host = (AbstractVirtualHost) objectFactory.create(VirtualHost.class, attributes,
virtualHostNode );

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/AbstractVirtualHostTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/AbstractVirtualHostTest.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/AbstractVirtualHostTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/AbstractVirtualHostTest.java
Fri Jul  8 08:03:42 2016
@@ -56,6 +56,7 @@ import org.apache.qpid.server.model.Virt
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.server.store.preferences.PreferenceStore;
 import org.apache.qpid.test.utils.QpidTestCase;
 import org.apache.qpid.test.utils.TestFileUtils;
 import org.apache.qpid.util.FileUtils;
@@ -73,6 +74,7 @@ public class AbstractVirtualHostTest ext
 
         SystemConfig systemConfig = mock(SystemConfig.class);
         when(systemConfig.getEventLogger()).thenReturn(mock(EventLogger.class));
+        when(systemConfig.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
         Broker<?> broker = mock(Broker.class);
         when(broker.getParent(SystemConfig.class)).thenReturn(systemConfig);
         when(broker.getModel()).thenReturn(BrokerModel.getInstance());
@@ -90,6 +92,7 @@ public class AbstractVirtualHostTest ext
         when(_node.getChildExecutor()).thenReturn(_taskExecutor);
         when(_node.getConfigurationStore()).thenReturn(mock(DurableConfigurationStore.class));
         when(_node.getCategoryClass()).thenReturn(VirtualHostNode.class);
+        when(_node.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
 
         _failingStore = mock(MessageStore.class);
         doThrow(new RuntimeException("Cannot open store")).when(_failingStore).openMessageStore(any(ConfiguredObject.class));

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostQueueCreationTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostQueueCreationTest.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostQueueCreationTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/virtualhost/VirtualHostQueueCreationTest.java
Fri Jul  8 08:03:42 2016
@@ -47,6 +47,7 @@ import org.apache.qpid.server.queue.Prio
 import org.apache.qpid.server.queue.StandardQueueImpl;
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.store.DurableConfigurationStore;
+import org.apache.qpid.server.store.preferences.PreferenceStore;
 import org.apache.qpid.test.utils.QpidTestCase;
 
 public class VirtualHostQueueCreationTest extends QpidTestCase
@@ -70,6 +71,7 @@ public class VirtualHostQueueCreationTes
 
         SystemConfig<?> context = mock(SystemConfig.class);
         when(context.getEventLogger()).thenReturn(eventLogger);
+        when(context.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
 
         Broker broker = mock(Broker.class);
         when(broker.getObjectFactory()).thenReturn(objectFactory);
@@ -88,6 +90,7 @@ public class VirtualHostQueueCreationTes
         when(_virtualHostNode.getTaskExecutor()).thenReturn(_taskExecutor);
         when(_virtualHostNode.getChildExecutor()).thenReturn(_taskExecutor);
         when(((VirtualHostNode)_virtualHostNode).getCategoryClass()).thenReturn(VirtualHostNode.class);
+        when(_virtualHostNode.createPreferenceStore()).thenReturn(mock(PreferenceStore.class));
         _virtualHost = createHost();
     }
 

Modified: qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbySystemConfig.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbySystemConfig.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbySystemConfig.java
(original)
+++ qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbySystemConfig.java
Fri Jul  8 08:03:42 2016
@@ -24,6 +24,7 @@ import org.apache.qpid.server.model.Mana
 import org.apache.qpid.server.model.SystemConfig;
 import org.apache.qpid.server.store.FileBasedSettings;
 import org.apache.qpid.server.store.SizeMonitoringSettings;
+import org.apache.qpid.server.store.preferences.PreferenceStoreAttributes;
 
 public interface DerbySystemConfig<X extends DerbySystemConfig<X>> extends SystemConfig<X>,
FileBasedSettings,
                                                                            SizeMonitoringSettings
@@ -36,4 +37,8 @@ public interface DerbySystemConfig<X ext
 
     @ManagedAttribute(mandatory = true, defaultValue = "0")
     Long getStoreOverfullSize();
+
+    @ManagedAttribute( description = "Configuration for the preference store, e.g. type,
path, etc.",
+            defaultValue = "{\"type\": \"Provided\"}")
+    PreferenceStoreAttributes getPreferenceStoreAttributes();
 }

Modified: qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java
(original)
+++ qpid/java/trunk/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java
Fri Jul  8 08:03:42 2016
@@ -21,6 +21,7 @@ package org.apache.qpid.server.virtualho
 
 
 import org.apache.qpid.server.model.ManagedAttribute;
+import org.apache.qpid.server.store.preferences.PreferenceStoreAttributes;
 
 public interface DerbyVirtualHostNode<X extends DerbyVirtualHostNode<X>> extends
org.apache.qpid.server.model.VirtualHostNode<X>, org.apache.qpid.server.store.FileBasedSettings
 {
@@ -28,4 +29,8 @@ public interface DerbyVirtualHostNode<X
 
     @ManagedAttribute(mandatory = true, defaultValue = "${qpid.work_dir}${file.separator}${this:name}${file.separator}config")
     String getStorePath();
+
+    @ManagedAttribute( description = "Configuration for the preference store, e.g. type,
path, etc.",
+            defaultValue = "{\"type\": \"Provided\"}")
+    PreferenceStoreAttributes getPreferenceStoreAttributes();
 }

Modified: qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCSystemConfig.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCSystemConfig.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCSystemConfig.java
(original)
+++ qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCSystemConfig.java
Fri Jul  8 08:03:42 2016
@@ -22,6 +22,7 @@ package org.apache.qpid.server.store.jdb
 
 import org.apache.qpid.server.model.ManagedAttribute;
 import org.apache.qpid.server.model.SystemConfig;
+import org.apache.qpid.server.store.preferences.PreferenceStoreAttributes;
 
 public interface JDBCSystemConfig<X extends JDBCSystemConfig<X>> extends SystemConfig<X>,
JDBCSettings
 {
@@ -36,4 +37,8 @@ public interface JDBCSystemConfig<X exte
 
     @ManagedAttribute(secure=true, defaultValue = "${systemConfig.password}")
     String getPassword();
+
+    @ManagedAttribute( description = "Configuration for the preference store, e.g. type,
path, etc.",
+            defaultValue = "{\"type\": \"Provided\"}")
+    PreferenceStoreAttributes getPreferenceStoreAttributes();
 }

Modified: qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/virtualhostnode/jdbc/JDBCVirtualHostNode.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/virtualhostnode/jdbc/JDBCVirtualHostNode.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/virtualhostnode/jdbc/JDBCVirtualHostNode.java
(original)
+++ qpid/java/trunk/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/virtualhostnode/jdbc/JDBCVirtualHostNode.java
Fri Jul  8 08:03:42 2016
@@ -24,6 +24,7 @@ import org.apache.qpid.server.model.Mana
 import org.apache.qpid.server.model.VirtualHostNode;
 import org.apache.qpid.server.store.jdbc.DefaultConnectionProviderFactory;
 import org.apache.qpid.server.store.jdbc.JDBCSettings;
+import org.apache.qpid.server.store.preferences.PreferenceStoreAttributes;
 
 public interface JDBCVirtualHostNode<X extends JDBCVirtualHostNode<X>> extends
VirtualHostNode<X>, JDBCSettings
 {
@@ -39,4 +40,8 @@ public interface JDBCVirtualHostNode<X e
 
     @ManagedAttribute(secure=true)
     String getPassword();
+
+    @ManagedAttribute( description = "Configuration for the preference store, e.g. type,
path, etc.",
+            defaultValue = "{\"type\": \"Provided\"}")
+    PreferenceStoreAttributes getPreferenceStoreAttributes();
 }

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/preferences/QueryPreferenceValue.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/preferences/QueryPreferenceValue.java?rev=1751864&r1=1751863&r2=1751864&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/preferences/QueryPreferenceValue.java
(original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/preferences/QueryPreferenceValue.java
Fri Jul  8 08:03:42 2016
@@ -19,10 +19,10 @@
 
 package org.apache.qpid.server.management.plugin.preferences;
 
+import java.util.Collections;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
-import com.google.common.collect.ImmutableMap;
-
 import org.apache.qpid.server.management.plugin.servlet.query.ConfiguredObjectQuery;
 import org.apache.qpid.server.model.preferences.PreferenceValue;
 
@@ -71,7 +71,7 @@ public class QueryPreferenceValue implem
             _pageSize = getValue(preferenceValueAttributes, PAGE_SIZE_ATTRIBUTE, DEFAULT_PAGE_SIZE);
             _currentPage = getValue(preferenceValueAttributes, CURRENT_PAGE_ATTRIBUTE, 0);
             _refreshInterval = getValue(preferenceValueAttributes, REFRESH_INTERVAL_ATTRIBUTE,
DEFAULT_REFRESH_INTERVAL);
-            _originalAttributeMap = ImmutableMap.copyOf(preferenceValueAttributes);
+            _originalAttributeMap = Collections.unmodifiableMap(new LinkedHashMap<>(preferenceValueAttributes));
         }
         catch (ClassCastException e)
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message