Package org.apache.qpid.proton.amqp.messaging

Examples of org.apache.qpid.proton.amqp.messaging.Header


    public Header newInstance(Object described)
    {
        List l = (List) described;

        Header o = new Header();


        switch(5 - l.size())
        {

            case 0:
                o.setDeliveryCount( (UnsignedInteger) l.get( 4 ) );
            case 1:
                o.setFirstAcquirer( (Boolean) l.get( 3 ) );
            case 2:
                o.setTtl( (UnsignedInteger) l.get( 2 ) );
            case 3:
                o.setPriority( (UnsignedByte) l.get( 1 ) );
            case 4:
                o.setDurable( (Boolean) l.get( 0 ) );
        }


        return o;
    }
View Full Code Here


   {
      public static ServerMessageImpl transform(ProtonRemotingConnection connection, EncodedMessage encodedMessage) throws Exception
      {
         org.apache.qpid.proton.message.Message protonMessage = encodedMessage.decode();

         Header header = protonMessage.getHeader();
         if (header == null)
         {
            header = new Header();
         }

         ServerMessageImpl message = connection.createServerMessage();
         TypedProperties properties = message.getProperties();
View Full Code Here

      public static EncodedMessage transform(ServerMessage message, int deliveryCount)
      {
         long messageFormat = message.getLongProperty(MESSAGE_FORMAT);
         Integer size = message.getIntProperty(PROTON_MESSAGE_SIZE_SS);

         Header header = populateHeader(message, deliveryCount);
         DeliveryAnnotations deliveryAnnotations = populateDeliveryAnnotations(message);
         MessageAnnotations messageAnnotations = populateMessageAnnotations(message);
         Properties props = populateProperties(message);
         ApplicationProperties applicationProperties = populateApplicationProperties(message);
         Section section = populateBody(message);
View Full Code Here

         return new EncodedMessage(messageFormat, buffer.array(), 0, c);
      }

      private static Header populateHeader(ServerMessage message, int deliveryCount)
      {
         Header header = new Header();
         header.setDurable(message.isDurable());
         header.setPriority(new UnsignedByte(message.getPriority()));
         header.setDeliveryCount(new UnsignedInteger(deliveryCount));
         header.setTtl(new UnsignedInteger((int) message.getExpiration()));
         return header;
      }
View Full Code Here

TOP

Related Classes of org.apache.qpid.proton.amqp.messaging.Header

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.