qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r754958 - in /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server: plugins/PluginManager.java security/access/plugins/LegacyAccessPlugin.java
Date Mon, 16 Mar 2009 16:53:59 GMT
Author: aidan
Date: Mon Mar 16 16:53:59 2009
New Revision: 754958

URL: http://svn.apache.org/viewvc?rev=754958&view=rev
Log:
QPID-1626: handle legacy config file a bit more gracefully.

Added:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/LegacyAccessPlugin.java
Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java?rev=754958&r1=754957&r2=754958&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java
Mon Mar 16 16:53:59 2009
@@ -34,6 +34,7 @@
 import org.apache.qpid.server.security.access.ACLPluginFactory;
 import org.apache.qpid.server.security.access.plugins.AllowAll;
 import org.apache.qpid.server.security.access.plugins.DenyAll;
+import org.apache.qpid.server.security.access.plugins.LegacyAccessPlugin;
 import org.apache.qpid.server.security.access.plugins.SimpleXML;
 import org.apache.qpid.server.security.access.plugins.network.FirewallPlugin;
 import org.osgi.framework.BundleActivator;
@@ -166,6 +167,7 @@
             _securityPlugins.put(SimpleXML.class.getName(), SimpleXML.FACTORY);
             _securityPlugins.put(AllowAll.class.getName(), AllowAll.FACTORY);
             _securityPlugins.put(DenyAll.class.getName(), DenyAll.FACTORY);
+            _securityPlugins.put(LegacyAccessPlugin.class.getName(), LegacyAccessPlugin.FACTORY);
             _securityPlugins.put(FirewallPlugin.class.getName(), FirewallPlugin.FACTORY);
         }
         return _securityPlugins;

Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/LegacyAccessPlugin.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/LegacyAccessPlugin.java?rev=754958&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/LegacyAccessPlugin.java
(added)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/LegacyAccessPlugin.java
Mon Mar 16 16:53:59 2009
@@ -0,0 +1,71 @@
+/*
+ *  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.security.access.plugins;
+
+import java.util.Collection;
+import java.util.HashSet;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.qpid.server.security.access.ACLPlugin;
+import org.apache.qpid.server.security.access.ACLPluginFactory;
+
+/**
+ * 
+ * Used to suppress warnings in legacy config files that have things in <security>
which aren't handled by a plugin directly. 
+ *
+ */
+public class LegacyAccessPlugin extends BasicACLPlugin
+{
+    public static final ACLPluginFactory FACTORY = new ACLPluginFactory()
+    {
+        private Collection maskedTags = new HashSet<String>();
+        {
+            maskedTags.add("principal-databases");
+            maskedTags.add("access");
+            maskedTags.add("msg-auth");
+            maskedTags.add("false");
+            maskedTags.add("jmx");
+        }
+
+        public boolean supportsTag(String name)
+        {
+            return maskedTags .contains(name);
+        }
+
+        public ACLPlugin newInstance(Configuration config)
+        {
+            return new LegacyAccessPlugin();
+        }
+    };
+    
+    public String getPluginName()
+    {
+        return getClass().getSimpleName();
+    }
+
+    @Override 
+    protected AuthzResult getResult()
+    {
+        // Always abstain
+        return AuthzResult.ABSTAIN;
+    }
+
+}



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message