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/08/25 17:25:03 UTC

svn commit: r1620344 [2/4] - in /qpid/branches/0.30/qpid/java: ./ bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/ bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/ bdbstore/src/main/java/resources/virtualhos...

Modified: qpid/branches/0.30/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/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java Mon Aug 25 15:25:00 2014
@@ -103,7 +103,7 @@ public class AMQProtocolEngine implement
     private String _clientProduct = null;
     private String _remoteProcessPid = null;
 
-    private VirtualHostImpl _virtualHost;
+    private VirtualHostImpl<?,?,?> _virtualHost;
 
     private final Map<Integer, AMQChannel<AMQProtocolEngine>> _channelMap =
             new HashMap<Integer, AMQChannel<AMQProtocolEngine>>();
@@ -175,6 +175,8 @@ public class AMQProtocolEngine implement
     private volatile boolean _stopped;
     private long _readBytes;
     private boolean _authenticated;
+    private boolean _compressionSupported;
+    private int _messageCompressionThreshold;
 
     public AMQProtocolEngine(Broker broker,
                              final NetworkConnection network,
@@ -208,7 +210,7 @@ public class AMQProtocolEngine implement
                 return null;
             }
         });
-
+        
         _messagesDelivered = new StatisticsCounter("messages-delivered-" + getSessionID());
         _dataDelivered = new StatisticsCounter("data-delivered-" + getSessionID());
         _messagesReceived = new StatisticsCounter("messages-received-" + getSessionID());
@@ -539,6 +541,8 @@ public class AMQProtocolEngine implement
                     _broker.getName());
             serverProperties.setString(ConnectionStartProperties.QPID_CLOSE_WHEN_NO_ROUTE,
                     String.valueOf(_closeWhenNoRoute));
+            serverProperties.setString(ConnectionStartProperties.QPID_MESSAGE_COMPRESSION_SUPPORTED,
+                                       String.valueOf(_broker.isMessageCompressionEnabled()));
 
             AMQMethodBody responseBody = getMethodRegistry().createConnectionStartBody((short) getProtocolMajorVersion(),
                                                                                        (short) pv.getActualMinorVersion(),
@@ -1131,6 +1135,15 @@ public class AMQProtocolEngine implement
                     _logger.debug("Client set closeWhenNoRoute=" + _closeWhenNoRoute + " for protocol engine " + this);
                 }
             }
+            String compressionSupported = clientProperties.getString(ConnectionStartProperties.QPID_MESSAGE_COMPRESSION_SUPPORTED);
+            if (compressionSupported != null)
+            {
+                _compressionSupported = Boolean.parseBoolean(compressionSupported);
+                if(_logger.isDebugEnabled())
+                {
+                    _logger.debug("Client set compressionSupported=" + _compressionSupported + " for protocol engine " + this);
+                }
+            }
 
             _clientVersion = clientProperties.getString(ConnectionStartProperties.VERSION_0_8);
             _clientProduct = clientProperties.getString(ConnectionStartProperties.PRODUCT);
@@ -1181,17 +1194,24 @@ public class AMQProtocolEngine implement
         return getMethodRegistry();
     }
 
-    public VirtualHostImpl getVirtualHost()
+    public VirtualHostImpl<?,?,?> getVirtualHost()
     {
         return _virtualHost;
     }
 
-    public void setVirtualHost(VirtualHostImpl virtualHost) throws AMQException
+    public void setVirtualHost(VirtualHostImpl<?,?,?> virtualHost) throws AMQException
     {
         _virtualHost = virtualHost;
 
         _virtualHost.getConnectionRegistry().registerConnection(this);
 
+
+        _messageCompressionThreshold = virtualHost.getContextValue(Integer.class,
+                                                                   Broker.MESSAGE_COMPRESSION_THRESHOLD_SIZE);
+        if(_messageCompressionThreshold <= 0)
+        {
+            _messageCompressionThreshold = Integer.MAX_VALUE;
+        }
     }
 
     public void addDeleteTask(Action<? super AMQProtocolEngine> task)
@@ -1595,15 +1615,16 @@ public class AMQProtocolEngine implement
         }
 
         @Override
-        public void deliverToClient(final ConsumerImpl sub, final ServerMessage message,
+        public long deliverToClient(final ConsumerImpl sub, final ServerMessage message,
                                     final InstanceProperties props, final long deliveryTag)
         {
-            registerMessageDelivered(message.getSize());
-            _protocolOutputConverter.writeDeliver(message,
+            long size = _protocolOutputConverter.writeDeliver(message,
                                                   props,
                                                   _channelId,
                                                   deliveryTag,
                                                   new AMQShortString(sub.getName()));
+            registerMessageDelivered(size);
+            return size;
         }
 
     }
@@ -1636,6 +1657,18 @@ public class AMQProtocolEngine implement
         return _closeWhenNoRoute;
     }
 
+    @Override
+    public boolean isCompressionSupported()
+    {
+        return _compressionSupported && _broker.isMessageCompressionEnabled();
+    }
+
+    @Override
+    public int getMessageCompressionThreshold()
+    {
+        return _messageCompressionThreshold;
+    }
+
     public EventLogger getEventLogger()
     {
         if(_virtualHost != null)

Modified: qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolSession.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolSession.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolSession.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolSession.java Mon Aug 25 15:25:00 2014
@@ -174,9 +174,9 @@ public interface AMQProtocolSession<T ex
 
     Object getReference();
 
-    VirtualHostImpl getVirtualHost();
+    VirtualHostImpl<?,?,?> getVirtualHost();
 
-    void setVirtualHost(VirtualHostImpl virtualHost) throws AMQException;
+    void setVirtualHost(VirtualHostImpl<?,?,?> virtualHost) throws AMQException;
 
     public ProtocolOutputConverter getProtocolOutputConverter();
 
@@ -210,4 +210,8 @@ public interface AMQProtocolSession<T ex
      * can't be routed rather than returning the message.
      */
     boolean isCloseWhenNoRoute();
+
+    boolean isCompressionSupported();
+
+    int getMessageCompressionThreshold();
 }

