You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2014/02/13 20:41:24 UTC

svn commit: r1568015 [2/2] - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/exchange/ broker-core/src/main/java/org/apache/qpid/server/message/ broker-core/src/main/java/org/apache/qpid/server/model/adapter/ broker-core/src/...

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java Thu Feb 13 19:41:22 2014
@@ -42,6 +42,7 @@ import org.apache.qpid.server.model.UUID
 import org.apache.qpid.server.plugin.ExchangeType;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.QueueArgumentsConverter;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.security.SecurityManager;
 import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.store.MessageStore;
@@ -301,6 +302,10 @@ public class ServerSessionDelegate exten
                     {
                         exception(session, method, e, "Cannot subscribe to queue '" + queueName + "' with destination '" + destination);
                     }
+                    catch (QpidSecurityException e)
+                    {
+                        exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
+                    }
                 }
             }
         }
@@ -786,6 +791,10 @@ public class ServerSessionDelegate exten
             {
                 exception(session, method, e, "Cannot declare exchange '" + exchangeName);
             }
+            catch (QpidSecurityException e)
+            {
+                exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
+            }
 
 
         }
@@ -898,6 +907,10 @@ public class ServerSessionDelegate exten
         {
             exception(session, method, e, "Cannot delete exchange '" + method.getExchange() );
         }
+        catch (QpidSecurityException e)
+        {
+            exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
+        }
     }
 
     private boolean nameNullOrEmpty(String name)
@@ -992,6 +1005,10 @@ public class ServerSessionDelegate exten
                     {
                         exception(session, method, e, "Cannot add binding '" + method.getBindingKey());
                     }
+                    catch (QpidSecurityException e)
+                    {
+                        exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
+                    }
                 }
                 else
                 {
@@ -1045,6 +1062,10 @@ public class ServerSessionDelegate exten
                 {
                     exception(session, method, e, "Cannot remove binding '" + method.getBindingKey());
                 }
+                catch (QpidSecurityException e)
+                {
+                    exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
+                }
             }
         }
     }
@@ -1272,6 +1293,10 @@ public class ServerSessionDelegate exten
                                 {
                                     exception(session, method, e, "Cannot delete '" + method.getQueue());
                                 }
+                                catch (QpidSecurityException e)
+                                {
+                                    exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
+                                }
                             }
                         };
                     final ServerSession s = (ServerSession) session;
@@ -1324,6 +1349,10 @@ public class ServerSessionDelegate exten
             {
                 exception(session, method, e, "Cannot declare queue '" + queueName);
             }
+            catch (QpidSecurityException e)
+            {
+                exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
+            }
         }
     }
 
@@ -1401,6 +1430,10 @@ public class ServerSessionDelegate exten
                     {
                         exception(session, method, e, "Cannot delete queue '" + queueName);
                     }
+                    catch (QpidSecurityException e)
+                    {
+                        exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
+                    }
                 }
             }
         }
@@ -1432,6 +1465,10 @@ public class ServerSessionDelegate exten
                 {
                     exception(session, method, e, "Cannot purge queue '" + queueName);
                 }
+                catch (QpidSecurityException e)
+                {
+                    exception(session, method, ExecutionErrorCode.UNAUTHORIZED_ACCESS, e.getMessage());
+                }
             }
         }
     }

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java Thu Feb 13 19:41:22 2014
@@ -29,7 +29,7 @@ import java.util.concurrent.locks.Lock;
 import org.apache.log4j.Logger;
 import org.apache.qpid.AMQConnectionException;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.common.AMQPFilterTypes;
 import org.apache.qpid.framing.AMQMethodBody;
 import org.apache.qpid.framing.AMQShortString;
@@ -262,13 +262,13 @@ public class AMQChannel implements AMQSe
         return _channelId;
     }
 
