diff options
| author | Keith Wall <kwall@apache.org> | 2014-04-21 14:28:29 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-04-21 14:28:29 +0000 |
| commit | c31c0f812ac7c165c46f3783868f22a90475584d (patch) | |
| tree | 1250b75be7ba05a5d85e88d08d42e9956421d84d /qpid/java/broker-plugins/derby-store | |
| parent | 9f70e3f0d1304971bd92e81add63cf22d0657640 (diff) | |
| download | qpid-python-c31c0f812ac7c165c46f3783868f22a90475584d.tar.gz | |
QPID-5715: [Java Broker] Add virtual host node to the model and refactor existing broker functionality to conform the new model. Save configuration model version as VHN attribute and refactor the upgraders and configuration recovery.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1588886 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins/derby-store')
4 files changed, 132 insertions, 2 deletions
diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java index e7a330102e..75711547e1 100644 --- a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java +++ b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java @@ -66,8 +66,11 @@ public class DerbyMessageStoreFactory implements MessageStoreFactory, DurableCon } } - @SuppressWarnings("unchecked") - Map<String, Object> configurationStoreSettings = (Map<String, Object>) attributes.get(VirtualHost.CONFIGURATION_STORE_SETTINGS); + } + + @Override + public void validateConfigurationStoreSettings(Map<String, Object> configurationStoreSettings) + { if(configurationStoreSettings != null && getType().equals(configurationStoreSettings.get(DurableConfigurationStore.STORE_TYPE))) { Object storePath = configurationStoreSettings.get(DurableConfigurationStore.STORE_PATH); diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java new file mode 100644 index 0000000000..f01391c0bf --- /dev/null +++ b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNode.java @@ -0,0 +1,63 @@ +/* + * + * 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.virtualhostnode.derby; + +import java.util.Map; + +import org.apache.qpid.server.configuration.updater.TaskExecutor; +import org.apache.qpid.server.model.Broker; +import org.apache.qpid.server.model.ManagedAttributeField; +import org.apache.qpid.server.model.ManagedObject; +import org.apache.qpid.server.plugin.DurableConfigurationStoreFactory; +import org.apache.qpid.server.store.derby.DerbyMessageStoreFactory; +import org.apache.qpid.server.virtualhostnode.AbstractStandardVirtualHostNode; +import org.apache.qpid.server.virtualhostnode.FileBasedVirtualHostNode; + +@ManagedObject( category = false, type = "DERBY" ) +public class DerbyVirtualHostNode extends AbstractStandardVirtualHostNode<DerbyVirtualHostNode> implements FileBasedVirtualHostNode<DerbyVirtualHostNode> +{ + @ManagedAttributeField + private String _storePath; + + public DerbyVirtualHostNode(Broker<?> parent, Map<String, Object> attributes, TaskExecutor taskExecutor) + { + super(parent, attributes, taskExecutor); + } + + @Override + protected DurableConfigurationStoreFactory getDurableConfigurationStoreFactory() + { + return new DerbyMessageStoreFactory(); + } + + @Override + public String getStorePath() + { + return _storePath; + } + + @Override + public String toString() + { + return getClass().getSimpleName() + " [id=" + getId() + ", name=" + getName() + ", storePath=" + getStorePath() + "]"; + } +} diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNodeFactory.java b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNodeFactory.java new file mode 100644 index 0000000000..7b01511036 --- /dev/null +++ b/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/virtualhostnode/derby/DerbyVirtualHostNodeFactory.java @@ -0,0 +1,45 @@ +/* + * + * 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.virtualhostnode.derby; + +import java.util.Map; + +import org.apache.qpid.server.model.AbstractConfiguredObjectTypeFactory; +import org.apache.qpid.server.model.Broker; +import org.apache.qpid.server.model.ConfiguredObject; + +public class DerbyVirtualHostNodeFactory extends AbstractConfiguredObjectTypeFactory<DerbyVirtualHostNode> +{ + + public DerbyVirtualHostNodeFactory() + { + super(DerbyVirtualHostNode.class); + } + + @Override + public DerbyVirtualHostNode createInstance(Map<String, Object> attributes, ConfiguredObject<?>... parents) + { + Broker<?> broker = getParent(Broker.class, parents); + return new DerbyVirtualHostNode(broker, attributes, broker.getTaskExecutor()); + } + +} diff --git a/qpid/java/broker-plugins/derby-store/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory b/qpid/java/broker-plugins/derby-store/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory new file mode 100644 index 0000000000..9a942db521 --- /dev/null +++ b/qpid/java/broker-plugins/derby-store/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.ConfiguredObjectTypeFactory @@ -0,0 +1,19 @@ +# +# 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. +# +org.apache.qpid.server.virtualhostnode.derby.DerbyVirtualHostNodeFactory |