Modified: qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ClientDeliveryMethod.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ClientDeliveryMethod.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ClientDeliveryMethod.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ClientDeliveryMethod.java Mon Aug 25 15:25:00 2014
@@ -26,6 +26,6 @@ import org.apache.qpid.server.message.Se
 
 public interface ClientDeliveryMethod
 {
-    void deliverToClient(final ConsumerImpl sub, final ServerMessage message, final InstanceProperties props,
+    long deliverToClient(final ConsumerImpl sub, final ServerMessage message, final InstanceProperties props,
                          final long deliveryTag);
 }

Modified: qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ConsumerTarget_0_8.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ConsumerTarget_0_8.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ConsumerTarget_0_8.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ConsumerTarget_0_8.java Mon Aug 25 15:25:00 2014
@@ -116,7 +116,7 @@ public abstract class ConsumerTarget_0_8
          * @throws org.apache.qpid.AMQException
          */
         @Override
-        public void send(MessageInstance entry, boolean batch)
+        public long send(MessageInstance entry, boolean batch)
         {
             // We don't decrement the reference here as we don't want to consume the message
             // but we do want to send it to the client.
@@ -124,7 +124,7 @@ public abstract class ConsumerTarget_0_8
             synchronized (getChannel())
             {
                 long deliveryTag = getChannel().getNextDeliveryTag();
-                sendToClient(entry.getMessage(), entry.getInstanceProperties(), deliveryTag);
+                return sendToClient(entry.getMessage(), entry.getInstanceProperties(), deliveryTag);
             }
 
         }
@@ -177,7 +177,7 @@ public abstract class ConsumerTarget_0_8
          * @param batch
          */
         @Override
-        public void send(MessageInstance entry, boolean batch)
+        public long send(MessageInstance entry, boolean batch)
         {
             // if we do not need to wait for client acknowledgements
             // we can decrement the reference count immediately.
@@ -194,17 +194,17 @@ public abstract class ConsumerTarget_0_8
             MessageReference ref = message.newReference();
             InstanceProperties props = entry.getInstanceProperties();
             entry.delete();
-
+            long size;
             synchronized (getChannel())
             {
                 getChannel().getProtocolSession().setDeferFlush(batch);
                 long deliveryTag = getChannel().getNextDeliveryTag();
 
-                sendToClient(message, props, deliveryTag);
+                size = sendToClient(message, props, deliveryTag);
 
             }
             ref.release();
-
+            return size;
 
         }
 
@@ -291,7 +291,7 @@ public abstract class ConsumerTarget_0_8
          * @param batch
          */
         @Override
-        public void send(MessageInstance entry, boolean batch)
+        public long send(MessageInstance entry, boolean batch)
         {
 
 
@@ -303,9 +303,9 @@ public abstract class ConsumerTarget_0_8
                 addUnacknowledgedMessage(entry);
                 recordMessageDelivery(entry, deliveryTag);
                 entry.addStateChangeListener(getReleasedStateChangeListener());
-                sendToClient(entry.getMessage(), entry.getInstanceProperties(), deliveryTag);
+                long size = sendToClient(entry.getMessage(), entry.getInstanceProperties(), deliveryTag);
                 entry.incrementDeliveryCount();
-
+                return size;
             }
         }
 
@@ -502,9 +502,9 @@ public abstract class ConsumerTarget_0_8
         }
     }
 
-    protected void sendToClient(final ServerMessage message, final InstanceProperties props, final long deliveryTag)
+    protected long sendToClient(final ServerMessage message, final InstanceProperties props, final long deliveryTag)
     {
-        _deliveryMethod.deliverToClient(getConsumer(), message, props, deliveryTag);
+        return _deliveryMethod.deliverToClient(getConsumer(), message, props, deliveryTag);
 
     }
 

Modified: qpid/branches/0.30/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/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicGetMethodHandler.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicGetMethodHandler.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/handler/BasicGetMethodHandler.java Mon Aug 25 15:25:00 2014
@@ -21,6 +21,9 @@
 
 package org.apache.qpid.server.protocol.v0_8.handler;
 
+import java.security.AccessControlException;
+import java.util.EnumSet;
+
 import org.apache.log4j.Logger;
 
 import org.apache.qpid.AMQException;
@@ -30,26 +33,23 @@ import org.apache.qpid.framing.BasicGetE
 import org.apache.qpid.framing.MethodRegistry;
 import org.apache.qpid.protocol.AMQConstant;
 import org.apache.qpid.server.consumer.ConsumerImpl;
+import org.apache.qpid.server.flow.FlowCreditManager;
+import org.apache.qpid.server.flow.MessageOnlyCreditManager;
 import org.apache.qpid.server.message.InstanceProperties;
 import org.apache.qpid.server.message.MessageInstance;
 import org.apache.qpid.server.message.MessageSource;
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.protocol.v0_8.AMQChannel;
-import org.apache.qpid.server.flow.FlowCreditManager;
-import org.apache.qpid.server.flow.MessageOnlyCreditManager;
 import org.apache.qpid.server.protocol.v0_8.AMQMessage;
 import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
+import org.apache.qpid.server.protocol.v0_8.ClientDeliveryMethod;
 import org.apache.qpid.server.protocol.v0_8.ConsumerTarget_0_8;
-import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.protocol.v0_8.RecordDeliveryMethod;
 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.protocol.v0_8.ClientDeliveryMethod;
-import org.apache.qpid.server.protocol.v0_8.RecordDeliveryMethod;
+import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 
-import java.security.AccessControlException;
-import java.util.EnumSet;
-
 public class BasicGetMethodHandler implements StateAwareMethodListener<BasicGetBody>
 {
     private static final Logger _log = Logger.getLogger(BasicGetMethodHandler.class);
@@ -202,17 +202,18 @@ public class BasicGetMethodHandler imple
         }
 
         @Override