-    public void setPublishFrame(MessagePublishInfo info, final MessageDestination e) throws AMQSecurityException
+    public void setPublishFrame(MessagePublishInfo info, final MessageDestination e) throws QpidSecurityException
     {
         String routingKey = info.getRoutingKey() == null ? null : info.getRoutingKey().asString();
         SecurityManager securityManager = getVirtualHost().getSecurityManager();
         if (!securityManager.authorisePublish(info.isImmediate(), routingKey, e.getName()))
         {
-            throw new AMQSecurityException("Permission denied: " + e.getName());
+            throw new QpidSecurityException("Permission denied: " + e.getName());
         }
         _currentMessage = new IncomingMessage(info);
         _currentMessage.setMessageDestination(e);
@@ -515,7 +515,8 @@ public class AMQChannel implements AMQSe
      * @throws AMQException                  if something goes wrong
      */
     public AMQShortString consumeFromSource(AMQShortString tag, MessageSource source, boolean acks,
-                                            FieldTable filters, boolean exclusive, boolean noLocal) throws AMQException
+                                            FieldTable filters, boolean exclusive, boolean noLocal)
+            throws AMQException, QpidSecurityException
     {
         if (tag == null)
         {
@@ -588,6 +589,11 @@ public class AMQChannel implements AMQSe
             _tag2SubscriptionTargetMap.remove(tag);
             throw e;
         }
+        catch (QpidSecurityException e)
+        {
+            _tag2SubscriptionTargetMap.remove(tag);
+            throw e;
+        }
         return tag;
     }
 

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java Thu Feb 13 19:41:22 2014
@@ -46,7 +46,7 @@ import org.apache.log4j.Logger;
 import org.apache.qpid.AMQChannelException;
 import org.apache.qpid.AMQConnectionException;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.codec.AMQCodecFactory;
 import org.apache.qpid.common.QpidProperties;
 import org.apache.qpid.common.ServerPropertyNames;
@@ -628,12 +628,6 @@ public class AMQProtocolEngine implement
                 _logger.info(e.getMessage() + " whilst processing:" + methodBody);
                 closeConnection(channelId, e);
             }
-            catch (AMQSecurityException e)
-            {
-                AMQConnectionException ce = evt.getMethod().getConnectionException(AMQConstant.ACCESS_REFUSED, e.getMessage());
-                _logger.info(e.getMessage() + " whilst processing:" + methodBody);
-                closeConnection(channelId, ce);
-            }
         }
         catch (Exception e)
         {

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicConsumeMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicConsumeMethodHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicConsumeMethodHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicConsumeMethodHandler.java Thu Feb 13 19:41:22 2014
@@ -35,6 +35,7 @@ import org.apache.qpid.server.protocol.A
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
 import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
 public class BasicConsumeMethodHandler implements StateAwareMethodListener<BasicConsumeBody>
@@ -175,6 +176,13 @@ public class BasicConsumeMethodHandler i
                                                    + queue.getName()
                                                    + " exclusively as it already has a consumer");
                 }
+                catch (QpidSecurityException e)
+                {
+                    throw body.getChannelException(AMQConstant.ACCESS_REFUSED,
+                                                   "Cannot subscribe to queue "
+                                                   + queue.getName()
+                                                   + " permission denied");
+                }
 
             }
         }

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicGetMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicGetMethodHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicGetMethodHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicGetMethodHandler.java Thu Feb 13 19:41:22 2014
@@ -45,6 +45,7 @@ import org.apache.qpid.server.protocol.v
 import org.apache.qpid.server.protocol.v0_8.ClientDeliveryMethod;
 import org.apache.qpid.server.protocol.v0_8.RecordDeliveryMethod;
 import org.apache.qpid.server.consumer.Consumer;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
 import java.util.EnumSet;
@@ -106,14 +107,22 @@ public class BasicGetMethodHandler imple
                     }
                 }
 
-                if (!performGet(queue,protocolConnection, channel, !body.getNoAck()))
+                try
                 {
-                    MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
-                    // TODO - set clusterId
-                    BasicGetEmptyBody responseBody = methodRegistry.createBasicGetEmptyBody(null);
+                    if (!performGet(queue,protocolConnection, channel, !body.getNoAck()))
+                    {
+                        MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
+                        // TODO - set clusterId
+                        BasicGetEmptyBody responseBody = methodRegistry.createBasicGetEmptyBody(null);
 
 
-                    protocolConnection.writeFrame(responseBody.generateFrame(channelId));
+                        protocolConnection.writeFrame(responseBody.generateFrame(channelId));
+                    }
+                }
+                catch (QpidSecurityException e)
+                {
+                    throw body.getConnectionException(AMQConstant.ACCESS_REFUSED,
+                                                      e.getMessage());
                 }
             }
         }
@@ -123,7 +132,7 @@ public class BasicGetMethodHandler imple
                                      final AMQProtocolSession session,
                                      final AMQChannel channel,
                                      final boolean acks)