-        public void deliverToClient(final ConsumerImpl sub, final ServerMessage message,
+        public long deliverToClient(final ConsumerImpl sub, final ServerMessage message,
                                     final InstanceProperties props, final long deliveryTag)
         {
             _singleMessageCredit.useCreditForMessage(message.getSize());
-            _session.getProtocolOutputConverter().writeGetOk(message,
+            long size =_session.getProtocolOutputConverter().writeGetOk(message,
                                                             props,
                                                             _channel.getChannelId(),
                                                             deliveryTag,
                                                             _queue.getQueueDepthMessages());
 
             _deliveredMessage = true;
+            return size;
         }
 
         public boolean hasDeliveredMessage()

Modified: qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverter.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverter.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverter.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverter.java Mon Aug 25 15:25:00 2014
@@ -26,7 +26,6 @@
  */
 package org.apache.qpid.server.protocol.v0_8.output;
 
-import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQDataBlock;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.ContentHeaderBody;
@@ -35,7 +34,6 @@ import org.apache.qpid.server.message.In
 import org.apache.qpid.server.message.MessageContentSource;
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueEntry;
 
 public interface ProtocolOutputConverter
 {
@@ -46,12 +44,12 @@ public interface ProtocolOutputConverter
         ProtocolOutputConverter newInstance(AMQProtocolSession session);
     }
 
-    void writeDeliver(final ServerMessage msg,
+    long writeDeliver(final ServerMessage msg,
                       final InstanceProperties props, int channelId,
                       long deliveryTag,
                       AMQShortString consumerTag);
 
-    void writeGetOk(final ServerMessage msg,
+    long writeGetOk(final ServerMessage msg,
                     final InstanceProperties props,
                     int channelId,
                     long deliveryTag,

Modified: qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverterImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverterImpl.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverterImpl.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/output/ProtocolOutputConverterImpl.java Mon Aug 25 15:25:00 2014
@@ -20,6 +20,10 @@
  */
 package org.apache.qpid.server.protocol.v0_8.output;
 
+import java.io.DataOutput;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQBody;
 import org.apache.qpid.framing.AMQDataBlock;
@@ -27,6 +31,7 @@ import org.apache.qpid.framing.AMQFrame;
 import org.apache.qpid.framing.AMQMethodBody;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.BasicCancelOkBody;
+import org.apache.qpid.framing.BasicContentHeaderProperties;
 import org.apache.qpid.framing.BasicGetOkBody;
 import org.apache.qpid.framing.BasicReturnBody;
 import org.apache.qpid.framing.ContentHeaderBody;
@@ -34,16 +39,13 @@ import org.apache.qpid.framing.MethodReg
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
 import org.apache.qpid.server.message.InstanceProperties;
+import org.apache.qpid.server.message.MessageContentSource;
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.plugin.MessageConverter;
 import org.apache.qpid.server.protocol.MessageConverterRegistry;
 import org.apache.qpid.server.protocol.v0_8.AMQMessage;
-import org.apache.qpid.server.message.MessageContentSource;
 import org.apache.qpid.server.protocol.v0_8.AMQProtocolSession;
-
-import java.io.DataOutput;
-import java.io.IOException;
-import java.nio.ByteBuffer;
+import org.apache.qpid.util.GZIPUtils;
 
 class ProtocolOutputConverterImpl implements ProtocolOutputConverter
 {
@@ -51,6 +53,7 @@ class ProtocolOutputConverterImpl implem
 
     private final MethodRegistry _methodRegistry;
     private final AMQProtocolSession _protocolSession;
+    private static final AMQShortString GZIP_ENCODING = AMQShortString.valueOf(GZIPUtils.GZIP_CONTENT_ENCODING);
 
     ProtocolOutputConverterImpl(AMQProtocolSession session, MethodRegistry methodRegistry)
     {
@@ -64,7 +67,7 @@ class ProtocolOutputConverterImpl implem
         return _protocolSession;
     }
 
-    public void writeDeliver(final ServerMessage m,
+    public long writeDeliver(final ServerMessage m,
                              final InstanceProperties props, int channelId,
                              long deliveryTag,
                              AMQShortString consumerTag)
@@ -72,7 +75,7 @@ class ProtocolOutputConverterImpl implem
         final AMQMessage msg = convertToAMQMessage(m);
         final boolean isRedelivered = Boolean.TRUE.equals(props.getProperty(InstanceProperties.Property.REDELIVERED));
         AMQBody deliverBody = createEncodedDeliverBody(msg, isRedelivered, deliveryTag, consumerTag);
-        writeMessageDelivery(msg, channelId, deliverBody);
+        return writeMessageDelivery(msg, channelId, deliverBody);
     }
 
     private AMQMessage convertToAMQMessage(ServerMessage serverMessage)
@@ -93,21 +96,97 @@ class ProtocolOutputConverterImpl implem
         return MessageConverterRegistry.getConverter(clazz, AMQMessage.class);
     }
 
-    private void writeMessageDelivery(AMQMessage message, int channelId, AMQBody deliverBody)
+    private long writeMessageDelivery(AMQMessage message, int channelId, AMQBody deliverBody)
     {
-        writeMessageDelivery(message, message.getContentHeaderBody(), channelId, deliverBody);
+        return writeMessageDelivery(message, message.getContentHeaderBody(), channelId, deliverBody);
     }
 
-    private void writeMessageDelivery(MessageContentSource message, ContentHeaderBody contentHeaderBody, int channelId, AMQBody deliverBody)
+    private long writeMessageDelivery(MessageContentSource message, ContentHeaderBody contentHeaderBody, int channelId, AMQBody deliverBody)
     {
 
-
         int bodySize = (int) message.getSize();
+        boolean msgCompressed = isCompressed(contentHeaderBody);
+        byte[] modifiedContent;
+
+        // straight through case
+        boolean compressionSupported = _protocolSession.isCompressionSupported();
+
+        if(msgCompressed && !compressionSupported &&
+                (modifiedContent = GZIPUtils.uncompressBufferToArray(message.getContent(0,bodySize))) != null)
+        {
+            BasicContentHeaderProperties modifiedProps =
+                    new BasicContentHeaderProperties(contentHeaderBody.getProperties());
+            modifiedProps.setEncoding((String)null);
+
+            writeMessageDeliveryModified(channelId, deliverBody, modifiedProps, modifiedContent);
+
+            return modifiedContent.length;
+        }
+        else if(!msgCompressed
+                && compressionSupported
+                && contentHeaderBody.getProperties().getEncoding()==null
+                && bodySize > _protocolSession.getMessageCompressionThreshold()
+                && (modifiedContent = GZIPUtils.compressBufferToArray(message.getContent(0, bodySize))) != null)
+        {
+            BasicContentHeaderProperties modifiedProps =
+                    new BasicContentHeaderProperties(contentHeaderBody.getProperties());
+            modifiedProps.setEncoding(GZIP_ENCODING);
+
+            writeMessageDeliveryModified(channelId, deliverBody, modifiedProps, modifiedContent);
+
+            return modifiedContent.length;
+        }
+        else
+        {
+            writeMessageDeliveryUnchanged(message, contentHeaderBody, channelId, deliverBody, bodySize);
+
+            return bodySize;
+        }
+    }
 
-        if(bodySize == 0)
+    private int writeMessageDeliveryModified(final int channelId,
+                                             final AMQBody deliverBody,
+                                             final BasicContentHeaderProperties modifiedProps,
+                                             final byte[] content)
+    {
+        final int bodySize;
+        bodySize = content.length;
+        ContentHeaderBody modifiedHeaderBody =
+                new ContentHeaderBody(BASIC_CLASS_ID, 0, modifiedProps, bodySize);
+        final MessageContentSource wrappedSource = new MessageContentSource()
+        {
+            @Override
+            public int getContent(final ByteBuffer buf, final int offset)
+            {
+                int size = Math.min(buf.remaining(), content.length - offset);
+                buf.put(content, offset, size);
+                return size;
+            }
+
+            @Override
+            public ByteBuffer getContent(final int offset, final int size)
+            {
+                return ByteBuffer.wrap(content, offset, size);
+            }
+
+            @Override
+            public long getSize()
+            {
+                return content.length;
+            }
+        };
+        writeMessageDeliveryUnchanged(wrappedSource, modifiedHeaderBody, channelId, deliverBody, bodySize);
+        return bodySize;
+    }
+
+    private void writeMessageDeliveryUnchanged(final MessageContentSource message,
+                                               final ContentHeaderBody contentHeaderBody,
+                                               final int channelId, final AMQBody deliverBody, final int bodySize)
+    {
+        if (bodySize == 0)
         {
             SmallCompositeAMQBodyBlock compositeBlock = new SmallCompositeAMQBodyBlock(channelId, deliverBody,
-                                                                             contentHeaderBody);
+                                                                                       contentHeaderBody);
 
             writeFrame(compositeBlock);
         }
@@ -120,13 +199,14 @@ class ProtocolOutputConverterImpl implem
 
             int writtenSize = capacity;
 
-            AMQBody firstContentBody = new MessageContentSourceBody(message,0,capacity);
+            AMQBody firstContentBody = new MessageContentSourceBody(message, 0, capacity);
 
             CompositeAMQBodyBlock
-                    compositeBlock = new CompositeAMQBodyBlock(channelId, deliverBody, contentHeaderBody, firstContentBody);
+                    compositeBlock =
+                    new CompositeAMQBodyBlock(channelId, deliverBody, contentHeaderBody, firstContentBody);
             writeFrame(compositeBlock);
 
-            while(writtenSize < bodySize)
+            while (writtenSize < bodySize)
             {
                 capacity = bodySize - writtenSize > maxBodySize ? maxBodySize : bodySize - writtenSize;
                 MessageContentSourceBody body = new MessageContentSourceBody(message, writtenSize, capacity);
@@ -137,6 +217,11 @@ class ProtocolOutputConverterImpl implem
         }
     }
 
+    private boolean isCompressed(final ContentHeaderBody contentHeaderBody)
+    {
+        return GZIP_ENCODING.equals(contentHeaderBody.getProperties().getEncoding());
+    }
+
     private class MessageContentSourceBody implements AMQBody
     {
         public static final byte TYPE = 3;
@@ -186,14 +271,14 @@ class ProtocolOutputConverterImpl implem
         }
     }
 
-    public void writeGetOk(final ServerMessage msg,
+    public long writeGetOk(final ServerMessage msg,
                            final InstanceProperties props,
                            int channelId,
                            long deliveryTag,
                            int queueSize)
     {
         AMQBody deliver = createEncodedGetOkBody(msg, props, deliveryTag, queueSize);
-        writeMessageDelivery(convertToAMQMessage(msg), channelId, deliver);
+        return writeMessageDelivery(convertToAMQMessage(msg), channelId, deliver);
     }
 
 

Modified: qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-0-8-protocol/src/test/java/org/apache/qpid/server/protocol/v0_8/InternalTestProtocolSession.java Mon Aug 25 15:25:00 2014
@@ -141,13 +141,13 @@ public class InternalTestProtocolSession
     {
     }
 
-    public void writeDeliver(final ServerMessage msg,
+    public long writeDeliver(final ServerMessage msg,
                              final InstanceProperties props, int channelId,
                              long deliveryTag,
                              AMQShortString consumerTag)
     {
         _deliveryCount.incrementAndGet();
-
+        long size = msg.getSize();
         synchronized (_channelDelivers)
         {
             Map<String, LinkedList<DeliveryPair>> consumers = _channelDelivers.get(channelId);
@@ -168,14 +168,16 @@ public class InternalTestProtocolSession
 
             consumerDelivers.add(new DeliveryPair(deliveryTag, msg));
         }
+        return size;
     }
 
-    public void writeGetOk(final ServerMessage msg,
+    public long writeGetOk(final ServerMessage msg,
                            final InstanceProperties props,
                            int channelId,
                            long deliveryTag,
                            int queueSize)
     {
+        return msg.getSize();
     }
 
     public void awaitDelivery(int msgs)
@@ -244,11 +246,11 @@ public class InternalTestProtocolSession
 
 
         @Override
-        public void deliverToClient(ConsumerImpl sub, ServerMessage message,
+        public long deliverToClient(ConsumerImpl sub, ServerMessage message,
                                     InstanceProperties props, long deliveryTag)
         {
             _deliveryCount.incrementAndGet();
-
+            long size = message.getSize();
             synchronized (_channelDelivers)
             {
                 Map<String, LinkedList<DeliveryPair>> consumers = _channelDelivers.get(_channelId);
@@ -269,6 +271,7 @@ public class InternalTestProtocolSession
 
                 consumerDelivers.add(new DeliveryPair(deliveryTag, message));
             }
+            return size;
         }
     }
 

Modified: qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ConsumerTarget_1_0.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ConsumerTarget_1_0.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ConsumerTarget_1_0.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ConsumerTarget_1_0.java Mon Aug 25 15:25:00 2014
@@ -112,10 +112,12 @@ class ConsumerTarget_1_0 extends Abstrac
         }
     }
 
-    public void send(MessageInstance entry, boolean batch)
+    public long send(MessageInstance entry, boolean batch)
     {
         // TODO
+        long size = entry.getMessage().getSize();
         send(entry);
+        return size;
     }
 
     public void flushBatched()

Modified: qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java Mon Aug 25 15:25:00 2014
@@ -32,6 +32,7 @@ import org.apache.qpid.amqp_1_0.messagin
 import org.apache.qpid.amqp_1_0.messaging.SectionEncoderImpl;
 import org.apache.qpid.amqp_1_0.type.Binary;
 import org.apache.qpid.amqp_1_0.type.Section;
+import org.apache.qpid.amqp_1_0.type.Symbol;
 import org.apache.qpid.amqp_1_0.type.codec.AMQPDescribedTypeRegistry;
 import org.apache.qpid.amqp_1_0.type.messaging.AmqpValue;
 import org.apache.qpid.amqp_1_0.type.messaging.Data;
@@ -43,6 +44,7 @@ import org.apache.qpid.server.virtualhos
 import org.apache.qpid.transport.codec.BBDecoder;
 import org.apache.qpid.typedmessage.TypedBytesContentReader;
 import org.apache.qpid.typedmessage.TypedBytesFormatException;
+import org.apache.qpid.util.GZIPUtils;
 
 public abstract class MessageConverter_to_1_0<M extends ServerMessage> implements MessageConverter<M, Message_1_0>
 {
@@ -202,7 +204,19 @@ public abstract class MessageConverter_t
                                                                       SectionEncoder sectionEncoder)
     {
         final String mimeType = serverMessage.getMessageHeader().getMimeType();
-        Section bodySection = getBodySection(serverMessage, mimeType);
+        byte[] data = new byte[(int) serverMessage.getSize()];
+        serverMessage.getContent(ByteBuffer.wrap(data), 0);
+        byte[] uncompressed;
+
+        if(Symbol.valueOf(GZIPUtils.GZIP_CONTENT_ENCODING).equals(metaData.getPropertiesSection().getContentEncoding())
+                && (uncompressed = GZIPUtils.uncompressBufferToArray(ByteBuffer.wrap(data)))!=null)
+        {
+            data = uncompressed;
+            metaData.getPropertiesSection().setContentEncoding(null);
+        }
+
+
+        Section bodySection = convertMessageBody(mimeType, data);
 
         final ByteBuffer allData = encodeConvertedMessage(metaData, bodySection, sectionEncoder);
 
@@ -279,14 +293,6 @@ public abstract class MessageConverter_t
         };
     }
 
-    protected Section getBodySection(final M serverMessage, final String mimeType)
-    {
-        byte[] data = new byte[(int) serverMessage.getSize()];
-        serverMessage.getContent(ByteBuffer.wrap(data), 0);
-
-        return convertMessageBody(mimeType, data);
-    }
-
     private ByteBuffer encodeConvertedMessage(MessageMetaData_1_0 metaData, Section bodySection, SectionEncoder sectionEncoder)
     {
         int headerSize = (int) metaData.getStorableSize();

Modified: qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaData_1_0.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaData_1_0.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaData_1_0.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaData_1_0.java Mon Aug 25 15:25:00 2014
@@ -72,6 +72,17 @@ public class MessageMetaData_1_0 impleme
         this(sections, encodeSections(sections, encoder));
     }
 
+    public Properties getPropertiesSection()
+    {
+        return _properties;
+    }
+
+
+    public Header getHeaderSection()
+    {
+        return _header;
+    }
+
     private static ArrayList<ByteBuffer> encodeSections(final List<Section> sections, final SectionEncoder encoder)
     {
         ArrayList<ByteBuffer> encodedSections = new ArrayList<ByteBuffer>(sections.size());

Modified: qpid/branches/0.30/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/edit.js
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/edit.js?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/edit.js (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/edit.js Mon Aug 25 15:25:00 2014
@@ -16,8 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-define(["qpid/common/util", "dojo/domReady!"],
-   function (util)
+define(["qpid/common/util", "dijit/registry", "dojo/domReady!"],
+   function (util, registry)
    {
        var fieldNames = ["storeUnderfullSize", "storeOverfullSize", "storePath"];
        return {

Modified: qpid/branches/0.30/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/add.html Mon Aug 25 15:25:00 2014
@@ -27,7 +27,8 @@
                           data-dojo-props="
                               name: 'storePath',
                               placeHolder: 'path/to/store',
-                              title: 'Enter store path'" />
+                              title: 'Enter store path',
+                              promptMessage: 'File system location for the configuration store'"/>
       </div>
     </div>
     <div class="clear"></div>

Modified: qpid/branches/0.30/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/add.html Mon Aug 25 15:25:00 2014
@@ -28,7 +28,7 @@
                               name: 'connectionUrl',
                               placeHolder: 'jdbc:provider:info',
                               required: true,
-                              missingMessage: 'JDBC URL must be supplied',
+                              promptMessage: 'JDBC URL specifying the connection to the database',
                               title: 'Enter JDBC URL'"/>
       </div>
     </div>
@@ -41,7 +41,7 @@
                               name: 'username',
                               placeHolder: 'username',
                               required: true,
-                              missingMessage: 'Username must be supplied',
+                              promptMessage: 'Database user name',
                               title: 'Enter username'" />
         </div>
     </div>
@@ -54,7 +54,7 @@
                               name: 'password',
                               placeHolder: 'password',
                               required: true,
-                              missingMessage: 'Password must be supplied',
+                              promptMessage: 'Database password',
                               title: 'Enter password'" />
         </div>
     </div>
@@ -66,8 +66,8 @@
                           data-dojo-props="
                               name: 'connectionPoolType',
                               required: true,
-                              missingMessage: 'Connection Pool type must be supplied',
-                              title: 'Select Connection Pool',
+                              promptMessage: 'Connection pool type to use when connecting to the database',
+                              title: 'Select the connection pool type',
                               placeHolder: 'Select pool type'" />
       </div>
     </div>

Modified: qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MessageServlet.java Mon Aug 25 15:25:00 2014
@@ -143,7 +143,12 @@ public class MessageServlet extends Abst
             throw new IllegalArgumentException("Could not find virtual host with name '" + vhostName + "'");
         }
 
-        return getQueueFromVirtualHost(queueName, vhost);
+        Queue queueFromVirtualHost = getQueueFromVirtualHost(queueName, vhost);
+        if (queueFromVirtualHost == null)
+        {
+            throw new IllegalArgumentException("Could not find queue with name '" + queueName  + "' on virtual host '" + vhost.getName() + "'");
+        }
+        return queueFromVirtualHost;
     }
 
     private Queue getQueueFromVirtualHost(String queueName, VirtualHost<?,?,?> vhost)

Modified: qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/servlet/rest/MetaDataServlet.java Mon Aug 25 15:25:00 2014
@@ -22,6 +22,7 @@ package org.apache.qpid.server.managemen
 
 import java.io.IOException;
 import java.io.Writer;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -52,8 +53,12 @@ public class MetaDataServlet extends Abs
         super.init();
 
         _instance = BrokerModel.getInstance();
+
+
     }
 
+
+
     @Override
     protected void doGetWithSubjectAndActor(final HttpServletRequest request, final HttpServletResponse response)
             throws ServletException, IOException
@@ -124,6 +129,18 @@ public class MetaDataServlet extends Abs
                 {
                     attrDetails.put("mandatory",((ConfiguredAutomatedAttribute)attribute).isMandatory());
                 }
+                if(!(((ConfiguredAutomatedAttribute)attribute).validValues()).isEmpty())
+                {
+                    Collection<String> validValues = ((ConfiguredAutomatedAttribute<?,?>) attribute).validValues();
+
+                    Collection<Object> convertedValues = new ArrayList<>(validValues.size());
+                    for(String value : validValues)
+                    {
+                        convertedValues.add(attribute.convert(value,null));
+                    }
+                    attrDetails.put("validValues", convertedValues);
+                }
+
             }
             if(attribute.isSecure())
             {

Modified: qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addBinding.html
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addBinding.html?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addBinding.html (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addBinding.html Mon Aug 25 15:25:00 2014
@@ -39,7 +39,7 @@
                               name: 'name',
                               placeHolder: 'Binding Key',
                               required: true,
-                              missingMessage: 'A binding key must be supplied',
+                              promptMessage: 'Binding key',
                               title: 'Enter binding key'" />
                 </div>
             </div>

Modified: qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addExchange.html
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addExchange.html?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addExchange.html (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addExchange.html Mon Aug 25 15:25:00 2014
@@ -21,32 +21,53 @@
 <div class="dijitHidden">
     <div data-dojo-type="dijit.Dialog" style="width:600px;" data-dojo-props="title:'Add Exchange'" id="addExchange">
         <form id="formAddExchange" method="post" dojoType="dijit.form.Form">
-            <table cellpadding="0" cellspacing="2">
-                <tr>
-                    <td valign="top"><strong>Exchange Name*: </strong></td>
-                    <td><input type="text" required="true" name="name" id="formAddExchange.name" placeholder="Exchange Name"
-                        dojoType="dijit.form.ValidationTextBox" missingMessage="A name must be supplied"
-                        data-dojo-props="regExp:'^(?!qpid\.|amq\.|\<\<default\>\>)[\x20-\x2e\x30-\x7F]{1,255}$', invalidMessage:'Illegal or reserved exchange name!'"/></td>
-                </tr>
-                <tr>
-                    <td valign="top"><strong>Durable? </strong></td>
-                    <td><input type="checkbox" name="durable" id="formAddExchange.durable" value="durable" checked="checked" dojoType="dijit.form.CheckBox" /></td>
-                </tr>
-                <tr>
-                    <td valign="top"><strong>Exchange Type: </strong></td>
-                    <td>
-                        <select name="type" id="formAddExchange.type" dojoType="dijit.form.FilteringSelect">
-                            <option value="direct">direct</option>
-                            <option value="topic">topic</option>
-                            <option value="headers">headers</option>
-                            <option value="fanout">fanout</option>
-                        </select>
-                    </td>
-                </tr>
-            </table>
+            <div class="clear">
+                <div class="formLabel-labelCell">Name*:</div>
+                <div class="formLabel-controlCell">
+                    <input type="text" id="formAddExchange.name"
+                           data-dojo-type="dijit/form/ValidationTextBox"
+                           data-dojo-props="
+                              name: 'name',
+                              placeHolder: 'exchange name',
+                              required: true,
+                              promptMessage: 'Name of exchange',
+                              title: 'Enter an exchange name',
+                              regExp:'^(?!qpid\.|amq\.|\<\<default\>\>)[\x20-\x2e\x30-\x7F]{1,255}$',
+                              invalidMessage:'Illegal or reserved exchange name!'"/>
+                </div>
+            </div>
+            <div class="clear">
+                <div class="formLabel-labelCell">Exchange Type:</div>
+                <div class="formLabel-controlCell">
+                    <select id="formAddExchange.type"
+                            dojoType="dijit.form.FilteringSelect"
+                            data-dojo-props="
+                              name: 'type',
+                              promptMessage: 'Type of exchange - responsible for routing messages to queues'">
+                        <option value="direct">direct</option>
+                        <option value="topic">topic</option>
+                        <option value="headers">headers</option>
+                        <option value="fanout">fanout</option>
+                    </select>
+                </div>
+            </div>
+            <div class="clear">
+                <div class="formLabel-labelCell">Durable?</div>
+                <div class="formLabel-controlCell">
+                    <input type="checkbox" id="formAddExchange.durable"
+                           dojoType="dijit.form.CheckBox"
+                           data-dojo-props="
+                              name: 'durable',
+                              value: 'durable',
+                              checked: true"/>
+                </div>
+            </div>
+
+
+            <div class="clear"></div>
+
             <div class="dijitDialogPaneActionBar">
-            <!-- submit buttons -->
-            <input type="submit" value="Create Exchange" label="Create Exchange" dojoType="dijit.form.Button" />
+                <input type="submit" value="Create Exchange" label="Create Exchange" dojoType="dijit.form.Button" />
             </div>
         </form>
     </div>

Modified: qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html
URL: http://svn.apache.org/viewvc/qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html?rev=1620344&r1=1620343&r2=1620344&view=diff
==============================================================================
--- qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html (original)
+++ qpid/branches/0.30/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html Mon Aug 25 15:25:00 2014
@@ -20,94 +20,267 @@
  -->
 <div class="dijitHidden">
     <div data-dojo-type="dijit.Dialog" data-dojo-props="title:'Port'" id="addPort">
-        <form id="formAddPort" method="post" dojoType="dijit.form.Form">
-            <div style="height:320px; width:420px; overflow: auto">
-            <div class="hidden" id="portEditWarning">NOTE: changes will only take effect after Broker restart.</div>
+        <form id="formAddPort" method="post" data-dojo-type="dijit.form.Form">
+            <div class="hidden infoMessage" id="portEditWarning">NOTE: changes will only take effect after Broker restart.</div>
             <div id="formAddPort:fields">
-                <input type="text" required="true" name="name" id="formAddPort.name" placeholder="Name"
-                    data-dojo-props="label: 'Name*:'" dojoType="dijit.form.ValidationTextBox"
-                    missingMessage="A name must be supplied"/>
 
-                <input type="text" required="true" id="formAddPort.port"
-                    data-dojo-props="label: 'Port Number*:', placeHolder: 'Enter port number'" dojoType="dijit.form.ValidationTextBox"
-                     name="port" missingMessage="A port number must be supplied"/>
-                <select id="formAddPort.type" data-dojo-type="dijit.form.FilteringSelect"
-                    data-dojo-props="name: 'type', value: '',placeHolder: 'Select Port Type', label: 'Port Type*:'">
-                    <option value="AMQP" selected="selected">AMQP</option>
-                    <option value="JMX">JMX</option>
-                    <option value="HTTP">HTTP</option>
-                </select>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.name">Name*:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <input id="formAddPort.name" type="text"
+                               data-dojo-type="dijit.form.ValidationTextBox"
+                               data-dojo-props="
+                                name: 'name',
+                                required: 'true',
+                                placeHolder: 'name',
+                                promptMessage: 'Name of port, must be unique',
+                                title: 'Enter name of port'"/>
+                    </div>
+                </div>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.port">Port Number*:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <input id="formAddPort.port" type="text"
+                               data-dojo-type="dijit.form.ValidationTextBox"
+                               data-dojo-props="
+                                name: 'port',
+                                required: 'true',
+                                placeHolder: 'port number',
+                                promptMessage: 'Port number to be bound',
+                                title: 'Enter port number'"/>
+                    </div>
+                </div>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.type">Port Type*:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <select id="formAddPort.type"
+                                data-dojo-type="dijit.form.FilteringSelect"
+                                data-dojo-props="
+                                    name: 'type',
+                                    label: 'Port Type*:',
+                                    value: '',
+                                    placeHolder: 'port type',
+                                    promptMessage: 'Port type',
+                                    title: 'Enter port type'">
+                            <option value="AMQP" selected="selected">AMQP</option>
+                            <option value="JMX">JMX</option>
+                            <option value="HTTP">HTTP</option>
+                        </select>
+                    </div>
+                </div>
             </div>
             <div id="formAddPort:fieldsAuthenticationProvider">
-                <select id="formAddPort.authenticationProvider" data-dojo-type="dijit.form.FilteringSelect"
-                    data-dojo-props="name:'authenticationProvider',label:'Authentication Provider*:', searchAttr: 'name', required: true, placeHolder: 'Select Provider'">
-                </select>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.authenticationProvider">Authentication Provider*:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <select id="formAddPort.authenticationProvider"
+                                data-dojo-type="dijit.form.FilteringSelect"
+                                data-dojo-props="
+                            name: 'authenticationProvider',
+                            searchAttr: 'name',
+                            required: true,
+                            placeHolder: 'provider',
+                            promptMessage: 'Authentication provider to authenticate users connecting to the port',
+                            title: 'Associate the port with an authentication provider'">
+                        </select>
+                    </div>
+                </div>
             </div>
             <div id="formAddPort:fieldsBindingAddress">
-                <input id="formAddPort.bindingAddress" type="text" name="bindingAddress" placeholder="*"
-                       dojoType="dijit.form.TextBox" data-dojo-props="label: 'Binding address:'"/>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.bindingAddress">Binding address:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <input id="formAddPort.bindingAddress" type="text"
+                               data-dojo-type="dijit.form.ValidationTextBox"
+                               data-dojo-props="
+                            name: 'bindingAddress',
+                            placeHolder: 'binding address',
+                            promptMessage: 'Restricts the port to listen on the specified address only. The <code>*</code> wildcard signifies all addresses',
+                            title: 'Enter a binding address'"/>
+                    </div>
+                </div>
             </div>
             <div id="formAddPort:fieldsAMQP">
-                <input id="formAddPort.protocolsDefault" type="checkbox" checked="checked"
-                   dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Support default protocols:'"/>
-                <select id="formAddPort.protocolsAMQP" name="protocols" data-dojo-type="dijit.form.MultiSelect" multiple="true"
-                    data-dojo-props="name: 'protocols', value: '', placeHolder: 'Select AMQP versions', label: 'AMQP versions:'"
-                    missingMessage="AMQP protocol(s) must be supplied">
-                    <option value="AMQP_0_8">AMQP 0.8</option>
-                    <option value="AMQP_0_9">AMQP 0.9</option>
-                    <option value="AMQP_0_9_1">AMQP 0.9.1</option>
-                    <option value="AMQP_0_10">AMQP 0.10</option>
-                    <option value="AMQP_1_0">AMQP 1.0</option>
-                </select>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.protocolsDefault">Support default protocols:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <input id="formAddPort.protocolsDefault" type="checkbox"
+                               dojoType="dijit.form.CheckBox"
+                               data-dojo-props="checked: true"/>
+                    </div>
+                </div>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.protocolsAMQP">AMQP protocols:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <select id="formAddPort.protocolsAMQP"
+                                data-dojo-type="dijit.form.MultiSelect"
+                                data-dojo-props="
+                                    name: 'protocols',
+                                    value: '',
+                                    placeHolder: 'AMQP protocols',
+                                    promptMessage: 'AMQP protocols to be associated with this port',
+                                    title: 'Select AMQP protocols to be associated with this port',
+                                    multiple: true">
+                            <option value="AMQP_0_8">AMQP 0.8</option>
+                            <option value="AMQP_0_9">AMQP 0.9</option>
+                            <option value="AMQP_0_9_1">AMQP 0.9.1</option>
+                            <option value="AMQP_0_10">AMQP 0.10</option>
+                            <option value="AMQP_1_0">AMQP 1.0</option>
+                        </select>
+                    </div>
+                </div>
             </div>
             <div id="formAddPort:fieldsJMX">
-                <select id="formAddPort.protocolsJMX" name="protocols" data-dojo-type="dijit.form.FilteringSelect"
-                    data-dojo-props="name: 'protocols', value: '', label: 'JMX protocol*:'" missingMessage="JMX protocol must be supplied">
-                     <option value="RMI">RMI</option>
-                     <option value="JMX_RMI">JMX RMI</option>
-                 </select>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.protocolsJMX">JMX protocol*:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <select id="formAddPort.protocolsJMX"
+                                data-dojo-type="dijit.form.FilteringSelect"
+                                data-dojo-props="
+                                    name: 'protocols',
+                                    value: '',
+                                    promptMessage: 'JMX protocol to be associated with this port',
+                                    title: 'Enter JMX protocol to be associated with this port'">
+                            <option value="RMI">RMI</option>
+                            <option value="JMX_RMI">JMX RMI</option>
+                        </select>
+                    </div>
+                </div>
             </div>
+
             <div id="formAddPort:fieldsHTTP">
-                <select id="formAddPort.protocolsHTTP" name="protocols" data-dojo-type="dijit.form.FilteringSelect"
-                    data-dojo-props="name: 'protocols', value: 'HTTP', label: 'HTTP protocol*:'" missingMessage="HTTP protocol must be supplied">
-                    <option value="HTTP">HTTP</option>
-                </select>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.protocolsHTTP">HTTP protocols*:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <select id="formAddPort.protocolsHTTP"
+                                data-dojo-type="dijit.form.FilteringSelect"
+                                data-dojo-props="
+                                    name: 'protocols',
+                                    value: 'HTTP',
+                                    label: 'HTTP protocol*:',
+                                    promptMessage: 'HTTP protocol to be associated with this port',
+                                    title: 'Enter HTTP protocol to be associated with this port'">
+                            <option value="HTTP">HTTP</option>
+                        </select>
+                    </div>
+                </div>
             </div>
+
             <div id="formAddPort:transport" >
-                 <select id="formAddPort.transports" name="transports" data-dojo-type="dijit.form.MultiSelect" multiple="true"
-                    data-dojo-props="name: 'transports',label: 'Transport:',placeHolder: 'TCP', value: '' ">
-                    <option value="TCP">TCP</option>
-                    <option value="SSL">SSL</option>
-                </select>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.transports">Transport:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <select id="formAddPort.transports"
+                                data-dojo-type="dijit.form.MultiSelect"
+                                data-dojo-props="
+                                    name: 'transports',
+                                    placeHolder: 'TCP',
+                                    value: '',
+                                    multiple: true,
+                                    promptMessage: 'Transport(s)',
+                                    title: 'Select transports'">
+                            <option value="TCP">TCP</option>
+                            <option value="SSL">SSL</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="clear"/>
             </div>
             <div id="formAddPort:fieldsTransportSSL">
-                <select id="formAddPort.keyStore" data-dojo-type="dijit.form.FilteringSelect"
-                    data-dojo-props="name:'keyStore',label:'Key Store*:', searchAttr: 'name', placeHolder: 'Select keystore', value: '', required: true ">
-                </select>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        <label for="formAddPort.keyStore">Key Store*:</label>
+                    </div>
+                    <div class="formLabel-controlCell">
+                        <select id="formAddPort.keyStore"
+                                data-dojo-type="dijit.form.FilteringSelect"
+                                data-dojo-props="
+                                    name: 'keyStore',
+                                    label: 'Key Store*:',
+                                    searchAttr: 'name',
+                                    placeHolder: 'keystore',
+                                    value: '',
+                                    required: true,
+                            promptMessage: 'Keystore that provides the SSL certificate',
+                            title: 'Select the keystore that provides the SSL certificate'">
+                        </select>
+                    </div>
+                </div>
             </div>
             <div id="formAddPort:fieldsClientAuth">
                 <div id="formAddPort:fieldsClientAuthCheckboxes">
-                 <input id="formAddPort.needClientAuth" type="checkbox" name="needClientAuth"
-                    dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Need SSL Client Certificate:'" />
-                 <input id="formAddPort.wantClientAuth" type="checkbox" name="wantClientAuth"
-                    dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Want SSL Client Certificate:'" />
-                </div>
-                <div><strong>Trust Stores:</strong></div>
-                <table id="formAddPort.trustStores" data-dojo-type="dojox.grid.EnhancedGrid"
-                        data-dojo-props="label:'Trust Stores:',plugins:{indirectSelection: true},rowSelector:'0px' " style="height: 100px; width:400px">
-                        <thead>
-                           <tr>
-                             <th field="name">Name</th>
-                             <th field="peersOnly">Peers Only</th>
-                           </tr>
-                         </thead>
-                </table>
+                    <div class="clear">
+                        <div class="formLabel-labelCell">
+                            <label for="formAddPort.needClientAuth">Need SSL Client Certificate:</label>
+                        </div>
+                        <div class="formLabel-controlCell">
+                            <input id="formAddPort.needClientAuth" type="checkbox"
+                                   data-dojo-type="dijit.form.CheckBox"
+                                   data-dojo-props="
+                                    name: 'needClientAuth'" />
+                        </div>
+                    </div>
+                    <div class="clear">
+                        <div class="formLabel-labelCell">
+                            <label for="formAddPort.wantClientAuth">Want SSL Client Certificate:</label>
+                        </div>
+                        <div class="formLabel-controlCell">
+                            <input id="formAddPort.wantClientAuth" type="checkbox"
+                                   data-dojo-type="dijit.form.CheckBox"
+                                   data-dojo-props="
+                            name: 'wantClientAuth'" />
+                        </div>
+                    </div>
+                </div>
+                <div class="clear">
+                    <div class="formLabel-labelCell">
+                        Trust Stores:
+                    </div>
+                </div>
+
+                <div class="clear">
+                    <div class="formLabel-controlCell">
+                        <table id="formAddPort.trustStores"
+                               data-dojo-type="dojox.grid.EnhancedGrid"
+                               data-dojo-props="
+                                plugins: {indirectSelection: true},
+                                rowSelector:'0px'"
+                               style="height: 100px; width:400px">
+                            <thead>
+                                <tr>
+                                    <th field="name">Name</th>
+                                    <th field="peersOnly">Peers Only</th>
+                                </tr>
+                            </thead>
+                        </table>
+                    </div>
+                </div>
             </div>
             <input type="hidden" id="formAddPort.id" name="id"/>
-            </div>
+            <div class="clear"/>
             <div class="dijitDialogPaneActionBar">
-            <!-- submit buttons -->
-            <input type="submit" value="Save Port" label="Save Port" dojoType="dijit.form.Button" />
+                <!-- submit buttons -->
+                <input type="submit" value="Save Port" label="Save Port" dojoType="dijit.form.Button" />
             </div>
         </form>
     </div>



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