-            throws AMQException
+            throws AMQException, QpidSecurityException
     {
 
         final FlowCreditManager singleMessageCredit = new MessageOnlyCreditManager(1L);

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicPublishMethodHandler.java Thu Feb 13 19:41:22 2014
@@ -34,6 +34,7 @@ import org.apache.qpid.server.exchange.E
 import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
 import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
 import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
 public class BasicPublishMethodHandler implements StateAwareMethodListener<BasicPublishBody>
@@ -88,7 +89,14 @@ public class BasicPublishMethodHandler i
 
             MessagePublishInfo info = session.getMethodRegistry().getProtocolVersionMethodConverter().convertToInfo(body);
             info.setExchange(exchangeName);
-            channel.setPublishFrame(info, exch);
+            try
+            {
+                channel.setPublishFrame(info, exch);
+            }
+            catch (QpidSecurityException e)
+            {
+                throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, e.getMessage());
+            }
         }
     }
 

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeclareHandler.java Thu Feb 13 19:41:22 2014
@@ -35,6 +35,7 @@ import org.apache.qpid.server.exchange.E
 import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
 import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
 import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.virtualhost.ExchangeExistsException;
 import org.apache.qpid.server.virtualhost.ReservedExchangeNameException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -124,6 +125,10 @@ public class ExchangeDeclareHandler impl
             {
                 throw body.getConnectionException(AMQConstant.COMMAND_INVALID, "Unknown exchange: " + exchangeName,e);
             }
+            catch (QpidSecurityException e)
+            {
+                throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, e.getMessage());
+            }
         }
 
 

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeleteHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeleteHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeleteHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/ExchangeDeleteHandler.java Thu Feb 13 19:41:22 2014
@@ -29,6 +29,7 @@ import org.apache.qpid.server.exchange.E
 import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
 import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
 import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.virtualhost.ExchangeIsAlternateException;
 import org.apache.qpid.server.virtualhost.RequiredExchangeException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -82,5 +83,9 @@ public class ExchangeDeleteHandler imple
         {
             throw body.getChannelException(AMQConstant.NOT_ALLOWED, "Exchange '"+body.getExchange()+"' cannot be deleted");
         }
+        catch (QpidSecurityException e)
+        {
+            throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, e.getMessage());
+        }
     }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueBindHandler.java Thu Feb 13 19:41:22 2014
@@ -41,6 +41,7 @@ import org.apache.qpid.server.queue.AMQQ
 import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
 import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
 import java.util.Map;
@@ -147,6 +148,10 @@ public class QueueBindHandler implements
         {
             throw body.getChannelException(AMQConstant.CHANNEL_ERROR, e.toString());
         }
+        catch (QpidSecurityException e)
+        {
+            throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, e.getMessage());
+        }
 
         if (_log.isInfoEnabled())
         {

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeclareHandler.java Thu Feb 13 19:41:22 2014
@@ -39,9 +39,11 @@ import org.apache.qpid.server.queue.Queu
 import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
 import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.store.DurableConfigurationStoreHelper;
 import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.util.Action;
+import org.apache.qpid.server.util.ConnectionScopedRuntimeException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
 import java.util.Map;
@@ -185,6 +187,10 @@ public class QueueDeclareHandler impleme
                 }
 
             }
+            catch (QpidSecurityException e)
+            {
+                throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, e.getMessage());
+            }
 
             //set this as the default queue on the channel:
             channel.setDefaultQueue(queue);
@@ -213,7 +219,7 @@ public class QueueDeclareHandler impleme
                                    QueueDeclareBody body,
                                    final VirtualHost virtualHost,
                                    final AMQProtocolSession session)
-            throws AMQException
+            throws AMQException, QpidSecurityException
     {
 
         final boolean durable = body.getDurable();
@@ -239,7 +245,14 @@ public class QueueDeclareHandler impleme
                         {
                             if (virtualHost.getQueue(queueName.toString()) == queue)
                             {
-                                virtualHost.removeQueue(queue);
+                                try
+                                {
+                                    virtualHost.removeQueue(queue);
+                                }
+                                catch (QpidSecurityException e)
+                                {
+                                    throw new ConnectionScopedRuntimeException("Permission exception: Unable to remove a temporary queue created by a session which has now removed itself", e);
+                                }
                             }
                         }
                     };

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeleteHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeleteHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeleteHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueDeleteHandler.java Thu Feb 13 19:41:22 2014
@@ -32,6 +32,7 @@ import org.apache.qpid.server.queue.AMQQ
 import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
 import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.store.DurableConfigurationStoreHelper;
 import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -111,7 +112,15 @@ public class QueueDeleteHandler implemen
                                                       "Queue " + queue.getName() + " is exclusive, but not created on this Connection.");
                 }
 
-                int purged = virtualHost.removeQueue(queue);
+                int purged = 0;
+                try
+                {
+                    purged = virtualHost.removeQueue(queue);
+                }
+                catch (QpidSecurityException e)
+                {
+                    throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, e.getMessage());
+                }
 
                 MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
                 QueueDeleteOkBody responseBody = methodRegistry.createQueueDeleteOkBody(purged);

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueuePurgeHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueuePurgeHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueuePurgeHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueuePurgeHandler.java Thu Feb 13 19:41:22 2014
@@ -33,6 +33,7 @@ import org.apache.qpid.server.queue.AMQQ
 import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
 import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
 public class QueuePurgeHandler implements StateAwareMethodListener<QueuePurgeBody>
@@ -103,10 +104,18 @@ public class QueuePurgeHandler implement
                                                       "Queue is exclusive, but not created on this Connection.");
                 }
 
-                long purged = queue.clearQueue();
+            long purged = 0;
+            try
+            {
+                purged = queue.clearQueue();
+            }
+            catch (QpidSecurityException e)
+            {
+                throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, e.getMessage());
+            }
 
 
-                if(!body.getNowait())
+            if(!body.getNowait())
                 {
                     channel.sync();
                     MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/QueueUnbindHandler.java Thu Feb 13 19:41:22 2014
@@ -38,6 +38,7 @@ import org.apache.qpid.server.queue.AMQQ
 import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.protocol.v0_8.state.AMQStateManager;
 import org.apache.qpid.server.protocol.v0_8.state.StateAwareMethodListener;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
 public class QueueUnbindHandler implements StateAwareMethodListener<QueueUnbindBody>
@@ -105,7 +106,14 @@ public class QueueUnbindHandler implemen
         }
         else
         {
-            exch.removeBinding(String.valueOf(routingKey), queue, FieldTable.convertToMap(body.getArguments()));
+            try
+            {
+                exch.removeBinding(String.valueOf(routingKey), queue, FieldTable.convertToMap(body.getArguments()));
+            }
+            catch (QpidSecurityException e)
+            {
+                throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, e.getMessage());
+            }
         }
 
 

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AckTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AckTest.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AckTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AckTest.java Thu Feb 13 19:41:22 2014
@@ -177,7 +177,7 @@ public class AckTest extends QpidTestCas
      * Tests that the acknowledgements are correctly associated with a channel and
      * order is preserved when acks are enabled
      */
-    public void testAckChannelAssociationTest() throws AMQException
+    public void testAckChannelAssociationTest() throws Exception
     {
         _subscriptionTarget = ConsumerTarget_0_8.createAckTarget(_channel,
                                                                  DEFAULT_CONSUMER_TAG,
@@ -206,7 +206,7 @@ public class AckTest extends QpidTestCas
     /**
      * Tests that in no-ack mode no messages are retained
      */
-    public void testNoAckMode() throws AMQException
+    public void testNoAckMode() throws Exception
     {
         // false arg means no acks expected
         _subscriptionTarget = ConsumerTarget_0_8.createNoAckTarget(_channel,
@@ -231,7 +231,7 @@ public class AckTest extends QpidTestCas
     /**
      * Tests that in no-ack mode no messages are retained
      */
-    public void testPersistentNoAckMode() throws AMQException
+    public void testPersistentNoAckMode() throws Exception
     {
         // false arg means no acks expected
 
@@ -255,7 +255,7 @@ public class AckTest extends QpidTestCas
      * Tests that a single acknowledgement is handled correctly (i.e multiple flag not
      * set case)
      */
-    public void testSingleAckReceivedTest() throws AMQException
+    public void testSingleAckReceivedTest() throws Exception
     {
 
         _subscriptionTarget = ConsumerTarget_0_8.createAckTarget(_channel,
@@ -292,7 +292,7 @@ public class AckTest extends QpidTestCas
      * Tests that a single acknowledgement is handled correctly (i.e multiple flag not
      * set case)
      */
-    public void testMultiAckReceivedTest() throws AMQException
+    public void testMultiAckReceivedTest() throws Exception
     {
 
         _subscriptionTarget = ConsumerTarget_0_8.createAckTarget(_channel,
@@ -326,7 +326,7 @@ public class AckTest extends QpidTestCas
     /**
      * Tests that a multiple acknowledgement is handled correctly. When ack'ing all pending msgs.
      */
-    public void testMultiAckAllReceivedTest() throws AMQException
+    public void testMultiAckAllReceivedTest() throws Exception
     {
 
         _subscriptionTarget = ConsumerTarget_0_8.createAckTarget(_channel,

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AcknowledgeTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AcknowledgeTest.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AcknowledgeTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/AcknowledgeTest.java Thu Feb 13 19:41:22 2014
@@ -84,40 +84,40 @@ public class AcknowledgeTest extends Qpi
         return _queue;
     }
 
-    public void testTransactionalSingleAck() throws AMQException
+    public void testTransactionalSingleAck() throws Exception
     {
         getChannel().setLocalTransactional();
         runMessageAck(1, 1, 1, false, 0);
     }
 
-    public void testTransactionalMultiAck() throws AMQException
+    public void testTransactionalMultiAck() throws Exception
     {
         getChannel().setLocalTransactional();
         runMessageAck(10, 1, 5, true, 5);
     }
 
-    public void testTransactionalAckAll() throws AMQException
+    public void testTransactionalAckAll() throws Exception
     {
         getChannel().setLocalTransactional();
         runMessageAck(10, 1, 0, true, 0);
     }
 
-    public void testNonTransactionalSingleAck() throws AMQException
+    public void testNonTransactionalSingleAck() throws Exception
     {
         runMessageAck(1, 1, 1, false, 0);
     }
 
-    public void testNonTransactionalMultiAck() throws AMQException
+    public void testNonTransactionalMultiAck() throws Exception
     {
         runMessageAck(10, 1, 5, true, 5);
     }
 
-    public void testNonTransactionalAckAll() throws AMQException
+    public void testNonTransactionalAckAll() throws Exception
     {
         runMessageAck(10, 1, 0, true, 0);
     }
 
-    protected void runMessageAck(int sendMessageCount, long firstDeliveryTag, long acknowledgeDeliveryTag, boolean acknowledgeMultiple, int remainingUnackedMessages) throws AMQException
+    protected void runMessageAck(int sendMessageCount, long firstDeliveryTag, long acknowledgeDeliveryTag, boolean acknowledgeMultiple, int remainingUnackedMessages) throws Exception
     {
         //Check store is empty
         checkStoreContents(0);

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/BrokerTestHelper_0_8.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/BrokerTestHelper_0_8.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/BrokerTestHelper_0_8.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/BrokerTestHelper_0_8.java Thu Feb 13 19:41:22 2014
@@ -26,6 +26,7 @@ import org.apache.qpid.framing.BasicCont
 import org.apache.qpid.framing.ContentHeaderBody;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.server.exchange.Exchange;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.util.BrokerTestHelper;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
@@ -64,7 +65,8 @@ public class BrokerTestHelper_0_8 extend
         return new InternalTestProtocolSession(virtualHost, createBrokerMock());
     }
 
-    public static void publishMessages(AMQChannel channel, int numberOfMessages, String queueName, String exchangeName) throws AMQException
+    public static void publishMessages(AMQChannel channel, int numberOfMessages, String queueName, String exchangeName)
+            throws AMQException, QpidSecurityException
     {
         AMQShortString routingKey = new AMQShortString(queueName);
         AMQShortString exchangeNameAsShortString = new AMQShortString(exchangeName);

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/QueueBrowserUsesNoAckTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/QueueBrowserUsesNoAckTest.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/QueueBrowserUsesNoAckTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/QueueBrowserUsesNoAckTest.java Thu Feb 13 19:41:22 2014
@@ -85,7 +85,7 @@ public class QueueBrowserUsesNoAckTest e
         return _queue;
     }
 
-    public void testQueueBrowserUsesNoAck() throws AMQException
+    public void testQueueBrowserUsesNoAck() throws Exception
     {
         int sendMessageCount = 2;
         int prefetch = 1;
@@ -136,7 +136,7 @@ public class QueueBrowserUsesNoAckTest e
         assertEquals("Message header count incorrect in the MetaDataMap", messageCount, ((TestableMemoryMessageStore) _messageStore).getMessageCount());
     }
 
-    private AMQShortString browse(AMQChannel channel, AMQQueue queue) throws AMQException
+    private AMQShortString browse(AMQChannel channel, AMQQueue queue) throws Exception
     {
         FieldTable filters = new FieldTable();
         filters.put(AMQPFilterTypes.NO_CONSUME.getValue(), true);

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java Thu Feb 13 19:41:22 2014
@@ -32,7 +32,7 @@ import java.util.concurrent.ConcurrentHa
 import org.apache.log4j.Logger;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.AMQInternalException;
-import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.amqp_1_0.transport.DeliveryStateHandler;
 import org.apache.qpid.amqp_1_0.transport.LinkEndpoint;
 import org.apache.qpid.amqp_1_0.transport.SendingLinkEndpoint;
@@ -329,6 +329,11 @@ public class SendingLink_1_0 implements 
                                                             //TODO
                                                             _logger.error("Error removing queue", e);
                                                         }
+                                                        catch (QpidSecurityException e)
+                                                        {
+                                                            //TODO
+                                                            _logger.error("Error removing queue", e);
+                                                        }
                                                     }
                                                 }
                                             };
@@ -348,7 +353,7 @@ public class SendingLink_1_0 implements 
 
                 qd = new QueueDestination(queue);
             }
-            catch (AMQSecurityException e)
+            catch (QpidSecurityException e)
             {
                 _logger.error("Security error", e);
                 throw new RuntimeException(e);
@@ -403,6 +408,11 @@ public class SendingLink_1_0 implements 
                 //TODO
                 _logger.error("Error registering subscription", e);
             }
+            catch (QpidSecurityException e)
+            {
+                //TODO
+                _logger.error("Error registering subscription", e);
+            }
         }
 
     }
@@ -455,7 +465,12 @@ public class SendingLink_1_0 implements 
                 catch(AMQException e)
                 {
                     //TODO
-                    _logger.error("Error removing queue", e);
+                    _logger.error("Error registering subscription", e);
+                }
+                catch (QpidSecurityException e)
+                {
+                    //TODO
+                    _logger.error("Error registering subscription", e);
                 }
             }
 

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java Thu Feb 13 19:41:22 2014
@@ -37,7 +37,7 @@ import org.apache.qpid.amqp_1_0.type.tra
 
 import org.apache.qpid.amqp_1_0.type.transport.Error;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.protocol.AMQConstant;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.logging.LogSubject;
@@ -362,6 +362,11 @@ public class Session_1_0 implements Sess
                                         //TODO
                                         _logger.error("Error removing queue from vhost", e);
                                     }
+                                    catch (QpidSecurityException e)
+                                    {
+                                        //TODO
+                                        _logger.error("Error removing queue from vhost", e);
+                                    }
                                 }
                             }
                         };
@@ -391,7 +396,7 @@ public class Session_1_0 implements Sess
 
             }
         }
-        catch (AMQSecurityException e)
+        catch (QpidSecurityException e)
         {
             //TODO
             _logger.error("Security error", e);

Modified: qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java Thu Feb 13 19:41:22 2014
@@ -21,7 +21,7 @@
 package org.apache.qpid.server.management.amqp;
 
 import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.consumer.Consumer;
 import org.apache.qpid.server.consumer.ConsumerTarget;
 import org.apache.qpid.server.filter.FilterManager;
@@ -373,7 +373,7 @@ class ManagementNode implements MessageS
                         }
                         catch(RuntimeException e)
                         {
-                            if (e instanceof AccessControlException || e.getCause() instanceof AMQSecurityException)
+                            if (e instanceof AccessControlException || e.getCause() instanceof QpidSecurityException)
                             {
                                 response = createFailureResponse(message, STATUS_CODE_FORBIDDEN, e.getMessage());
                             }
@@ -478,7 +478,7 @@ class ManagementNode implements MessageS
         }
         catch(RuntimeException e)
         {
-            if (e instanceof AccessControlException || e.getCause() instanceof AMQSecurityException)
+            if (e instanceof AccessControlException || e.getCause() instanceof QpidSecurityException)
             {
                 responseHeader.setHeader(STATUS_CODE_HEADER, STATUS_CODE_FORBIDDEN);
             }
@@ -516,7 +516,7 @@ class ManagementNode implements MessageS
             }
             catch(RuntimeException e)
             {
-                if (e instanceof AccessControlException || e.getCause() instanceof AMQSecurityException)
+                if (e instanceof AccessControlException || e.getCause() instanceof QpidSecurityException)
                 {
                     return createFailureResponse(requestMessage, STATUS_CODE_FORBIDDEN, e.getMessage());
                 }

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/RestServlet.java Thu Feb 13 19:41:22 2014
@@ -27,7 +27,7 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.log4j.Logger;
-import org.apache.qpid.AMQSecurityException;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.model.*;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.map.SerializationConfig;
@@ -498,7 +498,7 @@ public class RestServlet extends Abstrac
 
     private void setResponseStatus(HttpServletResponse response, RuntimeException e) throws IOException
     {
-        if (e instanceof AccessControlException || e.getCause() instanceof AMQSecurityException)
+        if (e instanceof AccessControlException || e.getCause() instanceof QpidSecurityException)
         {
             if (LOGGER.isDebugEnabled())
             {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java?rev=1568015&r1=1568014&r2=1568015&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java Thu Feb 13 19:41:22 2014
@@ -51,6 +51,7 @@ import org.apache.qpid.server.queue.Prio
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.ConflationQueue;
 import org.apache.qpid.server.queue.StandardQueue;
+import org.apache.qpid.server.security.QpidSecurityException;
 import org.apache.qpid.server.txn.AutoCommitTransaction;
 import org.apache.qpid.server.txn.ServerTransaction;
 import org.apache.qpid.server.util.BrokerTestHelper;
@@ -630,7 +631,7 @@ public class MessageStoreTest extends Qp
 
     }
 
-    private void createAllQueues()
+    private void createAllQueues() throws Exception
     {
         //Register Durable Priority Queue
         createQueue(durablePriorityQueueName, true, true, false, false);
@@ -651,7 +652,7 @@ public class MessageStoreTest extends Qp
         createQueue(queueName, false, false, false, false);
     }
 
-    private void createAllTopicQueues()
+    private void createAllTopicQueues() throws Exception
     {
         //Register Durable Priority Queue
         createQueue(durablePriorityTopicQueueName, true, true, false, false);
@@ -667,6 +668,7 @@ public class MessageStoreTest extends Qp
     }
 
     private void createQueue(String queueName, boolean usePriority, boolean durable, boolean exclusive, boolean lastValueQueue)
+            throws Exception
     {
 
         Map<String,Object> queueArguments = null;
@@ -689,22 +691,16 @@ public class MessageStoreTest extends Qp
         AMQQueue queue = null;
 
         //Ideally we would be able to use the QueueDeclareHandler here.
-        try
-        {
-            queue = getVirtualHost().createQueue(UUIDGenerator.generateRandomUUID(), queueName, durable, queueOwner, false, exclusive,
-                    false, queueArguments);
+        queue = getVirtualHost().createQueue(UUIDGenerator.generateRandomUUID(), queueName, durable, queueOwner, false, exclusive,
+                false, queueArguments);
+
+        validateQueueProperties(queue, usePriority, durable, exclusive, lastValueQueue);
 
-            validateQueueProperties(queue, usePriority, durable, exclusive, lastValueQueue);
 
-        }
-        catch (AMQException e)
-        {
-            fail(e.getMessage());
-        }
 
     }
 
-    private Map<String, Exchange> createExchanges()
+    private Map<String, Exchange> createExchanges() throws Exception
     {
         Map<String, Exchange> exchanges = new HashMap<String, Exchange>();
 
@@ -718,18 +714,11 @@ public class MessageStoreTest extends Qp
         return exchanges;
     }
 
-    private Exchange createExchange(ExchangeType<?> type, String name, boolean durable)
+    private Exchange createExchange(ExchangeType<?> type, String name, boolean durable) throws Exception
     {
         Exchange exchange = null;
 
-        try
-        {
-            exchange = getVirtualHost().createExchange(null, name, type.getType(), durable, false, null);
-        }
-        catch (AMQException e)
-        {
-            fail(e.getMessage());
-        }
+        exchange = getVirtualHost().createExchange(null, name, type.getType(), durable, false, null);
 
         return exchange;
     }



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